texts: QGIS "Categorized" Expression dialog , result show no "label/value" only "1"

texts:
In ArcMap when I use Categorized I can choose what values I want to display using the "Add Values" button. In layer panel the values I chosen will show up there with the correct name.

I tried the same in Qgis, but the values doesnt show, I only get a number 1 and 0 but not the actual name in the column of the attribute-table.

Here is how I do:
I got a layer with streets as polylines, each street has a streetname assigned to them in the attribute-table under the column "STREETNAME".

I go to "Properties->Style->Categorized".

Then I click the "Expression" button. In the "Expression Dialog" I create the following "expression".

"STREETNAME = 'ADAGE WY'

Here comes the problem, after I clicked "OK" and then "Classify" to classify based on the expression I dont get any values in the value  column.

Is it supposed to work that way or am I doing something wrong? I was hoping that the streetname "ADAGE WY" would show as a "Value".


texts: Can you create a square OD Cost Matrix with Network Analyst?

texts:
I have a feature dataset and want to find the cost of travel between each pair of features. Because I'm looking for road (not Euclidean) distances, I was told that the OD Cost Matrix solver in Network Analyst is the way to find the costs in ArcGIS. However, if my dataset has n features, the solver produces an n**2 x 1 matrix, whereas I need an n x n matrix, where each row and column represents a feature and each row-column intersection holds the travel cost between the two features.

Can Network Analyst format its output in this way? If not, what is the easiest way of obtaining such a square matrix?


texts: How are kappa and overall accuracy related with respect to thematic raster data?

texts:
I recently calculated kappa (using confusionMatrix{caret} in R) between a thematic raster dataset at 1m spatial resolution and another at 30m spatial resolution.  I was interested in quantifying the level of agreement between the two thematic raster datasets.  Random points were taken at the same location for each thematic raster and tabulated.  Thematic classes range from 1 - 6, which actually relates to the level of canopy cover (1 (low) - 6 (high)).  The following is the resulting error matrix:

     30m
1m    1    2    3    4    5    6
1    9906  21   0    0    1    3
2     13   36   0    0    0    0
3     0    0    0    0    0    0
4     0    0    0    0    0    0
5     0    0    0    0    0    0
6     0    0    0    0    0    0

Strangely, the overall accuracy and kappa seem to be at odds with each other:

Accuracy = 0.9962
Kappa    = 0.6649

What might be causing this discrepancy between Kappa and overall accuracy?  My best guess is that the confusion matrix is stacked toward the lower canopy cover ranges (1 and 2) while there are a few far-off errors at the higher canopy cover classes (3 - 6).


texts: Calculate elevation change in point feature class

texts:
I have a point feature class with 130 rows that represent the vertices of a trail I generated. I calculated the z height for each verticy/row. Now what I want to do is calculate the elevation change from one row to the next.

so I want to add a new field called, Z change with the number being how many feet from the below row to the above one.


texts: Map with just City/Country/River/etc names.

texts:
I am looking for a plug in or a map, that only has the names of the countries and cities and other urban and/or geographical features. Does anyone have or know of such a map/plugin.
I'v e been searching, but to no avail.

I'm using QGIS. (Wien 2.8.2)


texts:
I've imported into QGIS two vector detasets and set the correct reference system. First is a shapefile, second is a csv file. The problem is that they are in different places, but they should be one over the other (see image).

How can I solve this?

.stack.imgur.com/7dwzJ.png


texts: Plotting species distribution on map in R

texts:
I'd like to plot the distribution of a species on a map of Switzerland, following this tutorial.

library(maps)
library(mapdata)

map('worldHires', 'Switzerland', xlim=c(5, 12), ylim=c(45,48))

From this website I download the shapefile for e.g. Pinus sylvestris

psylvestris <- readShapePoly("Pinus sylvestris.shp")

I want to add the range to the map:

plot(psylvestris, add=TRUE, xlim=c(5, 12), ylim=c(45,48))

But I do not see anything (other than the map).. It appears to me the coordinates might be given in a different system (?)

> psylvestris
class       : SpatialPolygonsDataFrame
features    : 52
extent      : -1202142, 4710481, -925131.2, 6334053  (xmin, xmax, ymin, ymax)
coord. ref. : NA
variables   : 1
names       : Id
min values  :  0
max values  :  0

Unfortunately I do not know anything about spatial analysis and thus I have no idea how to fix this. Can you help me please?


texts: ArcGIS JS API 3.21 InfoTemplate ZoomIn Button

texts:
Has anyone had luck attaching a click event to a custom button built in the HTML of the InfoTemplate? Here's my InfoTemplate HTML:

uploadInfoTemplate = new InfoTemplate ({
    title: "",
    content: "Segment: ${segment}" +
             "
" +
             "Time: ${dateTime}" +
             "
" +
                 "<input class='zoomButton' type='button' value='Zoom to' />" +
             "
"
});

I then have hidden items on the default InfoTemplate, i.e. the zoomTo link. I want to simply replace the zoomTo's functionality with a button, to make it look a little nicer.


texts: Generate random points for IDs with similar coordinates with ArcMap

texts:
I have a dataset which consists of IDs with addresses and coordinates (long/lat). Some of the IDs have similar coordinates. How do I generate random points for the IDs that have those similar coordinates? For example, I have 60 IDs with same long/lat and they are located within the same province. How do I use the Generate Random Points tool in ArcMap to generate 60 random points within the same province and then later create a new column to store those new coordinates?

Right now I have over 10k points in the dataset. I can map them but it looks misleading as some IDs are assigned similar coordinates for simplicity purposes - and they are all stacked on top of each other in the map.

I have the province layer, and all points are retrieved from a .csv


texts:
I need to do the following in Python

open OSM & GPX files (I have packages for this)
transform points from GPX (like stick a track to roads)
calculate the results (distances, cumulative distances, etc.)

I need to do this repeatedly, so a Python script is much more preferred. Desktop software with plugins is not suitable. I'll prefer some Python & C modules than a quest of installing plugins. PostGIS may be an option too.

Shapely (Python package) seems to not be able to do this (it works only in 2D on a plane, and mentions it has no projections). I don't need 3D, but I have the input as lat&lon coordinates, and need to do geometric transformations (project a point on a polyline) and calculate distances in metres.

What modules should I use?


texts: Coloring polygons with random color in QGIS

texts:
I have a map with a large number of polygons that I want to colour individually for display purposes. There is not particular pattern required, only to present them as individual catchments in a figure.
Is there a method to achieve this in QGIS?


texts: Python uses arcpy.FeatureSet() with map service, but won't publish as a geoprocessing service?

texts:
I have a Python script that consumes a map service (with geometry) and puts it in a FeatureSet. (Ref. the code from this question or this question.)

for layer in layer_list:
    # generate gkey_query based on variable `layer`
    queryURL = baseURL + gkey_query # generates a valid map service URL
    feature_set = arcpy.FeatureSet()
    feature_set.load(queryURL)
    # do stuff with feature_set

This works as expected when executed as part of a toolbox Python script. However, when the script is then published as a geoprocessing service, it fails as follows (emphasis mine):

  esriJobMessageTypeError: Traceback (most recent call last): File "\VIEW01V\arcgisserver\directories\arcgissystem\arcgisinput\CNS\DeviceQuery.GPServer\extracted\v101\devices_to_premise\procedural.py", line 215, in network_trace_group = trace_network(start_gkey, stop_gkey_list) File "\VIEW01V\arcgisserver\directories\arcgissystem\arcgisinput\CNS\DeviceQuery.GPServer\extracted\v101\devices_to_premise\procedural.py", line 158, in trace_network feature_set.load(queryURL) File "c:\program files\arcgis\server\arcpy\arcpy\arcobjects\arcobjects.py", line 175, in load return convertArcObjectToPythonObject(self._arc_object.Load(*gp_fixargs(args))) RuntimeError: RecordSetObject: Cannot open table for Load

It appears that the published service isn't able to access map services. Is this possible and I just need to modify the URL in some way, or is this something that geoprocessing services aren't able to do?

(We are still on Desktop 10.2.1; not sure what the Server version is, but I can ask if necessary.)


texts: Is it possible to change spatial reference (and reproject) feature classes in-place, using ArcMap/GeoProcessing?

texts:
We have an Esri based system in production; a complicated data model with a large number of feature classes. We need to migrate the data to another spatial reference.

The feature classes have class extensions and relationship classes defined on them, so the behaviour of creating new feature classes for the reprojection result that the standard projection geoprocessing tool exhibits is very cumbersome (class extensions and relationships are lost).

If necessary, we'll code up a solution but would prefer not to. Is it somehow possible, using standard or 3rd party extensions, to do a bulk, in-place reprojection and setting of new spatial reference?


texts:
Hoping someone can see a faster way of doing this, because at the moment I'm averaging 9 hours per run for what I'm trying to do and well basically getting my behind chewed off by the boss :-)

The Scenario

We have a database running under PostgreSQL/postgis that's used to manage some mapping data for management of a transport fleet.

Within this database there are several tables but for my question here, we are interested only in "built up areas" (aka limitedzones) and "Movement Speeds" (aka speeds) - I can't go too much into detail because of NDA's etc, but "limitedzones" is a table that contains a number of

MULTIPOLYGONS

each representing a geographic area, and has an associated speed limit that a vehicle is allowed to travel whilst inside the bounds of that polygon.

"speeds" is a table of

POINTS

each point following the path of an allowed road and sampled with an allowed speed limit at 1 second intervals, representing a road that a vehicle is allowed to travel on.

At present some of these "allowed roads" cross through "Limited areas" where both the "allowed road" and "Limited Area" speed limit are the same. I've been tasked with removing these extra points from the "Allowed Roads" table where they match the conditions set out above.

What I've tried so far

My first attempt was to simply select the points, so lets say for 40 Mph and put them into a memory table, then loop over that table comparing them to the 'limitedareas' table using "ST_Intersects" this didn't work as expected, and failed to remove all the points.

It did however give me an idea of how many points I was looking at removing, and the count was easily in excess of 2 million.

After a bit more fiddling around, and a few more attempts I finally arrived at the following:

DELETE FROM speeds s
USING limitedzones lz
WHERE ST_Within(s.geometry,lz.geometry)
AND s.speed = lz.speed

and in a similar fashion used the following to interrogate & count:

SELECT s.* FROM speeds s
JOIN limitedzones lz ON ST_Within(s.geometry,lz.geometry)
WHERE s.speed = lz.speed
--LIMIT 10

Both of these work exactly the way I expect, but the select (When not limited) takes about 3 hours to run, and the delete over 9 hours!!

If at all possible I need to find a faster way of stripping these points out, as there is likely to be further work to add this into a regular update system, used ad-hoc on a frequent basis to keep the database in order.

I have good indexes both B-Tree (gist) and regular on all the columns, and when individual tables are used on there own, everything is nice and fast, so I know it's the join on 2 tables that's causing me the slowdown.

Any suggestions are welcome, and I'm even open to do this using a custom function / procedure if need be.


texts: ArcGIS API for JavaScript: Graphic does not display in IE10

texts:
I have recently created an application using the ArcGIS API for JavaScript. The application contains a geocoding functionality in which a point graphic is supposed to display showing the matching address. This is what the working result looks like in Google Chrome:

However, when the application is being used in IE 10, the point graphic does not show up upon successful completion of the geocoding operation (a match score of greater than 80). Here is what it looks like after geocoding in IE 10:

I have used the 'SimpleMarkerSymbol' to create the marker symbol for the 'Graphic' that is returned from the geocoding operation. Is this some sort of known issue that occurs when using ArcGIS API for Javascript graphics in IE?


texts: How do I interpret the results from the distance matrix?

texts:
In this dataset I have created the green dots represent coyote sightings while the yellow dots represent rabbit sightings. I am trying to determine if coyotes and rabbits are randomly distributed or if there is a relationship between coyote habitat and the proximity of rabbit habitat.
I created a distance matrix between the two sets of data points, but I'm unclear on how to interpret the results. Is there a coefficient that can be used to judge whether or not the distribution appears to be random?


texts: Calculating EVI in ArcMap for Landsat 8 Image gives values ranging from 55155 to -23235

texts:
How do I calculate EVI in ArcMap for Landsat 8 Image?

My values are ranging from 55155 to -23235.

I have tried using the formula:

2.5 * [(band 5- band 4)/ (band 5 + 6*band 4-7.5* band 2) + 1]

I have tried to use various parentheses in and around the formula. It simply isn't working for the range of values from -1 to +1.


texts: .tif image exported from QGIS will not load in ARCGIS

texts:
I have saved a layer in QGIS as a .tif image, and when I try to add this to an ARCGIS MXD I am using for a project it does not appear.

When I add it to a blank MXD the image loads, however, if I try to zoom in then the image fills the entire screeen and the map scale jumps to 1:500,000,000.

If the MXD already has other images in then the .tif image just does not appear.


texts: Referencing ArcMap in class library using ArcObjects?

texts:
I have created multiple ESRI addins, where the same code is used. I have created a class library, which I can reference rather than duplicating code. I have the following in my ESRI addin code which works fine

IMxDocument mxdoc = ArcMap.Application.Document as IMxDocument;

However if the same code is used in the class library, I am unable to build the dll. As the  class library does not know about ArcMap,

I have tried

ESRI.ArcGIS.ArcMap.Application arcmapApp = new ESRI.ArcGIS.ArcMap.Application();
IMxDocument mxdoc = arcmapApp.Document as IMxDocument;

However when I run the code in my addin (that references my Class Library), i get the following error

What is the correct way of referencing ArcMap in a class library?


texts: please could someone help me and bless me with an example of how to get coordinates from a polygon in OpenLayers?


texts: How to output ActiveView to JPEG image using ArcObjects?

texts:
I have an ArcGIS Desktop extension and I need to extract images from the map.

How can I programmatically output the active view to a jpeg image?


texts: How to get an equivalent to stand-alone installation of QGIS using OSGEO4W?

texts:
What should be downloaded / set (beyond the obvious) when installing QGIS using the OSGEO4W package manager - in order to end up with an equivalent setup to that which would result from using the QGIS standalone installer?

Documentation and advice make the basics clear in terms of installing one or more versions of QGIS but aren't so clear on what else is required should a full equivalent install be desired.

The requirements are different when using 'Express Install' and 'Advanced' options in the installer. The notes below relate to the use of the 'advanced' option.

At least the following three things seem to be required:

Select 'qt4-devel' in the OSGEO4W installer so that you have access to QT Designer [EDIT: I think I'm wrong on this one... qt4-devel ought to be downloaded automatically as part of a QGIS installation]
Set the GDAL environment variable
Select 'grass: GRASS GIS - stable release' in the OSGEO4W installer.
Select 'saga-ltr: SAGA (System for Automated ...' in the OSGEO4W installer.

What else is necessary? Are these correct?

This question was prompted because 've been sent a processing script which works fine on QGIS on machines where this has been installed using the standalone installer. When I try to run it on my machine (given that I installed QGIS using the OSGEO4W installer) it gives an error. It can't find the python module "PYQT4.QtCore" and I suspect that this is because I didn't fully know what I was doing when installing QGIS using the installer. I don't know how to fix this. I don't understand what further settings (etc) are required. You might think that someone with my level of knowledge should stick to installing QGIS with the stand alone installer, but I'm working in an organisation where we're trying to manage about 40 QGIS installations, sticking to the LTR version of QGIS for all users and the move from the stand alone installer seems important.


texts: Can ArcGIS make a join with selected attributes being added into the outcome?

texts:
My question is when making a spatial join, is it possible to only assign selected attributes of source layer to the target layer instead of getting all attributes from source layer? I'm asking is because each time when I do a join, I need to clean up the table to remove useless attributes.

Thanks!


texts: Export shapefile with column name of csv file or change column names afterwards

texts:
I am joining a .csv file with a shapefile in QGIS 2.18.12 and I need the column names for further processing (but they are way longer than 10 digits). However, when I save the new file, the column names are changed by GQIS. I found a manual way here. But my .csv file has 253 columns, therefore a manual processing afterwards is not reasonable.

Is there any way to export my file with the column names of the csv file, or change the column names of the shapefile afterwards in an automated way?


texts: How to create proportional symbol map in Leaflet using default icons?

texts:
I'm guessing this is possible but I cannot figure out how to do it. (Also, I am wondering if it would just be easier to do it with a custom icon or an SVG).

My current code looks like this:

function createSymbols(data, map){
var points = data.features

for (var i = 0, l = points.length; i < l; i++){

var obj = data.features[i];
var lon = obj.geometry.coordinates[1];
var lat = obj.geometry.coordinates[0];
var degrees = obj.properties.degrees;
var value = obj.properties.value;

L.Icon.Default.prototype.options = {
iconSize: [(6*value),(10*value)]
};

L.marker([lat,lon], {
  rotationAngle: degrees,

}).addTo(map);
};

The data is a JSON with 4 points at 4 different coordinate locations, for a total of 16 different markers. I want to size each marker based on the variable "value". The rotationAngle part rotates the marker based on a property in the JSON to make a "petal plot" visualization at each location (4 "petals on a single point, each representing a different point in the JSON with different values and IDs).

I know I can make a new custom icon with my own image and what not, but I still don't know how to size each one based on a value in the JSON. I also know how to resize SVGs based on values (like circleMarkers) but I thought I'd give this a try and see if it's possible.


texts: Quick way to add point features on a map

texts:
I am looking for a quicker way to add points. I am mapping the buildings on a satellite imagery, but every time I add a point, I need to press enter to close the action menu.

Is there a way to add points without going through the action menu?


texts: Run CAR model (CARBayes package) with zip (a zero-inflated Poisson) family in R

texts:
I am trying to run the function "S.CARBym" using a zero-inflated Poisson (zip) family because my data y (cases of a disease) has too many zeros. I couldn't run it because the function asks to specify the formula.omega and I don't know which parameters/values I should use in this argument.

library(CARBayes)
library(rgdal)
library(spdep)

spat.data = readOGR(dsn = ".", layer = "VAR_AMB")

W=poly2nb(spat.data)
W2 <- nb2mat(W, style="B")

eq1 = Cases~offset(log(Population))+temp+precip

modelbym1 <- S.CARbym(eq1, formula.omega=NULL, family="zip", data=spat.data, W=W2, burnin=100000, n.sample=300000, thin=20)

Error: a zip model was specified but the formula.omega argument was not specified


texts: Calculating relative height of point on slope relative to nearest creek and ridge using ArcMap

texts:
I'm attempting to calculate the relative height (values between 0 and 1 preferably) of waypoints on a slope along the path of least resistance.  Ideally, points in creeks would have values of 0 and points on ridges would have values of 1 (or opposite values would also work).  I have about 200 waypoints that I need to do this for and will need to do it manually otherwise.  I'm using ArcMap version 10.1.

To clarify, I have waypoints in mountainous terrain and I need to know the change in elevation that water will likely flow from the top of the ridge.  I would also like to know the change in height from the same waypoint to the point where it will intersect the nearest creek.  I will manually calculate the ratio of the difference in height from the waypoint to the ridge vs. the overall change in height in order to get a ratio of the height of water flow to the overall height of the water path before intersecting a creek.  It would be nice if there was a tool that already did this.


texts:
I have a question about the shape of the raster to be cut out. If you specify a range in raster extraction and select crop, it will be cropped into a rectangular shape.
I want to cut out a parallelogram instead of a rectangle. Is this possible?
We know the coordinates of the four corners of the parallelogram.


texts: ArcMap custom extension registered but not added

texts:
I haven't found any info on this particular problem so let me try here.

My job is to migrate a 9.3 desktop extention to 10.3, keeping the app in the original COM-based format (not converting it to an add-in).

During debugging in Visual Studio 2010, I had to enable 'make assembly COM visible' for it to be registered to ArcGIS, otherwise it didn't show. After setting up the windows setup project en building in release with the right setting it succesfully finished the installation, included and installed  all the depencies in the correct directory and was visible in my installed programs list.

The thing is, it DID show up correctly on my machine (even after fully cleaning the solution and unistalling dev or previous builds), but NOT on any other machine with version 10.3.0/1.

What I have tried so far:

making sure the application installation folder was correctly set in the setup project and the installation was being done there.
made a new setup project with the same settings (there was an old version checked in to the repo)
correct .NET version (3.5) as installation prerequisite, same as all the projects/class libraries in the solution
enabled/disable the options 'register for COM interop' and 'make COM visible' for the main project
built all esri-related projects in x86 explicitly instead of anyCPU
checked if Register property on the main projects assembly was set to 'vsdrfCOM'

Now I found out that the dll does get registered but there is some kind of safety check that doesn't add it to ArcMap upon registration. If it is not in the 'ESRI mx extension category'  (C:\Program Files (x86)\ArcGIS\Desktop10.3\bin\Categories.exe) then it will never be visible in ArcMap!!

But it appears that you can add it manually by opening the category importer, as shown below

How do I avoid this step?
Does anyone have more info on this problem? I don't seem to find much on "arcgis category importer" or the message...

I'm on windows 10 btw, the other test machines are on 8 and 10


texts: Generalize raster data dependent on DEM?

texts:
I'm working on a generalization process of probabilistic calculated raster data (rockfall extend, data shows probability of being hit by a rock in %; I used binary data, 1 for "one hit or more", 0 for "no hit").

Output should be well legible without "single lines" and if possible very smooth edges (you can see the many single lines in the input picture). As it will be used for batch processing, a solution as automatic as possible is prefered.

To some extend I got satisfying output data using resamplings, neighborhood analysis, vectorization or even just deleting values < 1% (these might be regarded as statistical mistake). You can see this in the following picture.

But still, there are some logical mistakes, some edges are not well rounded or do not really fit to e.g. valleys.

Thus, I'd like to connect the binary data with the DEM. I added a picture with contour lines to make more reasonable, what I try to explain. I wish that the edges follow a more or less logical line especially on the "lower" left line of the biggest patch.

I use QGIS, SAGA, GRASS. I tried some other tools and plugins (e.g. GDAL sieve), which also didn't help me. Further I considered using GRASS GIS watershed tools, but I wasn't able to connect this to my binary patches and gain proper data.

Finally, I am looking for a "GUI-solution".


texts: Styling using mi-style column from mapinfo

texts:
I have uploaded some MapInfo tables into postgis including the mi-style column using EasyLoader; I have had to rename all columns including both mi-style and sp-geometry columns to lowercase, including the mapinfo_mapcatalog, otherwise Oracle (which also needs to see this data) couldn't load the tables.

I would like to style this data using the original MapInfo styles. I have found a github link (https://github.com/NathanW2/MapInfo-to-QGIS-style-generator/wiki/Using-MapInfo-to-QGIS-style-generator.) that allows me to create a qlr from the MapInfo table but is there a way to use the mi-style column in postgis to create the correct entry in public.layer-styles which allows me to keep the styles within the Postgis database which I can then reference?


texts:
I installed the ArcOjbects SDK (if I remember correctly) and in visual studio I have referenced the needed assemblies.  Namely ESRI.ArcGIS.Geoprocessor.

When in stepping through in debug mode I hit this routine:

void BindingArcGISRuntime(object sender, EventArgs e)
        {

            //ProductCode[] supportedRuntimes = new ProductCode[] { ProductCode.Desktop };
            //foreach (ProductCode c in supportedRuntimes)
            //{
            //    if (RuntimeManager.Bind(c))
            //        return;
            //}

            if (!RuntimeManager.Bind(ProductCode.Desktop))
            {
                // Failed to bind, announce and force exit
                Console.WriteLine("Invalid ArcGIS runtime binding. Application will shut down.");
                System.Environment.Exit(0);
            }
        }

But I don't hit the

"Console.WriteLine("Invalid ArcGIS runtime binding. Application will shut down.");"

piece

Then straight to this auto-generated routine:

if (RuntimeManager.ActiveRuntime == null)
            {
                EventHandler temp = ResolveBindingEvent;
                if (temp != null)
                {
                    temp(this, new EventArgs());
                }
            }

            return Initialize();

Any ideas?  Thanks.


texts:
Currently I am trying to run a "custom" composite address locator through script and I cannot seem to figure out the proper syntax.  I can run the geocoder through the Arc Geocoder Tool (Runs Manually) but I cannot seem to get it working in the script.

In the tool the address inputs are as follows:

Street or Intersection:
City or Placename:
State:
ZIP Code:
ZIP4

addrFld = "AddrAdded"
lkCity1Fld = "MapCity"
stateFld = "State"
geo_flds = "Street or Intersection {0};City or Placename {1};State {2};ZIP Code <None>;ZIP4 <None>".format(addrFld, lkCity1Fld, stateFld)
locator = r"SomeDrive\Composite_Parcels"
arcpy.GeocodeAddresses_geocoding(in_table, locator, geo_flds, out_fc)

Receiving Error: ERROR 000010: Geocode addresses failed. Failed to execute (GeocodeAddresses).

The input table runs through the tool
The the address locator exists
The output location is the same as it is in the tool
Running: Arc 10.4.1
License: Advanced


texts: Extract country border from OpenStreetMap

texts:
I'm trying to extract the Jordanian country border from an OpenStreetMap. When I click the download link for the file, the following page opens:

How do I save these XML tags as an XML- or OSM file which I can convert into a shapefile, so that I can use it in QGIS?


texts: Counting plants in aerial images from UAV

texts:
I want to extract the number of plants per row in a crop land. I have and RGB mosaic from UAV orthorectified aerial images.

I would like to be able to identify single plants in order to count each plant.


texts: How to upload polygon shapefiles to my GPS?

texts:
I used QGIS to create a table (*.shp) containing 3 polygons. These polygons represent "forbidden zones" that I would like to export to my Garmin GPSmap62st so once on the countryside, I'll can see my position directly besides these "forbidden zones".

Can you tell me how please?


texts: Buffering selected polygons within same feature class using ArcGIS Pro?

texts:
The limitation below applies only to ArcGIS Pro versions 1.0 - 1.2.

When editing in ArcMap a workflow I used to create a polygon feature with a donut polygon in the same feature class around it was to:

Digitize the polygon
Use the Buffer from the pulldown on the Editor menu to create a buffer polygon larger than the original
Select the original polygon and use the Clip from the pulldown on the Editor menu to discard any part of the buffer polygon that fell under it.

Is there an equivalent workflow available in ArcGIS Pro?

From what I have seen the Buffer and Clip Geoprocessing tools are still there under ANALYSIS but these work at the feature class rather than feature level.

@ChrisW pointed out that there is also a Clip under Modify Features that seems equivalent to (and better than) Editor | Clip but it is the Buffer on the Editor menu pulldown that seems to have gone missing.


texts: Field Calculator giving Error message in QGIS?

texts:
Field Calculator: using the x- or yat or (0 "or-1" ) expression, I keep receiving an error:

  An error occurred while evaluating the calculation string: Index is
  out of range.

I have shut down and restarted a few times, sometimes the error does not return.

Why is this happening and what can I do to fix it?


texts: How to make labels visible after using Clip to Current Data Driven Extent?

texts: I would like to use the Clip to current Data Driven Page extent feature, however, it covers up the labels that are already present, leaving visible features unlabelled. Does anyone know how to force ArcMap to draw the labels within the visible portion?


texts: Band combinations for identifying limestone quarries

texts: What are the most useful band combinations for identifying current and recently closed limestone quarries (Landsat 5 and Landsat 8)?  In particular, for a dry sparsely vegetated region like much of Oman in the Middle East.


texts: Points in Polygon with ArcGIS-REST-JS library

texts:
I am trying to get the points in polygon with Node JS libraries. Using Simple JS, I can get using QueryTask. But there is no queryTask in Node lib.

var queryFeat = require('@esri/arcgis-rest-feature-layer');
    var abc = queryFeat.queryFeatures({
        url: "http://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/1",
        where: `OBJECTID = 2`
    }).then((res)=>{
        res.features.forEach((feat) => {
            console.log("ASDFGHJK:::: "+feat.attributes.OBJECTID);
            var xyz = queryFeat.queryFeatures({
                url: "http://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/0",
                returnGeometry: true,
                outFields: ['*'],
                geometry: feat.geometry,
                spatialRel: 'esriSpatialRelContains'
            }).then((blockFeat)=>{
                console.log("Block::: "+blockFeat.features.length);
            });
       });

I am getting blockFeat.features.length equals to 1000 (maximum features in response set by administrator)

I don't know what is the issue. I'm new with Node libraries.


texts:
I'm trying to draw a pentagon with postgis (srid 4326). My toy example works, but it looks deformed.

Here's my code

select ST_Rotate
         (
         ST_Translate
             ( st_setsrid('Point(47.601177 -3.055975)'::geometry, 4326)
             , 2.0::float, 2.0::float
             )
         , (0.0 + (360.0 / 5) * n) * 3.1415926 / 180.0
         , st_setsrid('Point(47.601177 -3.055975)'::geometry, 4326)
         )
     from generate_series(1,5) as t(n)

My problem :
 In a normal pentagon, the circle (which have the same center of the pentagon) should reach all the points. I don't understand what's wrong


texts:
Not unlike others, I've found myself forced to edit some code due to MapQuest changing how they offer the openstreetmap data, and using an API Key.

Getting the key, aswell as getting up a simple leaflet map zoomed to where i wanted went easily.

Now I'm trying to add a layer of points of interest, based on a text file. I had/have the data in a file 'textfile.txt', and through OpenLayers I was able to display the markers using the following code snippet:

var pois = new OpenLayers.Layer.Text( "Archieflijst",
            { location:"./textfile.txt",
              projection: map.displayProjection
            });
map.addLayer(pois);

How would I make that work now?

For reference, i'll post current code-build, without my actual API-key:

    <title>Werkterrein</title>
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.5/leaflet.css" />

I have 'textfile.txt' and 'ol.js' in the same folder.

Contents + example line for textfile.txt:

lat lon title   description icon    iconSize    iconOffset
51.0049363376102    3.19743523027068    Elk logo vertegenwoordigt een gerealiseerd project      icoon.png   16,16   -8,-8


texts: Customizing ArcGIS Pro using addins vs python tools?

texts:
With the upcoming release of ArcGIS Pro and the eventual retirement of Desktop and ArcObjects does it make more sense to start new customizations in python or continue to use ArcObjects/addins for the time being?

I have a new project about to start that will involve a custom toolbar for desktop with about 10 custom editing tools. Previously I have always carried out such a project in .NET and ArcObjects. But now I wonder:

Is the functionality now there to do this in python (At ArcGIS 10.1)?
If I continue to use ArcObjects what is a resonable expectation on the toolbar life expectancy?

The current editing environment is ArcGIS desktop 10.1 and is likely to stay that way for the next 1 - 2 years.


texts:
How can I recreate the look of old topographic maps that used thin lines to show bodies of water? I looked in the fill options and the closest I could find is shape-burst fill, but it uses a color gradient instead of lines.

This image shows the effect I am trying to create:

Image source Wikipedia Commons

I think the name of this style is called "water-lining", and was used because lithographic plates could not print solid areas of color.

Is there a way to create this style in QGIS?


texts: Different projections in the same shapefile

texts: I was just wondering if it was possible to change the projection of only certain objects in a shapefile, while the others remain the same. I have to insert points onto a map, and some of them are in a projection called MTM 10, while others are in MTM 13. In order to get the points into the shapefile I'm using, I have to copy and paste them from an imported AutoCAD drawing. The points are supposed to be in the same shapefile, but everytime I change the projection, they all move. Is there a way to get around this and only change the projection of a few points?


texts: Save ML prediction to Google Cloud Storage as a GeoTIFF file

texts:
I have a FCNN model saved on the Google Cloud to predict land cover based on satellite imagery. Currently, I am exporting the imagery from the Google Earth Engine as a TFRecord, making a prediction based on the ML model and uploading the saved TFRecord results as a Google Earth Engine asset (see example code below).
json_text = !gsutil cat {json_file}
mixer = json.loads(json_text.nlstr)

p = model.predict(predict_dataset)
writer = tf.io.TFRecordWriter(OUTPUT_IMAGE_FILE)

for prediction in p:
  classes = tf.argmax(prediction,-1)
  classes = tf.keras.backend.flatten(classes)

  example = tf.train.Example(
      features=tf.train.Features(
        feature={
          'label': tf.train.Feature(
              float_list=tf.train.FloatList(
                  value=classes))}))

  writer.write(example.SerializeToString())
writer.close()

!earthengine upload image --asset_id={OUTPUT_ASSET_ID} --pyramiding_policy=mode {OUTPUT_IMAGE_FILE} {json_file}

Rather than save the prediction to a TFRecord using tf.io.TFRecordWriter, how do I save the prediction as a georeferenced GeoTIFF file on the Google Cloud Storage?


texts:
I need to make a world map with a grid that have a angle like in this map

I look into it and find that I can add a grid in the print composer
I have succeeded to change the grid distance in the settings

I have not succeeded to make the required angle, and I tried to use the Robinson projection

I also tried to upload Graticules file from OSM, but the grid is still without a angle in "WGS 84 / Pseudo Mercator" and in "World_Robinson" as wall

Can anyone help me with this topic?


texts: Concatenating labels with some NULL values in QGIS?

texts:
I am trying to concatenate two fields into one label, where the second field sometimes has a NULL value.

The first field is a numerical street address (ADR_NO) the second field is a text string (ADR_NO_SFX).

I want to combine them like this:  13, 13A, 14, 15, 15A, etc

I tried the solution here Displaying multiple fields as labels if one field is null in QGIS? but the expression dialogue throws an error.

I also tried this, but I get empty labels whenever "ADR_NO_SFX" is NULL.

CASE WHEN  "ADR_NO_SFX" = NULL
  THEN "ADR_NO"
  ELSE "ADR_NO" || '-' || "ADR_NO_SFX"
END


texts: Why is QGIS not recognising latitude and longitude correctly?

texts:
I am importing a simple 5 column csv file into QGIS using Add Delimited Text Layer.
Each row of the table contains a name, a street address, a postcode, a decimal latitude and a decimal longitude, for example:

Harewood Road,"8a Harewood Road, Brentwood, Essex",CM15 9PD,51.635252,0.292283

In the add layer window (Data Source Manager), I get the file format and encoding recognised; under Geometry Definition, Point co-ordinates is automatically selected with X field linked to my longitude column and Y field as my latitude column.

DMS coordinates is not ticked.

Under Sample Data at the bottom, all looks as you would expect.

Once the layer is added, dots are displayed in QGIS on the map in a scatter as I would expect (my csv contains several point locations). But the scale is completely wrong. If I right-click on my layer and select Zoom to layer I find my dots are all in the middle of the sea (actually, off the Isles of Scilly in the far south-west corner of the UK National Grid).

At the bottom of my QGIS window there is a little widget showing Co-ordinate that shows appropriate-looking numbers e.g. 0.292283,51.635252, (lon,lat), but the Scale widget is showing 1:3! So these places are being mapped as if they cover the area of a post-it note.

Edit: looks like a duplicate of Mysterious Lat Long conversion to XY problem using QGIS ... the solution there was to use a different CRS. I'm currently using EPSG:27700 (British National Grid) for all my layers and basemap. So what should I project with instead?

If I then go to the layer properties and from the left menu select Attribute form, and then select the Latitude field, it shows the Widget type as Text Edit. If I change this to Range, the Minimum and Maximum fields are enormous numbers:

-/+ 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.00

Under Advanced Options it tells me that: "Current minimum for this value is 51.608082 and current maximum is 51.834236" which matches the min and max of my dataset.

If I import a similar csv file as a delim text layer, but with Eastings and Northings included, and pass those columns as the X and Y co-ordinates, it imports the points perfectly.
But for some reason QGIS is not correctly interpreting the valid lat and lon numbers I am giving it. I would like to know why.


texts: Google Fusion Tables vs Amazon Web Services: which is better for GIS data?

texts:
What are the pros/cons for storing storing spatial data in Google Fusion Tables versus Amazon Web Services?

Factors would include: Cost, performance, ease of update.


texts: Creating/extracting/summarizing data from unique values symbology using ArcMap

texts:
I am using ArcMap 10.3.
I have a bunch of data symbolized by categories - unique values.  I have grouped together many (10 to 40 per grouping) different values to create this symbology.  Now I need to figure out the total areas contained within these symbology classes I have created.
For example: I created a symbol value called 'Residential' by combining features with the attributes mobile home, labor camp, condo, apartment, duplex...and many more.
Now I need to know the total area in the 'Residential' symbol value I have created.
Is there any way to do this without going back to all the disparate classes (mobile home, labor camp, condo, etc etc) and summing them up first? (massive time sink)
It seems like a simple task since I can see the areas I need to quantify symbolized on the screen.


texts: Using GeoServer with ArcGIS Viewer for Flex

texts: I need to create a web GIS application using the ArcGIS Viewer for Flex graphical Appbuilder. Can I use it with GeoServer to publish my GIS data or is the viewer made exclusively for ArcGIS for Server?


texts:
Our organization recently bought an R2 Receiver and we were wondering if there were any iPad GPS collection apps other than ArcGIS Collector which will:

Connect via Bluetooth to our R2 Unit
Connect to our Trimble Base Station
Export these collected points easily to ArcMap


texts: Stitching rasters with specific coordinates together

texts:
I have a list of images (read with tifffile.imread) and the coordinates (xmin, xmax, ymin, ymax) stored in a list. Suppose the images cover an area of 100 by 100 meters. Some of the areas are missing. I would like to stitch the images together to tiles of 1000 by 1000 meters. The missing areas should be included in the tile as [255,255,255].

The following code illustrates stitching along the y-axis, without filling the missing images:

import numpy as np
import tifffile
import pandas as pd

images= [...]  #this is a list of images read with tifffile
"""
# Variables I have not used, but could be used
listCoordinates = [[xmin, xmax, ymin, ymax], [xmin, xmax, ymin, ymax],...]
imempty = = np.ones((100,100,3), np.int16)*255
aoi = "foo.shp" # shape file with area of interest, polygon
dframe = pd.DataFrame({'images':images, 'coord':listCoordinates})
"""
num = 10
xmax = 500  #starts at x coordinate of 500
xmaxLimit = xmax + num*1000
i = 0

startim = images[i]
while xmax <= xmaxLimit :
    i += 1
    img = images[i]
    startim = np.concatenate((img, startim ), axis=0)
    xmax = xmax + 1000

I am now looking for a function concatenating the 10 strips of np.concatenate((...), axis=0), with np.concatenate((...), axis=1) by looking up the coordinates.


texts: ArcGIS geoprocessing/extraction tool for online use

texts:
I'm looking to extract data from raster cells using drawn polygons in an online app through ArcGIS Online.

I would like to use the draw widget on AGOL to create a polygon layer, and use that layer to extract/summarize data from a raster, and perform a calculation using that data. Is that possible?

Ideally, it would create the area under the drawn area, and also provide statistics based on raster data (sum total, sd + mean) that are within the drawn area. If possible i would also like a calculated field for the resulting data as well.


texts: Keep only endpoints of line with Extract Vertices

texts:
Using QGIS 3.2, I can use the "Extract Vertices" tool to generate a layer of vertices for each line segment in my data. My data is split into line segments of between 400-500m in length (using the v.split command). Since the geography is not straight, the tool extracts numerous vertices for each line segment:

For example, the selected line segment in red has 5 associated vertices. Is there a way to keep only the endpoints of each segment? I can use the fact that "vertex_part = 0" to find one endpoint, but since my line segments vary in distance I'm not sure how to easily pick out the other end.


texts:
I have sediment data based on annotated images of the seafloor.  The images are classified into fine sediment, mixed sediment, boulder and outcrop the sum of which is 100% for each image.  For example one image might be 20% mixed and 80% boulder, another 100% outcrop, another 90% fine, 10% boulder.  I would like to interpolate the entire study site based on this point data.

Is it possible to interpolate based on all 4 fields at the same time or can I only interpolate 1 field at a time?

I am using arcGIS 10.3.


texts:
I’m working with a GIS that uses SQL Server as its DBMS. So I have to insert some data into a column called dbo.CidadesGeo, but before do that I have to understand how the geometry (geometria) column works. In addition, idcidade = idcity.

So, as you can see, the “geometria” column is set such as image type. When I selected all data I found something like that:

I’d like to convert this image type into WKT, then I could see how the coordinates looks like. Could someone help me with that?


texts: This really teases me. Somehow the Atlas-function in Print Composer are missing some of my polygons from my layer, when doing a print. I´ve looked at them once again,- they are there, and the geometry is right, but not all them are printed. How to solve this?


texts:
Is it possible to execute a GeoServer WFS request that returns CSV without a header?

Example:

https://localhost:8080/geoserver/wfs?service=wfs&version=1.0.0&request=GetFeature&typeName=topp:states&outputFormat=csv

Will return a comma separated list of all attributes of topp:states but includes a header row. Is it possible to make this request so that the header is excluded?


texts: Updating shapefile datastores on GeoServer

texts:
I am a web developer working with GIS guys who are concurrently working on a vector layer that updates every week or so, however, on our mapping application there are about 30 layers that would need to be deleted and recreated with the GeoServer interface. This process kills about 5 hours every week by hand and I want to automate the process.

I am handed a shapefile and a list of layers which do not change.
I imagine I am essentially updating the datastore, but when I try to update just the datastore the layers in my application stop working.

How can I update just the datastore without deleting and re-adding every layer?


texts:
I have hosted a Geoserver image in a docker container locally and I created a layer using some sample data stored in a Postgis database. I think the layer is correct, because when I click on layer preview->OpenLayers on the Geoserver webUI, everything looks OK. But I am not able to show the features inside my own Leaflet script. I only see a blank page with a grey background. Here is the code I am currently using:

var mymap = L.map('mapid').setView([52.296904, 4.852940], 18);

var rootUrl = 'http://localhost:8080/geoserver/wfs';

var defaultParameters = {
    service: 'WFS',
    version: '2.0.0',
    request: 'GetFeature',
    typeName: 'acme:pand',
    maxFeatures: 200,
    outputFormat: 'application/json',
    srsName:'EPSG:28992'

};

var parameters = L.Util.extend(defaultParameters);
var URL = rootUrl + L.Util.getParamString(parameters);

var WFSLayer = null;
var ajax = $.ajax({
    url : URL,
    dataType : 'json',
    jsonpCallback : 'getJson',
    success : function (response) {
        WFSLayer = L.geoJson(response, {
            style: function (feature) {
                return {
                    stroke: false,
                    fillColor: 'FFFFFF',
                    fillOpacity: 0
                };
            }
        }).addTo(mymap);
    }
});

I know that it is at least partially working, because the code does enter the 'success' and 'style' functions, I just can't see any features on the map. The firefox developer web console does not report any errors or warnings.

Is there anything wrong with my code or could there be something else that is causing my features not to show? I know I am centering the map at the right location.


texts: Count number of points inside a pixel in QGIS

texts: For a project I want to count the number of points in a raster, just like the picture below, in order to get idea of the point density. It seems simple but for some reason I am unable to find away to do this.


texts: How to update GeoServer memory settings?

texts:
I am using GeoServer 2.18 under Tomcat 9.0 on CentOS 7. (It's a development environment).
I want to increase RAM of my existing GeoServer and checking following links/related questions :
https://docs.geoserver.geo-solutions.it/edu/en/adv_gsconfig/gsproduction.html
https://community.webfaction.com/questions/20337/how-to-limit-memory-usage-of-tomcat-geoserver
Change GeoServer memory limits
It says need to update the container which is fine. I checked in catalina.sh, but not sure where  to update
How can I do this?


texts: QGIS Hillshade from a specific "light" source in space, not azimuth/altitude of light

texts:
I am trying to determine locations on a map that will have a clear line of sight to a satellite in geostationary orbit. Given a terrain raster I'd like to determine what areas of the map are in the "shade" and which could see the satellite. The problem is in QGIS you have to give an azimuth and altitude of light source, but obviously that will change depending where you are on the map?

Has anyone tried using hill shade that doesn't use a fixed light source, or the sun with a date/time?


texts: Problem with Rasterize Tool (vector to raster) QGIS 2.18.28

texts:
I am trying to convert a vector file into a raster using the rasterize tool however it us just producing a back block of a single value. I am rather confused as I have used this tool on another shapefile in the same project and it has worked perfectly.

The first screen shot is of the shape files in which i want to convert to raster (Nodes). I have included the attributes table in the screen shot.

The second screen shot is the input in which I used in the tool.

The the third screen shot is the output.

Any help would be greatly appreciated! Let me know if you need more info.


texts: exploded or compact storage format for cached orthophotos?

texts:
I cached 2 map services.One of them was cached using exploded option and the other map was  cached using compact.
The same scales were cached for both maps.
I am wondering about a method to calculate the performance / speed for each one, so I can choose which cached map can be used later.


texts: Any way to read bathymetry surveys (*.xyz) into QGIS as a TIN or as raw points?


texts: Every geoprocess with merged raster produces 999999 (ArcMap 10.6)

texts:
I have a county where there is some LiDAR (1 meter) coverage. For the rest of the county I downloaded 10 meter DEM from USGS. Both rasters are in same projection and units. I resampled the 10 meter to one meter and Mosaic to New Raster to produce one seamless raster for the county.

Need to get Zonal Statistics for parcels, and it keeps missing some parcels, I read some suggestions are convert to tif and resample so small parcels don't get omitted. So trying multiple analysis and always get 999999 error. These include:

(From Catalog) Export Raster to Different Format: TIFF

Resample

Spatial Analyst: Slope

Spatial Analyst: Aspect

Should I try new mosaic? Seems to me like my merged raster is corrupt in some way but I don't know how to best fix it.


texts: Getis-Ord GI and Moran's I when interested in clustering of data values not points

texts:
I have a dataset with many clustered (often coincident) points, each of which contains data.

I am not interested in the fact that the points are obviously clustered.  I would like to know whether the data values are clustered.

My reading of this page is that it is appropriate to run the Getis Ord GI tool on the point dataset directly.  Similarly Global Moran's I.

Is this correct?


texts: Python SQL connection causes crash in ArcMap

texts:
I have the following code which I have striped down to just included the part that is causing a crash in ArcMap.

import pymssql

# Connect to the Research db using Windows Integrated Authentication.
conn = pymssql.connect(host='000.000.0.0', database='Research', trusted=True)

conn.close()
del conn

The first time this is run as a script from the toolbar works just fine. However if I run the script again it crashes ArcMap to crash. "ESRI has encounter a serious error and will now exit." Then asks if I want to submit error report...

Thoughts on what's happening? I thought closing the connection would be enough.

Do I need a Try/Exception statework work here. To handle if the connection is already made then don't override it?

Also, If someone knows where to find the ESRI report log on the computer I will upload mine.


texts: Performing Weighted Flow Accumulation in GRASS?

texts:
I would like to calculate a weighted flow accumulation raster with GRASS. I have a DEM and a rainfall raster. I am looking to calculate the rainfall accumulated downstream. Basically, it is similar in the way that is calculated Flow Accumulation, but instead of sum cells with value 1, I would like to sum values from the rainfall raster.

It seems very easy in ArcGIS Desktop, but can I do it with GRASS?


texts:
I've been trying to implement the OpenLayers Example for reading MBTiles:  http://projects.bryanmcbride.com/ol_mbtiles/

Right off, the link to the necessary mbtiles.php script was broken, but I found what I believe to be a copy of it, here:  https://gist.github.com/1818011

After exporting my MBTiles file from TileMill, I saw in the SQLite that the mbtiles.php file's SQL query was using the wrong columns and tables for pulling the appropriate tile images.

The original query:

$sql = "SELECT * FROM tiles WHERE zoom_level = $zoom AND tile_column = $column AND tile_row = $row";

What it should be based off what TileMill Exported:

$sql = "SELECT images.tile_data FROM map, images WHERE map.zoom_level = $zoom AND map.tile_column = $column AND map.tile_row = $row AND map.tile_id = images.tile_id";

Once I did that and stopped doing bindColumns on SQLite columns I wasn't using, I could pull the tile images from my MBTiles file using the php script.

That's where I get stuck.  I followed the Javascript code from the OpenLayers example linked to above, but the TMS layer keeps calling for tile rows and columns that don't exist.

Here's the relevant bits of my JS code.  What I'm not showing is my creation of an OSM base layer.  I think the problem lies in the math used to calculate the x and y values in mbtilesURL():

function load_mbtiles(){
            var mbtilesLayer = new OpenLayers.Layer.TMS("MBTiles Overlay", "mbtiles.php", {
                getURL: mbtilesURL,
                isBaseLayer: false
            });

            map.addLayer(mbtilesLayer);
        }

        function mbtilesURL (bounds) {
            var db = "filename.mbtiles";
            var res = this.map.getResolution();
            var x = Math.round ((bounds.left - this.maxExtent.left) / (res * this.tileSize.w));
            var y = Math.round ((this.maxExtent.top - bounds.top) / (res * this.tileSize.h));
            var z = this.map.getZoom();

            return this.url+"?db="+db+"&z="+z+"&x="+x+"&y="+((1 << z) - y - 1);

        }

Can anyone think of why this function would be calling the completely wrong tiles?


texts: Selecting line with specific numeric field value using inline variable for arcpy.UpdateCursor()

texts:
I'm currently away in a remote field station using Arc 10.0 and having a hard time using an inline variable substitution for a numeric field value. I am trying to use UpdateCursor to select only a specific line by designating a "POSITION" field = to a numeric value that I can increment each time I go through the for loop.   When I use a number in the line, it works. However, I can't seem to get the right syntax to substitute the hard-coded number for a variable.

here's the section of code:

## Attempt to update the cursor, then get value, then setvalue using an inline variable for the desired Field value
## THIS does not work
stefile = "ste1.shp"
stefield = "POSITION"
steclus = "CLUSTER"
steac = "AC"
stevalue = 100
stepos = 22
Z = arcpy.UpdateCursor(stefile, '"POSITION" = stepos')        # This needs to be changed eg; '"POSITION" = a memvar') ...and at end of loop memvar +=1
for row in Z:
    print row.getValue(steclus)
    memvar = row.getValue(steclus)
    row.setValue(steac, stevalue)
    Z.updateRow(row)
    print row.getValue(steac)
    del Z
    del row

### HERE are the error messages
# Runtime error <type 'exceptions.RuntimeError'>: ERROR 999999:
# Error executing function.
# A column was specified that does not exist.

Am I simply using the wrong syntax?


texts: is there a way to tell if two linestrings "really" intersect in JTS or GEOS

texts:
In JTS (or GEOS) you can't tell if two linestrings really cross each other. The result is exactly the same whether the lines simply have a point in common but don't cross or if they really cross.

Is there an easy way to differentiate these cases ?
thanks


texts: How does ArcGIS calculate zonal statistics with partially overlapping zones?

texts:
I am trying to get zonal statistics in ArcGIS. My zone raster is a world map with zones defined as "provinces (such as the US states)," and the value inputs are temperature data for each "longitude*latitude grid box."

Although I can choose how small each grid box is, ranging from 0.1*0.1 degrees to 1*1 degrees, the provinces and grid boxes do not exactly match. So for example, there could be a province in Switzerland that perfectly overlaps with 5 grid boxes but only partially overlaps with 3 other grid boxes.

I get results just fine when I run standard zonal statistics code in Python but I have no clue how it took care of those partially overlapping zones. Is there any hidden weighting process behind the code?

Going back to the example I used, how is the mean temperature in that province calculated when only 5 out of 8 grid boxes are completely inside the province boundary, while only some parts of the other three are within the boundary?


texts: Error in installing gsconfig Python library for manipulating a GeoServer instance via the GeoServer RESTConfig API

texts:
I like to install gsconfig Python libraries I got error like this
Collecting gsconfig
 Downloading gsconfig-0.6.13.tar.gz
 Traceback (most recent call last):
  File "<string>", line 20, in <module
 Complete output from command python setup.py egg_info:
 Traceback (most recent call last):

  File "<string>", line 20, in <module

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\new\
AppData\Local\Temp\pip-build-5luj5ufr\gsconfig


texts: Is it possible to pan the map in QGIS composer?

texts:
I am relatively new to the composer feature of QGIS, and often have difficulty getting the map centred exactly where I want it. In particular the area of interest often moves when I set the scale.

Is it possible to pan or otherwise centre a plot that is easier than adjusting the extents manually.

Thanks


texts: How to specify gdal_contour output format as postgresql table?

texts:
I want to generate contours with gdal_contour command.
It generates an output as shapefile by default.
I want this utility to output a postgresql (postgis) table.

The documentation says there is a -f  option, but I couldn't find any examples on specifying a format.
http://www.gdal.org/gdal_contour.html

Can anyone provide an example of specifying postgis table as an output for gdal_contour?


texts: Projecting GCS Australian 1984 to WGS 1984 UTM (or similar) to get units of meters?

texts:
I am currently trying to run a kernel density analysis and need to change the co-ordinate system to a UTM measurement in order to set some meaningful biological constraints to my seabird data (eg, Search Area and cell size output). The best out come i am wanting is to set these in meters.

Currently my data is point data (XY or .CSV) and set in GCS_Australian_1984. I have been trying to change GCS_Australian_1984 to WGS 1984 UTM zone 12s (not sure if this an appropriate conversion in terms of file comparability) and when i run the "project" tool in data management i keep getting an error that says "table name is invalid" and "The project method cannot do a datum transformation".

My data is located in an area of W: 110 N: -6 S: -21.5 E: 131 (Timor Sea(Southern Hemishpere))

Is there any way or a recommendation, that i can transform my data into a format where kernel density analysis will give meters and not SQUARE_MAP_UNITS, this is not very meaningful to me.

Ps This is a good summary of what i am trying to achieve (http://www.youtube.com/watch?v=P3GP-IiQ-0Q)  at 5 minutes and  16 sec and using arcmap 10.1

SOLUTION

For any one having similar issues with getting your kernel density values (Search area or cell size out put) into biological terms then here is how to do it.

If you have point data add it as X and Y data under your "normal" co-ordinate system. File > add data > add XY data.

Then right click on the layer that was just imported. A tab will appear, select data > Export data > a box will appear select the file directory and export as a shape file.

then import this shape file back into arcmap 10.1 and change the co-ordinate system to UTM and save. this can be done in the data management tab in the arctool box and is under projections and transformations, select the project tool.

then run your kernel density with the transformed shape file. The option area units should be "ungreyed" select your units and done.

NOTE: XY data can not be transformed into UTMs it has to be changed into a shape file and reimported.


texts: Call GeoExt action by click ExtJs button

texts:
I have a problem.
I have a ExtJs button and want to call anyone GeoExt action. For example this

{xtype:'tbbutton',
                        cls: 'x-btn-icon',
                        id: 'testbutton',
                        tooltip: "Рисовать",
                        icon: url_servlet+'externals/gxp/src/theme/img/silk/delete.png',
                        handler: function(){
                            new GeoExt.Action({
                                text: "max extent",
                                control: new OpenLayers.Control.ZoomToMaxExtent(),
                                map: app.mapPanel.map
                            })
                        }

                      }

But its not work and map not zoom to max extent. So where i can mistake.
 In ideal i want to call action from actionColumn's buttons/
  I will glad if u help/


texts: Saving copy of 10.5 MXD to 10.4 using ArcPy at 10.5?

texts:
I wrote a python script to convert 10.5 mxd to 10.4 mxd.

However, in the saveACopy("mxd", "version") method, '10.4' is not in the list of possible values. If I open ArcMap 10.5 and manually "Save a copy..." there is a choice for 10.4.

I don't know if it's because 10.3 mxd and 10.4 mxd are the same, but when I try to open a 10.4 mxd with ArcMap 10.3, there is a version mismatch and it pops an error.

Is this perhaps happening because Esri forgot to update this part of the python api with version 10.5?

ArcMap 10.5.1, is the only version ever installed on the OS (Windows 10, running in a virtual machine). Nothing else is installed other than QGIS 2.18.10 and Firefox.

When running mxd.saveACopy('myfilename.mxd', '10.4'), it throws an error, saying that possibles values are '10.3', '10.1', '10.0', etc. The same value list as in the doc here


texts:
I am using version Rel. 5.2.0, September 15th, 2018 on OSX but get the same answers on other platforms with other versions.

prompt> echo 3 0 | proj +proj=utm  +zone=1  +ellips=wgs84

500000.00   19995929.89

Seems correct for the easting as the center of the zone should be 500km.  The northing decreases to about 10km for a value of 90 degrees latitude as shown below.

prompt> echo 3 90 | proj +proj=utm  +zone=1  +ellips=wgs84

500000.00   9997964.94

However, when I give a sightly negative latitude I get

prompt> echo 3 -.0001 | proj +proj=utm  +zone=1  +ellips=wgs84

500000.00   -19995918.83

Which means that (3,0) and (3,-.0001) have very, very different coordinates in the northern hemisphere utm zone 1.  I don't think this is correct -- hopefully, I am simply wrong and have made an error somewhere.


texts: Extract data in ArcGIS Online from map service hosted by ArcGIS for Server?

texts:
I have only found scripting solutions and extensive workarounds.

Scenario:

map services hosted on ArcServer
looking to publish on organizational account on ArcGIS Online via REST

The most common operation our guys would like to do, is export features as CSV, shp etc... And I just cannot find any built-in solution in ArcGIS Online to do that! We´re currently using FlexViewer and people are used to that feature (at least the CSV export).

I found these Esri articles, e.g:

https://doc.arcgis.com/en/arcgis-online/share-maps/use-hosted-layers.htm

And a few workarounds, e.g.:

https://socalgis.org/2015/08/11/extracting-features-from-map-services/

Esri's article doesn´t work on map services. The workaround does work, but involves running a Python script.

Is there a native solution by Esri for this operation?


texts:
Is there a (current) best practice to simplify ways? I have found:

https://github.com/podolsir/osmosis-simplifyways

But besides not being alive, here (http://permalink.gmane.org/gmane.comp.gis.openstreetmap.devel/26854) it says:

  Ok, I found out that osmosis-simplifyways is not compatible with
  osmosis 0.43.1. It will work with 0.39. But the tool is buggy. It
  removes nodes from ways where it connects to other ways.

Since I want to use the data for routing I guess it wouldn't work anyway.

Is there some well tested Ramer–Douglas–Peucker implementation to simplify osm data properly?


texts: Why does ArcMap crash if I try this Join Field (which ArcPy does not like either)?

texts:
I'm a little uncertain whether this question belongs here or on http://gis.stackexchange.com

Have an "AddJoin" that results in no shared records, which is not what I'm expecting. Is it because I'm using a text field for the join? Something else? I'm trying to do this on point features from  featureclass layers in a file gdb and a shapefile (both expressed as TableViews) on which I've performed a arcpy.SelectLayerByAttribute_management(). No cursors are being used.

Thanks for any ideas. ArcGIS 10.0. Also, ArcMap crashes if I try a JoinField on the same fields.

>>> arcpy.GetCount_management("GagesII")
<Result '1'>
>>> for row in arcpy.SearchCursor("GagesII"):
...     gageid=row.getValue("GAGE_ID")
...
>>> gageid
u'01170000'
>>> arcpy.GetCount_management("StreamGageEvent")
<Result '1'>
>>> for row in arcpy.SearchCursor("StreamGageEvent"):
...     sourcefea=row.getValue("SOURCE_FEA")
...
>>> sourcefea
u'01170000'
>>> if gageid==sourcefea:
...     print 'yes'
...
yes
>>>
>>> arcpy.AddJoin_management("GagesII", 'GAGE_ID', "StreamGageEvent", "SOURCE_FEA", "KEEP_COMMON")
<Result 'GagesII'>
>>>
>>> arcpy.GetCount_management("GagesII")
<Result '-1'>


texts: Checking for multiple layers existing using arcpy.Exists

texts:
Is it possible to check for more than one layer at a time?

I would like to do this (pseudocode):

if arcpy.Exists(vriLyr AND rsltLyr AND  forCovLyr):
     <skip ahead>
else:
    arcpy.SelectLayerByLocation_management(vriLyr, "INTERSECT", areaBoundary)
    arcpy.SelectLayerByLocation_management(rsltLyr, "INTERSECT", areaBoundary)
    arcpy.SelectLayerByLocation_management(forCovLyr, "INTERSECT", areaBoundary)

Any suggestions?


texts:
I'm relatively new to fiona and I'm wondering how I can crop/clip a vector file with a bounding box. It is important to mention I want to clip, not only to get the features withing the bounding box. So on this image, the input is in orange and the highlighted area is the desired result (imagine where was the bounding box).

This is the ogr2ogr equivalent:

ogr2ogr -spat -0.58 0.60 0.62 -0.30 -clipsrc spat_extent /tmp/result.shp /tmp/source.shp test

or from QGIS processing plugin "Clip vector by extent"


texts: Using QGIS Geometry Generator to get rectangle from point?

texts:
I would like to translate a point (from a point layer) to a rectangle polygon using the new Geometry Generator from QGIS 2.14.

I know the length and the height of the resulting rectangle. The point should be the centroid.


texts: When importing a shapefile, resulting field name in feature class contains schema and table name

texts:
I'm using the following snippet to import a shapefile into a SDE feature class.

arcpy.CopyFeatures_management(inputShapefile, outputFeatureClassName)

where inputShapefile is a shapefile on a mapped drive and outputFeatureClassName is a feature class that will be created on our SDE server.

With the exception of a single field name, all field names in the shapefile appear in the SDE feature class. The exception field is named "AREA" in the shapefile but somewhere along the way it is prefixed with SCHEMA.TABLENAME. Instead of a field named "AREA", it is named "ABC123.tmp.AREA".

I checked the feature class properties in ArcCatalog and this field has an alias that matches what I'm describing. My question, how to I prevent this from happening? I want the field name imported as-is.

update #1 - I tried to fully qualify outputFeatureClassName in the call to arcpy.CopyFeatures_management() , instead of just setting arcpy.env.workspace at the beginning of my code. Still experiencing this issue.

update #2 - In the SDE database, the field is named AREA. How do I prevent the alias from being created? None of the other fields have aliases of this form.


texts: Refresh Currently Open ArcMap Attribute Table using ArcObjects

texts:
I have written an ArcMap Addin (ArcMap 10.0) that allows a user to perform a join between an in-memory table and a feature class (feature layer) added to the TOC.  I want the attribute table of the feature layer to automatically refresh after the join occurs if the user happens to have the attribute table visible when performing the join.  This way the fields added to the table via the join will be visible to the user without having to close and reopen the Attribute Table.

The following function is what I have tried to refresh the Attribute Table, but it does not actually refresh the display.

Private Sub RefreshAttributeTable()
    Try
        Dim tableWindow As ITableWindow3 = New TableWindow
        tableWindow.ActiveTableWindow.Refresh()

        My.ArcMap.Document.ActiveView.Refresh()
    Catch ex As Exception

        Debug.WriteLine(String.Format("{0}; {1}", ex.Message, ex.StackTrace))

    End Try
End Sub

Can anyone help with this?


texts: How to visualize Map/matching result in QGIS 2.0?

texts:
I want to visualize this map-matching results in QGIS 2.0.

http://download.osgeo.org/pgrouting/forum/pgrouting.postlbs.org/browser/trunk/core/sql/matching.html

I load my network in QGIS 2.0 and I want to visualize the output of matching_line_as_linestring.sql.


texts:
I do have DEM of 1x1 meter and original LiDAR point cloud in .las, that DEM is made of. I need to extract river dikes (highest points of the dikes) to vector feature (point, polyline).

Any idea for the algorithm or an existing tool?

Dikes are in light gray on the 1st image and below is point cloud image for the example area with the dikes. River centerline in blue.

Any tool for linear features extraction from DEM?

I believe I need something like ENVI’s Spatial Feature Extraction Module (page 7), but without ENVI's part, as I can not afford it :)


texts: Converting .las to .pcd file using PDAL?

texts:
Is it possible to translate .las files to .pcd with PDAL? If so, using which tool? I need an example about how to set the command-line with such tool.

If it is not possible (or alternatively), is there other open source software that can translate .las to .pcd?


texts: Is the derived area/length/xy values of a polygon/polyline layer in QGIS usable?

texts: I have a raster that is projected to a state plane CRS and I am adding polygon/polyline shapefiles that are projected to WGS84.  On the fly transformation is set to reproject to my raster CRS.  When I use the identify features tool to select a feature, under derived I can see the correct area/length measurements.  Is there a way to transfer that exact information into a new column(s) in the attributes by using the field calculator?


texts:
I have a folder with an output (shapefiles) from an iteration. On this output, I want to perform a join between two attributetables.

So far so good. Here comes the tricky part.
There are different shapefiles (lets say 20), all with different names. Each attributetable has exactly the same amount of fields (maybe the numbers of rows differs).
What I want the script to do is: pick two specific attributetables which belong together (based on the name), join them and then go on to the next two attributetables until there are no more tables to join.
All shapefiles have different names, but where the %Name% stands in the script, the name is the same.

For example:

abc_clip_diss JOIN abc_full_diss
def_clip_diss JOIN def_full_diss
ghi_clip_diss JOIN ghi_full_diss

What I got so far and is not much because I am very new to python is that:

import arcpy

#set workspace
arcpy.env.workspace =

#set variables
inFeatures = "%Name%_clip_diss"
joinField = "WLType"
joinTable = "%Name%_clip_full"
fieldList = ["area_ha"]

#JoinField "JoinField_management (in_data, in_field, join_table, join_field, {fields})"
JoinField_management ("inFeatures" , "joinField" , "joinTable" , "fieldList")

I think a loop would be good here? But I did not understand that good how a loop works. I dont understand what that for XX in YY means. And I am not sure if I can do that thing: %Name%.

Any ideas, hints, suggestions?

EDIT 7/8/14 4:00 pm

import arcpy
import os

#set workspace
arcpy.env.workspace = "C:\\Users\\Documents\\Wetland\\New_Folder"
ws = arcpy.env.workspace

#create a list of features
fcl = arcpy.ListFeatureClasses()

#loop through the list
for fc in fcl:
    basename = fcl.split("_")[0] #split name of features and only take the first word as a basename

    inFeatures = os.path.join(ws, basename + "_clip_diss") #The table or feature class to which the join table will be joined.
    joinField = "WLType" #The field in the input table on which the join will be based.
    joinTable = os.path.join(ws, basename + "_clip_full") #The table to be joined to the input table.
    fieldList = "WLType" #The field in the join table that contains the values on which the join will be based.

    #JoinField "JoinField_management (in_data, in_field, join_table, join_field, {fields})"
    arcpy.JoinField_management(inFeatures , joinField , joinTable , fieldList)

Running this code I run into several problems. The biggest was the Error 000732 which said 'files do not exist'.
I converted all my shapefiles into a geodatabase which did the trick. The Geodatabase is in the folder "New_Folder".

But running the code now, still does not work. It does not Join one table to another.
I am wondering, where the problem is. Can anyone see it?


texts: What should the GeometryField encoding be for a GeoJSON data source in an OGR VRT?

texts:
I am trying to produce a color gradient for a temperature map and I am using gdal_grid, specifically:

gdal_grid -zfield "temperature" -a invdist:power=2.0:smoothing=0.0 -txe -72.5 -77.0 -tye 38.6 41.8 -outsize 400 400 -of GTiff -ot Float64 -l temperature map_layers.vrt temperature.tiff --config GDAL_NUM_THREADS ALL_CPUS

My .vrt:

<OGRVRTDataSource>
    <OGRVRTLayer name="temperature">
        <SrcDataSource>temperature/data/temperature.json</SrcDataSource>
        <GeometryType>wkbPoint25D</GeometryType>
        <LayerSRS>WGS84</LayerSRS>
        <GeometryField encoding="PointFromColumns" x="longitude" y="latitude" z="temperature"/>
    </OGRVRTLayer>
</OGRVRTDataSource>

Originally I used a .csv as a data source (successfully) but I would like to use a GeoJSON file instead. I am not sure what to use for GeometryType and GeometryField (they are currently what I used for the .csv) and I haven't been able to find documentation or examples.

Here is a snippet of the GeoJSON:

{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [-74.660809, 41.322093]
},
"properties": {
"name": "High Point Monument",
"solarradiation1avg_5min": "",
"soiltemperature_50cm": "",
"pressure": "",
"watercontentvf_50cm": "",
"soiltemperature_5cm": "",
"watercontentvf_20cm": "",
"heatindex": "",
"relhumid": "",
"winddir": "343.5",
"windchill": "",
"watercontentvf_5cm": "",
"watercontentvf_10cm": "",
"soiltemperature_20cm": "",
"windsp": "9.3",
"temperature": "57.1",
"soiltemperature_10cm": "",
"windspmax_5min": "19.0",
"precipitation": "",

So the latitude and longitude are together as coordinates, whereas in the CSV they were separate columns.

Can you point me to the right documentation?


texts:
On a web application I'm currently working on, some of the data for the GIS Service is bad. For instance, there may be multiple polygons that should be a singular graphic, but instead they are each their own individual graphic. So what I'm doing right now is creating a hash call GraphicHash which is keyed by the name of each graphic in the attribute.

From there I get each graphic and do a union on their extents.

var GraphicHash = {}; //hash for all the graphics
    var ctr = 0; //counter for collisions
    var zoom_change = false;

    // generate the hash keyed on REC_AREA_NAME, if collision, then add a number to the end of it
    recLayer.on("graphic-add", function(evt) {
            if (zoom_change == false) {
                var cur_graphic = toIDCase(evt.graphic.attributes.REC_AREA_NAME);
                if (GraphicHash[cur_graphic] == null) {
                    GraphicHash[cur_graphic] = evt.graphic;
                } else if (GraphicHash[cur_graphic].attributes.STREET_ADDRESS != evt.graphic.attributes.STREET_ADDRESS) {
                    GraphicHash[cur_graphic + ctr];
                    ctr++;
                } else {
                    var new_extent = GraphicHash[cur_graphic].geometry.getExtent().union(evt.graphic.geometry.getExtent());
                    GraphicHash[cur_graphic].geometry.getExtent().update(new_extent);
                }
            }
    });

However, after I have created that hash, I would like to go through each graphic, calculate the centroid and then display it on the map. Currently I am doing the following:

 for (var graphic in GraphicHash) {
    var centroid = GraphicHash[graphic].geometry.getCentroid();
    GraphicHash[graphic].setGeometry(centroid);
    GraphicHash[graphic].setSymbol(recSymbol);
    //graphic_array.push(GraphicHash[graphic]);
    recLayer.add(GraphicHash[graphic]);
 }

I do this on the "update-end" event. However, in some instances I get errors where getCentroid() is not a function and other times I get problems where a point exists for one of the hashed values, but it seems to have not included other polygons that needed to be hashed, and those polygons that weren't hashed appear on the map as polygons.


texts: How can I render a composite (multi-band) raster in true color in QGIS?

texts:
I have gone through most QGIS troubleshooting steps in the GIS stack exchange but have not found a solution. I have imported a composite multi-band spectral GEOTIFF raster as part of the Hansen Global Forest Loss dataset.
https://earthenginepartners.appspot.com/science-2013-global-forest/download_v1.0.html
I have tried many of the various options including stretching the min/max values per band, reversing the order of the bands, adjusting the Statistics extent and Accuracy options, Blending modes etc. Nothing seems to be getting the render closer to true color.
QGIS:

Correct RGB Rendering in Jupyter Notebook with Rasterio (Python):


texts: Changing user's password and adding users in Geoserver using REST service

texts: I want to change user's password (e.g. for admin user) and create a new one using Geoserver's REST API. Is this possible? I tried to look for some solution in their DOCUMENTATION, but nothing found about users and passwords...


texts: Where can I find high resolution data on residential land use?

texts:
I am currently searching for high resolution data on residential or commercial land use in the USA. I'd like to use this data to determine for a given location wether this location is in a house with people living in it or not. The data doesn't have to be perfect, as I only intend to do a case study on that. Therefore, it would be sufficient to find such data for a bigger city (e.g. Boston). Does anyone of you guys know if such data exists?

As I am not planning to use the data commercially, I can't afford paying very much for it. With this restriction, I can't use business directories like InfoUSA or Dunn & Bradstreet, which are mention in this question.

I considered using OSM, as it contains a node attribute landuse that can be used to mark a node as used for residential use. Unfortunately, the data in OSM currently doesn't seem to be very accurate in that respect. If I am wrong there, I would be very grateful for corrections and hints.


texts:
I am looking for a way to import my data from KML (example below) to PostGIS database.

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
<name>Location history from 04/20/2011 to 05/20/2011</name>
<open>1</open>
<description/>
<StyleMap id="multiTrack">
<Pair>
<key>normal</key>
<styleUrl>#multiTrack_n</styleUrl>
</Pair>
<Pair>
<key>highlight</key>
<styleUrl>#multiTrack_h</styleUrl>
</Pair>
</StyleMap>
<Style id="multiTrack_n">
<IconStyle>
<Icon>
<href>http://earth.google.com/images/kml-icons/track-directional/track-0.png</href>
</Icon>
</IconStyle>
<LineStyle>
<color>99ffac59</color>
<width>6</width>
</LineStyle>
</Style>
<Style id="multiTrack_h">
<IconStyle>
<scale>1.2</scale>
<Icon>
<href>http://earth.google.com/images/kml-icons/track-directional/track-0.png</href>
</Icon>
</IconStyle>
<LineStyle>
<color>99ffac59</color>
<width>8</width>
</LineStyle>
</Style>
<Placemark>
<name>Latitude User</name>
<description>Location history for Latitude User from 04/20/2011 to 05/20/2011</description>
<styleUrl>#multiTrack</styleUrl>
<gx:Track>
<altitudeMode>clampToGround</altitudeMode>
<when>2011-04-20T13:25:36.026-07:00</when>
<gx:coord>18.171574 53.391877 0</gx:coord>
<when>2011-04-20T13:30:31.488-07:00</when>
<gx:coord>18.171574 53.391877 0</gx:coord>
(...)
</gx:Track>
</Placemark>
</Document>
</kml>

Every time (in case of one file) I used Notepad++ (tools "Replace" to remove usless codes and organize to structure possible to import to Excel), Excel for preparing to import to ArcGIS, next used "Add XY Data" to create geometry and export to SHP, but currently I am looking for more automated solution. :)


texts: Difference between Bootstrap and Cross Validation MaxEnt

texts:
I didn't know which method to use cross-validation or bootstrap in maxent so I ran both and my AUC values for each method are quite different for bootstrap I have an AUC of 0.758 and for cross validation I have an AUC of 0.737. I have quite a large dataset 3000 + occurance points, and have tested different combinations of feature classes and regularisation  multipliers to find that the best for my data is LQHPT and RM of 1.5.
Can anyone explain way using each of these methods results in such a difference in AUC values and which one would be the best to use?
Many thanks in advance.


texts: Styling a shapefile obtained from S-57 data

texts:
I have downloaded S-57 data for a particular region and intend to publish this as a layer in GeoServer. To do this I used the ogr2ogr converter utility to convert S-57 data to a series of shapefiles (one for each feature).

The feature I am interested in is the Depth Contours feature(DEPCNT). I uploaded the shapefile corresponding to this feature in GeoServer and published it as a layer.

I am now able to see the Contours in the layer Preview. By looking up the attribute list for the layer I can see that the value of depth along contours is stored in the VALDCO(type double) field in meters. I am trying to create an SLD style by drawing the lines along with text labels, with the VALDCO attribute providing the value for the text label. I did this as follows:

   <LineSymbolizer>
      <Stroke>
        <CssParameter name="stroke">#FF0000</CssParameter>
      </Stroke>
    </LineSymbolizer>
     <TextSymbolizer>
       <Label>
         <ogc:PropertyName>VALDCO</ogc:PropertyName>
       </Label>
       <LabelPlacement>
         <LinePlacement />
       </LabelPlacement>

I am unable to see any text label with this property value. Is there anything wrong with the way I have done the styling?


texts:
Would it be possible to read in a LASCatalog from a URL or vector of URLs?

It is not possible with the standard function, readLASCatalog(). The benefit would be that you don't need to download all of the LAS files together, but only download them as needed, and discard them once they have been processed. Of coursed this would be much slower than storing them on disk, but would save a lot storage space.


texts: Setdrawingmode(null) giving Uncaught RangeError: Maximum call stack size exceeded main.js.27

texts:
I have my google map codes running for time where I can draw polygon and polyline without issue. Below are my snippet of codes on how I do my drawing. Unfortunately I got this error Uncaught RangeError: Maximum call stack size exceeded main.js.27. I notice that the error is at this line drawingManager.setDrawingMode(null);. The moment I comment this line all works fine. Is there a bug in function now ?

google.maps.event.addListener(drawingManager, 'overlaycomplete', function(e) {
        drawingManager.setDrawingMode(null);
       if(e.type.toString()=="polygon"){
           var points = e.overlay.getPath();
           geoFenceString = "POLYGON((";
           var latlngbounds = new google.maps.LatLngBounds();
           for (var i =0; i < points.length; i++) {
               var xy = points.getAt(i);
               latlngbounds.extend(xy);
               geoFenceString = geoFenceString+xy.lng()+" "+xy.lat()+",";
           }
           geoFenceString = geoFenceString+points.getAt(0).lng()+" "+points.getAt(0).lat();
           geoFenceString = geoFenceString+"))";
           var htmlString = '
\r\n';
           htmlString += '
Name	<input id="geoFenceName" type="text" style="width:100%" value="">
\r\n';
            htmlString += '
\r\n';
            htmlString += '
\r\n';
            var infowindow = new google.maps.InfoWindow({
            });

     }
     });

I can double confirm this because when I run codes from this link https://gist.github.com/rafalgalka/5765919 also give me same error.


texts: QGisPlugin : Trigger closeEvent by clicking 'X' in QgsAttributeForm

texts:
This is the code:
def formOpen(dialog, layer, feature):
   """Function called when a connec is identified in the map"""

   global feature_dialog
   # Create class to manage Feature Form interaction
   feature_dialog = ParentDialog(dialog, layer, feature)
   init_config()

def init_config():
   pass

class ParentDialog():
   def __init__(self, dialog, layer, feature):
   """ Constructor class """

       self.dialog = dialog
       self.layer = layer
       self.feature = feature
       self.iface = iface

I want to show message when button X(of QgsAttributeForm) is clicked ,something like:
    def closeEvent(self, event):

        reply = QtGui.QMessageBox.question(self, 'Message',
        "Are you sure to quit?", QtGui.QMessageBox.Yes,QtGui.QMessageBox.No)

        if reply == QtGui.QMessageBox.Yes:
            event.accept()
        else:
            event.ignore()

Is there any way to relate dialog (QgsAttributeForm) with closeEvent, or is there any other solution?


texts:
I'm new to GIS and OL3. My app needs to display a map in EPSG:4326 and the same app has to display a map in EPSG:3412 when I click on a button.

Here is the link for the JSFiddle http://jsfiddle.net/tmylamoule/ze9cg462/

My JS code

proj4.defs("EPSG:3412", "+proj=stere +lat_0=-90 +lat_ts=-70 +lon_0=0 +k=1 +x_0=0 +y_0=0 +a=6378273 +b=6356889.449 +units=m +no_defs");
var ePSG3412Button = document.getElementById('clickMe');
var ePSG3857Button = document.getElementById('clickMe2');

var map = new ol.Map({
  target: 'map',
  layers: [
    new ol.layer.Tile({
      source: new ol.source.MapQuest({
        layer: 'sat',
        wrapX: false,
        noWrap: true,
      }),
    })
  ],
});
ePSG3412Button.addEventListener('click', function() {
  var view2 = new ol.View({
    projection: 'EPSG:3412',
    center: ol.proj.transform([0, 0], 'EPSG:3857', 'EPSG:3412'),
    zoom: 1
  });
  map.setView(view2);
});
ePSG3857Button.addEventListener('click', function() {
  var view = new ol.View({
    projection: 'EPSG:3857',
    center: ol.proj.transform([0, 0], 'EPSG:3857', 'EPSG:3857'),
    zoom: 1
  });
  map.setView(view);
});

The only thing my code is doing is center the map in the middle of each projection. But I can't manage to transform the tiles.


texts: Sending e-mail on feature update in ArcGIS JavaScript application?

texts: We have an ArcGIS feature service that users can edit to change a "project status" attribute.  An example would be a change from "pending" to "in-progress".  Certain groups need to be notified when that attributes new value impacts them.  For instance, a change to "in-progress" would let accounting know that charges may start coming in to the job.  I'd like to e-mail the appropriate parties using the user's default email client but I'm not sure how to handle the attribute change event.  I am new to the JavaScript API and at this point any information will be useful.  I've investigated the ArcGIS JavaScript API guide related to event handling but would benefit from a more specific example.


texts: Fix unwanted sink contours from hydrologically correct DEM

texts:
I am creating contours from a DEM that has been hydrologically corrected via a Breach Depressions algorithm. The DEM is coloured light grey to dark grey (top to bottom), the stream is in blue and the contours in yellow. The stream runs from top to bottom of the image. The breach is quite deep relative to the surrounding terrain, as the stream is in fact a narrow slot canyon.

Unfortunately, the contours from that DEM are producing sinks rather than following the line of the stream, presumably because the stream is only 1 pixel wide.
The desired contours are roughly shown in green below. Is there an approach that will produce those contours?


texts: detecting all intersecting points between lines

texts:
I am using bellow query to get all the intersecting points from my line_string table.

select a.line_id,(st_dump(st_intersection(a.geom, b.geom))).geom from
roads a, roads b where st_touches(a.geom, b.geom);

Though it detects most of the intersecting points, its not detecting all the intersecting points.

In the above image blue dots are all detected points, where as red boxes are missed in detection.

There will be 2 possibilities.

One is marked in green, where roads are not intersecting (fly-over/under pass roads). Where geometry is not touching. OR two lines are not snapped/connected correctly.

But in the above image I cross checked many non detected lines, but they are perfectly snapped/connected.

I can use ST_Intersects in place of ST_Touches But the problem is,(If i am not wrong) it matches geometry spatially which leads to detecting intersecting points in flyover / underpass roads also.

Can anyone help me in understanding why its not detecting all intersecting points and how to correct it?

I also need to detect start or end point which is not intersected with other lines as intersecting point.


texts: Writing infinity to feature class in ArcPy?

texts:
Is it possible to write infinities to fields in ArcGIS feature classes, and if so, how?

Currently I get an exception thrown when I try.


texts:
I want to restrict the ability for someone to pan away from the extent the map has when it's loaded.

I have a map of New Zealand to be viewed at a national and regional level but worried people will get lost if they pan out to sea as it is the only geography loaded.

Ideally someone can pan around regions but not too far from New Zealand.


texts: Cause of Error 000308: Invalid Field Type when batch running ArcPy script?

texts:
This is my first post on this site.

I am using ArcGIS 10.2 for Desktop.

I wrote a simple script in the form of a python toolbox to calculate the speed of travel between consecutive entries of a point shapefile. The script works perfectly on single files. However, as soon as I try to run it as a batch, I get an error:

  Error 000308: Invalid Field Type.

EDIT: By running in batch, I mean I am right-clicking on the tool in ArcMap and selecting "batch", and then loading in several shapefiles at once.

I suspect that the error comes from something about how I defined the parameters:

    inFileParam = arcpy.Parameter(
                             displayName="Input Feature",
                             name="in_feature",
                             datatype="GPFeatureLayer",
                             parameterType="Required",
                             direction="Input",
                             )

    indivName = arcpy.Parameter(
                             displayName="indivName",
                             name="indivName",
                             datatype="Field",
                             parameterType="Required",
                             direction="Input",
                             )
    indivName.parameterDependencies = [inFileParam.name]
    indivName.filter.list = ["Text"]

    dateField = arcpy.Parameter(
                             displayName="dateField",
                             name="dateField",
                             datatype="Field",
                             parameterType="Required",
                             direction="Input",
                             )
    dateField.parameterDependencies = [inFileParam.name]
    dateField.filter.list = ["Date"]

The indivName and dateField parameters are what gives the error when I click on the "check values" button in the batch window. Removing the filter seems to fix the error, but I would really like to have the filter. As I said above, it works just fine when I input them in a non-batch run of the tool. Also of note, this same problem has happened from pretty much every (but strangely not all) tools I have made.

As of now, my workaround is to modify the tool to explicitly code the field names when I need to do a batch run, but this is not ideal, since I am hoping to distribute this tool to other researchers.


texts: How can I add custom projections to the default spatial_ref_sys table in PostGIS?

texts:
The data I work with requires me to project between WGS84 (4326) and OSGB (27700), the default projection in PostGIS is using the older less accurate version of the projection.

I am trying to add both the OSTN02 and OSTN15 projections and have successfully added the .gsb files into

C:\Program Files\PostgreSQL\9.6\share\contrib\postgis-2.4\proj

and used

INSERT INTO "spatial_ref_sys" ("srid","auth_name","auth_srid","srtext","proj4text") VALUES (27715,'EPSG',27700,'PROJCS["OSGB 1936 / British National Grid",GEOGCS["OSGB 1936",DATUM["OSGB_1936",SPHEROID["Airy 1830",6377563.396,299.3249646,AUTHORITY["EPSG","7001"]],AUTHORITY["EPSG","6277"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4277"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",49],PARAMETER["central_meridian",-2],PARAMETER["scale_factor",0.9996012717],PARAMETER["false_easting",400000],PARAMETER["false_northing",-100000],AUTHORITY["EPSG","27700"],AXIS["Easting",EAST],AXIS["Northing",NORTH]]','+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +units=m +no_defs +nadgrids=OSTN15_NTv2_OSGBtoETRS.gsb ');

to create the new entry in the spatial_ref_sys table with a custom 'srid' number.

All of this works fine and I can see the difference in projections in QGIS.

However what I would like to do is have these projections available as default on new PostGIS extended databases? I tried entering the projects into the spatial_ref_sys.sql file but this doesn't seem to make a difference? Is there a way to do this?