texts: What GIS applications and services have been affected by the Heartbleed vulnerability?

texts:
Heartbleed is the name given to a recent, very severe security vulnerability in the OpenSSL library, used in a large number of websites and applications. It is being called one of the worst computer security vulnerabilities in recent history. Even StackExchange was vulnerable as of April 8th (since resolved according to this answer).

You can read more about it in these Security.SE questions:

How exactly does the OpenSSL TLS heartbeat (Heartbleed) exploit work?
What should a website operator do about the Heartbleed OpenSSL exploit?
What clients are proven to be vulnerable to Heartbleed?

What GIS applications and services have been affected by this vulnerability?

Link to any official statements by the application maintainers about the vulnerability and/or how to resolve it.

Note to moderators: Please mark this question and answers as community wiki, as this is more of a PSA than a Q&A.


texts: Difference between Table of Contents (TOC) and Legend in ArcGIS Viewer for Flex?

texts:
I have been using the ArcGIS Viewer for Flex for quite a while. I couldn't help noticing there were still two widgets, one for Table of Contents (TOC) and the other for Legend.

It looks to me TOC is a layer tree with checkboxes but no icons, while legend is a layer tree with icons but no checkbox.

What's the difference between TOC and legend in a web mapping app or anywhere?

Web apps certainly can do both. GeoPDF allows you to toggle layers.

Unless you want to print a map out, personally I don't see a reason that those two are separated.

For those who see significant differences, please take a look at the screenshots on my blog (The site doesn't allow me add an image because I am new?!). Or maybe try a custom widget on FlexViewer 2.2 for a clickable legend or a TOC with layer icons. And since search rules all nowadays, it allows you to search layers across services by keyword.

Then tell me if you still see they are two or one.


texts: OpenLayers: transfer from custom projection to map projection

texts:
I am building a web application with OpenLayers that contains a map that allows insert, edit and remove points, my map is now using “EPSG:4326" projection.

I have shapefiles and xlsx files that contain polygons and points that I need to insert as layer in the map.  The problem is that the shapefiles use EPSG:2309 projection, this is Israel tm grid projection that OpenLayers doesn't recognize.

How do I transfer these points/polygons to the EPSG:4326 projection?

I found this: http://spatialreference.org/ref/epsg/2039/html/
But I don't know if its can be helpful, or how...


texts: Identifying layers by grouping using ArcPy

texts:
I have a number of layers that I want to manipulate with ArcPy. On my ArcGIS Pro map I have them under a group layer.
To deal with them, I have been picking them by name as follows:
for theLayer in theMaps.listLayers():
    # print (theLayer.name)
    if theLayer.supports("ISFEATURELAYER"):
        if theLayer.isFeatureLayer and theLayer.name[:10] == "....":

but I'm wondering if I cannot just reference them by group?
Parsing the name creates an admin overhead to rename the sources first.
Something like
if theLayer.belongsToGroupLayer("MyGroupLayerName"):

or
if theLayer.parentlayer == "MyGroupLayerName":

The Layer class documentation does not offer any solution to this.


texts: Updating from and to junctions for the road segments in ArcGIS 10.4

texts: I have road line and junction point with me, I would like to know how to update the from and to junction ids to the road segment based on the road digitization direction.


texts: Alternative to gdal2tiles MapTiler for tiling a GTiff

texts:
Right now I am trying to tile a GTiff into tiles to be used for e.g. Leaflet (so Mercator).

I played around with MapTiler and gdal2tiles. I am not entirely happy with both. Gdal2Tiles seems to pixelate the tiles, when I compare them to the tif. MapTiler cannot read the tif (I removed a band, MapTiler does not like that - also I want to be able to run the thing on a server, without GUI).

I also heard about TileMill, but TileMill seems to be deprecated.

So, I was wondering if there is any suitable alternative for tiling a GTiff?

BTW: the approach should be capable to tile a GeoTIFF with world-wide coverage.


texts: How can I get my GPS track data into a graphics program?

texts:
I'm using a Garmin Edge 705 bike GPS/computer unit, which produces .gpx files. I can use the standard software it comes with to plot on Google Maps etc, but I'd like to be able to output just a vector polyline for use in Adobe Illustrator.

Any ideas? I'm guessing .svg is going to be the best format, and I could use Inkscape or similar if that makes it any easier.

Sorry, other projects are taking up my time but I will try the suggestions out as soon as I can.


texts: Extract intersecting polygon from multipolygon search

texts:
I'm using the latest SQL Server and trying to build a query where i can search a database of spatial data and find the intersecting polygon.

The problem is that the spatial data can be of multipolygon type, and I would like to be able to return only the intersecting polygon inside it's geometry, not the entire thing.  Is this possible? Simple example below:

DECLARE @searchLoc geometry
SET @searchLoc = geometry::Point(@LON, @LAT, @SRID)

SELECT LocationName, <intersectingPoly?>
FROM dbo.LocationTable
WHERE LocationTable.LocGeometry.STIntersects(@searchLoc) = 1


texts: Error importing shapefile into postgreSQL using shp2psql?

texts:
I've tried this a few different ways and keep getting the same error.
I have a shapefile currently in WGS84 UTM Zone 15 which is SRID 32615.

I used the ArcMap multipart to singlepart tool to create a singlepart polygon.
I followed the instructions found at http://postgis.net/windows_downloads
to install postgresql and postgis.

I open pgAdmin III and select the postgis_21_sample table.
Plugins > PostGIS Shapefile and DBF Loader 21.

I check connection details and it connects fine.  I add my .shp file.
I set Schema to public and Table to postgis_21_sample.
I leave geo column alone and set SRID to 3265.

When I click import I get

==============================
Importing with configuration: postgis_21_sample, public, geom, C:\GIS\forest_buffer\postgres_single.shp, mode=c, dump=1, simple=0, geography=0, index=1, shape=1, srid=3265
Shapefile type: Polygon
PostGIS type: MULTIPOLYGON[2]
Failed SQL begins: "SET CLIENT_ENCODING TO UTF8;
SET STANDARD_CONFORMING_STRINGS TO ON;
BEGIN;
CREATE TABLE "public"."postgis_21_sample" (gid serial,
"shape_leng" numeric,
"shape_area" numeric,
"orig_fid" int4);
ALTER TABLE "public"."postgis_21_sample" ADD PRIMARY KEY (gid);"
Failed in pgui_exec(): ERROR:  function addgeometrycolumn(unknown, unknown, unknown, unknown, unknown, integer) does not exist
LINE 9: SELECT AddGeometryColumn('public','postgis_21_sample','geom'...
               ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

Shapefile import failed.

I've also tried projecting this shapefile to WGS84 with SRID 4326 and receive the same error.

There are >100,000 features and I need to buffer, dissolve, negative buffer, and finally buffer back to the original size to fill gaps.  ArcMap and QGIS fail to do it after days of waiting.


texts: Best method to georeference oblique photographs?

texts: I have a series of oblique photos taken from an airplane of oyster beds that need to be mapped.  Does anyone have any tips on georeferencing oblique images?  I have access to ArcGIS and ENVI.


texts: Is it possible to draw an attribute to a segment?

texts:
I have a project that consists of creating a route in order to help cyclists know which route is best.
The objective is to create a route manually that tells the rider the safety zones (by color), the type of route (by the type of line), the inclination (symbolism arrow) and the parallel paths (color of the margin).
How do I associate a segment with an attribute, for example the security attribute (x = security). Assign a scale of 1 to 5 and whenever the value is 1 it changes the color to red and whenever it is 5 it changes to green.


texts: Derive WGS84 Longitude & Latitude from British Northings & Eastings

texts: I'm looking for a fairly simple way to append columns with  WGS84 longitude and latitude to a table containing northings and eastings.  The source data is Ordnance Survey's CodePoint Open, which I is I think OSBGB36.  I want to use this with OpenStreetMap.  I have the CodePoint data in a csv file and loaded into an MS Access database, from which I can load it into QGIS.  From there I've tried exporting it with a transform operation into various file formats but this doesn't seem to do the trick.  I do have access to PostGIS and SQL Server 08R2 but little experience of using sql spatial.


texts: Load and display a large number of points using openlayers

texts:
I am using OpenLayers.Layer.Vector to load and display KML files.
Some of the KML files have a large number of points in them (lets say around 20,000).
I am surprised they load at all (in chrome), but it unfortunately does take too long.

Would there be any way to speed it up (for example, parse the KML in parts).


texts: How do I create zones using location features?

texts:
I have a list of rock art sites with a recording of every image within each site. For example, Site 1 has 4 kudu, 1 lion, 3 males and a locust; Site 2 has 2 leopards, 1 elephant and 3 giraffes; Site 3 etc etc. I have about 177 sites all with different attributes.

What I would like to do is create a map that generates a 'region' for each image type. So for example I want to circle all of the sites that have elephants painted in them and create an 'elephant zone'. I then want to do this for each attribute (image type) and see whether I can identify different painting traditions across the region.

I also want to measure where the greatest density of sites is.

Lastly, I want to calculate where the greatest diversity of image types exists. Some sites have only a few types where as others have more than 15 and I would like to know if these larger sites cluster somewhere or not.

Thanks for the help.


texts: Why do no Labels appear on .pdf output from ArcPy when turned on in Layout?

texts:
Do labels needed to be coded into an arcpy script in order to be visible on an arcpy .pdf output? In ArcGIS the labels are visible for various features, but when I use the arcpy script (either in IDLE or in ArcGIS directly) only certain labels appear. I've checked the Label manager and verified the expressions (i.e. making sure they're visible at a large scale (1:1000) but everything looks ok). Interestingly, it's only the labels for the features that are run through the script that don't appear. Any thoughts would be much appreciated

Edit:
I've checked to make sure the layers are visible

Two things that are additionally weird: 1)  every time I run the code I get a slightly different result, i.e. some with label, some without, and 2) although the code is producing the right number of individual .pdfs, they are all for the same record, i.e. there are 17 .pdfs produced for 17 records, but each one is the same (I know this last part is likely considered a second question, but something tells me they're related).

Here's the full code:

mxd = arcpy.mapping.MapDocument("C:\\temp\\Graffiti_DM3.mxd")
df = arcpy.mapping.ListDataFrames(mxd, "*")[0]
graffitilyr=arcpy.mapping.ListLayers(mxd, "*", df)[0]

newquery = '"Incident_Z" =' + "'10003'"
graffitilyr.definitionQuery=newquery
features = arcpy.SearchCursor(graffitilyr)
count = 1

print "let's get started"
for feature in features:
        df.rotation = "0"
        arcpy.SelectLayerByAttribute_management(graffitilyr, "NEW_SELECTION", "FID=" + str(count))
        #df.extent = graffitilyr.getSelectedExtent(True)
        df.zoomToSelectedFeatures()
        df.scale = df.scale * .004
        arcpy.RefreshActiveView()
        df.panToExtent(graffitilyr.getSelectedExtent())
        #df.scale = "1000"
        outpdf="C:\\temp\\" + str(count) + ".pdf"
        arcpy.mapping.ExportToPDF(mxd,outpdf)
        count = count+1


texts: Converting QGIS expression into Excel function

texts:
In QGIS I use this expression to build a "ID" from fields:

rpad(concat("abt", coalesce("u_abt",'X'),"beeinh"),5,'0') || '-Z01'

I need to translate this expression into a Excel or Calc function. How can I perform it?


texts: Creating raster based on 'count' of certain property in 8 underlying rasters

texts:
I need to build a raster based on 8 raster layers.

Data in these 8 layers are divided into 3 classes, (1) K (values 1-1.5), (2) V (values 2-4) and (3) Z (values 5-12). The new raster is raster K, and for each cell I want to count how many times K occurs in the corresponding cell in the rasters below (later, I want to do the same for V and Z). The number of cells belong to this class should be the cell value in the new raster.

It is not my goal to add the values, just count how many cells belong to a certain class.

I have been searching in the ArcToolbox, but I cannot seem to find a tool that does this. Can anyone help me? I am very unfamiliar with scripting.

I am using Using ArcGIS 10.2.1


texts: Differences between OSM data and MapQuest OSM data?

texts:
I currently have an OSM "stack" server (Postgres/PostGIS, Mapnik, OpensLayers) working in a development environment, with almost all the South America countries loaded on the database. Since the applications I'm targeting uses geocoding extensively, I made a test deployment of Nominatim.

While testing, I discovered that almost all searches on Buenos Aires (where my company resides) didn't return a "house number" or something like the "between numbers" of Google Maps. The official Nominatim site didn't return that data neither. But, using the Nominatim service of MapQuest, there is always a house number on the returned XML.

Since MapQuest theoretically  use the same data and tools, why they can show that information?

Are they using another source of spatial data?

Lot of posts says that OSM currently doesn’t have much "house numbers" loaded. Indeed, here in Buenos Aires, a very few streets have house numbers on it.

In OpenStreeMaps.org, if I enter this:

  750 lavalle, ciudad autonoma de buenos aires, argentina

... and click in the first suggested option, the viewer shows the correct street, but the place mark is on the "first number" of the street, probably the first point in the street polyline, ignoring the number, and all different numbers point to the same place mark. If I use Nominating in OSM, all numbers point to the same lat/lon also.

In MapQuest, if I enter the exactly same address, the map shows the correct street, and the place mark is in the correct location of the number 750. I don't know if they are interpolating, but the mark is quite correctly placed. And altering the number, the place mark goes to the correct position too.

If MapQuest uses OSM data, how can MapQuest do that?


texts: Controlling page count increment of Data Driven Pages using ArcPy?

texts:
I was wondering if there is a way to add coding to Data Driven Pages with python.

I would like to be able to take the "Data Driven Page with Count" and increment the count by one or in some cases two.

For example, I have 10 data driven pages and need to add two more pages to the series i.e.  making the final count 12 pages.


texts: Extract maximum pixel value vertex from a raster for a given grid cell without altering the position of the source location in QGIS

texts:
I have a 0.5 X 0.5 metre resolution raster. I would like to extract the maximum value points from the raster for every 2 metre square cell. And the extracted points should be in the centre of the source pixel.

In the shown example, the vertex point 18 should be extracted which is the maximum value within the 2m x 2m. And the position of the vertex point 18 should not be altered. I tried this using resampling tool and then extracting the vertices, but this puts the extracted value in the middle of the 2m x 2m cell.


texts: Turn Off the Query Ability at the Service Layer Level

texts: I have a service with three layers that I publish to our Enterprise 10.6.1, from ArcMap 10.6.1. I know that when I publish the service from my MXD, I can check/uncheck the box in the Mapping Capabilities window. But this will turn it off for all layers, correct? I would like to turn it off for one layer and leave it on for the other two in the service. Am I able to do that, either at the MXD level or at the Portal Manager/ArcGIS Server Administrator Directory level?


texts: Off-screen canvas rendering technique in Leaflet

texts:
I'm looking for an open source implementation of the off-screen canvas technique in Leaflet.  This technique is useful to speed rendering of many thousands of like images to an HTML5 Canvas: The image is drawn once to a canvas object that is not part of the HTML document, and then copied (as a bitmap) repeatedly to the visible canvas.

Here's an excerpt from Dense canvas, offscreen (@ckrahe) on CodePen:

_offscreen = document.createElement("canvas");
_otx = _offscreen.getContext("2d");
_otx.arc(CIRCLE_RADIUS, CIRCLE_RADIUS, CIRCLE_RADIUS, 0, (2*Math.PI));
_otx.fillStyle = "#0000ff";
_otx.fill();
...
_ctx.drawImage(_offscreen, (x - CIRCLE_RADIUS), (y - CIRCLE_RADIUS));

This canvas app (i.e. non-Leaflet) draws 50,000 circles in a fraction of the time than the naive approach draws 1,000 (where each arc is rendered and styled individually).

Consider this admittedly-contrived Leaflet 1.2 example (it randomly generates 50,000 L.CircleMarkers). Each time the map moves, the 'moveend' event triggers internal Leaflet calls to Canvas._updatePaths. The supporting method, _updateCircle, invokes 'arc' directly to the visible canvas.

_updateCircle: function (layer) {

    if (!this._drawing || layer._empty()) { return; }

    var p = layer._point,
        ctx = this._ctx,
        r = layer._radius,
        s = (layer._radiusY || r) / r;

    this._drawnLayers[layer._leaflet_id] = layer;

    if (s !== 1) {
        ctx.save();
        ctx.scale(1, s);
    }

    ctx.beginPath();
    ctx.arc(p.x, p.y / s, r, 0, Math.PI * 2, false);

    if (s !== 1) {
        ctx.restore();
    }

    this._fillStroke(ctx, layer);
},

Clearly each L.CircleMarker has its own Options object reference and, possibly, style.  But it's at least conceivable that a plugin could, perhaps with a hint, detect like layers and optimize their drawing.

Thoughts?


texts: Import shapefile to PostGIS using Python and OGR?

texts:
I am not able to import a shapefile to PostGIS using the same library (OGR). I am using below link but it gives me error.
Import shp to Postgis using Python and ogr

Error:

Traceback (most recent call last):

File "C:/Users/n/.qgis2/python/plugins\Importtool\Import_tool.py", line 223, in select_output_file_5

layer = shapefile.GetLayer(0)

AttributeError: 'NoneType' object has no attribute 'GetLayer'


texts: TIFF somewhat does not match with a shapefile

texts: Two layers, one .shp and a NDVI image (from the MODIS, exported it in TIFF format from envi), have the same geographic coordinate system (GCS_WGS_1984), but they are not overlapping 100% in ArcGIS. The data frame in WGS 84, UTM Zone 36 N. As you can see, these layers are shifted relative to each other (a little bit).


texts: Why don't public organizations support Web Mercator EPSG 3857 for WMS?

texts:
Given that Web Mercator is the defacto standard for web mapping and all basemaps (Google, ESRI, Mapbox) are based on this coordinate system..

Why do many organizations e.g. NOAA not publish their WMS with support for Web Mercator ?

For example, this WMS https://idpgis.ncep.noaa.gov/arcgis/services/NWS_Forecasts_Guidance_Warnings/watch_warn_adv/MapServer/WMSServer?request=GetCapabilities&service=WMS

only supports EPSG 4326 (WGS84) and 4269 (NAD83).

To get this service to overly with a Web Mercator basemap, the service needs to be re-projected on-the-fly, something that only seems possible with desktop GIS tools.

My understanding is that adding support for additional coordinate systems is simply a matter of adding them to the list when the service is published.

Is this really such a burden/consumer of resources to do ?


texts: Google maps, download entire province/region from google maps

texts:
Is there a way to download a region from Google maps to a PDF or JPEG file? I would like to download as many zoom levels as possible so I can zoom in and out without being online. I need this for practical reasons when I will be traveling to remote China and I need detailed maps of certain provinces/counties.I will be browsing these maps on an iPod touch.

I only need the street information, so only the "map" part of gmaps.


texts: Inputing minimum X, maximum X, minimum Y, and maximum Y to create bounding box feature using ArcPy

texts:
How do I create a bounding box of Hawaii.shp using the minimum X, maximum X, minimum Y, and maximum Y and store it in a polygon shapefile?
xmin: 372236.642923
xmax: 941120.123667
ymin: 2094769.12138
ymax: 2458884.21017

import arcpy
arcpy.env.workspace = r"F:\Labs\Original\Lab8\Lab08"

fc = "newpolygon.shp"
arcpy.CreateFeatureclass_management(arcpy.env.workspace,fc,"Polygon")
array = arcpy.Array()
coordinates =
for x,y in coordinates:
    point = arcpy.Point()
    array.add(point)
polygon=arcpy.Polygon(array)
cursor = arcpy.da.InsertCursor(fc,["SHAPE@"])
cursor.insertRow([polygon])

print "Done"
del cursor


texts: QGIS Python - Error: Algorithm not found

texts:
Trying using the processing toolbox in a standalone python script the needed Algorithm could not be found:

Error: Algorithm not found

Error in sys.excepthook:
Traceback (most recent call last):
  File "/Applications/QGIS.app/Contents/Resources/python/qgis/utils.py", line 196, in qgis_excepthook
    showException(type, value, tb, None, messagebar=True)
  File "/Applications/QGIS.app/Contents/Resources/python/qgis/utils.py", line 107, in showException
    open_stack_dialog(type, value, tb, msg)
  File "/Applications/QGIS.app/Contents/Resources/python/qgis/utils.py", line 142, in open_stack_dialog
    iface.messageBar().popWidget()
AttributeError: 'NoneType' object has no attribute 'messageBar'

Original exception was:
Traceback (most recent call last):
  File "test_standalone_copy.py", line 33, in <module>
    outputs_QGISINTERSECTION_1=processing.runalg('qgis:intersection', outputs_QGISFIELDCALCULATOR_1['OUTPUT_LAYER'],polygon,False,None)
TypeError: 'NoneType' object has no attribute '__getitem__'

I tried already the solution in Error: Algorithm not found (QGIS) but unfortunately it didn't worked...

This is my script

import sys
sys.path.append('/Applications/QGIS.app/Contents/Resources/python')
sys.path.append('/Applications/QGIS.app/Contents/Resources/python/plugins')
sys.path.append('/Applications/QGIS.app/Contents/Resources/python/plugins/processing')

import qgis
from qgis.core import *

import json, requests
import processing
# supply path to qgis install location
QgsApplication.setPrefixPath(r"/Applications/QGIS.app/Contents/MacOS", False)
# create a reference to the QgsApplication, setting the # second argument to False disables the GUI
qgs = QgsApplication([], False)
# load providers
qgs.initQgis()

# test set of coordinates
geometry_decode = [(-0.125037,51.5307), (-0.12763,51.5338), (-0.128062,51.5344), (-0.128236,51.5346), (-0.128305,51.5347), (-0.128377,51.5348), (-0.128438,51.5349)]
geometry = [QgsPoint(point[1],point[0]) for point in geometry_decode]

line = QgsGeometry.fromPolyline(geometry)

route = QgsVectorLayer("LineString?crs=epsg:4326&index=yes","route","memory")
pr = route.dataProvider()

route.startEditing()

feature = QgsFeature()
feature.setGeometry(line)

route.addFeatures([feature])
route.commitChanges()
QgsMapLayerRegistry.instance().addMapLayer(route)

filepath_polygon ='ne_50m_admin_0_sovereignty.shp'
polygon = QgsVectorLayer(filepath_polygon,"countries","ogr")

outputs_QGISFIELDCALCULATOR_1=processing.runalg('qgis:fieldcalculator',route,'tot_length',0,10.0,3.0,True,'$length',None)
outputs_QGISINTERSECTION_1=processing.runalg('qgis:intersection', outputs_QGISFIELDCALCULATOR_1['OUTPUT_LAYER'],polygon,False,None)

# Write your code here to load some layers, use processing algorithms, etc.
# When your script is complete, call exitQgis() to remove the provider and # layer registries from memory
qgs.exitQgis()


texts: I'm working with Corine Land Cover Map 2012 in QGIS. I can't find any information about the color code. Values range from 0 to 255 but there's no indication which value stands for which land cover type.


texts: How to publish ECW images to ArcGIS Server?

texts:
When I am going to publish mxd (containging image.ecw) to ArcGIS Server, the following error appears:

  Confiquration image.ecw. MapServer can not be started. Server Object
  instance creation failed on machine.

What should I do to resolve this error?


texts: QGIS: Converting a QVariantlist from a GeoJSON to a List with some prefix removed

texts:
I have some problem seeming to converting a QVariantList from a GeoJSON file to a list in a new shapefile.
Every time I just do the expression "Column" and just put the type of data as List in the Refactor Fields algorithm.
The data vanishes, in other words it becomes completly empty (not even the NULL is Showing).
There is one exception for one pecular column. You see there is a column with a kind of prefix so to remove that prefix from some thing like "Type1:Type1a:Actual value" to "Actual Value" I did this formula.
 CASE WHEN "references"  IS NOT NULL THEN
string_to_array("references" ,':')[2]
ELSE
NULL
END

Problem is it only will keep the first record in the list
I want to have all the values here because the reference column is a link column. There are three columns being in Qvariantlist, only the column references contains a prefix I want to have removed all the rest does not need a prefix removal.

Edit: 5/07/2020:
The Sollution provided by Thomas is putting me in the right direction the formula .
array_to_string("Field",',') does make sure I truly get the data back as a string but even  though I select the data to be a list in my refactor fields I still cannot set as a list in my arribute forms.

Allso to note that the formula that the formula Thomas had provided cause my field to go empty. If I do array_to_string alone it is fine but as soon as I do his, formula to remove the prefix of something like this:
Pipe:AWeVe:P7224741f-fa8f-4503-8b04-4f654ca294f1,Pipe:AWeVe:P8e69091d-cc9c-436a-8357-a3e85eb8495
Or TelecommunicationsCable:InfraDEFRegio5:43565,TelecommunicationsCable:InfraDEFRegio5:4357

To:
P7224741f-fa8f-4503-8b04-4f654ca294f1,P8e69091d-cc9c-436a-8357-a3e85eb8495
    Or
43565,4357

What needs to removed in EACH value is the substring that goes to the second ':' mark.
EDIT 2: Let me be clear here that in the references column in the screenshot that sometimes in that you Columns there is only one value in the list.


texts: PostGIS - Get a point inside a line or polygon

texts:
I need to get the center point of a line or polygon to make marker for my app. So that when you click a marker the geometry appears (line or polygon). I used ST_Centroid to make it work.

The result is what I expected unnest some polygons or lines whichs centroids are out of the geometry. What i would like for those lines or polygons is to get the "most center point" but inside the geometry.

How can I do this? Is there a solution?


texts: Get a coordinate system from raster file

texts:
I am writing a code to loop through all the files in a folder and reproject them, using a raster as the spatial reference. I have a suspicion that there is a different way to get the coordinate system from a raster. This is my code so far:

#Import system modules
import arcpy
import os

#Set environment
arcpy.env.workspace = "D:/Project/Joined"
arcpy.env.overwriteOutput = True

#Get list of files in Joined folder
fileList = arcpy.ListFeatureClasses()
print fileList

#Set raster as basis for coordinate system
base = "D:/Project/Data/Development.tif"
base2 = arcpy.Describe(base)
out_coor_system = arcpy.SpatialReference(base2)

#Loop through shapefiles in fileList and reproject
for fc in fileList:
    outName = fc + '_rprj.shp'
    new = arcpy.Project_management(fc, outName, out_coor_system)

This is the error I am receiving:

File "D:/Project/Data/Reproject.py", line 16, in <module>
    out_coor_system = arcpy.SpatialReference(base2)
  File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy\arcobjects\mixins.py", line 949, in __init__
    self._arc_object.createFromFile(item)
RuntimeError: ERROR 999999: Error executing function.

From what I've read, this is a pretty generic error for Python IDLE to throw.

I made the code print out out_coor_system and I am getting: <geoprocessing spatial reference object object at 0x0D2CE830> printed out to me. Could this be the problem?

I also wanted to add that the projection I am trying to use is a custom one that my organization uses. I don't know if that's relevant (it seems it shouldn't be) but I wanted to throw that in.


texts: Seeking Uruguay or South America DEM or DTM?

texts:
Is there any DEM (Digital Elevation Model) or DTM (Digital Terrain Model) for Uruguay or South America?

I am aware of the Renare for Uruguay.


texts: Creating Spatial Index for Geopackage using QGIS?

texts: Working in QGIS 2.18.14 standalone on Windows, is there a way to create a Spatial Index for Geopackage (gpkg) layers?


texts: Calculating median of all pixels of all layers of raster stack in ArcGIS for Desktop?

texts:
I have a stack of 15 layers and I need to calculate the median of all the pixels of all the layers.

How can i do so in ArcGIS?

I tried zonal statistics but it only calculates the median among pixels in one layer.

I also tried Cell Statistics but then it calculates the median of every single pixel trough time.

I need to consider all the values of all the pixels of all the layers together and calculate the median of that distribution.


texts: Text Annotation not appearing in Print Composer

texts:
I am trying to print a map made in an earlier version of QGIS, but now the text annotations are not appearing in the print composer.  "Draw map canvas items" is checked on.  Am I missing something else perhaps?  I've tried in both version 2.14 and 2.18 (running on a Mac with Sierra).

Here is the map in the main project window:

Here is the map in the print composer:

At this point I'm wondering if anyone else can confirm that this is just my problem and not a bug. Can anyone else on a Mac confirm that text annotations look normal in a print composer? They printed fine a year ago (the last time I worked in QGIS). I now have a new computer and downloaded the latest version of the software. I've tried creating entirely new projects to isolate the problem, but text annotations won't print in any of them.


texts: ArcGIS 10 IGPFunction2 and IGPFunctionFactory Implementation

texts:
I'm creating a custom ArcToolbox tool in C# .NET in ArcGIS 10 SP2.  Though I seem to be having two issues which maybe related:

Firstly, my tool is run as a background task i.e. the GP dialog does not show, instead the progress bar displays on ArcMap's status bar.  Can I get the GP progress pop up dialog to display instead when my GP tool is executed?

Secondly,  I want to use IGPUtilities3:AddToMap or IGPUtilities3:GetMap() in the execute method of the GPFunction class but neither work.  Either my dataset doesn't get added or GetMap() return null.  If I check the InApplication or CanAddToMap properties they return false.  I'm just doing a IGPUtilities3 utils = new GPUtilitiesClass.

I guess it hasn't tied into the ArcMap application but how do I fix this in a GPFunction class?

Thanks


texts: Point to point distance over specified distance

texts:
I need to calculate the distance between neighbouring points which conform to a staggered line.

I have two point datasets, one being the baseline and another the monitor. The points typically reside ontop of each other within a few metres. I need highlight the ones that fall outside a specified range.

The specification is that one point must have a neighbouring point no further than +/- 9m away from it within 1km sections. The average cannot be over 12m as well. So I need to calculate the distance to its closest neighbour and output this into tabular form thus highlighting where the second feature is out of 'spec' with an appropriate colour. It is likely that only a few will be out over many 1000's.

Any help appreciated.


texts: No layers after exporting ArcScene scene to 2D

texts:
For one project I am working with ArcScene 10.5.1 for the 3D-visualisation of some points in space and now I encounter one problem I can't go around: the export of the scene to 2D contains no layers and the outcome is only one unique image! There is no matter, if it is exported as .PDF or .AI, the outcome is the same - one raster image without layers. I went through all the export parameters, made different changes, but it didn't help. The problem is that I need to process the model in the Adobe Illustrator and to adjust the size of the points, because the exported ones are too small-sized, whatever the size is given in the ArcScene. My project has only few polygons, few lines and two thousand points. And there are no raster data at all, what could explain the problem if it would be the case.
Notable that there is no problem to export the scene into .pdf with separate layers in ArcMAp using the same shape-files. Does anyone encounter the same problem or does anyone know how to solve the problem? In the forum I found only 8 years old post with the same issue, but it seems it was not solved.


texts:
I recently started working on ArcMap.
I want to make some changes to the edit tools.

For example I want to prevent the user from using the sketch tool when the time is between 1pm and 2pm

But I don't know where to start.
If anyone has a simple example I would appreciate it.


texts: ExportMap in OpenLayers not finding canvas property in layers

texts:
I am trying to follow this example to export map to canvas:

http://dev.openlayers.org/sandbox/camptocamp/canvas/openlayers/examples/exportMapCanvas.html

But, it is failing at this line (ExportMap.js):
this.canvasContext.drawImage(layerCanvas, 0, 0, this.canvas.width, this.canvas.height);

None of the layers seem to have a canvas property (layer.canvas).  Does anyone know how to put the canvas property on the layers?

Update #1
I noticed that the canvas property is always undefined:

if (layer.canvas !== null)
        {
            this.drawLayer(layer.canvas);
        }

Also the layer.useCanvas is also undefined even though the layer has the value set to:

useCanvas: OpenLayers.Layer.Grid.ONECANVASPERLAYER

CODE:

// Setup tiled base layer
            baseLayer = new OpenLayers.Layer.WMS(
                "sf:layer01",
                "http://server01:8080/geoserver/sf/wms",
                {
                    "LAYERS": 'sf:layer01',
                    "STYLES": '',
                    TRANSPARENT: 'true',
                    format: 'image/png'
                },
                {
                    visibility: true,
                    buffer: 0,
                    displayOutsideMaxExtent: true,
                    isBaseLayer: true,
                    yx: { 'EPSG:4326': false },
                    useCanvas: OpenLayers.Layer.Grid.ONECANVASPERLAYER,
                    renderers: ["Canvas"]
                }
            );


texts: GRASS GIS tools cannot perform on QGIS 3.6 Noosa

texts:
I am a fresh-hand to QGIS 3.6 Noosa. When I want to use GRASS GIS tools like r.recode, r.cost and so on, I am confronted with error information like this:

  The specified GRASS 7 folder 'C:\OSGEO4~1\bin\bin' does not contain a
  valid set of GRASS 7 modules. Please, go to the Processing settings
  dialog, and check that the GRASS 7 folder is correctly configured.

I've checked the processing settings but still cannot find solution to this.

What should I do?


texts:
When starting up QGIS 3.2.2 (also tested with 3.2.3), I get the following message in the "Plugins" Log Message Window:

2018-10-18T08:03:48     WARNING    Failed to load C:/OSGEO4~1/apps/qgis/plugins/grassplugin7.dll (Reason: Cannot load library C:\OSGEO4~1\apps\qgis\plugins\grassplugin7.dll: Das angegebene Modul wurde nicht gefunden.)
2018-10-18T08:03:48     WARNING    Failed to load C:/OSGEO4~1/apps/qgis/plugins/grassprovider7.dll (Reason: Cannot load library C:\OSGEO4~1\apps\qgis\plugins\grassprovider7.dll: Das angegebene Modul wurde nicht gefunden.)
2018-10-18T08:03:48     WARNING    Failed to load C:/OSGEO4~1/apps/qgis/plugins/grassrasterprovider7.dll (Reason: Cannot load library C:\OSGEO4~1\apps\qgis\plugins\grassrasterprovider7.dll: Das angegebene Modul wurde nicht gefunden.)
2018-10-18T08:03:48     INFO    Loaded mmqgis (package: mmqgis)
2018-10-18T08:03:50     INFO    Loaded Networks (package: networks)
2018-10-18T08:03:50     INFO    Loaded QuickOSM (package: QuickOSM)
2018-10-18T08:03:52     INFO    Loaded QuickMapServices (package: quick_map_services)
2018-10-18T08:03:52     INFO    Loaded DB Manager (package: db_manager)
2018-10-18T08:03:52     INFO    Loaded MetaSearch Catalog Client (package: MetaSearch)
2018-10-18T08:03:54     INFO    Loaded Processing (package: processing)

And sure enough, I cannot use the GRASS GIS Plugins. I also have QGIS 2.18.24 installed, the plugins are fully available there. Any idea what the issue might be?

EDIT:

I also tested with OSGeo4W Network Installer (64 bit), with the same result. Also note that grassplugin7.dll, grassprovider7.dll and grassrasterprovider7.dll are available in the folder C:\OSGeo4W64\apps\qgis\plugins

EDIT 2:

Here are my MSVC++ Versions


texts: Searching for LANDSAT for the state of New Mexico

texts:
I am looking for a website that allows me to download free LANDSAT for all of the State of New Mexico. I need them to perform my work on RUSLE and need LANDSAT for c factor.
Does anyone suggest of a good website ? The one I have download is the GLCF: Earth Science Data Interface from the University of Maryland. I have some LANDSAT 2006 that covers the southern new mexico.

Anyone have a suggest? Thank you.


texts:
Using ST_Contains in where clause sometimes gives me error messages like

ERROR:  GEOSContains: TopologyException: side location conflict at 37.3706 55.7882

For now I can't guarantee validity for every geometry in DB, using third-party import tools, so I just catch every exception:

CREATE OR REPLACE FUNCTION safe_st_contains(geom1 geometry, geom2 geometry)
  RETURNS BOOL AS
  $$
  BEGIN
    RETURN ST_Contains($1, $2);
    EXCEPTION WHEN others THEN
      RAISE NOTICE 'TopologyException'; -- this is a guess
      RETURN FALSE;
  END;
  $$
LANGUAGE plpgsql;

I'd like to know where exceptions like TopologyException really belong and which exception conditions should I use instead of OTHERS ?


texts: Running ArcPy function CADToGeodatabase() crashes ArcMap/ArcCatalog?

texts:
My code:

    import arcpy, csv
    from arcpy import env

    dgnfile = str(arcpy.GetParameterAsText(0))
    outFeatureClass = str(arcpy.GetParameterAsText(1))  #the fc in my fgdb template to be  populated by data read from the dgn
    i = 0
    while outFeatureClass[i:i+4] <> ".gdb": i+=1
      inFeatureClass = outFeatureClass[:i+4]
      CADdataset = "GD_Temp"
      refscale = "1000"
      arcpy.CADToGeodatabase_conversion(dgnfile,inFeatureClass,CADdataset,refscale)

This is my code which crashes out.
I am able to read geometry out of a CAD dataset which has been created in ArcCatalog manually, and populate an existing FC in my FGDB. But the dgn-to-CADdataset part crashed. When I placed my first question I ASSUMED the CADToGeodatabase routine would work. Is it a simple Python code error? ESRI are their usual helpful self.
By the way, I've omitted the code which subsequently reads the output from CADToGeodatabase().

Following is what I am feeding into CADToGeodatabase routine, as quoted from PythonWin debug session (...=intevening folders):

argument 1:  'C:\GeneralWorkData\...\9202.dgn'
argument 2:  'C:\GeneralWorkData\...\GD_9202_ED5031N_FGDB_Pop.gdb'
argument 3:  'GD_Temp'
argument 4:  '1000'

It is supposed to create a new feature dataset in the .gdb, which is what I am trying to achieve here.

The Sample Code you mentioned is the method I am using for my work, but it crashes ArcMap/ArcCatalog/PythonWin Debug, with no (helpful) error message. These are the right argument formats according to Resource Centre Help for ArcGIS 10.0!

Don't want to look at "Interoperability"(?) right now, as I have code which works to read out of the CADToGeodatabase results so it would mean starting all over again. In other words, I can import dgn data by hand in Catalog then read that data in Python and put it where I like, so the second half of the Python project is done, now I need the first. I posted originally prematurely, didn't know this would crash, apologies again. Is there any chance someone could try this routine with real dgn data, cos I am thinking we are looking at an ESRI bug...?


texts:
I'm trying to create a label in the QGIS composer which automatically displays the Composer name (or window name may do the same thing).

For example, I can display the project filename by using @project_filename but I cannot determine how to display the composer name.


texts: Subset and sort a SpatialPolygonsDataFrame object by one variable

texts:
I took a sample of a spatial polygon dataframe with 2256 elements using:

valdata <- ref_10[sample(ref_10@data$ID, length(ref_10)/3),]

now I would like to sort my new spatial dataframe by my ID-colum and always get this error message:

  valdata[sort(valdata@data$ID),]

  Error in valdata[sort(valdata@data$ID), ] : cannot get a slot
  ("Polygons") from an object of type "NULL"


texts: Convert MODIS mod021km hdf file to geotif using specific band

texts:
I need to convert some bands of "mod021km" or "myd021km" files to geotif images (bands like: red,green, blue, nir ,...).

I used pymodis ==> modis_convert.py script but there is a problem!

When i select a subdataset, for example "EV_500_Aggr1km_RefSB" that it has 5 bands, as a result, I get a .TIF file with just one band!!! When I need a tif file for each band or one file with 5 bands.
I found out that pymodis uses gdal.ReprojectImage to convert image from HDF to Geotiff. i also found the code below in order to reproject hdf files:

from osgeo import gdal
import numpy as np

def hdf_subdataset_extraction(hdf_file, dst_dir, subdataset):
    """unpack a single subdataset from a HDF5 container and write to GeoTiff"""
    # open the dataset
    hdf_ds = gdal.Open(hdf_file, gdal.GA_ReadOnly)
    band_ds = gdal.Open(hdf_ds.GetSubDatasets()[subdataset][0], gdal.GA_ReadOnly)

    # read into numpy array
    band_array = band_ds.ReadAsArray().astype(np.int16)

    # convert no_data values
    band_array[band_array == -28672] = -32768

    # build output path
    band_path = os.path.join(dst_dir, os.path.basename(os.path.splitext(hdf_file)[0]) +
    "-sd" + str(subdataset+1) + ".tif")

    # write raster
    out_ds = gdal.GetDriverByName('GTiff').Create(band_path,
                                              band_ds.RasterXSize,
                                              band_ds.RasterYSize,
                                              1,  #Number of bands
                                              gdal.GDT_Int16,
                                              ['COMPRESS=LZW', 'TILED=YES'])
    out_ds.SetGeoTransform(band_ds.GetGeoTransform())
    out_ds.SetProjection(band_ds.GetProjection())
    out_ds.GetRasterBand(1).WriteArray(band_array)
    out_ds.GetRasterBand(1).SetNoDataValue(-32768)

    out_ds = None  #close dataset to write to disc

One of the parameters of defining out_ds by gdal.GetDriverByName. Create is 1 (described as #number of bands). i changed it from 1 to 5 (number of subdataset bands) in modis_convert.py script and i get a .TIF file with 5 bands as a result. but i don't know that everything is correctly done or not! can anyone help me please.


texts: Is it possible to create a custom marker from a vector image?

texts:
I am relatively new to QGIS and I am working on an application based on PyQGIS. Right now, I am working on a kind of GPS which gets a set of points and returns the route  between these points as a rubberband.  For the starting and end point I am using 2 crosses which are QgsVertexMarkers. Although it's difficult to see them here's an example:

I would like these markers to be not a cross but rather the usual pin you can find at a GPS application:

But I can't find a way to define my own marker as vector image. Is it possible to do so?


texts: Problem with interpolation of 3D points in GRASS

texts:
I have a sample of 3D points (x,y,z) with tepmerature attribute. I can import my data as a 3D vector map. I want to create a volume of voxels by using v.vol.rst. When I use this module, this error happens
WARNING: strip exists with insufficient data
Processing all selected output files will require 0 bytes of disk space for temp files

can somebody help me how to solve this problem?

Thanks


texts: Calculating the minimal distance to the nearest polygon for multipolygons in different crs

texts:
I'm currently working on 31 different multipolygon shapefiles for which I need to generate a minimal distance to the nearest polygon "ANPs" (which is a multipolygon itself). I haven't been able to do it easily. I have had to modify the crs of the "ANPs" shapefile and disband the multipolygons in order to obtain individual polygons and then finding the closest neighbor and calculate minimal distance for it.
In the picture, you can see some of the 31 polygon shapefiles and the centroids of the "ANPs" shapefile. For each district, I want to generate the minimal distance for the closest blue dot.

I haven't been able to come up with an iterative/loop function to do this code automatically, but here is what I have came up with for:
`st_crs(ANPs)    #returns, "MEXICO_ITRF_2008"
 st_crs(DISTAgs) #returns, "WGS 84 / UTM zone 13N"

 ANPs_84=st_transform(ANPs, 32613)  #transforms to WGS 84 to UTM zone 13 N.

 ANPs= st_cast(ANPs_84,  "POLYGON") #disbanding to polygons.
 DISTAgs=st_cast(DISTAgs, "POLYGON")

 ##disbanding ANPs results in the following error message.
 ##In st_cast.sf(ANPs, "POLYGON") :
 ## repeating attributes for all sub-geometries for which they may not be constant

 ANPsc=st_centroid(ANPs)            #calculating centroids.
 DISTAgsc=st_centroid(DISTAgs)

 st_nearest_feature(DISTAgsc, ANPsc) #nearest feature`

And that's as far as I got.
So,
Should I worry about the multiple polygons generated by st_cast? (I think not because they are labeled).
Is there an interative way to do this for all the other DISTx shapefiles?
Will this be to innacurate?
DISCLAIMER: I'm new to cartography, GIS and more or less to RStudio.


texts: How to perform a spatio-temporal query in attribute table?

texts:
I am not good at programming, so I would ask for your understanding concerning my question.

I have an attribute table that contains five columns which are: (Date, ID, Latitude, Longitude, Rainfall).
Rainfall for different periods of time (which are defined in column "Date") have been recorded in certain stations.
In the column "ID" is the ID of the station on which the recording has been made for a specific period of time.
Every station has a unique ID, but at the same location, rainfall has been recorded for different time periods. On the column "Rainfall" appears the amount of rain that was recorded on the specific time and the specific station.

My question is, how can I get the total rainfall in a certain station that has been recorded, using all the records in column "Date" that refer to that specific station. Could I somehow use the coordinates of its station to get the total rainfall that has occurred on that specific station?

The software I use is QGIS 2.4 on Windows machine.


texts: Trying to identify the program which created tab file in question

texts:
i am trying to identify format or the program which created following geo tiff and tab files.

Basically I am trying to update map images in our custom program which uses following tab format and tiff files and no way to contact original developer as he is no where to be found.

Following is content of one of the tab files:

!table
!version 300
!charset WindowsLatin1

Definition Table
File "1000001.TIF"
Type "RASTER"
(524448,182304) (0,6912) Label "Pt 1",
(524448,192672) (0,0) Label "Pt 2",
(534816,192672) (6912,0) Label "Pt 3",
(534816,182304) (6912,6912) Label "Pt 4"
CoordSys Earth Projection 8, 79, "m", -2, 49, 0.9996012717, 400000, -100000
Units "m"

If anyone can shed any light I would be very grateful.

Thanks in advance.


texts: QGIS Two people working on one shapefile at once?

texts:
Is it possible for two people to work on the same shapefile at the same time?

Atm we split the data into two shapes and merge them after editing (version 2.12), but we are looking for a more comfortable, easier way to handle this... Especially the style is important. In the 2.12 version loading label style is quiet tricky...


texts: QGIS 3.10 Layout Manager not printing Google Satellite background

texts:
I am trying to compose a layout with Google Satellite as background. I am trying to add such background both with XYZ tiles utility and with QuickMap Services plugin. In both cases the layer is visible on the map and in the layout, but if a save the layout as Image or pdf, I don't see Google Satellite. I see only a white backgound.
How can the issue be solved?


texts: Batch save symbols for each category of a layer as style in ArcGIS

texts:
I have a soiltype layer with 50+ categories and corresponding symbols. I need to save this symbols with the category as name in a *.style file.

Is there a way to batch save symbols for each category of a layer as style?

If you have got symbols having the same name like your categories in a *.style file, it enables you to import the symbols with Match to symbols. The advantage in opposition to importing the whole symbology of a layer is, that only categories which truly exist are imported with match to symbols. So you get a legend which only displays present categories no empty ones.

EDIT:

Additional to J.R.'s answer a screen shot of the tools location.


texts: Keeping no data values in clipped rasters

texts:
I am using QGIS and I have a raster layer with temperature values. The ocean has "no data" values, since I need only terrestrial information. I need to clip this image to retain only one part of the raster... I used the clipper tool, but the resulting clipped raster shows values of "0" in the ocean (instead of the original 'no data' values)... I can't convert 0 to 'no data' since my image contains 0 in the terrestrial portion that I need to keep...
Is there a way to keep no data values?


texts:
I have these 3 lines:

line1 <- matrix(c(-1.81209, -1.80470, -1.80616, 55.68024, 55.67947,
                    55.67544), ncol=2)
line2 <- matrix(c(-1.80468, -1.80330, -1.79690, 55.68322, 55.68017,
                  55.67800), ncol=2)
line3 <- matrix(c(-1.79798, -1.80069, -1.78929, 55.68364, 55.68138,
                  55.67966), ncol=2)

line1L <- Line(line1)
line2L <- Line(line2)
line3L <- Line(line3)
my.lines <- Lines(list(line1L, line2L, line3L), ID="my.lines")
myLines <- SpatialLines(list(my.lines))

proj4string(myLines) <- CRS("+proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0")
myLinesSpatial <- spTransform(myLines, CRS("+init=epsg:27700 +datum=WGS84"))

plot(myLinesSpatial)

I need to discard any part of any line, that falls within 100m of any other
line. This will result in segments of each of the three lines being removed.
How can I do this?


texts: Where do I find city/town point locations in US census data?

texts:
I'm generating RF propagation maps with Splat!. It can plot cities (as points) on its coverage map. It comes with a tool to import ASCII Arc/Info Ungenerate files. These used to be available from the US Census at this URL. Now the only data I can find available is either in Esri Shapefile format or KML format. I think I can convert these to the format needed by Splat!, however, these shapefiles define the boundaries of a place, not the point (lat, lon) where the place is located (i.e. the center of Portland, OR).

Where can I find census data for the point at which a city or town is located?


texts:
I have a drone software package that wants to output my data in CRS 32612.  QGIS seems to load and view it fine but when I extract contours from a DEM at this projection it tries to write the temporary layer to CRS 4326 which in theory would be fine but the contours are in outer space!  When I try to change the contour layer to CRS 26912 or 32612 they come back in view but are not overlaying the DEM.  (Miss by about 350m to the west.)  I assume this is because of the magnitude of the math projecting a UTM coord it thinks is UTM back to an actual UTM.
My question is does QGIS properly handle the 326## CRS projections or am I doing something else wrong?


texts: Displaying marker in polygon without converting polygons to points, while maintaining dynamic legend, and exporting map?

texts:
The following seems like a straightforward requirement because I recall ArcInfo Workstation having an ARCPLOT command called POLYGONMARKERS available to do the display part 20 years ago.

Yesterday I tried to display a marker inside every polygon visible within an extent using ArcGIS for Desktop 10.2.

Some options for trying to do this are described in an Ask A Cartographer posting and comments.

The option of converting polygons to points was eliminated because the point placement for a polygon partially inside the map might often fall outside of the map.

However, this workaround sounded promising (and coincided with the approach our client was using):

  You can of course symbolize polygons as points without changing the
  geometry type -- this is what you do when you use Graduated or
  Proportional Symbols (or even Charts) to render the polygon features.

  ... if you use the Graduated Symbol
  renderer and set the Symbol Size settings to be equal (e.g., from 4
  pts to 4 pts).

... so I gave it a try:

Start ArcMap 10.2 with a Blank Map (any ArcGIS 10.x version could probably be used)
Drag ...\ArcTutor\Editing\Zion.gdb\Research_areas (or any polygon shapefile/feature class) into the map so that it has one layer
Open the Layer Properties to the Symbology tab and show Quantities>Graduated symbols
Set the Value field to anything numeric - I chose AREA
Set Classes to 1 (anymore means multiple legend values - which I could work around by turning the legend into graphics)
Set Symbol sizes from 4 to 4 (as recommended)
Click on Template to open the Symbol Selector and choose Circle1 from the ESRI styleset (which sets it to 18pts by default)
The result looks great on screen ...

... but now try to use File | Print Preview (or Export Map) and I think you will see the markers go missing!

Local support have informed me that Esri

  have logged a new software bug: NIM095386 Graduated symbols with
  only one class do not print or export to PDF

Before I log an ArcGIS Idea to have this work (and in a more simple manner) in ArcGIS Pro, does anyone know an existing ArcGIS Idea or workaround (excluding those already eliminated above) to this issue?


texts: Multiple ComposerMap items not rendering properly Pyqgis

texts:
I am currently trying to put together compositions using inputs from two different map canvases. One is from a canvas built and controlled via a plugin, the other is the the main QGIS canvas (accessed via iface).

At this stage I am just playing around to try and figure out basic mechanics (no real attention to placements etc), and most code is modelled on the cookbook and other similar snippets

I am trying to do it by creating two QgsComposerMap objects (requires two QgsComposition objects initialised from each of the map canvases), then adding them both to one composition and rendering.

This method appears to work (I get a render of both sources on the same page, with size and position controlled by the QgsComposerMap settings), however one part renders horribly pixellated and blurry. It is always the the ComposerMap that doesnt have the 'pageRender' composition as the parent. The problem occurs regardless of scales, extents etc from what I have been able to test

render = canvas.mapSettings()
planrender = maincanvas.mapSettings()

#initialise composition
c = QgsComposition(render)
cp = QgsComposition(planrender)
#add section map item
x, y = 0, 0
w, h = c.paperWidth(), c.paperHeight()
composerMap = QgsComposerMap(c, x ,y, w, h)
c.addComposerMap(composerMap)

#add plan map item
x, y = 0, c.paperHeight()/2
w, h = c.paperWidth(), (c.paperHeight()/2)
composerMapPlan = QgsComposerMap(cp, x ,y, w, h)
composerMapPlan.setMapCanvas(maincanvas)
c.addComposerMap(composerMapPlan)

dpi = c.printResolution()
dpmm = dpi / 25.4
width = int(dpmm * c.paperWidth())
height = int(dpmm * c.paperHeight())

# create output image and initialize it
image = QImage(QtCore.QSize(width, height), QImage.Format_ARGB32)
image.setDotsPerMeterX(dpmm * 1000)
image.setDotsPerMeterY(dpmm * 1000)
image.fill(0)

# render the composition
imagePainter = QPainter(image)

c.renderPage(imagePainter,0)

#try with draw function
#sectsize = QtCore.QSizeF(width, (height/2))
#plansize = QtCore.QSizeF(width, (height/2))
#sectextent = canvas.extent()
#planextent = maincanvas.extent()

#composerMap.draw(imagePainter, sectextent, sectsize, dpi)
#composerMapPlan.draw(imagePainter, planextent, plansize, dpi)

imagePainter.end()

image.save("out.tiff", "tiff")

The commented out section is where i tried using the QgsComposerMap.draw(xxx)method, and this renders the objects correctly, however ignores the placement within the composition, and so draws the two maps over each other

Anyone got any ideas on what I'm doing wrong here or how to better approach the code?


texts: Setting Labels on Vector features in OpenLayers 5

texts:
I am following this very big example to set labels on the style of the vector but it's confusing.

The labels should be the Plot numbers, of each feature, which come from the JSON file.

Also i have seen this API. How can I get the data and display it?

new ol.style.Text({
  font: '12px Calibri,sans-serif',
  textBaseline: 'bottom',
  fill: new ol.style.Fill({
    color: 'rgba(0,0,0,1)'
  }),
  stroke: new ol.style.Stroke({
    color: 'rgba(255,255,255,1)',
    width: 3
  })
});

var style_simple = new ol.style.Style({
  fill: new ol.style.Fill({
    color: 'khaki'
  }),
   stroke: new ol.style.Stroke({
      color: 'blue',
      width: 2,
      opacity:1
    })
});

var vector = new ol.layer.Vector({
    source: new ol.source.Vector({
    url: 'JS/getjson.json',
    format: new ol.format.GeoJSON()
    }),style:style_simple
});

var map = new ol.Map({
  target: 'map',
  layers: [roadlayer,vector],
    controls: ol.control.defaults().extend([new ol.control.ScaleLine()]),
    view: new ol.View({
    center: ol.proj.fromLonLat([33.33386, 35.14710]),
    zoom: 14,
    maxZoom: 19
  })
});


texts: Applying proper conversion from True to Grid bearing

texts:
Assume that Grid North is 1.49 deg W of True North.

Also, the magnetic declination is 13.11 deg.

If I wanted to take gyroscopic surveys (measured from True North) and then convert them to Grid North, what values would be needed to do so correctly?

I've been told to add 1.49 deg to the True North measures to convert them to Grid North measures.

But, I've also been told the opposite, to subtract the 1.49 deg from the True North.

I've also been led to believe that since you are going from True to Grid (in a counterclockwise direction) you would therefore add the -1.49 deg.

Perhaps someone can better explain?


texts:
I have prepared an aggregated DiGraph using big data from a Spark Cluster. The resulting graph structure looks like this:
- Nodes are numbers (bus stop numbers) and have a 'pos' attribute with GPS coords.
- Edges are tuples as connections in between the nodes with attribute 'count', which are the number of passengers.

How can I import this networkx Graph G to qQIS for further analysis?

I tried exporting as shape file but get an error:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-58-6af13780765e> in <module>()
----> 1 nx.write_shp(G, 'output/shp')

~/.conda/envs/graph/lib/python3.6/site-packages/networkx/readwrite/nx_shp.py in write_shp(G, outdir)
    304     for n in G:
    305         data = G.nodes[n]
--> 306         g = netgeometry(n, data)
    307         attributes, nodes = create_attributes(data, node_fields, nodes)
    308         create_feature(g, nodes, attributes)

~/.conda/envs/graph/lib/python3.6/site-packages/networkx/readwrite/nx_shp.py in netgeometry(key, data)
    227         elif 'Wkt' in data:
    228             geom = ogr.CreateGeometryFromWkt(data['Wkt'])
--> 229         elif type(key[0]).__name__ == 'tuple':  # edge keys are packed tuples
    230             geom = ogr.Geometry(ogr.wkbLineString)
    231             _from, _to = key[0], key[1]

TypeError: 'int' object is not subscriptable


texts: How to give start and end vertex ids dynamically in pgr_dijkstra?

texts:
I am new to PostGIS and Postgresql. I am using pgrouting and pgr_dijkstra query. pgr_dijkstra requires a start vertex and an end vertex and produces the shortest path between that. How do I give these dynamically (i.e. no static value)? I have  columns of start ids and end ids. I have cluster number of each vertex. I need all the shortest paths between all combination of start and end provided that the start and end are not from same cluster. For example:

start_id     end_id
 1             2
 2             25
 5             12
 .             .
 .             . (and so on)

vertex id     cluster id
 1             A
 2             B
 5             C
 7             A
 25            C
 12            B
 .             .
 .             . (and so on)

So, I need all the shortest paths between 1 to 2, 1 to 25, 1 to 12 then between 2 to 25, 2 to 12 then 5 to 2, 5 to 25, 5 to 12 and so on if start and end are not from same cluster. And I will make a line (using st_makeline) by the vertices or nodes come as the pgr_dijkstra output. I have made the following query but unable to give the start id and end id dynamically with where clause.

select st_makeline(the_geom) from (SELECT edge.start_geom as the_geom FROM public.edge_table_with_limits edge INNER JOIN (SELECT node
                                FROM pgr_dijkstra('SELECT gid AS id,
                                start_id AS source,
                                end_id AS target,
                                (distance*weight_d) AS cost,
                                (reverse_di*weight_d) AS reverse_cost
                                FROM edge_table_with_limits',....,....,TRUE)) route ON edge.start_id = route.node
    UNION SELECT edge.end_geom as the_geom FROM public.edge_table_with_limits edge INNER JOIN (SELECT node
                                FROM pgr_dijkstra('SELECT gid AS id,
                                start_id AS source,
                                end_id AS target,
                                (distance*weight_d) AS cost,
                                (reverse_di*weight_d) AS reverse_cost
                                FROM edge_table_with_limits',....,....,TRUE)) route ON edge.end_id = route.node) as subquery

In the above query, if I put any start id and end id as constant number in the  dotted blanks, this query is working fine. But, I need to do it dynamically.
Query for selecting start id and end id is almost following:

select start_id, end_id from public.edge_table_with_limits where start_cls is not end_cls

I know these queries are needed to be changed, but how to do it?


texts:
I am using QGIS 3.16.0 and I need to find the difference between two rasters that overlap in some areas (basically I need the areas that are not overlapped). First, I tried polygonizing the smaller raster so I extract the vector file obtained from the bigger raster, but the rasters are very big and polygonizing the smaller raster makes my computer to stop working since there are so many small polygons. I tried subtracting the smaller raster from the bigger one in raster calculator, but the result is the same as the second layer since the extent of both rasters are the same and both have only two values: 1 for where are trees and 0 for where there are not any tress. So using raster calculator will result in 0 for all areas.
How can I obtain the non overlapping areas of these two rasters?


texts: How can I make gdal2tiles tile layer smaller in size?

texts: I am making tile layers that expand a large portion of North America using gdal2tiles. The output of 1 tile layer can be around 20GB or more. Is there a way to reduce the size of the tiles?


texts: I am setting up an offline tile server. Does anyone know of something similar to OpenStreetMaps and/or Stamenmaps for terrain data that I can use with unfolding or other api?


texts: Why modelbuilder does not give the actual result?

texts:
I have 20 pairs of origin and destination. And, also I have 20 different line barriers for those pairs, as I want to determine the shortest path between them. If the name of the origin and destination is 100 then the name of the corresponding barrier is also 100. So, I build the model based upon the algorithm in previous study.
The model have a iterator that will select the pair of O-D and corresponding barrier one at a time, to find the shortest path between Origin and Destination. The problem is although there is a route between them, final output doesn't have shortest path for some O-D pairs. When I try to do it one by one, it works (i.e. shortest path for all of them is obtained easily). But, when I try to do it using model builder, only 6 out of 20 shortest path is obtained. The error I get is " No route from location 1 to location 2".

The main confusion is that the MODEL can solve the shortest path for 6 of them.(if there is problem it should have failed to solve any of them or if there was no any problem it should be able to solve all of them)

I know this might be confusing to those who havent faced this kind of problem before. Any ways if there is someone who can get through this problem, I would be grateful.

There is no any disconnectivity between the segments and no one way restrictions too.

EDITED NEW QUESTION: I added some of the road segments with all of its snapping options activated. But the route analysis fails to go through that node. Below is the snap of the Network Dataset. The highlighted segments are the newly added segments.


texts: Reclassifying Raster Value Classes based on pre-defined function using ArcGIS Spatial Analyst?

texts:
I have this distance raster (shown in the image below).

Is it possible to reclassify the distance values based on the description below-

For distance values 0-100 (new value decreases linearly from 10 to 1);
For distance values 100-200 (new value=1);
For distance values 200-500 (new value increases linearly from 1 to 10);
For distance >500 (new value=10)

The graph below shows the function.


texts: Why does it take longer and longer to export my maps as png in a loop?

texts:
And how can I improve my performance? I wrote a simple python script to export a few hundred maps:

Open a MXD, add a layer, apply a definition query, apply a symbology, export to PNG.

The definition query is in the loop. Everything else is always the same. And there are always 153 features selected in the FC. In the first three minutes between 10 and 20 pngs are produced. After that only 2. How can I prevent this and improve the performence? There are hundreds of pngs waiting.

import arcpy,os

field1 = "Field1"
mxd = r"X:\GIS\test.mxd"
mxd2 = arcpy.mapping.MapDocument(mxd)
df = arcpy.mapping.ListDataFrames(mxd2)[0]
shp = r"X:\GIS\TestGDB\test"
dbf = r"X:\GIS\testdata.dbf"
elementlist = ["value1","value2",...] #here are a few hundret elements in the list
seasonlist = ["spring","summer","autumn","winter"]
for element in elementlist:
    for index,season in enumerate(seasonlist):#[0:1]:
        where_clause = '"%s" = %s' % (str(field1),str("'"+element+"'"))

        layer = shp.split(os.sep)[-1]
        layername = layer
        arcpy.MakeFeatureLayer_management(shp,layername)
        layer = arcpy.mapping.Layer(layer)
        layer.name = layername + "_" + season

        layer2 = arcpy.mapping.TableView(dbf)
        layername2 = layer2.name + "_" + season

        layer2.definitionQuery = where_clause

        arcpy.mapping.AddTableView(df,layer2)
        arcpy.AddJoin_management(layer,in_field,layer2,join_field,"KEEP_ALL")

        expression = "!" + symbologyfield + "!"
        arcpy.CalculateField_management(layer,valuefield,expression,"PYTHON")

        arcpy.RemoveJoin_management(layer)
        #arcpy.UpdateLayer(df, update_layer, source_layer, {symbology_only})

        arcpy.ApplySymbologyFromLayer_management(layer,layerfile)
        arcpy.mapping.AddLayer(df,layer,"TOP")

        layer.visible = True

        for element2 in arcpy.mapping.ListLayoutElements(mxd2,"TEXT_ELEMENT"):
            if element2.name == textfield1:
                element2.text = str(element)
            if element2.name == textfield2:
                element2.text = str(season)

        arcpy.RefreshActiveView()
        arcpy.RefreshTOC()

        arcpy.mapping.ExportToPNG(mxd2, output + os.sep + str(element) + "_" + str(season) + r".png",resolution=printresulution)


texts:
Using OpenLayers, I want to display multiple markers over an OSM map by creating them from an array within a while loop.

The code works when I hard-code a single coordinate, but not when reading the coordinates from the array.

What can be done to construct the markers?

JSFiddle: http://jsfiddle.net/qmxrtnfo/9/

You can test it via:

ol.proj.fromLonLat([lonlatarray[i]])
//  ol.proj.fromLonLat([16.332253, 48.503684])


texts: Downloading Map tiles from Mapbox or OpenStreetMap?

texts:
I am trying an offline Map application in which I need to show a map up to some zooming level.

I thought that I would download tiles and put it locally.

How can Map tiles can be downloaded from Mapbox or OpenStreetMap?


texts: PyQGIS Temporal Controller current moment

texts:
I have a QGIS Project with Temporal Controller, in Python Console. How could I capture the current moment of the simulation?

I'm trying, but doesn't work
canvas = iface.mapCanvas()
temporal= canvas.temporalController().currentFrameNumber ()


texts: How to save postgres table to kml without losing attributes using python

texts:
I am saving the postgres table loaded in QGIS to kml.

qgis.core.QgsVectorFileWriter.writeAsVectorFormat(aLayer, myFile, "ogr", projDest, "KML")

But the output file does not have the attributes. So if I want to convert/save the table into KML without losing attributes how can this be done using python.


texts: How to integrate set of neighboring pixels in raster dataset?

texts:
I generated peaks of tree crowns as an individual pixels from DSM dataset, but there are some trees that have more than 1 peaks. I would like to integrate them based on the threshold value, for example I want to integrate 2 or 3 neighboring pixels that lay in 1 square meters and create one in the middle. I know Integrate tool can do this for vector dataset, but if I convert peaks to vector and re-convert to raster, there is a change in raster dataset which affects further analysis.

Is there any  tool in ArcGIS similar to Integrate which works for raster dataset, or is there any tool to integrate neighboring pixels in any GIS software?


texts: Failed to Connect to database: Underlying database error occured

texts:
I'm trying to connect to a personal database in ArcGIS 10.2 that contains work that I've spent the last two weeks working on but I am now receiving an error:

Failed to connect to database. An underlying database error occurred. Unrecognized database format 'F:\streets.mdb'.

Operating system: Windows 7, Database type: personal, Parent Directory: Networked

I'm really hoping there is a solution to this problem. Any suggestions on how to overcome this issue?

EDIT
Just noticed there is an associated LDB file that is currently in the folder with the database. If I understand correctly an LDB file is some sort of lock that should disappear once you have closed the file you are working with. Could this be the source of the issue?


texts: Overlay Text Generated in Illustrator Over Map And Export to KML in QGIS

texts:
I have some text that I generated in Illustrator, outlined, and then exported to a DXF. I need to assign spatial data so that I can export that DXF from QGIS to KML with correct lat/lon coordinates. The exported KML will be imported into ground control software to create a multicopter flight plan. When finished, I should be able to fly along the outline of the text in the sky.

I grabbed a Shapefile from the US Census bureau so I have some reference to work with. When I import the DXF, for one, the scale is entirely incorrect.

For starters, how do I scale this? I'm not coming up with much help in the docs. I'm imagining the KML export should be straightforward once I manage getting the vector data imported and formatted correctly.


texts: Using the arcpy Python library with hosted feature service layers from ArcGIS Online?

texts:
Is it possible to use the arcpy library with hosted feature service layers from ArcGIS Online?

I am aware of the ArcGIS API for Python, but the API lacks many of arcpy's features.

In my case, I'd like to script populating a new field of a point layer with the layer's XY attributes (latitude and longitude). This is known as 'Calculate Geometry' in ArcMap and 'Add Geometry Attributes' in ArcGIS Pro.

I need this to be scripted, rather than done manually, because I am working with a layer that frequently has additional points added to it via Survey123. Survey123 does not automatically record the longitude and latitude of points added to it through its form, and again, the ArcGIS API for Python does not cover 'Calculate Geometry' to my knowledge. Finally, I would prefer not to download the ArcGIS Online layer, run arcpy scripts on it locally, then re-publish the layer, since this tends to reset symbology, field names, etc. - but if anyone who knows more about ArcGIS Online can help with this strategy, that could solve the problem as well.

The arcpy code would be something as simple as:

import arcpy
arcpy.env.workspace = <some file gdb>
arcpy.AddGeometryAttributes_management(<name of the layer as a string>, "POINT_X_Y_Z_M")

But in my case, instead of a feature class in file geodatabase stored locally, all I have is a hosted feature service. I've tried using the REST endpoint url as the workspace, but it doesn't seem to work. I've also tried extracting the feature layer itself via the ArcGIS API for Python, then using that in the arcpy code:

search_result = gis.content.search(query="<my layer name>", max_items=1, item_type="Feature Service")
# or search_result = gis.content.get(<item ID of my layer>)
item = search_result[0]
item_layers = item.layers
layer_fset = item_layers[0].query()
layer_features = layer_fset.features
layer_flayer = item_layers[0]

But that doesn't seem to work, either.
Either I'm missing something or perhaps it's not possible.


texts: Static map visualization of multiple categories/attributes in a point?

texts:
I have a point data with multiple categorical  values for each point location.  For example:

point1 = a,b
point2 = a
point3 = b,c
point4 = a,b,c,d,e
and so on

Note that the values are categorical/nominal, therefore, I cannot create some form of ranking among data points.  What map visualization options can I do with this type of data?


texts: Relating Polygons to Results in AngularJS & Leaflet

texts:
I am using Lealfet.draw tools for creating polygons and then fetching results from a database  based on the coordinates of those polygons. I want to be able to relate each polygon to it's corresponding result. Ideally if a user hovers over the result, the corresponding polygon should get highlighted. is there a leaflet functionality for doing such thing or any other alternative?

Map creation

 leafletData.getMap().then(function(map) {

            leafletData.getLayers().then(function(baselayers) {
                var drawnItems = baselayers.overlays.draw;

                map.on('draw:created', function(e) {

                    var layer = e.layer;

                    drawnItems.addLayer(layer);

                    console.log(JSON.stringify(layer.toGeoJSON()));
                    coordinates_selected = layer.toGeoJSON();

                });
            });
        });

fetching results and displaying it

function map(obj) {

            var o = obj.data.hits.hits;
            var b = [];
            for (var i in o) {
                o[i]._source.id = o[i]._source.compendium_id;
                try {
                    b.push(o[i]._source.metadata.o2r.spatial.union.features[0]);

                    {

                    }
                    throw error()
                } catch (g) {
                    console.error("missing spatial");
                }
            }
            $log.debug('mconfiging result: %o', o, b);
            angular.extend($scope, {
                geojson: {
                    data: b,
                    style: {
                        fillColor: "green",
                        weight: 2,
                        opacity: 1,
                        color: 'white',
                        dashArray: '3',
                        fillOpacity: 0.7
                    }
                }
            });

            return obj;
        }


texts: How to pass special characters to geoprocessing tool?

texts:
I have a geoprocessing service to create various tasks. So the paarmeters for JTXSteps.ExecuteGPTool are here
 /addjobcomment /url:"https://xyz/arcgis/rest/services/F2F_Workflow/Task/GPServer/CreateTask/submitJob?job_type_name=drafting&job_name=[JOB:NAME]&description=&owned_by=[JOB:OWNED_BY]&assigned_to=[JOBEX:WSP_TASK.DRAFTING_ROLE]&project_job_id=[JOB:PARENT_JOB]&initiator_job_id=[JOBEX:INITIATOR_JOB_ID]....&f=pjson"

I have a requirement now to pass this string !@#$%^&*()_+/;:"',.?][}{| as job name essentially to capture all possible special characters in other systems for project names. I have noticed '#' breaks the sequence of parameters and with '&' rest of the string for the Job_name gets ignored. The call to submit GP jobs are expected through workflows and parameters are being read from SQL server tables for subsequent tasks.


texts: Wrap the set of points to the minimum polygon

texts:
Given I have a set of points which represents the circles which are intersected.
As result I'm trying to receive the boundary which represent the polygon which wraps all circles.

Please take a look to the picture below.
The inner black dots should be completely ignored. As result I'm trying to receive the set of dots which marked with red line.


texts: Set QGIS (on android and/or linux) to use a custom .qgs file by default when opened.

texts: Need to have QGIS open with all my settings/layers/projections etc by default.  Created a .qgs file that has all this info in it.  Using Android and Ubuntu.  Tried a shortcut to the .qgs file in android and that didn't work.


texts: Rendering OSM with QGIS for MapServer to use in OpenLayers

texts:
I want to show tiles in OpenLayers offline.

I've installed QGIS 2.0, TileCache, and MapServer on Windows.

Enabled plugin OpenLayers in QGIS.

What kind of data I suppose to extract from QGIS with my own OSM file? And how can I done this process?

I'm new in this map things and I'm now so close I think.


texts: Problems while Text Label Rotation (angle field) in QGIS 3.8

texts:
I encountered a problem when exporting webmap using qgis2web.
It turned out not rendering the angle field set in the shapefile for those specific text labels (as Points). I used OpenLayers to export my webmap.  This is what it looks like after exporting to web:

I was expecting it exports how it was displayed in the original editing panel in QGIS:

Obviously, the rotation is gone, and the color setting is also gone.
If it can be set back manually, where should I alter the js code?


texts: Creating shapefile file with Fiona and GeoPandas?

texts:
I am trying to create a shapefile and a geojson using geopandas and fiona.

import fiona
import fiona.crs

...

geometry = [Point(xy) for xy in zip(df['longitude'],df['latitude'])]
crs = {'init': 'epsg:4326'}
gdf = GeoDataFrame(df, crs=crs, geometry=geometry)

some more stuffs and finally:

gdf.to_file('localization/shapefiles/localizaciones.shp', driver='ESRI Shapefile')

but the .prj file is in blank. Then the projection is wrong.

I am writing  the content of the the .prj file after the file is created in blank, but the crs problems still in progress either in geojson file or gpx files. No crs is created


texts: Arcpy CalculateField not working on ArcGIS Server 10.0

texts:
I'm working on ArcGIS 10.0 sp5.
I have a very strange behaviour. In an arcpy script I have these two very simple commands, to add a field "ID_UDF" to a table and then fill it with a value:

arcpy.AddField_management(table, "ID_UDF", "LONG", "", "", "", "", "NULLABLE", "NON_REQUIRED", "")
arcpy.CalculateField_management(table, "ID_UDF", '{0}'.format(ID_UDF), "VB", "")

The script is contained in a Toolbox.
If I execute the script with ArcGIS Desktop it works fine and the field ID_UDF is correctly added and filled with the value.
If I publish the Toolbox with ArcGIS Server and I execute it from there the field is added but not filled, it remains with a NULL value.

In both cases in the Geoprocessing log I have no errors, and both commands (AddField and CalculateField) are successfully executed.

Even if I remove the AddField command (supposingly the field is already created), CalculateField alone is working correctly with ArcGIS Desktop but not with ArcGIS Server. In the script there are many other commands that work fine on both environments.

Any ideas?


texts: Where can I download free or open access census datasets for China, including their respective spatial boundaries?

texts:
I am interested in the equivalent of US Census Bureau open data and its relevant Tigerline spatial data, albeit for China. In Canada, we also have data released by Statistics Canada along with cartographic reference boundaries.

I should make it clear that I am having trouble navigating the Chinese National Bureau of Statistics website, http://www.stats.gov.cn/english/. It may be in fact that this website does not offer any free data, but it is located elsewhere?

Most importantly, I am looking for free/open data!


texts: How to fix QGIS Server internal server error when using shapefiles?

texts:
i read all the questions with 500 server error i could find on the net but nothing seems to solve my problem:

I installed qgis and all depending packages on a debian server.
The first REQUEST=GetCapabilities worked fine and i created a qgs project file in qgis desktop on my windows workstation.

Then i moved the project file + shapefiles to the cgi-bin directory and changed the permissions to do everything for everyone.

Calling REQUEST=GetCapabilities then gave me a nice output but no layers.

The problem was I forgot to change the path to the shp files. After changing it and retrying the REQUEST=GetCapabilities i got the 500 internal server error.

In apache log it only says "premature end of script headers: qgis_mapserv.fcgi" - nothing else. no missing libary.

To make sure it wasn't something with a specific shapefile i created a project with a single raster layer and a png file. I copied both to my cgi-bin folder again. And surprise. This is working. I get my raster image displayed

I also tried to put the shapefiles into my home directory and pointed the path in the project file there --> 500

tried absolute and relative pathes in project file --> 500

Any ideas why qgis desktop is working with my shapefiles but qgis server doesn't?


texts: How to identify, spatial references of two layers are same?

texts:
I have two layers.

Polygon layer
Polyline layer

Now I want to check if spatial references of these two layers are same. How can I achieve this ??

In spatial reference there are many property like NAME, LINEAR UNIT, FALSE_EASTING, CENTRAL_MERIDIAN etc , and these properties may vary in different projection systems as far as I know.

How can this be done in a better way?

I am using .NET technologies in arcMap


texts: Downloading feature class from ArcGIS Online web map?

texts:
I'm new to ArcGIS Online (or ArcGIS.com as they're calling it now), and I'm confused as to how data is organized, and how it is accessible. I created a new map, chose Add -> Create Editable Layer, and set up an editable layer open to the public for people to submit input. Now I want to download this feature class to my computer. The only option I know of is to go to "My Content" then download the entire web map as a map package, but when I open it up, it only has the basemap and not the editable layer.

Is it possible to download this data as an individual feature class (shapefile), or at all?


texts: What is the maximum number of overlays / layers that I can simultaneously load onto an online OpenLayers 4 / OSM map?


texts: ogr2ogr in Python results in non geometry

texts:
When I want to call ogr2ogr from Python, the given polygons are set to none.
I tried to call ogr2ogr by:
from subprocess import check_call, STDOUT
command = f"ogr2ogr -f GPKG -s_srs EPSG:25833 -t_srs EPSG:25833 {destination} GMLAS:{file_name} -oo REMOVE_UNUSED_LAYERS=YES"
check_call(command, stderr=STDOUT)

or by:
options = ["ogr2ogr", "-f", "GPKG", "-s_srs",  "EPSG:25833",  "-t_srs",  "EPSG:25833",  destination,
               f"GMLAS:{file_name}",  "-oo",  "REMOVE_UNUSED_LAYERS=YES"

check_call(options, stderr=STDOUT)

Both shall convert a GML file (opened with GMLAS) driver to geopackage.
The conversion is done without an error, a) the file is too small and when I open the file (eg in QGIS) I see, that the shapes are set to NAN.
But it's seems not to be because of the command string. When I copy the command string and exicute it in the Terminal (eg. Terminal of Pycharm with the projects conda environment). The conversion is done properly.
How can I make sure, that this conversion is done correctly and everything is done exactly as I do, in the terminal?


texts: How to list the available GRASS modules in command line

texts:
Using GRASS shell, I know that I can use the -help suffix to get information about a particular module.

E.g. r.relief -help will return this:

Description:
 Creates shaded relief map from an elevation map (DEM).

Keywords:
 raster, elevation, relief, terrain, hillshade

Usage:
 r.relief input=name output=name [altitude=value] [azimuth=value]
   [zscale=value] [scale=value] [units=string] [--overwrite] [--help]
   [--verbose] [--quiet] [--ui]

Flags:
 --o   Allow output files to overwrite existing files
 --h   Print usage summary
 --v   Verbose module output
 --q   Quiet module output
 --ui  Force launching GUI dialog

Parameters:
     input   Name of input raster map
    output   Name for output shaded relief map
              Name for output raster map
  altitude   Altitude of the sun in degrees above the horizon
             options: 0-90
             default: 30
   azimuth   Azimuth of the sun in degrees to the east of north
             options: 0-360
             default: 270
    zscale   Factor for exaggerating relief
             default: 1
     scale   Scale factor for converting meters to elevation units
             default: 1
     units   Elevation units (overrides scale factor)
             options: intl,survey
              intl: international feet
              survey: survey feet

Therefore, it seems reasonable to me, that there must be a command to list all the available modules names. Is there? What?


texts: Network Analyst REST service gives error "Routing error: Unable to complete operation unable to find attribute invalid Context"

texts:
I have created an Network Analyst Routing sample. On Arcmap it works fine when creating a route on the data.

However, when I create Network Analyst service through ArcGIS Server, using this REST service Silverlight sample gives this error:

Routing error: Unable to complete operation unable to find attribute invalid Context

Any help please.


texts: Programmatically calculating the length of all polyline features in a featureclass

texts:
I've come across this issue a few times and have not yet found an agreed upon solution on any forum.

Simply put, I have a featureclass containing many polyline features. I would like to calculate the lengths of each feature and write that value to a new field, which I have already added to the featureclass.

I know that I can export the featureclass to a geodatabase and have the length calculated automatically, but that doesn't make much sense in terms of programmatic workflow. It seems like I might be missing something simple, but there are obviously others out there with the same unanswered question.

EDIT: I should have been more clear. I would like to carry this out using ArcObjects. The field calculator method that keeps coming up does not appear to work for this purpose.

EDIT 2: I've sorted out one method for doing this using ArcObjects. Solution/Code is below. Thanks for all the help and suggestions.

The following code assumes you are operating on IFeatureClass and have already added a field called "Length" to the existing FeatureClass (which contains a series of polyline Features). I have tested it on a shapefile containing about 300 polyline Features.

            Dim nLengthFieldIndex As Integer = pFCXS.FindField("Length")
            Debug.Assert(nLengthFieldIndex > -1)
            Dim dLength As Double
            If TypeOf pFC Is IFeatureClass Then
                Dim pFeatureCursor As IFeatureCursor
                pFeatureCursor = pFC.Search(Nothing, False)
                If TypeOf pFeatureCursor Is IFeatureCursor Then
                    Dim pFeature As IFeature = pFeatureCursor.NextFeature()
                    While pFeature IsNot Nothing
                        Dim pLine As IPolyline
                        pLine = pFeature.Shape
                        If TypeOf pLine Is IPolyline Then
                            dLength = pLine.Length
                            pFeature.Value(nLengthFieldIndex) = dLength
                            pFeature.Store()
                            pFeature = pFeatureCursor.NextFeature
                        End If
                    End While
                End If
                pFeatureCursor.Flush()
            End If


texts: How to distinguish installation of ArcView from ArcEditor?

texts:
How would I tell an installation of ArcView from ArcEditor, if looking at only the installed files? Specifically, how do I distinguish

ArcView 9.3 from ArcEditor 9.3
ArcView 10.0 from ArcEditor 10.0

For example, the file ArcSOC.exe indicates an installation of ArcGIS Server.


texts: When is it safe to use ObjectIDs as keys in a relationship class?

texts:
I've always avoided using ObjectIDs when defining relationship classes.  It is my understanding that some actions on a geodatabase will re-set objectIDs (like import/export).  However I do see a lot of people using them.

Am I just being paranoid, or are there cases when it is safe to use ObjectIDs when defining a relationship class?


texts: Using Spatial Analyst Geoprocessing functions in ArcObjects?

texts: I'm trying to run some geoprocessing functions in ArcObjects.  Some of the tools I want to use are part of the spatial analyst extension.  In 9.3.1 it was fairly straightforward to follow the documentation and execute geoprocessing tools in ArcObjects.  In ArcGIS it seems all the spatial analyst tools are only available through the arcpy.sa site package.  The tools still exist in the arctoolbox with a standard parameter for the output raster.  But all the documentation on the tools show the output as a raster object not a standard parameter.  When I try and execute the tool in ArcObjects it fails because it doesn't expect a return and as far as I can tell there is no parameter for the output raster.  Anyone trying to run spatial analyst geoprocessing tools from ArcObjects in 10?


texts: Joining averaged raster values to each feature using ArcGIS for Desktop?

texts:
I have precipitation data that I would like to average over each municipal unit in a boundary layer.  First, how do I average the rainfall spatially by each administrative unit?

Second, the rainfall values are not unique to each administrative unit, and so I am not sure how to join them to the attributes table of the admin boundary layer.  Although they will be unique once they are averaged, in the sense that there is one averaged value per administrative unit.  If this is true, which variable do I merge on? Do I need to create something new?

I am using the end result (an average rainfall value for each municipal unit) in STATA, hence the need to export the attribute table.  The program I'm using is ArcMap.


texts:
I have a website that is displaying a MapBox map, using Leaflet. One of the layers is generated from an Esri ArcGIS Rest interface, using Esri's Leaflet plugin: https://esri.github.io/esri-leaflet/

My current task is to allow the user to click on the map, and then to display information for nearby features in the ArcGIS layer. From reading the docs, Esri's L.esri.query object should be able to manage this.

My problem? L.esri.query is undefined.

Initially, I'd just been loading the v1.0 JS file:

<script src="//cdn.jsdelivr.net/leaflet.esri/1.0.0/esri-leaflet.js"></script>

When that didn't work, I tried loading the v2.0 JS file:

<script src="https://cdn.jsdelivr.net/leaflet.esri/2.0.0-beta.7/esri-leaflet.js"></script>

And when that didn't work, I included every plugin listed at https://esri.github.io/esri-leaflet/download/:

<script src="https://cdn.jsdelivr.net/leaflet.esri.clustered-feature-layer/2.0.0-beta.1/esri-leaflet-clustered-feature-layer.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/leaflet.esri.geocoder/2.0.2/esri-leaflet-geocoder.css">
<script src="https://cdn.jsdelivr.net/leaflet.esri.geocoder/2.0.2/esri-leaflet-geocoder.js"></script>
<script src="https://cdn.jsdelivr.net/leaflet.esri.renderers/2.0.1/esri-leaflet-renderers.js"></script>
<script src="https://cdn.jsdelivr.net/leaflet.esri.gp/2.0.2/esri-leaflet-gp.js"></script>

And still, nothing. So, the question, where is L.esri.query() defined?


texts: Intersection of points for overlapping polygons

texts:
I have the following intersection task:

I want to do an intersection of points and polygons. I want to add the variables of the polygons to the intersected points
Some of the points fall in more than one polygon. It is ok for the polygons to overlap since they are areas of influence.
As output, I would like to obtain the intersected points and the variables for all the polygons that intersect with them.
If 3 is not possible, I was thinking of duplicating the points that fall in more than one polygon and merge each of them with the information of the polygons.

How should I do this in ArcMap 10.3?
The image below illustrates this issue.


texts:
I have created a map with a simple marker at a specified location but I cannot figure out how to have an infowindow attached to the position open automatically on page load.

This is my init function:

//Lay out the required libraries
dojo.require("dijit.layout.BorderContainer");
dojo.require("dijit.layout.ContentPane");
dojo.require("dijit.TitlePane");
dojo.require("esri.map");
dojo.require("esri.dijit.Popup");
dojo.require("esri.symbol");
dojo.require("esri.dijit.BasemapGallery");
dojo.require("esri.arcgis.utils");
dojo.require("esri.dijit.Geocoder");

var map = null;
var gsvc = null;
var pt = null;

function init() {

    esri.config.defaults.geometryService = new esri.tasks.GeometryService("http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer");

    // create the map
    map = new esri.Map("map", {
        basemap: "topo", //Possibilities: "streets" , "satellite" , "hybrid", "topo", "gray", "oceans", "national-geographic", "osm"
        center: [@Model.Longitude.ToString(), @Model.Latitude.ToString()], //long, lat (Middle of the USA)2140164826
        zoom: 11,
        logo: false
    });

    //add the basemap gallery
    var basemapGallery = new esri.dijit.BasemapGallery({
        showArcGISBasemaps: true,
        map: map
    }, "basemapGallery");

    basemapGallery.startup();

    var Geocoder = new esri.dijit.Geocoder({
        map: map
    }, dojo.byId("search"));

    Geocoder.startup();

    dojo.connect(basemapGallery, "onError", function (msg) {
        console.log(msg)
    });

    dojo.connect(map, "onClick", projectToLatLong);

    var point = new esri.geometry.Point(@Model.Longitude, @Model.Latitude);
    point = esri.geometry.geographicToWebMercator(point);
    var symbol = new esri.symbol.SimpleMarkerSymbol().setColor(new dojo.Color([255, 0, 0, 0.5]));
    var graphic = new esri.Graphic(point, symbol);
    var layer = new esri.layers.GraphicsLayer();

    layer.add(graphic);
    map.addLayer(layer);
}


texts: Publishing layer Package tool as a geoprocessing service

texts:
I am trying to build a small application (silverlight based) that would allow creation of layer package based on an area of interest. I have identified a GP tool that does this. The tool is located in Data Management Tools > Package section. I have a model that allows user input as parameters. The issue that I am having is that it takes multiple layers as input and It doesn't allow me to set the datatype as Featureset. AFAIK, to be able to publish this as service, it needs to be feature set NOT feature layer.

I am looking for some input if someone had any suggestions on how to publish this as a GP service OR if there are any other options to do this. Being a system script, I don't have access to the script.

Thanks
Jay


texts: In QGIS, how to control the rendering order of objects in a single layer with rule-based symbology?

texts:
In QGIS 2.18, I have a symbology of points in a layer based on rules.
I want to control the rendering order of the layer in QGIS, with on top the type with the lower counts.

Intuitively I would expect to observe a rendering order modification by drag-droping the types, but this does not occur. A related question is of no help.

As you can see on the image I have tried using the "control features rendering order" but without success.

How could I do?