texts: how to create translucent objects in KML?

texts:
I've been able to create a KML file that shows a circle on my (Google Earth) map.  Now I would like to have a translucent fill on the circle.  I'm new to KML, so I'm learning by trial-and-error with examples from the web.

My code looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
  <Document>
    <Placemark>
      <Name>EWR</Name>
      <Description>EWR</Description>
      <Style>
       <IconStyle>
         <Icon/>
       </IconStyle>
       <LineStyle>
         <color>ff0000ff</color>
         <width>2</width>
       </LineStyle>
     </Style>
    <LineString>
      <tessellate>1</tessellate>
      <coordinates>
       -74.0733123604,40.6924798
       -74.0753862256,40.7075157245
      [...]
      </coordinates>
    </LineString>
 </Placemark>
 </Document>
 </kml>

CLARIFICATION: I've gotten a few answers saying "adjust the value for the 'color' tag".  That's enlightening, but doing that changes the opacity of the outline.  What I want to do is fill the circle.  I'm guessing that I need some additional tag(s) to do that.


texts: Unable to publish a Referenced Mosaic Dataset to ArcGIS Server 10.2.1

texts:
I have a number of Raster Catalogs I want to publish.  It is my understanding that in order for them to be published to ArcGIS Server I need to create Referenced Mosaic Datasets for them.

I have done this.

I have also successfully registered the data folders with ArcGIS Server and enabled the Image extension (this is needed to publish mosaics).

When I come to publish the referenced mosaic dataset, in the Service Editor I select to only use the “Image” capability and for it to only allow the “image” operation, as I only want the user to be able to view the data.  I am not caching the service.

When I analyse the service, I only get one Medium error.  This is just warning me that no statistics have been calculated for the Mosaic dataset.  As this service is a “view-only” service, I do not need statistics.

When I click on “Publish”, it runs through the whole publishing service and then I get an error

  Failed to Publish Service.

If I look at the server log, I get the following error:

  Error executing tool.: ERROR 001369: Failed to create the service.
  Failed to execute (Publish Service Definition)

This seems to be a generic error.

Digging a bit more into the server log I can see that there is an error about an invalid path:

  Invalid input data source path:
  \\servername\data\Production\Backdrop_Mapping\Mosaics\Data_50K\Data_50K.gdb\Data_50K

This is refering to the Mosaic dataset which I am trying to publish.

This folder is successfully registered as a data store on the server:

  \\servername\data\Production\Backdrop_Mapping

As I understand it, this should include all subfolders.

I have created a simple mxd with 1 vector dataset and published it from the same source folder without any problems.  The vector dataset was in the same fgdb as the mosaic dataset.  So I know the server is able to connect to and read from this location.

Any sugestions of what I could try next would be great.

Tech spec:  ArcGIS Sever 10.2.1, Standard Licence, Image extension.


texts: Converting shapefiles (.shp) to CAD (.dwg ) format using QGIS?

texts: How to convert shapefiles  to .dwg format using QGIS 1.7.0?


texts: Changing attribute data types using PyQGIS

texts:
OK, so I've already asked a question how to access attribute data types when developing plugin for QGIS, using PyQGIS. And one helpful member said i should use pendingFields() method on the current layer. Here is the link on that query: LINK

Indeed I could access them but when I tried to change the data type with setType() and setTypeName() functions, it didn't work. When I queried the objects with type() and typeName() they showed the new data types I have given them, but when I wanted to enter new values for some feature I realized that this layer doesn't recognize new data types.

For example, first attribute field has by default Real data type, so it recognizes only numbers. I converted that field to String using command:

fields[0].setType(10)

btw:

fields = currentLayer.pendingFields()

But the field still acts like before, and doesn't recognize letters, only numbers.
How to change data types? Is it even possible? Or you can only define data type for new attribute?


texts: Using ArcPy with Windows Task Scheduler script cannot read Excel file?

texts:
I have an arcpy Python script that downloads an Excel spreadsheet and then copies one of the sheets from the document to a table in a geodatabase.  I need this script to run automatically every night, unattended, and so have it configured from the Windows Task Scheduler.

The script runs fine when run directly from the IDE.

When run from the Task Scheduler (as the same user) it can see the Excel file, but it cannot see any of the sheets within the file.  Ie...

os.path.exists(filepath) returns True
arcpy.Exists(filepath) returns True
arcpy.Exists(os.path.join(filepath, sheetname)) returns False when run from Task Scheduler (but returns True when run from IDE as the same user)
arcpy.ListTables() returns [ ] (empty list) when run from Task Scheduler (but returns a list of all the sheets when run from IDE as the same user)

The same problem occurs when run from the Task Scheduler whether it is configured to run only when user is logged in or run whether user is logged in or not.

Why can my script read the contents of the Excel file when run interactively, but not when run from the Task Scheduler?

I'm confident that it is not a permissions issue, because the script reads the same file just fine when run from the IDE as the same user for which it is run from the Task Scheduler.

Some Things I've Tried:

I have tried the solution to many posted problems that appear similar.  Ie to create the following directories:

  C:\Windows\System32\config\systemprofile\Desktop
  C:\Windows\SysWOW64\config\systemprofile\Desktop

However, I believe that this is only for opening an Excel file in Excel itself.  It certainly did not resolve the problem for me when trying to read an Excel file with arcpy.

I also tried the solution for the question at:  https://superuser.com/questions/622507/windows-task-scheduler-wont-run-file-on-non-system-drive

Ie, to give explicit permissions for the user to the file's directory, and not just relying on the group permissions.  But this did not help either.


texts: filling up a depression to create new surface

texts: A collegue here has a problem I cannot help with. She has the surface (as raster) of a landslide release area (from AFTER the slide) and wants to calculate the calculate the theoretical/approximate volume of the release surface. Is there a funtion in ArcGIS or GRASS GIS 7 that fills the slide relesease area? The problem is that we do not have the pre-release surface, so cut/fill does not work here.


texts: Saving JSON data result in an incomplete file

texts:
I am trying to save out a geoJSON file from OpenLayers 3.
I have most of the code sorted but the resulting file is missing the CRS line,when I add it manually the file works just fine.

function loadXMLDoc() {
var geoJSON = new ol.format.GeoJSON();
var jsondata = geoJSON.writeFeatures(lyr_site.getSource().getFeatures(),    {featureProjection: 'EPSG:3857'},{dataProjection: 'EPSG:3857'});
var xmlhttp = new XMLHttpRequest();
xmlhttp.open('POST', 'run.php', true);
xmlhttp.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');
xmlhttp.send(jsondata);

The resulting file header looks like this:

{"type":"FeatureCollection","features":[{"type":"Feature","geometry":      {"type":"Polygon","coordinates":[[[0.519087728539022,51.72285434232731],[0.5190669877274288,51.72334258224663],[0.5190633831708146,51.723622249385755],

And it should look more like this (I think)

{
"type": "FeatureCollection",
"crs": { "type": "name", "properties": { "name":       "urn:ogc:def:crs:EPSG::3857" } },

"features": [


texts: ArcGIS Server Geoprocessing Service failing on repeat call

texts:
Trying to create a geoprocessing service on ArcGIS for Server 10.3 to do some routing on a networkx graph. The service only works on the first call. It fails on subsequent calls. I note this because when I restart the service and make a fresh call, I get expected results.

Below is the published script via a toolbox.

import os
import networkx as nx
import arcpy

LOCAL_WS = r"C:\inetpub\wwwroot\src.gdb"
EDGES_FC = os.path.join(LOCAL_WS, "EDGES")
MAINS_FC = os.path.join(LOCAL_WS, "MAINS")

M = nx.MultiGraph()
edge_fields = ["LOC1", "LOC2", "CABLE"]
with arcpy.da.SearchCursor(EDGES_FC, edge_fields) as ecur:
    for erow in ecur:
        loc1 = erow[0]
        loc2 = erow[1]
        cable = erow[2]

        # Add the segment to the graph
        M.add_edge(loc1, loc2, key=cable)

def checkIsolated(a_node, z_node):
    try:
        paths = nx.dijkstra_path(M, source=a_node, target=z_node)
        return "HAS PATH"
    except nx.NetworkXNoPath:
        return "NO PATH"
    except:
        return "FAILED ROUTING"

if __name__ == "__main__":
    # Isolation Test
    a_loc = arcpy.GetParameterAsText(0)
    z_loc = arcpy.GetParameterAsText(1)
    checkResult = checkIsolated(a_loc, z_loc)
    arcpy.SetParameterAsText(2, checkResult)

This is the error logged by ArcGIS for Server:

File  "E:\arcgisserver\directories\arcgissystem\arcgisinput\FindIsolated.GPServer\extracted\v101\arcgisservermxds\NetworkXTools.tbx#FindIsolated.py", line 11, in File "E:\Python27\ArcGISx6410.3\lib\site-packages\networkx\__init__.py", line 128, in import networkx.drawing File "E:\Python27\ArcGISx6410.3\lib\site-packages\networkx\drawing\__init__.py", line 6, in from . import nx_pydot File "E:\Python27\ArcGISx6410.3\lib\site-packages\networkx\drawing\nx_pydot.py", line 27, in from pkg_resources import parse_version File "E:\Python27\ArcGISx6410.3\lib\site-packages\pkg_resources\__init__.py", line 50, in from pkg_resources.extern import six File "E:\Python27\ArcGISx6410.3\lib\site-packages\pkg_resources\extern\__init__.py", line 44, in load_module mod = sys.modules[extant] AttributeError: 'NoneType' object has no attribute 'modules' Failed to execute (FindIsolated).

The networkx library was installed into in the 64-bit version of the Python on Windows 2008 Server (that comes bundled with ArcGIS for Server). IIS is our web server.

Any thoughts?

(My hope is to have an active web service holding the networkx graph and not have to recreate it everytime I want to route some nodes.)


texts: Updating field in feature class with Search and Update Cursor:Stop Iteration error

texts:
I would like to update a field in a single feature class by a.) searching for a field where the values are not blank and b.) searching for a field where the values are blank.

A typical scenario of this update would occur if there are two service requests in one feature class with the same service request number with one being updated.  When the updated feature is in the feature class, it does not maintain all of the same values that the previous feature class held.  The one field that I would like to update is VehicleNam.  So if I have a feature class where SR # 555 appears twice, as OID1 and OID2, but only OID1 has a value for VehicleNam I would like to update the VehicleNam field in OID2 as well.  Here is the script that I have so far, however an error is being thrown at line 5.  I am using ArcGIS 10.2.2

with arcpy.da.UpdateCursor(fc, ["VehicleNam"],"""VehicleNam <> ''""") as ucursor:
    with arcpy.da.SearchCursor(fc, ["VehicleNam"],"""VehicleNam = ''""") as scursor:
        for srow in scursor:
             svalue = srow[0]
             urow = ucursor.next()  # instead of a full "for urow in ucursor" loop each time
             urow[0] = svalue
            ucursor.updateRow(urow)

Runtime error
Traceback (most recent call last):
  File "<string>", line 5, in <module>
StopIteration


texts: Given a geocode or geo location in US, how to find exits that are within some distance from the geo location for US?

texts: We have a need to find the geocodes of US highway exits that are within some distance from a given geocode. I do not know how to do this? Can one please direct to the right source or provide a solution to me?


texts: How to import SpatiaLite data into GRASS?

texts: How can I import SpatiaLite tables into GRASS? Are there any restrictions I should be aware of? How does GRASS cope with columns that don't have a specific type (Sqlite tends to create such columns e.g. if you create a new table from a query using SUM() or similar)?


texts:
I have a mosaic data set that contains around 60 rasters. I generated a seam line for them and it worked great.

However, the only issue is that I can only view the seam line at a scale less than 1:12,000.

I am needing it about 10x larger. At the larger scales it looks as if there was never a seam line generated.


texts: Remove/Hide SHAPE.STArea() & SHAP.STLength() fields

texts: Is there a way to hide SHAPE.STArea() & SHAP.STLength() fields in feature classes in an SDE GDB?  I'm working with a client who says that these fields were not in any feature class in the GDB and now all the sudden these fields are in their featureclasses.  I know that you can't delete these fields so if there is no way to remove them is there anything that would cause these fields to appear when they previously weren't visible when looking at the attribute table?  Working with ArcCatalog 10.2


texts: How to get Shapefile point coordinates into .xls?

texts:
How can I get just Coordinates (in a file) from point features (shapes) without a big hustle. Something like Shape to .xls, with distinct coordinates?

I want to use this coordinates immediately, so GPX is no solution.


texts: Converting latitude and longitude to XY coordinates

texts:
I am doing a JavaScript application that requires the movement of a certain element in a real world map, in frames.

For each frame, I have the following positions in latitude and longitude for the element, for example for frame 0:
- Latitude: 49.011213
- Longitude: 8.422885

For frame 1:
- Latitude: 49.01121
- Longitude: 8.422887

Frame (Frame 0) needs to be point (0,0) and I want the following ones to be converted to XY coordinates as well.

Basically, I need a JavaScript script that receives the latitude and longitude of a frame and returns the position (x,y) for that frame (in relation to frame 0 with position (0,0)).

I've tried the following but it doesn't work:

function convertSphericalToCartesian(latitude, longitude)
{
    // Convert from Degrees to Radians
    let latRad = latitude * (Math.PI)/180;
    let lonRad = longitude * (Math.PI)/180;

    let earthRadius = 6367; // Radius in km
    let posX = earthRadius * Math.cos(latRad) * Math.cos(lonRad);
    let posY = earthRadius * Math.cos(latRad) * Math.sin(lonRad);
    return {x: posX, y: posY};
}

Do you know a better formula for this?


texts: Creating ArcGIS color ramp to show from -X to 0 to X as Red to White to Green?

texts:
How do I get a color ramp in ArcGIS to show from -X to 0 to X, as Red to White to Green?

Whenever I try, ArcGIS scales the colors from min to max, without regard to 0.  White ends up representing a positive or negative value.

I want the full red to represent the negative of the full green even if I don't have symmetric values in my data!  This is important if I do not wish to lie about the data.  If I show full green for -5000 but full red for +25000 the scales are misleading and intermediate values cannot be accurately interpreted.


texts: Getting selected feature geometry using QGIS API?

texts:
I want to get the geometry for a selected feature using QGIS API. When extracting geometry for unselected features this is what I typically do:

l = iface.activeLayer()
fs = l.getFeatures() #returns QgsFeatureIterator object
f = fs.next() #returns next QgsFeature object
g = g.geometry() # returns geometry object

I tried doing something similar with only selected features but ran into a problem:

l = iface.activeLayer()
s = l.selectedFeatures() #returns QgsFeature object
g = s.geometry() #throws error. Also dir(s) confirms that s has no geometry() method

How come s has no method geometry()?

Isn't it an instance of the same class as f in the first example?

How can I extract geometry for only the selected feature?


texts: PostGIS create table with multiple geometry

texts:
I want to create a table with a geometry field in it. e.g.:

CREATE TABLE ptgeogwgs(gid serial PRIMARY KEY, geog geography(POINT) );

In my case, this geometry field can either be a POINT, a LINESTRING or a POLYGON. I couldn't find any examples where that unique column could take three different types. So I guess the type of geometry should be fixed in advance. Nonetheless, is is better to create one table for each geometry type or create multiple columns, one for each geometry type.

Furthermore, if I choose for the second option, are the two empty geometry fields stored as "null" and therefore taking some memory space or doesn't empty fields in PostGIS table take any space?


texts: How to select and export points interactively by drawing polygons?

texts: Does anyone know how to select a large number of addresses by basically highlighting areas on a GIS map you need names & addresses for and exporting them onto a spreadsheet?? Maybe there's no such thing but it'd sure be nice to know!


texts: Selecting only specific features not all, and dragging and dropping correctly

texts:
First issue:
I would like to select only a few features and not select rest

Let imagine I have 5 features in below code you will see that I can select all of them.

Second issue
The second issue is related to translating feature, it is working while selecting feature through a click event, however, I want to use pointerMove event

condition: ol.events.condition.pointerMove,

But in that case, dragging feature is freezing

The main parts of code are below, have you ever faced this kind problems and how did you solve?

const source = new ol.source.Vector({
    features: [polygonFeature, text1, text2, text3, text4],
    });
var select = new ol.interaction.Select({
    condition: ol.events.condition.click,
    });

const translate = new ol.interaction.Translate({
   features: select.getFeatures(),
});

const modify = new ol.interaction.Modify({
   features: select.getFeatures()
});

const initMap = () => {
   map = new ol.Map({
      interactions: ol.interaction.defaults().extend([select, translate, modify]),
      target: 'map',
      layers: layersCollections,
      view: view,
   });
};


texts: Finding a GeoDatabase for assisting mobile clients (offline) to sync with Host DB

texts:
We have a current system that uses a combination of SAFE FME and PostGIS data (raster and feature) to create download packages for mobile clients. The clients are typically offline web technology (e.g. Leaflet on mobile or tablets, or electron (uses Chromium and node JS) [Some are QGIS and other desktop map software, but that is not our focus here]

There are a number of drawbacks to the system, I won't list all (you can) but the chief one is that we have no clear way of pushing differential updates, or receiving back-haul data from the clients (currency, audit, as well as simple user generated GeoJSON overlay).

We believe that instead of delivering self-contained static packages (ala OGC GeoPackages) - we should provide a dynamic evergreen refresh version of the data. This could be done if we insert a GeoDataBase (in between the PostGIS and the clients) that can sync both on the host (to stage and manage the centralized store) and "child DB" which resides on each client. We have a couple of ideas (see below) but all have their drawbacks. If anyone any solutions we are unfamiliar with, or suggestions to deal with the problems we have identified - we would love to hear that.

Assume:

client is using Web-style Map client: Leaflet or Mapbox GL
client needs read to raster tiles and read/write geoJson feature data stored in a local (offline) database
When client comes online, it needs to sync to a master DB which will reconcile changes and  multicast new raster and vector data connected clients.
The database can be fully segmented, so that no two users are writing to the same area (i.e. it is a multiple readers, and single writer problem)

One potential solution could be to use a CouchDB as the master, and PouchDB as the client DB (e.g. leaf-pouch client ) the issue here would be that leaflet-pouch does not seem to support raster tiles.

Alternatively,  use Leaflet.TileLayerCached but that seems to be just for raster caches.

Another thought would be to go with Pouch GeoPackage  and use the new OGC GeoPackage standard, but one would have to build the sync software from scratch, as well as choose the master DB technology (Probably something compatible with FME so that FME could read/write the source DB and create the GeoPackage diff)

Is there another approach we are missing?


texts:
Is there a way to create a z-aware Shapefile directly in QGis?

It seems the support for z-coordinates in QGis has been building up over the last years (which is why similar questions in the past are not very helpful). However it seems 3D Shapefiles cannot be created directly in QGis.

I am using QGis 2.18.10 and cannot find the option to create a Shapefile with z-Coordinates. I have not been using QGis for long, but it seems odd that there is no option in the "New Shapefile Layer" dialog.

A possible workaround to this is creating a 2D-Shape and save it using the geometry > include z-Dimension. Is there another way?


texts: SetNull in Python script for Arcgis assign 0 value

texts:
I am writing a script in Python where I assign to few Tiff defined in a function as inputRaster a NoData value as follows:

whereClauseSetNull = "VALUE > 100"
outSetNull = SetNull(inputRaster, inputRaster, whereClauseSetNull)
outSetNull.save(outSetNullFullPath)

When I add the resulting Tiff to ArcMap, the pixels that meet the condition have a 0 value. Only if I manually assign the 0 value to NoData they are recognized as such.

Even more strange, if I manually repeat the process through the Set Null Tool, the result is what I expected.

Can anybody know why SetNull function assign 0 instead of NoData to the pixels that meet the conditions when executed on the script?


texts: Is there a line symbology that also shows vertices?

texts:
Is there such a thing as a line/vertices symbology? If not a workaround? In some situations, particularly when editing, I would like to see my lines as well as all the vertices similar to the effect I get when using the Edit Vertices tool but on all features in the feature class not just the selected feature.

The solution should be dynamic, without having to create a separate point layer but having one line features class loaded twice in the TOC is acceptable.

Programmatic solution using an example (addin, ArcObjects & VB.Net) is acceptable.

I have the ArcEditor license in case there is a trick to use with representations.


texts:
I'm trying to replicate a nearest-neighbor analysis that returns X (one OR more than one) neighbors in either QGIS or PyQGIS.

For example:

In this output, I have a set of locations (Red Stars) that are being connected to the target hubs (Blue Circles) via nearest neighbor analysis (Pink Lines). What I'd like is to find the 2nd, 3rd, 4th, etc. nearest neighbor for my set of locations to relate to hubs.

Many methods are available for performing this in PostGIS and in ArcGIS/ArcPy but it seems like there isn't an explicit method for returning more than one neighbor using Distance to Hubs or the NNJoin plugin.

Ideally, the best method would be either PyQGIS/Python based or easily replicable via the QGIS modeler interface.

Some other examples from the net:

How to get the second nearest neighbor between two point patterns in R?

Indexed Nearest Neighbour Search in PostGIS


texts:
I've googled for making viewshed analysis using Geoserver WPS, but didn't find any result. Also I've searched the WPS functions that Geoserver supports but didn't find viewshed.

Does Geoserver support viewshed?
If not, how to make such analysis.

My Environment is Geoserver, PostGIS, and Openlayers


texts: ExtractByMask ignoring my set workspace, saving to Default.gdb instead

texts:
I am calculating NDVI and then want to mask it with a vector file. I set my workspace a gdb and the NDVI raster calculator function saves to my gdb but the extract by mask saves to the Default.gdb.
Note: file path names changed for question posting
import arcpy
from arcpy.sa import *
arcpy.env.workspace = "C:\\Users\\example\\example\\example\\example\\example\\example\\example.gdb"
arcpy.env.overwriteOutput = True

#Local Variables
Band4 = "Band4"
Band5 = "Band5"
NDVI_raw = "NDVI_raw"
NDVI = "NDVI" #Masked NDVI
Neighbourhoods = "Neighbourhoods"

#Calculate NDVI
arcpy.gp.RasterCalculator_sa("(Float(\"Band5\") - Float(\"Band4\")) / (Float(\"Band5\") + Float(\"Band4\"))", NDVI_raw)

#Mask out NDVI
ExtractByMask_NDVI = ExtractByMask(NDVI_raw, Neighbourhoods)


texts: Automatic marking or tracking of edited features

texts:
I'm working with ArcMap 10.2.

What is a good way to mark or find edited features in order to keep track of them without manual field updating?

Is there a way to have ArcMap automatically update a value in a certain field when I edit a features, for example when I move a point?


texts: Analysing slope gradient from LiDAR .asc data?

texts:
I'm new to using QGIS. I have purchased some LiDAR data which downloads as .asc format, is there a way to analyse the terrain slope angle from this data or does it need to be converted into DEM? Ideally I would like to display the steeper slope angles (>35 degrees) as a different colour to the shallower (less steep) slope angles.

I'm using QGIS 2.0 Dufour on windows vista platform.


texts: Eliminating Smaller Polygons (orphans) from Larger Polygon in ArcMap?

texts:
I have a "water bodies" shapefile.  Technically there is no land to the shapefile, nonetheless the effect of visible land is produced (everything that isn't ocean).  Problem is, because it is a "water bodies" shapefile it also includes lakes, which essentially appear as 'orphaned' polygons outside the larger ocean.

What is the simplest way to produce a shapefile where all lakes are eliminated?  (See screen shot below)  I should also say I'm using ArcMap 10.2.


texts: Generate sample (Gaussian distribution) and store simulations in raster stack in R

texts:
I have a raster stack, one of the raster layers is the mean prediction of a property for that pixel, the second layer is the variance of the prediction.

I would like to write a function for generating a sample (n=50) from the Gaussian distribution, for each pixel, 50 simulations. And store the output in a raster brick or similar.

When I try directly with the function rnorm I get error message. When I try with overlay (raster), using rnorm as input function, also.

Does anyone have a clue of how doing this?

I did not calculate the spatial variograms, the soil property was predicted simply with regression.

For example:

r <- raster(nrow=10, ncol=10)
s1 <- setValues(r,runif(n = 100, min = 0, max=50))
s2 <- setValues(r,runif(n = 100, min = 1, max=5))
N <- setValues(r,50)

test <- overlay(N,s1,s2,fun=rnorm)
test
class       : RasterBrick
dimensions  : 10, 10, 100, 3  (nrow, ncol, ncell, nlayers)
resolution  : 36, 18  (x, y)
extent      : -180, 180, -90, 90  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0
data source : in memory
names       :   layer.1,   layer.2,   layer.3
min values  : -2.551580, -1.781912, -2.879981
max values  :  2.533998,  2.245894,  2.828349

test <- rnorm(n=N, mean=s1,sd=s2)
Error in rnorm(n = N, mean = s1, sd = s2) : arguments incorrects


texts: Calculate areas of each soilscape type per boundary

texts:
I would like to do the following:

Get the area of each soilscape type

Calculate the sum of area per boundary

I'm trying to do the following but seems the output is always "0"


texts: Delete data from directories arcgiscache in ArcGIS Server?

texts:
I have some arcgis cache layer on arcgis server.
After delete service from arcgis manager i'm expect that folder auto delete from directories arcgiscache, but it doesn't. In result i don't have service, but have arcgiscache.
I used rest clear cache but it not help.
So how delere arcgiscache and service from argis server correctly?


texts: Request entity too large importing replica schema changes?

texts:
setup:
Main server: SDE 10.2 SQL Server on our own network. Parent replica and tools run from here.
Destination server: Amazon web server running ArcGIS Server & SDE 10.2 SQL Server. Child replica lives here. Accessed through a geodata service

Getting an unusual error trying to sync replica changes from a replica change file to a replica using a geodata service. I generated the change file no problem using the same geodata service but when I use it in the "Import Replica Schema" geoprocessing tool the job fails with an error that says "request entity too large".

Google searches show a similar Apache error to do with max upload file size but this change file is very modest 52 kb.

Has anybody come across something similar?

One thing of note the web service is an Amazon AWS server and it is a 2 way replica.

For the moment I'm going to try to copy the change file to the web server and run the import from there but long term I need to set up batch jobs that test for and import schema changes.

Using the replica schema change file directly on the amazon server using .sde connections instead of the geodata service worked without problem

I was able to replicate this issue with 2 other replicas created on the same server and published on the same amazon server.


texts: Creating standalone python Script using PyQGIS?

texts:
I have written a code which solve my problem for Demand Allocation. I have Input (.csv)File and Output is also (.csv) File. However I have to integrate this script
in Java Application.(https://stackoverflow.com/questions/10097491/call-and-receive-output-from-python-script-in-java), So i am thinking to write Standalone python script.I dont't have any idea how to use it.Can someone help me in this code. Any path or Variable that need to be set.Please point that too.I am working on windows 7& with QGIS 3.0 Version

from qgis.core import QgsProject
uri='file:///C:/Test/points_40.csv?
delimiter=,&crs=epsg:4326&id=id&xField=Lat&yField=Long'
layer=QgsVectorLayer(uri,'Points','delimitedtext')
root = QgsProject.instance().layerTreeRoot()
QgsProject.instance().addMapLayer(layer)
vectorLyr=QgsVectorLayer("C:/Test/demand/Demand.shp","BuildingLayer","ogr")
vectorLyr.isValid()
QgsProject.instance().addMapLayer(vectorLyr)
uri='file:///C:/Test/data.csv?delimiter=,'
infoLyr=QgsVectorLayer(uri,'Population','delimitedtext')
infoLyr.isValid()
QgsProject.instance().addMapLayer(infoLyr)
csvField='FID_1'
shpField='FID'
joinObject=QgsVectorLayerJoinInfo()
joinObject.setJoinFieldName(csvField)
joinObject.setTargetFieldName(shpField)
joinObject.setJoinLayerId(infoLyr.id())
joinObject.setUsingMemoryCache(True)
joinObject.setJoinLayer(infoLyr)
vectorLyr.addJoin(joinObject)
import processing
parameters={'INPUT' : 'file:///C:/Test/points_40.csv delimiter=,&crs=epsg:4326&id=id&xField=Lat&yField=Long', 'BUFFER' : 0, 'OUTPUT' : 'C:/Test/demand/vor_points.shp' }
processing.run('qgis:voronoipolygons',parameters)
vor_points=QgsVectorLayer("C:/Test/demand/vor_points.shp","VorLayer","ogr")
vor_points.isValid()
QgsProject.instance().addMapLayer(vor_points)
vor_layer = vor_points.clone()
root.insertChildNode(-1, QgsLayerTreeLayer(vor_layer))
root.removeLayer(vor_points)
import processing
processing.run('qgis:checkvalidity',{ 'INPUT_LAYER' : 'C:/Test/demand/Demand.shp', 'METHOD' : 2, 'VALID_OUTPUT' : 'C:/Test/demand/valid.shp', 'INVALID_OUTPUT' : 'C:/Test/demand/invalid.shp', 'ERROR_OUTPUT' : 'C:/Test/demand/error.shp' })
ValidHouse=QgsVectorLayer("C:/Test/demand/valid.shp","validHouse","ogr")
ValidHouse.isValid()
QgsProject.instance().addMapLayer(ValidHouse)
processing.run("native:centroids", {'INPUT':'C:/Test/demand/valid.shp','ALL_PARTS':True,'OUTPUT':'C:/Test/demand/centroid.shp'})

 centroidLyr=QgsVectorLayer("C:/Test/demand/centroid.shp",
"CentroidLayer","ogr")
centroidLyr.isValid()
QgsProject.instance().addMapLayer(centroidLyr)
processing.run("qgis:distancematrix",{ 'INPUT' : 'C:/Test/demand/centroid.shp', 'INPUT_FIELD' : 'FID', 'TARGET' : 'file:///C:/Test/points_40.csv?delimiter=,&crs=epsg:4326&id=id&xField=Lat&yField=Long', 'TARGET_FIELD' : 'id', 'MATRIX_TYPE' : 0, 'NEAREST_POINTS' : 1, 'OUTPUT' : 'C:/Test/finalDistance.csv' })


texts: QGIS expression "get_feature" will not evaluate feature, when called within "is_selected"

texts:
I have an expression get_feature('Schools', 'INST_NO', "schoolid") which returns a feature, as intended:

However, I want to test if the feature is currently selected. So, I have created this expression is_selected(get_feature('Schools', 'INST_NO', "schoolid"), 'Schools')
Which looks just like the example given in the help text for is_selected.
However, this does not work; it throws the error Eval Error: Cannot convert to feature:


texts: Open Street Map and Arcgis 10.1 Network Analyzer

texts:
how to make roads in open_street_map ready for network_analyze in Arcgis-10.1
Details:
I'v download an osm map of my town
I saved the street lines as polyline shapefile
I opend them in arcgis-10.1
I made the network dataset and add it to arcmap
When I try to make a network anlyse to find the shortest route for 3 or 4 points I got an error message that the lines (street polylines) are not snapped well. So I can find the shortest route for some points (where the polylines are snapped well) but can't do that for far away points.
Now
Is there any way to solve this problem??
Can I do any kind of "automatic" snapping for all the polylines??


texts:
I am new to Python and QGIS, and I want to automate a process so I want to learn how to use the QGIS Pyhton API to make our own code and do the job.
If anyone knows any tutorial about this then please share, it will be of great help.


texts: Understand values for Landsat 8 surface reflectance image

texts:
What do the numbers represent when you download an image, in my case Landsat 8 OLI TIRS surface reflectance.
Are they DN numbers or reflectance values?
If the image is not surface reflectance product, do those numbers still mean the same?


texts: Troubleshooting ERROR 000814: Invalid file type from arcpy.TableToExcel()?

texts:
I wrote the script below to iterate through a file geodatabase's feature classes and convert them to an excel table. However, it returns the error

ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000814: Invalid file type
Failed to execute (TableToExcel)

I converted the feature classes to table views but I can't figure out what is wrong with the paramaters. The error is at line 18, which is where the arcpy.TableToExcel_conversion('table', outname) operation begins.

import arcpy
from arcpy import env

env.workspace = r'C:\Parishes\Cameron.gdb'
parish = "Cameron"

for fc in arcpy.ListFeatureClasses():

    if arcpy.Exists('tableview'):
        arcpy.Delete_management('tableview')

    arcpy.MakeTableView_management(fc, 'tableview')

    outname = str(fc) + parish + ".xls"

    arcpy.TableToExcel_conversion('tableview', outname)
    arcpy.AddMessage('Created "{}" Table export '.format(fc))

arcpy.Delete_management('tableview')


texts:
Googlemaps shows you how large an area is on a map by showing a small bar with the number of miles/kilometers at the bottem left. Does leaflet also support this somehow?

I do not see it listed in the docs at leafletjs but it seems like something that the library should support.


texts:
From a point shapefile of pools, I create an extent and I want to check if another pool is in the extent, take the coordinates and save it. I have the following code, but when I run it it just loops one time (without the last part the code run perfectly)

import random
from osgeo import ogr,gdal

InputImage = r'C:\Users\Usuario\Desktop\QGIS-Pool\Ortofotos\PNOA_MA_OF_ETRS89_HU31_h50_0823.tif'
Shapefile = r'C:\Users\Usuario\Desktop\QGIS-Pool\Git\Pool_shapefile\Pool.shp'
RasterFormat = 'GTiff'
PixelRes = 0.5
VectorFormat = 'ESRI Shapefile'
folder = 'C:\\Users\\Usuario\\Desktop\\QGIS-Pool\\Git\\images\\'
tilemapping = {}

# Open datasets
Raster = gdal.Open(InputImage, gdal.GA_ReadOnly)
Projection = Raster.GetProjectionRef()

VectorDriver = ogr.GetDriverByName(VectorFormat)
VectorDataset = VectorDriver.Open(Shapefile, 0) # 0=Read-only, 1=Read-Write
layer = VectorDataset.GetLayer()
FeatureCount = layer.GetFeatureCount()
print("Feature Count:",FeatureCount)

# Iterate through the shapefile features
Count = 0
for feature in layer:
    Count += 1
    #print("Processing feature "+str(Count)+" of "+str(FeatureCount)+"...")

    geom = feature.GetGeometryRef()
    xmid, xmid, ymid, ymid = geom.GetEnvelope()
    xmid = xmid + random.randint(-40, 40)
    ymid = ymid + random.randint(-40, 40)
    xmin, ymin = xmid - 50, ymid - 50
    xmax, ymax = xmid + 50, ymid + 50

    # Create raster
    OutTileName = folder + str(Count) + '.tif'
    OutTile = gdal.Translate(OutTileName, Raster, width=224, height=224, projWin = [xmin, ymax, xmax, ymin])
    OutTile = None # Close dataset

    centers = []
    for feature1 in layer:
        geom1 = feature1.GetGeometryRef()
        x, x, y, y = geom1.GetEnvelope()
        if (xmin < x) & (x < xmax) & (y > ymin) & (y < ymax):
            x = (x - xmin) / (xmax - xmin)
            y = (y - ymin) / (ymax - ymin)
            centers.append((x,y))

    if len(centers) > 0:
        tilemapping[Count] = centers

# Close datasets
Raster = None
VectorDataset.Destroy()
print("Done.")

I don't know what is happening or how to solve it.


texts: Stopping Manifold from writing TMP files?

texts:
We work with sizable Manifold Projects that sometimes go over a Gb of vector data. After working in Manifold for a while Gigs of TMP files are getting written to the hard drive.

We use manifold 8 64 bit - so we would have assumed everything was done in memory as that's what 64 bit's great for!

Is there anyway to stop this? We're running 12Gb x64 Windows 7 machines and there's got to be a performance hit in there...  Plus our sysadmins aren't too fond of the Gigs of TMP files we leave lying around.


texts: Geoserver feature type details duplicate Oracle DB users

texts: I have two users in a Oracle DB user_1 and user_2. This issue occurs when I create a two tables by user_1 its show one table as user_1.table_1 and the second table as user_2.table_2. I'm not sure why this is occurring?


texts:
I'm having no luck finding examples.  I've found code like that below but this is for earlier versions.

shapeLayer = new VEShapeLayer();
shapeSpec = new VEShapeSourceSpecification(VEDataType.ImportXML, layer.url, shapeLayer);
veMap.ImportShapeLayerData(shapeSpec);


texts:
I've searched the manuals and plugins and done some tests..

Is it in any way possible to perform 3D drawing and editing of vector objects for 3D mapping e.g. in a 3D shapefile or PostGIS 3D table?


texts:
I'm trying to export a layer via QTiles, gotten from the Data Source Manager and connecting to (USGSHydroCached).

I have QTiles set to zoom levels 0-20 and Render tiles outside of layers extent checked (basemap goes up to 20). For some reason, the hydro layer only shows up to zoom level 17 (as per Leaflet). At zoom levels 18,19,20 the layer disappears.

QTiles is generating folders and files up to zoom level 20 (assuming this is the extent checkbox).

Is there a way to have it render the tile beyond that zoom level (poor resolution is fine)?


texts: ArcGIS Javascript 4 API - Class breaks visualization in GeoJSONLayer

texts:
I'm trying to create a data-driven visualization using a GeoJSONLayer with ArcGIS Javascript 4.14 using "esri/renderers/smartMapping/creators/color" on a field named "Number" (specifically a Class Break Render following this and the documentation) but I'm getting a 404 error and the layer is not rendering properly (only default color). The JSON layer,  placed in my root folder, is (I guess) a proper JSON working with other renderers but not with this one.

JSON (sample)

{
    "type": "FeatureCollection",
    "features": [
        {
            "id": "12",
            "type": "Feature",
            "properties": {
                "ISO": "DEU",
                "NAME_0": "Germany",
                "Number": 116,
                "Region": "Baden-Württemberg",
                "index": 12
            },
            "geometry": {
                "type": "MultiPolygon",
                "coordinates": [
                    [
                        [
                            [
                                9.651418686000056,
                                49.780555725000056
                            [.........]
                            [
                                8.682067871000072,
                                49.61891174300007
                            ]
                        ]
                    ]
                ]
            }
        },
..........

<!DOCTYPE html>

<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<title>TEST</title>

<link rel="stylesheet" href="https://js.arcgis.com/4.14/esri/themes/dark/main.css">

The error is

https://localhost/output.json/generateRenderer?classificationDef=%7B%22type%22%3A%22classBreaksDef%22%2C%22breakCount%22%3A4%2C%22classificationField%22%3A%22Number%22%2C%22classificationMethod%22%3A%22esriClassifyQuantile%22%7D&where=1%3D1&f=json 404

What am I doing wrong?

Thanks in advance.
m.


texts: What is the meaning of a bearing exactly?

texts:
I have encountered this bearing concept as the following.

Background:
        Given the profile "testbot"
        And a grid size of 10 meters

Scenario: Testbot - Intial bearing in simple case
    Given the node map
        """
        a b c d
        """

    And the ways
        | nodes |
        | ad    |

    When I route I should get
        | from | to | bearings  | route | bearing    |
        | b    | c  | 90 90     | ad,ad | 0->90,90->0|
        | b    | c  | 180 90    |       |            |
        | b    | c  | 80 100    | ad,ad | 0->90,90->0|
        | b    | c  | 79 100    |       |            |
        | b    | c  | 79,11 100 | ad,ad | 0->90,90->0|

Scenario: Testbot - Intial bearing in simple case
    Given the node map
        """
        a
        0 c
        b
        """

    And the ways
        | nodes |
        | ac    |
        | bc    |

    When I route I should get
        | from | to | bearings | route | bearing       |
        | 0    | c  | 0 0      |       |               |
        | 0    | c  | 45 45    | bc,bc | 0->45,45->0   |
        | 0    | c  | 85 85    |       |               |
        | 0    | c  | 95 95    |       |               |
        | 0    | c  | 135 135  | ac,ac | 0->135,135->0 |
        | 0    | c  | 180 180  |       |               |

Scenario: Testbot - Initial bearing on split way
    Given the node map
       """
       g d 2       1         c f
       h a         0         b e
       """

    And the ways
        | nodes | oneway |
        | ab    | yes    |
        | bc    | yes    |
        | cd    | yes    |
        | da    | yes    |
        | be    | yes    |
        | fc    | yes    |
        | dg    | yes    |
        | ha    | yes    |

    When I route I should get
        | from | to | bearings | route       | bearing                    |
        | 0    | b  | 10 10    | bc,bc       | 0->0,0->0                  |
        | 0    | b  | 90 90    | ab,ab       | 0->90,90->0                |
        | 0    | b  | 170 170  | da,da       | 0->180,180->0              |
        | 0    | b  | 189 189  | da,da       | 0->180,180->0              |
        | 0    | 1  | 90 270   | ab,cd,cd    | 0->90,90->0,270->0         |
        | 1    | 2  | 10 10    | bc,bc       | 0->0,0->0                  |
        | 1    | 2  | 90 90    | ab,cd,ab,ab | 0->90,90->0,270->180,90->0 |
        | 1    | 0  | 189 189  | da,da       | 0->180,180->0              |
        | 1    | 2  | 270 270  | cd,cd       | 0->270,270->0              |
        | 1    | 2  | 349 349  |             |                            |

It really confused me. Moreover, the bearing.hpp file is as the following.

namespace engine
{

struct Bearing
{
    short bearing;
    short range;

    bool IsValid() const { return bearing >= 0 && bearing <= 360 && range >= 0 && range <= 180; }
};

inline bool operator==(const Bearing lhs, const Bearing rhs)
{
    return lhs.bearing == rhs.bearing && lhs.range == rhs.range;
}
inline bool operator!=(const Bearing lhs, const Bearing rhs) { return !(lhs == rhs); }
}

I understand that the bearing here is related to the direction / angle of the vehicle movement, right? Based on wiki, https://en.wikibooks.org/wiki/Trigonometry/Compass_Bearings, I got a rough sense of what it is. After viewing this video, https://www.youtube.com/watch?v=T40AMljjgrU I understand what is the bearing between two given locations in a map. Still, I need more clarifications with respect to the above scenario. More specially, what is exactly 0->0, 0->90 when talking about bearings?


texts: Why are electric power lines so highly visible in satellite images?

texts:
In Google Maps, why are electric power lines so highly visible? I can find them every place in the United States that has above-ground power.

For example, in the Google Maps image below, the high voltage lines are clearly visible. And, above the white boat and trailer near the center of the image, the residential (grid/mains) power lines are also visible.

In my area of the U.S., I estimate that high voltage lines are about 1.5" (4cm) in diameter, and residential power lines to houses are about 0.5" (1.25cm) in diameter.

The width of both lines is surely less than the resolution of the satellite images, so why are they still highly visible?

Edit: Good observation by user30184 that an object that is sufficiently long, sufficiently uniform in color, and with sufficient contrast to its background can be visible well below camera resolution.

The same picture above, but zoomed back so far that vehicles are ambiguous, the power lines are still visible in the right of way for the high voltage lines.


texts: Interpreting meter values of extent using ArcGIS Pro?

texts:
I am using ArcGIS Pro application to create a map and add a single polygon feature class onto the map.

As shown below, I use bold polyline to outline the boundary of the polygon and click "zoom to layer" to make sure the current display extent fit the polygon well.

Then I check the current visible extent and I get the set of the four meter values.

Then I try to customize the extent by choosing the polygon feature class and the extent value looks totally different. What I expect is to see very similar meter values there.

What does each representation of extent mean so that I can understand the difference seen here?


texts: Legend in Geoserver generates wrong image

texts:
I have written the Style in CSS, in Geoserver. Following is the code

/*@title Cresta HighRes*/
    *{
    stroke-width:1;
      stroke:#686868;
      fill:#e1e1e1;
    }

    [@scale < 1500000] {
        label:[cresta_hr_id];
        label-anchor: 0.5 0.5;
        font-family: "Calibri";
        font-fill: #ffffff;
        font-style: normal;
        font-size: 12;
      halo-color:#787878;
      halo-radius:2;
      }

This creates a Legend graphic
where "Cresta High Res" is appearing twice. I want it to appear only once like this . What should i do ?


texts: Iterating Create NetCDF Raster Layer in ModelBuilder?

texts:
Recently I have updated my ArcGIS to 10.5 and I got stuck with a process that I used to do a thousand times before in 10.2.2 version.

I need to calculate zonal statistics from rasters stored in netcdf format and I need to process a lot of them. To do that, I used to create a table with time dimension values stored in netcdf using "make netcdf table view", so I was always sure that time is stored in a good format:

Then I was creating model with field value iteration so I was iterating every single date and creating raster from netcdf

It was working well every time in the past and now for some reason it's not. I have noticed that in the Dimension Value list in make netcdf raster layer tool I can choose not only "Value" as it was before but I can also choose separate date

the tricky thing is that in this list date is in other format and I think that it's my source of problem.

If I create time table directly from netcdf file, why the date is in other format in this two places?

Can anyone tell my how can I change the date format in ArcGIS?


texts:
I'm having issues getting my Esri.FileGDBAPI.DLL to work. I have the other two files, FileGDBAPI.dll, FileGDBAPID.dll in my bin folder. I can only add the Esri dll to my references, the other two I get an error saying that they can't be added because they either aren't accessible, not COM components or valid assemblies.

This is the error I get when running it:

A procedure imported by 'Esri.FileGDBAPI.DLL' could not be loaded.

By the way, I also have the FileGDB_DotNet.dll file in my Windows/system directory and I'm using .Net4.0. Thanks!


texts: How to convert a data frame grid to a shapefile?

texts: I have a map layout set up in ArcMap 9.3.1 with an index grid on the data frame.  What I would like to do is convert this index grid to a shapefile that includes the grid reference information.  I've tried the Convert Graphics to Features button on the Drawing toolbar, but it is greyed out.  Is anyone aware of a method or script to perform this operation?


texts: Extended Qgis Web Client - (gisapp) Helloworld Project Setup on Ubuntu 15.10

texts:
I have a problem setting up the Helloworld Project to load in a browser. All QGIS server settings are working including 'GetCapabilities' requests etc. When I click on the test url:

http://localhost/gisapp/helloworld?public=on

I get:

The requested URL /gisapp/helloworld was not found on this server.

Apache2 log:-

[Fri Nov 13 19:22:04.470964 2015] [mpm_prefork:notice] [pid 1102] AH00163: Apache/2.4.12 (Ubuntu) SVN/1.8.13 mod_wsgi/4.3.0 Python/2.7.10 configured -- resuming normal operations
[Fri Nov 13 19:22:04.471044 2015] [core:notice] [pid 1102] AH00094: Command line: '/usr/sbin/apache2'
[Fri Nov 13 19:37:20.277608 2015] [mpm_prefork:notice] [pid 1102] AH00169: caught SIGTERM, shutting down
[Fri Nov 13 19:37:21.410392 2015] [mpm_prefork:notice] [pid 3915] AH00163: Apache/2.4.12 (Ubuntu) SVN/1.8.13 mod_wsgi/4.3.0 Python/2.7.10 configured -- resuming normal operations
[Fri Nov 13 19:37:21.410448 2015] [core:notice] [pid 3915] AH00094: Command line: '/usr/sbin/apache2'
[Fri Nov 13 19:56:04.745097 2015] [mpm_prefork:notice] [pid 3915] AH00169: caught SIGTERM, shutting down
[Fri Nov 13 19:56:05.866559 2015] [mpm_prefork:notice] [pid 4225] AH00163: Apache/2.4.12 (Ubuntu) SVN/1.8.13 mod_wsgi/4.3.0 Python/2.7.10 configured -- resuming normal operations
[Fri Nov 13 19:56:05.866616 2015] [core:notice] [pid 4225] AH00094: Command line: '/usr/sbin/apache2'

"/var/log/apache2/error.log" 8L, 1053C


texts: Interpolating contour lines from TIN-model vs Grid in ArcGIS Desktop

texts:
I am a complete beginner in GIS and taking a class right now, and we are doing some assignments in ArcGIS Desktop (ArcMap).

In one of them we were given a shapefile with heightpoints. These had been manually collected using gps, and they had been chosen to best represent the variations of the landscape.

Next we were to build a TIN-model and a Grid (with 3D Analyst toolbox -Interpolation / Natural Neighbor, Z vaule field = SPOT, Output Cell Size = 10 meter) from these points.

And finally to interpolate contour lines with Surface Contour - Contour interval = 10 meter.

Which of these methods give the most accurate contour lines, and why?

I have a hard time getting my head aroud this. I have written in my report that the Grid-based contours are more accurate because the Grid has alot more interpolated points to use when drawing the contours. Or is this just making the lines more smooth, not more accurate.

In this example file we are using, the grid cell size set to 10 meters, gives a smaller grid than the TIN-triangles, even when the original data points are close together.

The grid based contours are interpolated twice. First from the data points to all the centers of all the cells, and then to the contour lines.

And the TIN-based contours are interpolated straight from the data points to new points on the lines that form the edges of the triangles.

here is a picture of the points, models and countours from ArcMap:
http://i.imgur.com/jfzdZEE.jpg


texts: I have to build the polygons from some polylines it is an area like a main land(with some boundaries) and some islands around it,islands are building polygons and main land is missing,when i have tried to build the polygons in FME.I have snapped all the lines first and used the transformers like reader-linejoiner-polygonbuilder-writer,I am also using ArcGIS Desktop, MapInfo and QGIS.


texts:
Trying to make a new feature on a map.
I got the code like this where i`m using atm hardcoded coordinates:

function addFeature(browserEvent, dataSource) {
  //add feature
  var url = dataSource + '/0/addFeatures';
  var coordinate = browserEvent.coordinate;
  var x = coordinate[0];
  var y = coordinate[1];
  //console.log('De locatie is ' + coordinate);

  var jsonTemp = [{
    'geometry': {
      'x': 248460.375,
      'y': 440990.21880000085
    },
    'attributes': {
      'relcp86d_': 0,
      'relcp86d_i': 99999,
      'symbol': 77,
      'polygonid': 1,
      'scale': 1,
      'angle': 10,
      'omschrijvi': 'Testobject'
    }
  }];

  var jsonTempStringified = JSON.stringify(jsonTemp);
  var jsonTempStringifiedParsed = JSON.parse(jsonTempStringified);

  $.ajax({
    url: url,
    dataType: 'json',
    type: 'POST',
    data: jsonTempStringifiedParsed,
    success: function(data) {
      console.warn(data);
    },
    error: function(xhr, ajaxOptions, thrownError) {
      console.warn(xhr);
      console.warn(thrownError);
      //console.warn(ajaxOptions);
    }
  });

}

I tried to use this exact json in the browser and it works(Link) but using it via this it's giving me errors and i tried all kind of things. As you can see from a previous post i really have problems with json and the arcgis server services.

Error code is:

SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
Stacktrace:
ajaxConvert@http://localhost:8080/dist/app.js:9465:19
done@http://localhost:8080/dist/app.js:9933:15
[10]</</</<.send/callback/<@http://localhost:8080/dist/app.js:10225:9

I also tried to remove the [] doesn't help it keeps having the same problem.
As you can see i have also tried with or without or even double parse/stringify just nothing helps.


texts:
I have  a dataset of around 20,000 points in a point layer and a polygon layer with a few hundred polygons. Some of the points lie inside the polygons, others do not. I'd like to label every point as either in or out of the polygon, separately in the attribute table of the points layer.
Can anyone please advise?


texts: Need a Python field calculation that works like the DatePart( ) VB Function

texts:
I have a field called Abandoned Year (short integer data type) that I am trying to populate with a four digit year from a column called Decommission Date (Date data type).  I have done this in the past using the DatePart( ) VB function but how do I accomplish this same task in a Python field calculation?

Here is the code written in VB:

AbandonedYear = DatePart ("YYYY", [DecommissionDate])

Thanks


texts: Error while deleting field in geopackage using QGIS 3.4.2

texts:
I have a geopackage file and I would like to delete a field. I run into unexpected behavior.

My process:

Open QGIS
Add gepackage layer
Open attribute table
Enable Edit mode
Click remove field

select the field and click ok
Stop edit
Save the changes

after I press save, my entire attribute table is gone.

Am I doing something wrong or is this a bug in QGIS?

QGIS 3.4.2


texts:
Have anyone tried to set up a tilecache for a certain area of a map, leaving the areas outside of the tiles boundingbox to pure wms calls?

Background is I have a map where about 10% of it is accessed way more frequently than others and it would be good to have it cached but at the same time I can not cache the map as a whole due to space restrictions.

Can I do this in any tilecaching solution or do I have to split the map in two?


texts: I am having problems with the Editor function "construct points" in ArcGIS. If I select the line where I want to construct the points, the direction of the points is not correct. The orientation arrows are not going in only one direction but starting from both sides of the line (see attached picture). Has anyone  experienced a similar problem?


texts: Extract data from raster file (precipitation) and join to vector file database

texts: I am new in QGIS. I do have a raster file with precipitation data, and a vector data file that contains data on botanical collections (name of species, lon and lat). I want to extract the data of precipitation for each of the collection points, for each species There are 1200 data points. Is there a way to do this?


texts: Calculating density within a shapefile (in R)

texts:
I'm trying to calculate density within a shapefile, but I'm fairly confident I'm doing it wrong. The idea is to figure out which geographical regions there have been the most sales by density.

Here is a link to the file that I use (testdata.shp)

library(sf)

sample <- st_read("testdata.shp")

sample$area <- st_area(sample$geometry)

density_calc <-sample %>% st_buffer(0) %>% group_by(areas) %>% summarise(`Sales (density)` = sum(sales)/sum(area))

Here are the details of the shapefile:

Geometry set for 2106 features
geometry type:  MULTIPOLYGON
dimension:      XY
bbox:           xmin: -120.0065 ymin: 35.00184 xmax: -114.0396 ymax: 42.00221
epsg (SRID):    4326
proj4string:    +proj=longlat +datum=WGS84 +no_defs

I guess my issue is, I don't really know what is right and wrong, so I have no clue if I did it correctly.

Sorry if it's not the most extensive question, I just don't remember my high school geometry that well!


texts: Since there are a huge number of remote sensing products available, I feel confused.  Is there any data catalog for data specification, date of acquisition, and type of application?


texts:
Using gdal translate, would it be possible to convert from IMG to GeoTIFF?

We have very little experience with gdal and would really be grateful for some insight.


texts: How to format latitude and Longitude labels to show only degrees with suffix without any decimal or minutes?

texts: I am setting my latitude and longitude labels in the QGIS map > map grid properties > draw coordinates > format but this only has decimal, decimal with suffix, degree minutes (w and w/o suffix) etc but I only want the degrees with suffix as in 78° E, 65° N but I cant see a way to get to that format.


texts: VBA ArcGIS 9.3 Field Calculator: 'countif' across several fields

texts:
I have an attribute table with 15 columns that contain either a '0' or a taxonomy number. I would like a summarized column that shows the number of different species.

location  type1  type2  type3  etc etc...  nr_of_species
    1      123    234    0      .........      2
    2      456     0     0      .........      1
    3       0      0     0      .........      0

Is there a way to do this with VBA and field calculator? I have no experience with VBA, so i might need a complete dummy-guide.

thanks!


texts: Is there any examples on how to use the rastercalc.py or rastercalcengine.py? And what are the purpose of these python module? Are these modules the same with gdal utilities which can be run in command line? Can I use from any of these two modules in subtracting two raster images?


texts: Why sometimes Network Analyst can not find the shortest or the best route?

texts:
Normally in Network analyst and route detection it has to find the shortest and efficient way.But here in my work I can see that it does not find the best choice.I wonder why it chose the longer path ?
I have to mention that I am working on geological part of an area and I want to know the shortest connection between available fractures!
Would it be because lots of vertices? or anything is wrong there that it cannot solve the route?
Below you can see one of the examples of my project!


texts: spTransform cutting off part of ROI in stereographic projection

texts:
I'd like to have a map of land above 50N in the stereographic projection.  I use the following code but as you can see, some land is cut out.

  proj<- "+proj=stere +lat_0=90 +lat_ts=71 +lon_0=0 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs +ellps=WGS84
    +towgs84=0,0,0"

    data("wrld_simpl", package = "maptools")
    wm <- crop(wrld_simpl, extent(-180, 180, 50, 90))
    wm <- spTransform(wm, CRSobj = CRS(proj))

    ### plot land
    plot(wm, col="grey", border="grey")

#add wrapper circle
pts=SpatialPoints(rbind(c(-180,50),c(0,50),c(180,80),c(180,80)), crs(data))
my_line = SpatialLines(list(Lines(Line(cbind(seq(-180,180,0.5),rep(50,721))), ID="outer")), CRS("+init=epsg:4326"))
my_line1<-st_as_sf(my_line)
bounds<-st_transform(my_line1,crs =proj)
plot(bounds,col="gray42",add=TRUE)


texts: Editing LiDAR point cloud to remove noise/outliers present below and above ground?

texts:
I have "dirty" LiDAR data containing first and last returns and also inevitably errors under and over the surface level. (screenshot)

I have SAGA, QGIS, ESRI and FME at hand, but no real method. What would be a good workflow to clean this data? Is there a full automated method or would I somehow be deleting manually?


texts: Are there high resolution images available for download on earthexplorer?

texts:
The problem with earth explorer GeoTiff files is, if you zoom in enough, the resolution is very fuzzy.

If you want to look at your backyard, for example, that is impossible.  If you use the earth explorer summary (on the right side of their website), which is very similar to google maps, you can zoom in on any area of the country in great detail.

Can I download images of this quality on earth explorer?


texts: QGIS save shapefile - problems with attribute table

texts:
I added point coordinates of a delimited text file layer with an attribute table containing about 1000 columns.

As soon as I want to save this created layer as a shapefile I get an error that some creation of a certain field failed (reason unkown). When excluding this field there is a problem with another one and so on.

I guess QGIS can´t deal with an attribute table this large or there are some characters in the text that QGIS can´t handle (I´ve already tried to replace underscores with points).

Any other suggestion why this does not work out?

Or maybe other ways to tranform a .csv format with coordinates to .shp ?


texts: PyQGIS OpenLayers map is not seen correctly in PNG file saved through QgsComposition, Looks like partially loaded

texts:
I have created a Python script to create a map which contains three layers. One is a polygon layer of administrative boundaries, one is point layer, one is an OpenLayers plugin map.

I want to export this as an image in PNG format. I do this using QgsComposition class as suggested in this link:
http://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/composer.html

However in the resulting picture it seems like the picture was exported before the OpenLayers map was fully loaded. In the picture you can see few tiles from the map while other area is full white. Is it some kind of refresh problem or I am not doing it correctly?

Please help.


texts: Parent model that iterates over nested models that iterate over Buffer?

texts:
I have these two nested models (sub-models) that are buffering each feature in a feature class and creating a shapefile for each result (their geoprocessing is identical). They both work fine when run standalone.

I'm trying to take the list of shapefiles created by both nested models and pass it back to the parent model (below). Then the parent model needs to iterate over the lists and perform merge (and more). The merge needs to be based on matching values of one attribute; there is a 1:1 relationship in the lists. So the one item from nested model A is merged with one item from nested model B, etc.

I tried Collect Values on the output of Copy Features and (in the parent model) the Merge could not see the Collect Values results as valid inputs.

How can I get the lists back to the parent such that it can iterate on them?

Based on the comment from @Hornbydd, I changed the models as shown below - the two "sub-sub" models, that is, the innermost layer of nesting; the sub model, the next layer, and then the parent. If the first question was not clear, the intent is only to do the merge on two of the output files, i.e. Copy Feature results, at a time. The models as they are merge all the Copied Feature results into one feature class. I want the merge to take "one_1k_ft" and "one_1_mi" then "two_1k_ft" and "two_1_mi" etc etc. A common field exists in both attribute tables so ideally I can merge based on matching values there.


texts:
I´m trying to obtain GeoTIFF files to use them in Photoscan from ASCII files.

My process is as follows: I have 200 ASCII files more of less, I use the ASCII to raster tool in batch mode process in Arc GIS and with this I obtain an ESRI Raster, then I want to use the convert tool of QGIS to obtain the GeoTIFF.

My specific problem is I can´t save the files in other directory instead the default directory in the batch mode and that means that I can´t have the files in the right format to use it in QGIS because they are inside a geodatabase.

Probably exist other way to do what I´m trying to do but I don´t know it.

I share a sample ASCII file.
enter link description here


texts: Subtracting rasters using gdal_calculate command?

texts:
How do I subtract two raster using gdal_calculate command?

Note that gdal_calc is different from gdal_calculate.py.

The rasters I am using have different dimensions.


texts: Creating Custom Geographic Transformation using ArcMap

texts:
I am using ArcMap 10.7.
It comes down to needing to get my data into a local custom spatial reference system. I have not yet been able to project my data into it.
Desired coordinate system/spatial reference:
Calgary_3TM_WGS_1984_W114
Full detail:
Projection: Transverse_Mercator
false_easting: 0.0
false_northing: 0.0
central_meridian: -114.0
scale_factor: 0.9999
latitude_of_origin: 0.0
Linear Unit: Meter (1.0)

Geographic Coordinate System: GCS_WGS_1984
Angular Unit: Degree (0.0174532925199433)
Prime Meridian: Greenwich (0.0)
Datum: D_WGS_1984
Spheroid: World_Geodetic_System_of_1984_GEM_10C
    Semimajor Axis: 6378137.0
    Semiminor Axis: 6356752.314245179
    Inverse Flattening: 298.257223563

So far I have tried a number of the datum transformations included in ArcGIS for NAD83 -> WGS84 but none have worked, resulting in errors such as 'geographic transformation not valid'.
To create a new custom geographic transformation I was never taught, and looking online has extremely little information on doing so, and the printed material simply explains what geographic transformations are and no further. I have so far only found a single video, which brings up the issue of the 'method' of the transformation. I haven't been able to find anything from Esri on the subject (but perhaps I am not looking in the right place).
What am I doing incorrectly, or what must I do in moving forward on this?


texts: How to dissolve naturalearth vectordata with gdal?

texts:
trying to use the workflow described by @aflaciano at How to render area that crosses 180°? I did the following:
1) downloaded and installed gdal-111-1600-x64-core.msi from http://www.gisinternals.com/sdk/ on my windows 7 64 bit pc.
2) downloaded data from http://www.naturalearthdata.com
3) used the following batch-file adapted from @aflaciano:

rem Clip world.shp between -169° and +180° of longitude in order to exclude the Chukotka Peninsula (1st part):
rem ==========================================================================================================
ogr2ogr world_clip.shp ne_110m_admin_0_countries.shp -clipsrc -169 -90 180 90
rem Shift and clip world.shp between +180° and +191° of longitude in order to include the Chukotka Peninsula (2nd part):
rem ====================================================================================================================
ogr2ogr Chukotka_Peninsula.shp ne_110m_admin_0_countries.shp -dialect sqlite -sql "SELECT sov_a3, ShiftCoords(geometry,360,0) FROM ne_110m_admin_0_countries" -clipsrc 180 -90 191 90
rem Merge the two parts:
rem ====================
ogr2ogr world_shifted.shp world_clip.shp
ogr2ogr -update -append world_shifted.shp Chukotka_Peninsula.shp -nln world_shifted
rem Finally, dissolve countries boundaries of world_shifted.shp obtaining world_output.shp:
rem =======================================================================================
ogr2ogr world_output.shp world_shifted.shp -dialect sqlite -sql "select ST_Union(Geometry),sov_a3 FROM world_shifted GROUP BY sov_a3"

at step 3 last line of the batch-file I must have done an error, because dissolve does not work for me, but I get no error message:

ogr2ogr world_output.shp world_shifted.shp -dialect sqlite -sql "select ST_Union(Geometry),sov_a3 FROM world_shifted GROUP BY sov_a3"

I tried also other variables for dissolve , e.g. sovereignt or admin, geounit, adm0_a3


texts: QGIS 3.4.2 on Windows: pyqgis 3 rule-visibility depending on scale

texts:
I have a plugin for QGIS 2.18. In QGIS 2.18 it was possible, to toggle the visibility of each of the 7 "sublayers" (see below) by python-code:

    symbol = QgsMarkerSymbolV2.createSimple({'name': 'circle'}) # Markersymbol benennen; z.B.: [ square, diamond, pentagon, triangle, circle, cross2, x ].
    renderer = QgsRuleBasedRendererV2(symbol) # Kreieren eines neuen Regel-basierten Renderers.
    root_rule = renderer.rootRule() # Holen der "root" Regel.
    for label, expression, color, groesse, maszstab in Statusregeln:
        rule = root_rule.children()[0].clone() # Kopie der default-rule erzeugen.
        rule.setLabel(label)
        rule.setFilterExpression(expression)
        rule.symbol().setColor(QColor(color))
        rule.symbol().setSize(groesse)
        rule.setScaleMinDenom(1)
        rule.setScaleMaxDenom(int(maszstab))
        root_rule.appendChild(rule) # Anhängen der rule an die Liste.
    root_rule.removeChildAt(0)
    layer.setRendererV2(renderer)
    layer.triggerRepaint()

In QGIS 3 the methods "setScaleMinDenom" and "setScaleMaxDenom" don't work anymore.

Is there a replacement in QGIS3?

If not yet existing, is it planned?

I used
rule.setMaximumScale(int(maszstab))
I am using QGIS 3.4.2 for Windows 7, 64-bit. Maybe the QGIS-version is the reason.


texts: Is there a free and open-source MXD to SLD converter?

texts:
Possible Duplicate:
  How to edit or convert ArcGIS 10 layer style to a SLD’s file

I'm trying to set up a web map server for one of the government agencies in my country. Server setup's done (GeoServer) and now I'm just trying to integrate it to their current workflows. Unfortunately, they are currently using ArcGIS 9.3 and they're used to making maps using it and saving them as MXDs. I know they could style their maps again using SLD but they find it a bit troublesome and I don't want to give them another reason to resist FOSS. (They're resistant enough as it is)

Google searches return GeoCat but it's a paid product and I was hoping to test a free one first if possible. I also found ArcMap2SLD but it crashes my computer and it hasn't been updated in some time. Anybody know some other tool?


texts: How to add dynamic text in standalone PyQGIS to reflect iteration of layer names

texts:
I am working with a standalone PyQGIS script below (that was given as an answer to How to iterate over layers and export them as PNG images with PyQGIS in a standalone script). The script exports the "boundary, climits, and Div1_Irrig_1956_0" layers as one png. The script then exports the "boundary, climits, and Div1_Irrig_1976_1" layers as another png and so on. I am trying to add to the code a way to include a text element in each export process that reflects the Div1_Irrig... layer name.

from qgis.core import QgsApplication, QgsMapLayerRegistry, QgsVectorLayer, QgsProject
from qgis.gui import QgsMapCanvas, QgsMapCanvasLayer, QgsLayerTreeMapCanvasBridge
from PyQt4.QtCore import QTimer, QSize
import sys, os
import time

qgisApp = QgsApplication([], True)
qgis_prefix = "C:\\OSGeo4W\\apps\\qgis"
qgisApp.setPrefixPath(qgis_prefix, True)
qgisApp.initQgis()

# Required variables with your shapefile paths and names
pngsPath = 'E:/IrrigatedLands/FC_qgis/'
boundaryLayer = QgsVectorLayer("E:\\IrrigatedLands\\FC_qgis\\boundary.shp", 'boundary', 'ogr')
climitsLayer = QgsVectorLayer("E:\\IrrigatedLands\\FC_test\\citylimits\\climits.shp", 'climits', 'ogr')
otherLayers = {'Div1_Irrig_1956_0': QgsVectorLayer("E:\\IrrigatedLands\\FC_qgis\\Div1_Irrig_1956_0.shp", 'Div1_Irrig_1956_0', 'ogr'),
    'Div1_Irrig_1976_1':QgsVectorLayer("E:\\IrrigatedLands\\FC_qgis\\Div1_Irrig_1976_1.shp", 'Div1_Irrig_1976_1', 'ogr'),
    'Div1_Irrig_1987_2': QgsVectorLayer("E:\\IrrigatedLands\\FC_qgis\\Div1_Irrig_1987_2.shp", 'Div1_Irrig_1987_2', 'ogr')}
count = 0

canvas = QgsMapCanvas()
canvas.resize(QSize(500, 500)) # You can adjust this values to alter image dimensions
#canvas.show()

# Add layers to map canvas taking the order into account
QgsMapLayerRegistry.instance().addMapLayer(boundaryLayer)
QgsMapLayerRegistry.instance().addMapLayers(otherLayers.values() )
QgsMapLayerRegistry.instance().addMapLayer(climitsLayer)
layerSet = [QgsMapCanvasLayer(climitsLayer)]
layerSet.extend([QgsMapCanvasLayer(l) for l in otherLayers.values() ])
layerSet.append(QgsMapCanvasLayer(boundaryLayer))
canvas.setLayerSet( layerSet )

# Link Layer Tree Root and Canvas
root = QgsProject.instance().layerTreeRoot()
bridge = QgsLayerTreeMapCanvasBridge(root, canvas)

def prepareMap(): # Arrange layers
    for lyr in otherLayers.values(): # make all layers invisible
        base = os.path.basename(lyr)
        name = os.path.splitext(base)[0]
        layerOn = "" # When required layer is turned on this will be the layer name to output
        root.findLayer( lyr.id() ).setVisible(0) # Unchecked

        for lyr in otherLayers:
            lyr.visible = False
            if lyr.name == "climits":
                lyr.visible = True
            if lyr.name == "boundary":
                lyr.visible = True
            if lyr.name == name:
                lyr.visible = True
                layerOn = lyr.name

            if layerOn:
                print layerOn

    root.findLayer( otherLayers.values()[count].id() ).setVisible(2) # Checked
    canvas.zoomToFullExtent()
    QTimer.singleShot(8000, exportMap) # Wait a second and export the map
    return

def exportMap(): # Save the map as a PNG
    global count # We need this because we'll modify its value
    canvas.saveAsImage( pngsPath + otherLayers.keys()[count] + ".png" )
    print "Map with layer",otherLayers.keys()[count],"exported!"
    if count < len(otherLayers)-1:
        QTimer.singleShot(8000, prepareMap) # Wait a second and prepare next map
    else: # Time to close everything
        qgisApp.exitQgis()
        qgisApp.exit()
    count += 1
    return

prepareMap() # Let's start the fun
qgisApp.exec_()


texts:
I'm trying to install the pgrouting library but have hit a bit of a problem whilst installing. It's probably something I've done (I'm quite new to Linux so struggling to understand the error message). Has anyone seen this before or have any ideas of how to resolve it?

[root@localhost pgrouting]# git clone git://github.com/pgRouting/pgrouting.git pgrouting

[root@localhost pgrouting]# cd pgrouting

[root@localhost pgrouting]# sudo /root/cmake-2.8.3-Linux-i386/bin/cmake .

[root@localhost pgrouting]# make install

[ 16%] Building CXX object core/src/CMakeFiles/routing.dir/shooting_star_boost_wrapper.o /root/pgrouting/core/src/shooting_star_boost_wrapper.cpp:26:54: error: boost/property_map/vector_property_map.hpp: No such file or directory In file included from /root/pgrouting/core/src/shooting_star_search.hpp:22, from /root/pgrouting/core/src/shooting_star_boost_wrapper.cpp:27: /root/pgrouting/core/src/shooting_star_relax.hpp:18:47: error: boost/property_map/property_map.hpp: No such file or directory make[2]: [core/src/CMakeFiles/routing.dir/shooting_star_boost_wrapper.o] Error 1 make[1]:[core/src/CMakeFiles/routing.dir/all] Error 2 make: [all] Error 2

I followed the instructions given at http://www.pgrouting.org/docs/1.x/install_centos.html and I'm installing on CentOS 5.5.


texts: Apply css styles to layers in openlayers3

texts:
define layers and styles using openlayers3 API.
I need to apply css styles for layers.for that code is in below used

//applying styles for wms layer
var fill = new ol.style.Fill({color: 'rgba(237, 26, 170, 0.82)'});
var stroke = new ol.style.Stroke({color: '#4A12ED',width: 1.25});
var text = new ol.style.Text({color: '#F21A6C'});

var styles = [new ol.style.Style({
                image: new ol.style.Circle({
                    fill: fill,
                    stroke: stroke,
                    radius: 5
                }),
                fill: fill,
                stroke: stroke,
            })];

var wms = new ol.layer.Tile({
    source: new ol.source.TileWMS({title: "Population Density",url: 'http://sedac.ciesin.columbia.edu/geoserver/wms',params: {LAYERS: 'gpw-v3:gpw-v3-population-density_2000'}}),
    style: styles
});

/*****************************************************************************/
//applying styles for unescap layer

var unescap = new ol.layer.Tile({
    source: new ol.source.TileWMS({url: 'http://203.159.29.11:8200/geoserver/unescap/wms?',params: {LAYERS: 'unescap:rg_di_any_all'}}),
    style: new ol.style.Style({
        stroke: new ol.style.Stroke({color: '#319FD3',width: 1}),
        fill: new ol.style.Fill({color: 'rgba(17, 224, 36, 0.66)'}),
        text: new ol.style.Text({
            font: '12px Calibri,sans-serif',
            fill: new ol.style.Fill({color: '#ff0'}),
            stroke: new ol.style.Stroke({ color: '#09C',width: 3})
        })
    })
});

but styles are not applied
error messages are not available in console
I want to know what is wrong with this code and how to apply styles properly.


texts: Arcpy Pythonaddins Equivalent of arcpy.GetParameterAsText

texts:
I've build a neat little search arcpy script. The user opens any mxd, zooms to a location, chooses a corporate fGDB, and runs the tool. The user gets a list of all the populated feature class that intersects the current extent. Later I aim to write a process that the user can choose which layers they want to add. However I digress. I'm looking at embedding the arcpy into an addin, my first issue is learning what the equivalent of a arcpy.GetParameterAsText is, as I want the user to specify the work-space they need to interrogate.

import arcpy
import pythonaddins
class ButtonClass1(object):
"""Implementation for AddIn_Test4_addin.button (Button)"""
def __init__(self):
    self.enabled = True
    self.checked = False
def onClick(self):
    ################## MAP DOCUMENT DATA FRAME EXTENT

    StagingGDB = arcpy.GetParameterAsText(0)
    #StagingGDB = "C:\\Data\\Projects\\SearchTool\\CorpData1.gdb"
    arcpy.env.workspace = StagingGDB
    ExtentFC = StagingGDB +"\\ExtentFC"

    ############ Clean Up & Pre Check
    if arcpy.Exists(ExtentFC):
        arcpy.Delete_management(ExtentFC)

    ################## MAP DOCUMENT DATA FRAME EXTENT
    mxd = arcpy.mapping.MapDocument("current")
    df = arcpy.mapping.ListDataFrames(mxd)[0]
    currentExtent = df.extent

    ################## EXTENT FC
    pnt1 = arcpy.Point(currentExtent.XMin , currentExtent.YMin)
    pnt2 = arcpy.Point(currentExtent.XMax , currentExtent.YMin)
    pnt3 = arcpy.Point(currentExtent.XMax , currentExtent.YMax)
    pnt4 = arcpy.Point(currentExtent.XMin , currentExtent.YMax)
    array = arcpy.Array()
    array.add(pnt1)
    array.add(pnt2)
    array.add(pnt3)
    array.add(pnt4)
    array.add(pnt1)
    DisplayExtent = arcpy.Polygon(array)
    arcpy.FeatureClassToFeatureClass_conversion(DisplayExtent , StagingGDB ,"ExtentFC", "", "", "")
    pass

Any ideas?


texts: arcpy.mapping use a template (mxd) to apply layout view?

texts: Is there a class or a function in arcpy.mapping that can import an empty mxd, that contains only the layout elements, and applying it?


texts:
I need to generate gdal overview for tif image having parameter value 2 4.but when I run following error shows-
 Error 4:'example.tif.ovr' not recognized as a supported file format. overviews building failed.
please suggest guys with example are also welcome.


texts: Generate a stars object from tabular spatial temporal data?

texts:
I have tabular data with columns longitude, latitude, time, and intensity, like so:

library(lubridate)

## mock example data
ex <- tibble(longitude = 1:10,
             latitude = 10:1,
             date = today() : (today() + 9),
             intensity = rnorm(10))

In reality, it is a collection of ~ 230 compressed tab-separated text files,  10 MB each, in the above format.

I am trying to go from this tabular representation (e.g. reading this data with readr::read_tsv()) to a stars object (eventually/ideally a stars_proxy object, given the data size).

One thing I've considered is converting to an st object first:

star1 <- ex %>%
  st_as_sf(coords = c("longitude", "latitude"),
         crs = 4326) %>%
  st_as_stars()

but this creates a stars object with only one dimension, which is a geometry.  Since I have a point geometry, I'd rather have this as x and y dimensions in the 4326 (WGS84) CRS, and I'd like time to be a dimension.  I can coerce the dimension (I think), with:

star2 <- st_set_dimensions(star1, 1, star1$date, "date")

though I still see only 1 listed dimension:

star2
stars object with 1 dimensions and 2 attributes
attribute(s):
     date          intensity
 Min.   :18332   Min.   :-1.3239
 1st Qu.:18334   1st Qu.:-0.9127
 Median :18336   Median :-0.1671
 Mean   :18336   Mean   :-0.1405
 3rd Qu.:18339   3rd Qu.: 0.4975
 Max.   :18341   Max.   : 1.0076
dimension(s):
         from to offset delta refsys point values
geometry    1 10  18332     1     NA  date   NULL

So, given data in this tabular format, how do I generate a proper a stars object (ideally stars_proxy object), with proper x,y, and time dimension attributes?


texts: Can't continue scrolling on mobile devices when a map occupy all the screen

texts:
We have an issue on mobile which is the user can't keep scrolling if the there is a map on the page and it occupies the whole screen.

Here is the code:

// center of the map
var center = [-33.8650, 151.2094];

// Create the map
var map = L.map('map').setView(center, 3);

// Set up the OSM layer
L.tileLayer(
 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
  maxZoom: 18
}).addTo(map);
// add a marker in the given location
L.marker(center).addTo(map);
map.dragging.disable();
map.tap.enable();

And here is a jsfiddle demo of the problem:
https://jsfiddle.net/x5p2nLrs/23/embedded/result/#Result

Can you please let me know If I'm missing something?


texts: GeoExt2 How I make subnodes in Layer Tree

texts:
I'm loading WMS layers to OpenLayers map in the following way :

Here is a JSFiddle example :
http://jsfiddle.net/Alophind/9r95T/

 function LoadLayers(data) {
    jQuery.each(data, function (i, val) {
        if (val.layer != "") {
            var layer = new OpenLayers.Layer.WMS(val.name, geoserver,
                    {
                        LAYERS: val.layer,
                        STYLES: '',
                        format: format,
                        tiled: true,
                        transparent: true,
                        tilesOrigin: map.maxExtent.left + ',' + map.maxExtent.bottom
                    },
                    {
                        buffer: 0,
                        visibility: false,
                        displayOutsideMaxExtent: false,
                        isBaseLayer: false,
                        yx: { 'EPSG:4326': true }
                    }
                );
            arrLayers.push(layer);
        }
    });
}

and I instantiate a GeoExt tree like this :

mapPanel = Ext.create('GeoExt.panel.Map', {
        border: true,
        region: "center",
        map: map,
        layers: arrLayers
    });

    var store = Ext.create('Ext.data.TreeStore', {
        model: "GeoExt.data.LayerTreeModel",
        root: {
            expanded: true,
            children: [
                {
                    plugins: ['gx_overlaylayercontainer'],
                    expanded: true
                }
            ]
        }
    });

    tree = Ext.create('GeoExt.tree.Panel', {
        border: true,
        region: "west",
        title: "Layers",
        width: 200,
        split: true,
        store: store,
        collapsible: true,
        collapseMode: "mini",
        autoScroll: true,
        //store: store,
        rootVisible: false,
        lines: false
    });

I want to be able to put the layers in the tree as subnodes . for example :

Root
|
|-Buildings
|     |---Layer 1
|
|-Cars
|     |--- Layer 3

How can I do it ?

I've managed to add the following code manullay :

tree.getRootNode().appendChild({
            text: "Root,
            group: true,
            children: [
                    {
                        text: "Buildings",
                        layer: "MyTest:BuildingsSHP",
                        leaf: true,
                        checked: false,
                        children: [],
                        nodeType: "gx_layer"
                    },
                    {
                        "text": "Cars",
                        "layer": "MyTest:CarsSHP",
                        "leaf": true,
                        "checked": false,
                        "children": [],
                        "nodeType": "gx_layer"
                    }
                ],
            expanded: true
        });

And I do get new nodes in the tree...
But when I click the check box , nothing happens (they don't show in map and not added to the legend panel)

What else am I missing ?


texts: Extruding Height in ModelBuilder of ArcGIS Pro?

texts:
I am trying to create a ModelBuilder in ArcGIS Pro to convert KML files to Multipatch. The steps:

KML to Layer tool
I select the layer and in the Appearance contextual tabs, I will extrude the height
Layer 3D to Feature Class tool

I have the conversion tools which i can add into the model, but I cannot find a tool to extrude the layer height, thus I cannot create a model to automate the process.
Is there a way where I can extrude the height using tool in ModelBuilder, so the when I convert to Multipatch, it will contain the height as well?


texts: Clipping from given point using ModelBuilder?

texts:
I am working with ModelBuilder and I am trying to clip an area around a certain point.

Is there a tool that I can use in which I can assign it a certain distance from the point.

For instance, if I have a point X and I want to clip an area that is 12.5 miles each direction from the point and then have it as a layer.


texts: How to project coordinates in spatialite using PHP?

texts:
I'm using a spatialite database in a PHP program and I need to simulate an "identify" on a polygon layer (EPSG 32632), using point whose coordinates are dinamically generated.

I know that this query works fine ...

select NAME from poly32632 where within(GeomFromText('POINT(837121 5087604)'),poly32632.Geometry);

My problem is that my points coordinates are originally in EPSG 4326 system coordinates so, I've to project them in EPSG 32632 before to use them in my select.

I don't use Javascript in my program, so I can't use something like PROJ4JS to do it: is it possible to convert my coordinates couple directly in EPSG 32632 in my Spatialite query construction? Alternative queries in Spatialite to obtain the same result?


texts:
How do I add the HS2 Snake Grid Projection to QGIS?
I have the projection file HS2TN15_NTv2.GSB and I have added to the shared projections folder C:\Program Files\QGIS 3.10\share\proj.
I also know that the HS2 survey grid is on the ESPG:9300  .
I know from the manual section 10.5.1 that I also need to add a custom projection, and include the parameters, part of which is the file name. But, being right at the limit of my knowledge I have no clue as to what this might comprise.


texts:
So I have been tasked to create a visual map of case volume shipped to each region from each of our warehouses. I think the most effective way to visualize this data is to create an intensity (bubble) map based on total shipped volume to each city. I know in my head of what I want to see but not sure what program is best to visualize this data. I have access to Microsoft Map Point 2006. I was thinking maybe Google Fusion Tables could also translate this but I have never used that tool.

Ideally, I was thinking if i can have a radio button that represents inbound (like stock transfer orders) /outbound orders (customer orders), then a drop down for the warehouse selection, and have a map automatically generate the intensity/bubble map, would be great.

I currently have my raw data in excel, I can pivot the data with the warehouse as a filter, and sum of cases by city & state. Does anyone have any suggestions or recommendations of free software that can be used? Thank you!


texts: Can I use a Esri geocoding service with my custom basemap?

texts: I am looking at the JavaScript samples in here. I am searching some street by search bar. But not zooming to street, it only viewing city. I have a custom tiled map service layer in my server. Can I use this geocoding service and my custom basemap?


texts:
I am trying to write an script which will start the Geoserver service on system boot. A good manual is given here. I am on Ubuntu14.04 and using Geoserver-2.6.1.

I have edited the following lines accordingly, in this script.

USER=administrator
GEOSERVER_DATA_DIR=/home/$USER/geoserver-2.6.1/data_dir
GEOSERVER_HOME=/home/$USER/geoserver-2.6.1
JAVA_HOME=/usr/lib/jvm/java-6-sun
JAVA_OPTS="-Xms128m -Xmx512m"

When I am starting the service using the following command, it's giving an OK status.

administrator@abc:~# sudo service geoserver start
* Starting GeoServer daemon geoserver                                   [ OK ]

But can't open the manager webpage

http://localhost:8081/geoserver/web/

Plus, when I am trying to stop the service, the following Error is coming

administrator@abc:~# sudo service geoserver stop
* Stopping GeoServer daemon geoserver
No process in pidfile '/var/run/geoserver.pid' found running; none killed.
                                                                     [ OK ]

Where am I wrong?


texts:
I learned (thanks!) to use the join feature built into the layer properties, but in my case it doesn't work because data do not match perfectly. Infact shape refers to geotagged photos, csv is a log file which contains orientation data (azimuth); I would like to join them by date field (day, hours, seconds): I would need to join the "nearest" data, non spatially but temporally!

This is the case: I geotag photos made with my digital camera using Geosetter; I want to add orientation: how? sitis.mobi/geolog give me the idea: to record orientation of the smartphone put in the front pocket (by means a "sensor logger" application). Sensor loggers produce a csv with timestamp and data: you can set log frequency, but obviosly camera and logger timestamp are different. I need to join closest data by date: like "nearest point" in spatial data! It will be very useful to join smartphone sensor data to photos made with quality camera!


texts: How to stop gdalwarp creating world-spanning outputs near the dateline?

texts:
I'm using gdalwarp to manipulate SRTM tiles near the the dateline (i.e. 180°, aka the antimeridian). SRTM tiles have a very slight (1/2 pixel) overlap with the meridian. You can see this using gdalinfo:

gdalinfo S16W180.hgt
Driver: SRTMHGT/SRTMHGT File Format
Files: S16W180.hgt
Size is 1201, 1201
[...]
Lower Left  (-180.0004167, -16.0004167) (180d 0' 1.50"W, 16d 0' 1.50"S)
Upper Right (-178.9995833, -14.9995833) (178d59'58.50"W, 14d59'58.50"S)
[...]

So the source spans the dateline by a tiny amount.

This causes problems with gdalwarp, which ends up creating huge globe-spanning outputs.

gdalwarp -t_srs "epsg:900913" S16W180.hgt test.tif
gdalinfo test.tif
Driver: GTiff/GeoTIFF
Files: test.tif
Size is 1703, 5
[...]
Lower Left  (-20037508.330,-1806798.473) (180d 0' 0.00"W, 16d 7'13.00"S)
Upper Right (20032839.451,-1689152.120) (179d57'29.01"E, 15d 5'45.84"S)

Note the longitudes span (almost) the entire globe, and also the number of lines is unexpectedly small (5)

Is this a bug in gdalwarp? If not, what are the correct options to pass to gdalwarp to get a sensible output?


texts: Configuring lascatalog to clip and export using a shapefile

texts:
I used the following commands as mentioned in the answer here

ctg = readLAScatalog(...)
 p   = read.table(...)
 opt_output_file <- "/folder/AOI_{Id_placett}"
 aois = lasclipCircle(ctg, p$x, p$y, 10)

The opt_output_file <- "/folder/AOI_{Id_placett}" command only created a  variable named 'opt_output_file'. Apparently, this variable was not used in the following clipping command and the results was a lascatalog named 'aois' only. No files were written.

I then used the ABA approach. Here it seems to have been used differently, as follows:

ctg <- readLAScatalog(...)
plots <- st_read("...")
opt_output_files(ctg) <- paste0(tempdir(), "/{Id_placett}") #Id_placett is the column name
plots_ALS_clipped <- lasclip(ctg, plots, radius=15)

The lascatalog i.e. ctg is mentioned in the command opt_output_files(ctg). This seems to have worked and a temporary folder was created. But there are two issues that I encountered:

1) If I replace tempdir() with another path, I don't see any files in the location specified by me. There are some files (not all clipped plots) in the RtmpSQSLrf folder shown below. In the ABA example, it was mentioned that the clipped plots will be saved on the HDD

2) {/Id_placette} is used as a column name to retain the names of the clipping polygons. But all the clipped las entities in the lascatalog end with the column name i.e. "Id_placett". I thought they are supposed to end with corresponding clipping polygon names.

For example, plots_ALS_clipped@data$filename returns the following (showing only first few entries):

 [1] "\\AppData\\Local\\Temp\\RtmpSQSLrf\\Id_placett.las"
 [2] "\\AppData\\Local\\Temp\\RtmpSQSLrf\\Id_placett.las"
 [3] "\\AppData\\Local\\Temp\\RtmpSQSLrf\\Id_placett.las"
 [4] "\\AppData\\Local\\Temp\\RtmpSQSLrf\\Id_placett.las"
 [5] "\\AppData\\Local\\Temp\\RtmpSQSLrf\\Id_placett.las"

As you can see, all the clipped areas in the plots_ALS_clipped are named as 'Id_placett'


texts:
I have a folder called CSV, in it there are several CSV files with coordinates and attributes.

I want to convert all files in a CSV folder into shapefiles
New created shapefiles should have original CSV file name
All newly created shapefiles should be placed in another folder called SHP.
Once all shapefiles created, merge all shapefiles into one (could go over a GB)

For this, I tried to play around with ogr2ogr, had a bit of success but could’t go further.

For example, one web page shows to create (1) Create a dbf file (2) Create a vrt file (3) Create the shapefile by using ogr2ogr.

I can recreate what it says but I can’t workout how to point a folder i.e. CSV and convert all files in that into shapefiles.

Once I could accomplish above then, I would like a simple ogr2oge like command to merge all shapefiles into one shapefile.

Another point: Is there any way to use just text.bat file for above processes instead of OSGeo4W shell?


texts:
I tried to use pexif to update my photo EXIF with following the work on StackExchange (How to save geodatabase attachments to disk with updated exif data). However, I got the below error message when I used pexif.JpegFile.fromFile for it.

How do I resolve it?

> img = pexif.JpegFile.fromFile('IOP_002.jpg')

Traceback (most recent call last):
  File "<pyshell#6>", line 1, in <module>
    img = pexif.JpegFile.fromFile('IOP_002.jpg')
  File "C:\Ernie_Liu\EXIF_extraction\pexif-0.13\pexif.py", line 944, in fromFile
    return JpegFile(open(filename, "rb"), filename=filename, mode=mode)
  File "C:\Ernie_Liu\EXIF_extraction\pexif-0.13\pexif.py", line 1003, in __init__
    attempt = segment_class(mark, input, data, self.mode)
  File "C:\Ernie_Liu\EXIF_extraction\pexif-0.13\pexif.py", line 801, in __init__
    DefaultSegment.__init__(self, marker, fd, data, mode)
  File "C:\Ernie_Liu\EXIF_extraction\pexif-0.13\pexif.py", line 143, in __init__
    self.parse_data(data)
  File "C:\Ernie_Liu\EXIF_extraction\pexif-0.13\pexif.py", line 845, in parse_data
    ifd = IfdTIFF(self.e, offset, self, self.mode, tiff_data)
  File "C:\Ernie_Liu\EXIF_extraction\pexif-0.13\pexif.py", line 421, in __init__
    self.special_handler(tag, actual_data)
  File "C:\Ernie_Liu\EXIF_extraction\pexif-0.13\pexif.py", line 749, in special_handler
    if self.tags[tag][1] == "Make":
KeyError: 50341


texts: Convert cursor output to list of geometries


texts:
I have over sampled polygons that I need to simplify, without changing the shape. basically, I want to reduce the number of vertices, by eliminating the ones that are useless and have the polygons represented with the significant vertices only. I used to do that with ET GeoWizards Plug-in, but I don't have a license anymore.
My table has 500.000 features, water polygons.

Any ideas?


texts: QGIS Vector Data with blank attribute tables

texts:
I have vector data shapefiles for Manitoba, but there is no names in the attribute tables. It seems Manitoba is still working on their attribute data. Is there a shapefile I can download to get these labels? How can I get labels for all these features? Please Help.

Edit: Just the basic topographic features like the names associated with lakes, rivers, towns, etc. I know how to turn on labels from existing data, but i'm unsure how to label features that do not have the names in the attribute tables