title: osm2pgsql loses connection at end of import for large PBF, north-america-latest.osm.pbf

text: I just wanted to check and see if anybody else out there encountered this issue before I started diving into the code. I'm using osm2pgsql to import OSM data into my Postgres database. I encounter the following exception at what seems like the end of the process: **Server side log:**               LOG:  could not receive data from client: No connection could be made because the target machine actively refused it.               CONTEXT:  COPY planet_osm_polygon, line 162     STATEMENT:  COPY planet_osm_polygon (osm_id,"access","addr:housename","addr:housenumber","addr:interpolation","admin_level","aerialway","aeroway","amenity","area","barrier","bicycle","brand","bridge","boundary","building","construction","covered","culvert","cutting","denomination","disused","embankment","foot","generator:source","harbour","highway","historic","horse","intermittent","junction","landuse","layer","leisure","lock","man_made","military","motorcar","name","natural","office","oneway","operator","place","population","power","power_source","public_transport","railway","ref","religion","route","service","shop","sport","surface","toll","tourism","tower:type","tracktype","tunnel","water","waterway","wetland","width","wood","z_order","way_area",tags,way) FROM STDIN     LOG:  could not receive data from client: No connection could be made because the target machine actively refused it.               CONTEXT:  COPY planet_osm_roads, line 145     STATEMENT:  COPY planet_osm_roads (osm_id,"access","addr:housename","addr:housenumber","addr:interpolation","admin_level","aerialway","aeroway","amenity","area","barrier","bicycle","brand","bridge","boundary","building","construction","covered","culvert","cutting","denomination","disused","embankment","foot","generator:source","harbour","highway","historic","horse","intermittent","junction","landuse","layer","leisure","lock","man_made","military","motorcar","name","natural","office","oneway","operator","place","population","power","power_source","public_transport","railway","ref","religion","route","service","shop","sport","surface","toll","tourism","tower:type","tracktype","tunnel","water","waterway","wetland","width","wood","z_order","way_area",tags,way) FROM STDIN     LOG:  incomplete message from client     CONTEXT:  COPY planet_osm_polygon, line 162     STATEMENT:  COPY planet_osm_polygon (osm_id,"access","addr:housename","addr:housenumber","addr:interpolation","admin_level","aerialway","aeroway","amenity","area","barrier","bicycle","brand","bridge","boundary","building","construction","covered","culvert","cutting","denomination","disused","embankment","foot","generator:source","harbour","highway","historic","horse","intermittent","junction","landuse","layer","leisure","lock","man_made","military","motorcar","name","natural","office","oneway","operator","place","population","power","power_source","public_transport","railway","ref","religion","route","service","shop","sport","surface","toll","tourism","tower:type","tracktype","tunnel","water","waterway","wetland","width","wood","z_order","way_area",tags,way) FROM STDIN     LOG:  incomplete message from client     CONTEXT:  COPY planet_osm_roads, line 145     STATEMENT:  COPY planet_osm_roads (osm_id,"access","addr:housename","addr:housenumber","addr:interpolation","admin_level","aerialway","aeroway","amenity","area","barrier","bicycle","brand","bridge","boundary","building","construction","covered","culvert","cutting","denomination","disused","embankment","foot","generator:source","harbour","highway","historic","horse","intermittent","junction","landuse","layer","leisure","lock","man_made","military","motorcar","name","natural","office","oneway","operator","place","population","power","power_source","public_transport","railway","ref","religion","route","service","shop","sport","surface","toll","tourism","tower:type","tracktype","tunnel","water","waterway","wetland","width","wood","z_order","way_area",tags,way) FROM STDIN     LOG:  could not receive data from client: No connection could be made because the target machine actively refused it.               CONTEXT:  COPY planet_osm_rels, line 171703     STATEMENT:  COPY planet_osm_rels FROM STDIN;          LOG:  could not receive data from client: No connection could be made because the target machine actively refused it.               CONTEXT:  COPY planet_osm_line, line 159     STATEMENT:  COPY planet_osm_line (osm_id,"access","addr:housename","addr:housenumber","addr:interpolation","admin_level","aerialway","aeroway","amenity","area","barrier","bicycle","brand","bridge","boundary","building","construction","covered","culvert","cutting","denomination","disused","embankment","foot","generator:source","harbour","highway","historic","horse","intermittent","junction","landuse","layer","leisure","lock","man_made","military","motorcar","name","natural","office","oneway","operator","place","population","power","power_source","public_transport","railway","ref","religion","route","service","shop","sport","surface","toll","tourism","tower:type","tracktype","tunnel","water","waterway","wetland","width","wood","z_order","way_area",tags,way) FROM STDIN     LOG:  incomplete message from client     CONTEXT:  COPY planet_osm_rels, line 171703     STATEMENT:  COPY planet_osm_rels FROM STDIN;          LOG:  could not receive data from client: No connection could be made because the target machine actively refused it.               CONTEXT:  COPY planet_osm_point, line 12884252     STATEMENT:  COPY planet_osm_point (osm_id,"access","addr:housename","addr:housenumber","addr:interpolation","admin_level","aerialway","aeroway","amenity","area","barrier","bicycle","brand","bridge","boundary","building","capital","construction","covered","culvert","cutting","denomination","disused","ele","embankment","foot","generator:source","harbour","highway","historic","horse","intermittent","junction","landuse","layer","leisure","lock","man_made","military","motorcar","name","natural","office","oneway","operator","place","poi","population","power","power_source","public_transport","railway","ref","religion","route","service","shop","sport","surface","toll","tourism","tower:type","tunnel","water","waterway","wetland","width","wood","z_order",tags,way) FROM STDIN     LOG:  incomplete message from client     CONTEXT:  COPY planet_osm_line, line 159     STATEMENT:  COPY planet_osm_line (osm_id,"access","addr:housename","addr:housenumber","addr:interpolation","admin_level","aerialway","aeroway","amenity","area","barrier","bicycle","brand","bridge","boundary","building","construction","covered","culvert","cutting","denomination","disused","embankment","foot","generator:source","harbour","highway","historic","horse","intermittent","junction","landuse","layer","leisure","lock","man_made","military","motorcar","name","natural","office","oneway","operator","place","population","power","power_source","public_transport","railway","ref","religion","route","service","shop","sport","surface","toll","tourism","tower:type","tracktype","tunnel","water","waterway","wetland","width","wood","z_order","way_area",tags,way) FROM STDIN     LOG:  incomplete message from client     CONTEXT:  COPY planet_osm_point, line 12884252     STATEMENT:  COPY planet_osm_point (osm_id,"access","addr:housename","addr:housenumber","addr:interpolation","admin_level","aerialway","aeroway","amenity","area","barrier","bicycle","brand","bridge","boundary","building","capital","construction","covered","culvert","cutting","denomination","disused","ele","embankment","foot","generator:source","harbour","highway","historic","horse","intermittent","junction","landuse","layer","leisure","lock","man_made","military","motorcar","name","natural","office","oneway","operator","place","poi","population","power","power_source","public_transport","railway","ref","religion","route","service","shop","sport","surface","toll","tourism","tower:type","tunnel","water","waterway","wetland","width","wood","z_order",tags,way) FROM STDIN     LOG:  could not receive data from client: No connection could be made because the target machine actively refused it.               LOG:  unexpected EOF on client connection with an open transaction     LOG:  could not receive data from client: No connection could be made because the target machine actively refused it.               LOG:  unexpected EOF on client connection with an open transaction     ERROR:  unexpected EOF on client connection with an open transaction     CONTEXT:  COPY planet_osm_rels, line 171703     STATEMENT:  COPY planet_osm_rels FROM STDIN;          ERROR:  unexpected EOF on client connection with an open transaction     CONTEXT:  COPY planet_osm_line, line 159     STATEMENT:  COPY planet_osm_line (osm_id,"access","addr:housename","addr:housenumber","addr:interpolation","admin_level","aerialway","aeroway","amenity","area","barrier","bicycle","brand","bridge","boundary","building","construction","covered","culvert","cutting","denomination","disused","embankment","foot","generator:source","harbour","highway","historic","horse","intermittent","junction","landuse","layer","leisure","lock","man_made","military","motorcar","name","natural","office","oneway","operator","place","population","power","power_source","public_transport","railway","ref","religion","route","service","shop","sport","surface","toll","tourism","tower:type","tracktype","tunnel","water","waterway","wetland","width","wood","z_order","way_area",tags,way) FROM STDIN     ERROR:  unexpected EOF on client connection with an open transaction     CONTEXT:  COPY planet_osm_roads, line 145     STATEMENT:  COPY planet_osm_roads (osm_id,"access","addr:housename","addr:housenumber","addr:interpolation","admin_level","aerialway","aeroway","amenity","area","barrier","bicycle","brand","bridge","boundary","building","construction","covered","culvert","cutting","denomination","disused","embankment","foot","generator:source","harbour","highway","historic","horse","intermittent","junction","landuse","layer","leisure","lock","man_made","military","motorcar","name","natural","office","oneway","operator","place","population","power","power_source","public_transport","railway","ref","religion","route","service","shop","sport","surface","toll","tourism","tower:type","tracktype","tunnel","water","waterway","wetland","width","wood","z_order","way_area",tags,way) FROM STDIN     LOG:  could not send data to client: No connection could be made because the target machine actively refused it.               STATEMENT:  COPY planet_osm_rels FROM STDIN;          LOG:  could not send data to client: No connection could be made because the target machine actively refused it.               STATEMENT:  COPY planet_osm_line (osm_id,"access","addr:housename","addr:housenumber","addr:interpolation","admin_level","aerialway","aeroway","amenity","area","barrier","bicycle","brand","bridge","boundary","building","construction","covered","culvert","cutting","denomination","disused","embankment","foot","generator:source","harbour","highway","historic","horse","intermittent","junction","landuse","layer","leisure","lock","man_made","military","motorcar","name","natural","office","oneway","operator","place","population","power","power_source","public_transport","railway","ref","religion","route","service","shop","sport","surface","toll","tourism","tower:type","tracktype","tunnel","water","waterway","wetland","width","wood","z_order","way_area",tags,way) FROM STDIN     LOG:  could not send data to client: No connection could be made because the target machine actively refused it.               STATEMENT:  COPY planet_osm_roads (osm_id,"access","addr:housename","addr:housenumber","addr:interpolation","admin_level","aerialway","aeroway","amenity","area","barrier","bicycle","brand","bridge","boundary","building","construction","covered","culvert","cutting","denomination","disused","embankment","foot","generator:source","harbour","highway","historic","horse","intermittent","junction","landuse","layer","leisure","lock","man_made","military","motorcar","name","natural","office","oneway","operator","place","population","power","power_source","public_transport","railway","ref","religion","route","service","shop","sport","surface","toll","tourism","tower:type","tracktype","tunnel","water","waterway","wetland","width","wood","z_order","way_area",tags,way) FROM STDIN     ERROR:  unexpected EOF on client connection with an open transaction     CONTEXT:  COPY planet_osm_polygon, line 162     STATEMENT:  COPY planet_osm_polygon (osm_id,"access","addr:housename","addr:housenumber","addr:interpolation","admin_level","aerialway","aeroway","amenity","area","barrier","bicycle","brand","bridge","boundary","building","construction","covered","culvert","cutting","denomination","disused","embankment","foot","generator:source","harbour","highway","historic","horse","intermittent","junction","landuse","layer","leisure","lock","man_made","military","motorcar","name","natural","office","oneway","operator","place","population","power","power_source","public_transport","railway","ref","religion","route","service","shop","sport","surface","toll","tourism","tower:type","tracktype","tunnel","water","waterway","wetland","width","wood","z_order","way_area",tags,way) FROM STDIN     LOG:  could not send data to client: No connection could be made because the target machine actively refused it.               STATEMENT:  COPY planet_osm_polygon (osm_id,"access","addr:housename","addr:housenumber","addr:interpolation","admin_level","aerialway","aeroway","amenity","area","barrier","bicycle","brand","bridge","boundary","building","construction","covered","culvert","cutting","denomination","disused","embankment","foot","generator:source","harbour","highway","historic","horse","intermittent","junction","landuse","layer","leisure","lock","man_made","military","motorcar","name","natural","office","oneway","operator","place","population","power","power_source","public_transport","railway","ref","religion","route","service","shop","sport","surface","toll","tourism","tower:type","tracktype","tunnel","water","waterway","wetland","width","wood","z_order","way_area",tags,way) FROM STDIN     ERROR:  unexpected EOF on client connection with an open transaction     CONTEXT:  COPY planet_osm_point, line 12884252     STATEMENT:  COPY planet_osm_point (osm_id,"access","addr:housename","addr:housenumber","addr:interpolation","admin_level","aerialway","aeroway","amenity","area","barrier","bicycle","brand","bridge","boundary","building","capital","construction","covered","culvert","cutting","denomination","disused","ele","embankment","foot","generator:source","harbour","highway","historic","horse","intermittent","junction","landuse","layer","leisure","lock","man_made","military","motorcar","name","natural","office","oneway","operator","place","poi","population","power","power_source","public_transport","railway","ref","religion","route","service","shop","sport","surface","toll","tourism","tower:type","tunnel","water","waterway","wetland","width","wood","z_order",tags,way) FROM STDIN     LOG:  could not send data to client: No connection could be made because the target machine actively refused it.               STATEMENT:  COPY planet_osm_point (osm_id,"access","addr:housename","addr:housenumber","addr:interpolation","admin_level","aerialway","aeroway","amenity","area","barrier","bicycle","brand","bridge","boundary","building","capital","construction","covered","culvert","cutting","denomination","disused","ele","embankment","foot","generator:source","harbour","highway","historic","horse","intermittent","junction","landuse","layer","leisure","lock","man_made","military","motorcar","name","natural","office","oneway","operator","place","poi","population","power","power_source","public_transport","railway","ref","religion","route","service","shop","sport","surface","toll","tourism","tower:type","tunnel","water","waterway","wetland","width","wood","z_order",tags,way) FROM STDIN     FATAL:  connection to client lost     FATAL:  connection to client lost     FATAL:  connection to client lost     LOG:  could not send data to client: No connection could be made because the target machine actively refused it.               FATAL:  connection to client lost     FATAL:  connection to client lost     FATAL:  connection to client lost      **Client side log:**               osm2pgsql SVN version 0.83.0 (64bit id space)          Using projection SRS 900913 (Spherical Mercator)     Setting up table: planet_osm_point     NOTICE:  table "planet_osm_point" does not exist, skipping     NOTICE:  table "planet_osm_point_tmp" does not exist, skipping     Setting up table: planet_osm_line     NOTICE:  table "planet_osm_line" does not exist, skipping     NOTICE:  table "planet_osm_line_tmp" does not exist, skipping     Setting up table: planet_osm_polygon     NOTICE:  table "planet_osm_polygon" does not exist, skipping     NOTICE:  table "planet_osm_polygon_tmp" does not exist, skipping     Setting up table: planet_osm_roads     NOTICE:  table "planet_osm_roads" does not exist, skipping     NOTICE:  table "planet_osm_roads_tmp" does not exist, skipping     Using built-in tag processing pipeline     Allocating memory for sparse node cache     Node-cache: cache=1650MB, maxblocks=0*211201, allocation method=8192     Mid: pgsql, scale=100 cache=1650     Setting up table: planet_osm_nodes     NOTICE:  table "planet_osm_nodes" does not exist, skipping     NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "planet_osm_nodes     _pkey" for table "planet_osm_nodes"     Setting up table: planet_osm_ways     NOTICE:  table "planet_osm_ways" does not exist, skipping     NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "planet_osm_ways_     pkey" for table "planet_osm_ways"     Setting up table: planet_osm_rels     NOTICE:  table "planet_osm_rels" does not exist, skipping     NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "planet_osm_rels_     pkey" for table "planet_osm_rels"          Reading in file: north-america-latest.osm.pbf     Processing: Node(610466k 131.5k/s) Way(39617k 1.07k/s) Relation(171710 11.37/s)      I'm using the latest cygwin build of osm2pgsql: https://vanguard.houghtonassociates.com/browse/OSM-OSM2PSQL-60/artifact My commandline parameters:               ./osm2pgsql.exe -v -c -d osm -U osm -H localhost -P 5432 -S default.style -s -C 1650 --hstore -r pbf north-america-latest.osm.pbf      Data file is from: http://download.geofabrik.de/north-america-latest.osm.pbf - 5GB My server has a 6core AMD processor, TB harddrive, and 12GB of memory. OS: 64bit Windows 7 Professional Any input is greatly appreciated. Thanks!


title: How to use ArcGIS WPF Runtime Deployment Tool via Command Line?

text: I'd like to be able to use the WPF Runtime (10.1.1) Deployment tool via the command line. If I run DeploymentTool.exe /? on the command line, I get the dialog in the attached image. The /c option indicates support for using a config file. I cannot find documentation on the config file format. Can someone point me in the right direction? ![enter image description here](http://i.stack.imgur.com/b3dYN.png) Apparently when you create a configuration in the tool, it is stored in the registry at HKEY_CURRENT_USER\Software\ESRI\ArcGIS Runtime SDK\Settings. If any additional information is stored elsewhere, I can't find it.


title: Openlayers with WMS service problem Resource interpreted as Image but transferred with MIME type application/vnd.ogc.wms_xml

text: I added a WMS layer var wmslayer = new OpenLayers.Layer.WMS("Cities", {http://someip.com/ArcGIS/services/BurkeMcDowell2013_06_26FORGOPI/MapServer/WMSServer?request=GetCapabilities&service=WMS", { transparent: true }, {isBaseLayer: false});} And the url which openlayers generated and call {someip.com/ArcGIS/services/BurkeMcDowell2013_06_26FORGOPI/MapServer/WMSServer?request=GetCapabilities&service=WMS&SRS=EPSG%3A900913&TRANSPARENT=TRUE&VERSION=1.1.1&STYLES=&FORMAT=image%2Fpng&BBOX=-10018754.17,2504688.5425,-7514065.6275,5009377.085&WIDTH=256&HEIGHT=256} But its not returning images but a message in console, Resource interpreted as Image but transferred with MIME type application/vnd.ogc.wms_xml: http://someip.com/ArcGIS/services/BurkeMcDowell2013_06_26FORGOPI/MapSer…X=-10018754.17,5009377.085,-7514065.6275,7514065.6275&WIDTH=256&HEIGHT=256". OpenLayers.js:460) OpenLayers.Tile.Image.OpenLayers.Class.setImgSrc OpenLayers.js:460 OpenLayers.Tile.Image.OpenLayers.Class.initImage OpenLayers.js:460 OpenLayers.Tile.Image.OpenLayers.Class.renderTile OpenLayers.js:456 OpenLayers.Tile.Image.OpenLayers.Class.draw OpenLayers.js:456 OpenLayers.Layer.Grid.OpenLayers.Class.initGriddedTiles OpenLayers.js:480 OpenLayers.Layer.Grid.OpenLayers.Class.moveTo OpenLayers.js:469 OpenLayers.Layer.OpenLayers.Class.redraw OpenLayers.js:265 OpenLayers.Layer.HTTPRequest.OpenLayers.Class.redraw OpenLayers.js:451 OpenLayers.Map.OpenLayers.Class.addLayer OpenLayers.js:230 Objs.adddlayer CreateMapMediator.js:1531 f.event.dispatch jquery-1.7.2.min.js:3 h.handle.i can any one help me solve it..? (I added someip.com coz i cant add a numeric ip there*)


title: recording pixel value with Python script in ArcGIS 10.x

text: A scripting newbie question... I'd like to write a Python script for ArcGIS 10.x that would record the pixel value for all pixels in a raster. Furthermore, I'd like to only record a given value once in the results. For example, if there are 23 values of 180 overall, only record one instance of that value. The raster in question is 4-band so the results would have to include values for all pixels in each band, recorded separately by band. The **Pixel Inspector tool** will show you the value per pixel (and surrounding pixels), but I'd like to record the values as described. Any help and examples would be greatly appreciated.


title: What is QGIS equivalent of ArcGIS GetCount for use in Python script?

text: I have a number of layers in **QGIS** that I would like to select attributes on, and get the feature count for, within a Python script. In ArcGIS for Desktop I have been using **SelectLayerByAttribute** and **GetCount**. What is the QGIS equivalent?


title: Geoserver heatmap in meters rather than pixels

text: Is it possible to get the radius' density kernel of the heatmap in meters rather than in pixels? http://suite.opengeo.org/opengeo- docs/cartography/rt/heatmap.html If not, is there other alternatives to draw heatmaps efficiently from my postgresql db and send it to leaflet? (I tried heatmap.js but it is quite slow)


title: Does a Google Earth Pro licence allow you to export geo-referenced satellite images for use in other GIS software?

text: I'm considering purchasing Google Earth Pro so that I can use satellite images in commercial reports. I wasted my trial period however, and I don't know whether I can export geo-referenced images from GE pro for use in other software (e.g. QGIS). Can this be done (both in practical and legal terms), or does the licence tie you to only printing from GE Pro, or is it legal to extract those images, but you can only get them as jpegs? As a slight aside, does the licence allow you to print Google maps that are generated from other sources, e.g. the OpenLayers plugin in QGIS, which would be the simplest solution for me


title: How can I preserve ObjectIDs in a Featureset returned from an SOE?

text: I'm returning a featureset from an SOE. To create the FeatureSet, I'm first creating a Recordset, inserting features into it, and then serializing it as json using SOESupport. The client then deserializes it as a featureset. The resulting featureset has different OIDs. **Is there a way to preserve the OIDs of the features I'm inserting into the recordset?** When I perform a query using the REST API, the featureset returned has the original objectID's. IMapServer3.QueryData might do this, but I don't see a way to pass it an array of OIDs as I can with IFeatureClass.GetFeatures.


title: Symbolizing Raster using single Unique Value?

text: I'm dealing with a raster in GRID format. Currently it is symbolized in Unique Values and contains 5 classes. I'm trying to consolidate these to one class. Is there a way to do this and keep a single Unique Value?


title: Zonal statistics for millions of overlapping polygons

text: I am running ArcGIS 10.1 with 64-bit GP on Windows 8.1 x64. I want to calculate the zonal statistics of buffer polygons based on parcels and a kernel density raster. The 4.7 million polygons overlap and are stored in a single feature class, making the problem particularly difficult. I've tried to use the supplemental Spatial Analyst Tools developed by ESRI in various ways, but the script isn't fast enough. I've tried to compute the zonal statistics piece by piece, using small census areas (with several hundred buffer polygons each) and large ones (thousands of buffer polygons). None of these implementations perform adequately. I've included the following features in a Python script:   * loading buffer polygons into the in_memory workspace before loading into the ZS tool   * creating feature layers where needed   * writing the results to a single text file The code for performing ZS one polygon at a time is posted below, however the tool only completes about one parcel every minute. I'm wondering if anyone has any insight on how to improve zonal statistics performance or the script in general. Thank you!               import arcpy, os, string, csv     from arcpy import env          # arcpy.ImportToolbox("D:\ClusterAnalysis_Deployment\SpatialAnalystSupplementalTools\Spatial Analyst Supplemental Tools.pyt")     arcpy.CheckOutExtension("Spatial")          # LOCATIONS #     # Local machine paths     gdb = r"D:\path\to\geodatabase.gdb"     results = r"\path\to\results"          # Virtual machine paths          # INPUT DATA #     b = gdb + "\\" + "ParcelBuffers"     kd = gdb + "\\" + "kdensity750"          env.workspace = gdb     env.overwriteOutput = True          # TEMPORARY DATA #     buffers = arcpy.MakeFeatureLayer_management(b, "bdata")     kdensity = arcpy.Raster(kd)          parcelList = []          cursor = arcpy.da.SearchCursor(buffers, ("PIN"))     for row in cursor:         parcelList.append(row[0])     del cursor          countDict = {}     countDict["Count:"] = 0          print "Script setup... done"          # GEOPROCESSING #     for PIN in parcelList:         parcel_ram = "in_memory" + "\\" + "parcel"         zs_table = results + "\\" + "zs_table_" + str(PIN) + ".dbf"         solution = results + "\\" + "ZS_solutions.txt"              arcpy.SelectLayerByAttribute_management(buffers, "NEW_SELECTION", "\"PIN\" = \'" + str(PIN) + "\'")         count = int(arcpy.GetCount_management(buffers).getOutput(0))         arcpy.CopyFeatures_management(buffers, parcel_ram)         arcpy.SelectLayerByAttribute_management(buffers, "CLEAR_SELECTION")         arcpy.gp.ZonalStatisticsAsTable_sa(parcel_ram, "PIN", kdensity, zs_table, "DATA", "ALL")              table = arcpy.gp.MakeTableView_management(zs_table, "zs_table_lyr")              fields = arcpy.ListFields(table)         field_names = map(lambda n:n.name, fields)         header = string.join(field_names, "\t")              with open(solution, 'w') as x:             x.write(header + "\n")             cursor = arcpy.SearchCursor(table)             for row in cursor:                 values = string.join(map(lambda n: str(row.getValue(n)), field_names), "\t")                 x.write(values + "\n")             del row, cursor              countDict["Count:"] = countDict["Count:"] + count         print "Zonal statistics computed and saved for parcel: " + str(countDict["Count:"])              arcpy.Delete_management(parcel_ram)         arcpy.Delete_management(zs_table)         arcpy.Delete_management(table)         del count


title: Creating a snapshot in ArcMap of a layer to be use for legend?

text: I am trying to create a snapshot using FastStone Capture version 5.3 to be use for the legend because it is diffcult to match their color especially is you are using raster or transparent ? How do I save the snapshot to file and then use that file for the legend ? Any suggest ? I am using 9.3.1 SP3. Thanks for the input.


title: Questions on smooth lines on soil polygon?

text: In a couple of weeks I am going to do QA/QC on soil polygons and I'm wonder if there is a way for me to run a script or a tool box that allow me to find the jagged lines ? Alternative, my plan would be to set up using a quad layer for each quad and then review the lines that need to be smooth. I would create a new layer to mark an error that need to be correct smooth line. I feel that it would take about a week or so to complete the work. The layer itself is a big file. In the past, I have had convert from polygon to polyline but it took a lot of time and work to clean up. If you do that, there would be probably a lot of gaps in between lines ane would create gaps and produce topology errors. Does anyone have a suggest a better way around it ? I am using ArcGIS 9.3.1 SP3. Thanks !


title: Cannot run toolbox model from button

text: I have a button on my toolbar that when clicked, will run a particular model, I have copied the code from here http://resources.esri.com/help/9.3/ArcGISEngine/com_cpp/samples/com/Geoprocessing/5eb001ba-1d6b-4596-b5f8-27c2ad7cb210.htm But when i click on the button i get the following error. -2147467259 Automation error Unspecified error My code is as follows               Private Sub LoadExcelToSDE_Click()          On Error GoTo Error:               ' Create the geoprocessor     Dim pGp As IGeoProcessor     Set pGp = New GeoProcessor          'Set Overwriteoutput to True     pGp.OverwriteOutput = True          'Add the custom toolbox containing the model tool     'pGp.AddToolbox "H:\Corporate GIS and Web Mapping\Projects\CSY_City_Development   \ArcMapPrototype\City_Development.tbx"     pGp.AddToolbox "C:\Documents and Settings\HalilxS\Application Data\ESRI\ArcToolbox\My Toolboxes\City_Development.tbx"          'create the parameter array     Dim pParamArray As IVariantArray     Set pParamArray = New esriSystem.VarArray          'Populate array of paramaters     'pParamArray.Add "H:\Corporate GIS and Web Mapping\Projects\CSY_City_Development\Data\Developers\UK Developers & Contact Details.xlsx\developers$"     pParamArray.Add "C:\Temp\UK Developers & Contact Details.xlsx\developers"          Dim pResult As IGeoProcessorResult          'Execute the model     Set pResult = pGp.Execute("LoadDevelopers", pParamArray, Nothing)          'Get the returned tool messages     ReturnMessages pResult          Error:     MsgBox Err.Number & vbCrLf & Err.Description               End Sub     Public Sub ReturnMessages(ByVal messages As IGeoProcessorResult)          Dim i As Long     Dim message As String          For i = 0 To messages.MessageCount - 1         message = messages.GetMessage(i)         Debug.Print     Next          End Sub      Any ideas on how to fix this, I have tried to change the location of the toolbox and the excel spreadsheet as well but the error still occurs. I'm using ArcGIS 9.3.1 and VBA Cheers Halil


title: How to convert Midpoint of Polyline into Point Feature using ArcPy?

text: I am trying to write a python script to determine flow direction on a water pipe network. I've used this script to find the mid point along each polyline, now i need to convert this data into a point feature class, which will become an arrow of flow direction. I've tried saving it as a list but cannot convet the list to a point feature. Can anyone suggest ways to save the mid point locations as a point feature class?                 #FlowArrows.py       import arcpy       #setting the environment       arcpy.env.workspace = "J:/PYTHON/Flow_Direction.gdb"       #arcpy.env.overwriteOutput = True            #Setting the containers       Pipes = r"J:\PYTHON\Flow_Direction.gdb\Pipes"       Nodes = r"J:\PYTHON\Flow_Direction.gdb\Nodes"       MidList = []            #Getting the mid point       Cursor = arcpy.SearchCursor(Pipes)           for i in Cursor:           Midpoint = i.shape.positionAlongLine(0.50,True).firstPoint           MidList.append(Midpoint)            print ("done")


title: Pgrouting OpenLayers all together

text:
I'm new to all this I'm still trying to understand how things work.I have found a tutorial for pgrouting that shows the shortest path with Dijsktra or A* or shooting star at a map . I followed the tutorial but I couldn't set it to run . The tutorial is this ! I have written some code and but i can't underastand why it doesn't work ! my php code seems to work correct(if i test it alone) it gives me the result I want , but i don't know if it can communicate properly with my html ! if someone could give a look at the code and point me were I wrong(with as much detail as possible because I'm new) I would appreciate it NOTICE : in order of some of my code to be shown i ereised the " < " from the html code line 1 - 22 and at php code i ereised the " " from the start end ending of the file Thanks in advance !! html code:                              html xmlns="http://www.w3.org/1999/xhtml">         head>             title>OpenLayers Take Points Example                                       html, body, #map {                     margin: 0;                     width: 99.5%;                     height: 90%;                 }                                           script type="text/javascript" src="ext/adapter/ext/ext-base.js">     script type="text/javascript" src="ext/ext-all.js">     link rel="stylesheet" type="text/css" href="ext/resources/css/ext-all.css" />     link rel="stylesheet" type="text/css" href="ext/examples/shared/examples.css" />     script src="OpLayer/lib/OpenLayers.js" type="text/javascript">     script type="text/javascript" src="GeoExt/lib/GeoExt.js">     link rel="stylesheet" href="OpLayer/theme/default/google.css" type="text/css">     script src='http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAl9RMqSzhPUXAfeBCXOussRTQDbvAygy0cfGJr8dEMAYKf3RWNBQqP9mjKIsqTfmAlz5LOJ3Xpy5s4w'>     script src="DrawPoints.js" type="text/javascript">     script type="text/javascript">                              var array = new Array();     var count = 0;         OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {                            defaultHandlerOptions: {                         'single': true,                         'double': false,                         'pixelTolerance': 0,                         'stopSingle': false,                         'stopDouble': false                     },                                               initialize: function(options) {                     this.handlerOptions = OpenLayers.Util.extend(                         {}, this.defaultHandlerOptions                     );                     OpenLayers.Control.prototype.initialize.apply(                         this, arguments                     );                      this.handler = new OpenLayers.Handler.Click(                         this, {                             'click': this.trigger                         }, this.handlerOptions                     );                 },                       trigger: function(e) {                         var xy = map.getLonLatFromViewPortPx(e.xy);            array[count++] = xy.transform(epsg_900913, epsg_4326);                  if(count==2){alert("is "+count);                 executeSQL(array);             }                 }                  });                       var map,json_layer,myStyles,undifined;         var epsg_4326 = new OpenLayers.Projection("EPSG:4326");             var epsg_900913 = new OpenLayers.Projection("EPSG:900913");           function init(){               var options = {             projection: epsg_900913,             displayProjection: epsg_4326,             units: "m",             numZoomLevels: 20,             maxResolution: 156543.0339,             maxExtent: new OpenLayers.Bounds(-20037508, -20037508,  20037508, 20037508)               };                      map = new OpenLayers.Map('map', options);                 var google_street = new OpenLayers.Layer.Google("Google Streets",{'sphericalMercator': true, numZoomLevels: 20} );                      var google_satellite = new OpenLayers.Layer.Google("Google Satellite",             {type: G_SATELLITE_MAP, 'sphericalMercator': true, numZoomLevels: 20}  );               var points_layer = new OpenLayers.Layer.Vector("points");              var draw_points = new DrawPoints(points_layer);                  var drag_points = new OpenLayers.Control.DragFeature(points_layer, {                     autoActivate: true              });         drag_points.onComplete = function() {             route.destroyFeatures();         };                            map.addControls([draw_points, drag_points]);                   myStyles = new OpenLayers.StyleMap({                 "default":new OpenLayers.Style({                     fillColor: "#ffcc66",                     strokeColor: "#ff9933",                     strokeWidth: 3}),                 "select": new OpenLayers.Style({                     fillColor :"#66ccff",                     strokeColor :"3399ff"})         });                      map.addLayers([google_street , google_satellite]);                 map.addControl(new OpenLayers.Control.LayerSwitcher());         map.addControl(new OpenLayers.Control.MousePosition());         map.addControl(new OpenLayers.Control.Navigation());                 map.addControl(new OpenLayers.Control.PanZoomBar());                 map.addControl(new OpenLayers.Control.ScaleLine());                 //map.addControl( new OpenLayers.Control.Permalink('permalink'));                 map.addControl( new OpenLayers.Control.OverviewMap());                 map.addControl(new OpenLayers.Control.KeyboardDefaults());              //somewhere in athens         var map_center = new OpenLayers.LonLat(23.723022460938,37.956298828125);               //metatropi apo x/y se spherical                   map_center.transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject());          map.setCenter(map_center, 17);                       var click = new OpenLayers.Control.Click();                 map.addControl(click);                 click.activate();                       }               var format = new OpenLayers.Format.GeoJSON({                 internalProjection: epsg_900913,                             externalProjection: epsg_4326});      function executeSQL(xy){ var json_url = "http://localhost/Geoext/pgrouting1.php?"; json_url += "x1=" + escape(array[0].lon); json_url += "&y1=" + escape(array[0].lat); json_url += "&x2=" + escape(array[1].lon); json_url += "&y2=" + escape(array[1].lat); json_url += "&method=SPD"; alert(json_url); if(undifined != json_layer){ json_layer.destroy(); }               json_layer = new OpenLayers.Layer.Vector("Route",                     {styleMap: myStyles,                          strategies: [new OpenLayers.Strategy.Fixed()],                      protocol: new OpenLayers.Protocol.HTTP({                      url:json_url,                      format: format})            });          map.addLayer(json_layer);      };                   </script>
Add markers example

             An example .

           and my php code : //$a =$_SERVER["REMOTE_ADDR"]; //echo" $a "; // Database connection settings define("PG_DB" , "athens"); define("PG_HOST", "localhost"); define("PG_USER", "postgres"); define("PG_PORT", "5432"); define("TABLE", "ways"); // Connect to database $con = pg_connect("dbname=".PG_DB." host=".PG_HOST." user=".PG_USER);               if($con == true){         echo "Connection succeded\n";     }else{         echo "Connection couldn't established\n";     }       $x1 = $_GET["x1"]; $y1 = $_GET["y1"]; $x2 = $_GET["x2"]; $y2 = $_GET["y2"]; $method = $_GET["method"]; echo "to x1 einai toso $x1 --y1 $y1 ---x2 $x2 -- y2 $y2 method $method\n"; // Find the nearest edge $startEdge = findNearestEdge($x1,$y1); $endEdge = findNearestEdge($x2,$y2); echo"$startEdge kaiiiiiiiiiiiiiiiii $endEdge "; // FUNCTION findNearestEdge function findNearestEdge($a , $b) {                 // Connect to database       $con = pg_connect("dbname=".PG_DB." host=".PG_HOST." user=".PG_USER);            $sql = "SELECT gid, source, target, the_geom,                    distance(the_geom, GeometryFromText(                        'POINT(".$a." ".$b.")', 4326)) AS dist                   FROM ".TABLE."                    WHERE the_geom && setsrid(                        'BOX3D(".($a-0.1)."                                ".($b-0.1).",                                ".($a+0.1)."                                ".($b+0.1).")'::box3d, 4326)                   ORDER BY dist LIMIT 1";            $query = pg_query($con,$sql);              $ed[0]=$edge['gid']      = pg_fetch_result($query, 0, 0);         $ed[1]=$edge['source']   = pg_fetch_result($query, 0, 1);         $ed[2]=$edge['target']   = pg_fetch_result($query, 0, 2);         $ed[3]=$edge['the_geom'] = pg_fetch_result($query, 0, 3);        echo"$ed[0] $ed[1] $ed[2] $ed[3] "; // Close database connection pg_close($con);                 return $ed[0];      } // Select the routing algorithm switch($_REQUEST['method']) {                 case 'SPD' : // Shortest Path Dijkstra       echo "edepa "; $sql = "SELECT rt.gid, ST_AsGeoJSON(rt.the_geom) AS geojson, length(rt.the_geom) AS length, ".TABLE.".gid FROM ".TABLE.", (SELECT gid, the_geom FROM dijkstra_sp_delta( '".TABLE."', ".$startEdge['source'].", ".$endEdge['target'].", 0.1) ) as rt WHERE ".TABLE.".gid=rt.gid;"; break;                 case 'SPA' : // Shortest Path A*               $sql = "SELECT rt.gid, ST_AsGeoJSON(rt.the_geom) AS geojson,                         length(rt.the_geom) AS length, ".TABLE.".gid                      FROM ".TABLE.",                          (SELECT gid, the_geom                              FROM astar_sp_delta(                                 '".TABLE."',                                 ".$startEdge['source'].",                                 ".$endEdge['target'].",                                 0.1)                          ) as rt                      WHERE ".TABLE.".gid=rt.gid;";           break;            case 'SPS' : // Shortest Path Shooting*              $sql = "SELECT rt.gid, ST_AsGeoJSON(rt.the_geom) AS geojson,                         length(rt.the_geom) AS length, ".TABLE.".gid                      FROM ".TABLE.",                          (SELECT gid, the_geom                              FROM shootingstar_sp(                                 '".TABLE."',                                 ".$startEdge['gid'].",                                 ".$endEdge['gid'].",                                 0.1, 'length', true, true)                          ) as rt                      WHERE ".TABLE.".gid=rt.gid;";         break;         } // close switch // Connect to database $dbcon = pg_connect("dbname=".PG_DB." host=".PG_HOST." user=".PG_USER); // Perform database query $query = pg_query($dbcon,$sql); // Return route as GeoJSON $geojson = array( 'type' => 'FeatureCollection', 'features' => array() ); // Add edges to GeoJSON array while($edge=pg_fetch_assoc($query)) { ` $feature = array( 'type' => 'Feature', 'geometry' => json_decode($edge['geojson'], true), 'crs' => array( 'type' => 'EPSG', 'properties' => array('code' => '4326') ), 'properties' => array( 'id' => $edge['gid'], 'length' => $edge['length'] ) ); // Add feature array to feature collection array array_push($geojson['features'], $feature); ` } // Close database connection pg_close($dbcon); // Return routing result header('Content-type: application/json',true); echo json_encode($geojson);


title: When I save a project to a folder, I get this error message

text: I opened QGIS, started a new project, and loaded rasters. Then I saved the project to a folder I had already created. I got the following error message. The same exact message appeared when I closed QGIS, then booted it up again, and opened the same project!               An error occured during execution of following code:     sys.path.append('/Users/greg/Documents/Greg's stuff/GIS/QGIS_projects_I_made')                 File "", line 1         sys.path.append('/Users/greg/Documents/Greg's stuff/GIS/QGIS_projects_I_made')                                                     ^     SyntaxError: invalid syntax      > Python version: 2.7.2 (default, Oct 11 2012, 20:14:37) [GCC 4.2.1 Compatible > Apple Clang 4.0 (tags/Apple/clang-418.0.60)] > > QGIS version: 2.0.1-Dufour 'Dufour', f738351 > > Python path: > ['/Applications/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing', > '/Applications/QGIS.app/Contents/MacOS/../Resources/python', > '/Users/greg/.qgis2/python', '/Users/greg/.qgis2/python/plugins', > '/Applications/QGIS.app/Contents/MacOS/../Resources/python/plugins', > '/Library/Frameworks/SQLite3.framework/Versions/B/Python/2.7', > '/Library/Frameworks/GEOS.framework/Versions/3/Python/2.7', > '/Library/Python/2.7/site-packages/numpy-override', > '/Library/Frameworks/GDAL.framework/Versions/1.10/Python/2.7/site-packages', > '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', > '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', > '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat- > darwin', > '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat- > mac', > '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat- > mac/lib-scriptpackages', > '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', > '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib- > tk', > '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib- > old', > '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib- > dynload', > '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', > '/Library/Python/2.7/site-packages', > '/Applications/QGIS.app/Contents/Resources/python/plugins/fTools/tools']


How do you make an unclassed choropleth in QGIS 2.x? I'm using 2.4 and can't find an option in a layer's Style tab like the continuous color option that seems to have existed in QGIS 1.x. I'm curious to see ways to work around this if it is indeed no longer an official option.


title: Geoserver WMS layer does not show in OpenLayers

text:
I'd like to overlay a Geoserver WMS layer in OpenLayers & OpenStreetMaps. I'm having problems because the wms is not showing on top of the OSM layers (mapnik, cyclemap). This is the code:                             <meta http-equiv="Content-Type" content="text/html; charset=utf-8">         <title>Exercise 13 OSM Basemaps</title>

                Using another code I can see the wms alone:                             <meta http-equiv="Content-Type" content="text/html; charset=utf-8">         <title>Exercise OSM Basemaps</title>

                What I'm missing here? It seems like projection incompatibilities?


title: How to use ECW images with MapInfo?

text: I'm wondering if there is a way to use ECW images in MapInfo without having to 'register' the image as I bring it in? I mean, ECW images are _already rectified_ (well the ones I use for GIS are anyway) with coordinate system information embedded into the header of the image. Other GIS applications such as ArcGIS, Quantum GIS, gvSIG etc will load an ECW image generally without any problems... and without trying to rectify, that which is already rectified! Of course, my valid fear is that by choosing the 'register' option when I open the ECW in MapInfo, I'll alter (possibly for the worse) the geo-rectification already applied to the image. I don't want to do that. I have a potential client who's already acquired MapInfo and needs to help setting up. Any thoughts &/or help appreciated. (Summit GIS and Mapping). EDIT (27/10/2011): Using MapInfo Professional 11.0


title: Routing engine that supports right sided pickups

text: I am using open street maps and I need to incorporate routing in to my application. I know there are various routing engines that I can use, but I have a very specific requirement for the direction of travel along the road when the vehicle approaches a stop location. Specifically this: I am routing school buses. Some roads are considered hazardous, which means that students are not allowed to cross the street to get on the bus. In this situation, I would need the bus to be traveling in the proper direction to prevent the child from crossing the street. On other (non-hazardous) roads, students are allowed to cross the street to load the bus. I am currently using asp.net, c#, and javascript. I would prefer an open source solution but would be willing to pay for something if I know it will fulfill my requirements.


title: Ubuntu 14.04 Another ImportError: No module named qgis.core

text: # Issue I feel like this is covered territory here, but the issue is has appeared on two separate occasions for me--first when upgrading from Ubuntu 12.04 to 14.04 in May. I got it fixed then, but I recently set up a virtualenv with and that has caused some crossed paths, so to speak. Signs are that python-qgis is installed and that it is a path issue at runtime. qgis.org says to set my `PYTHONPATH=/qgispath/share/qgis/python`, and it appears that the package manager used `/usr/share/qgis/python` on my system. My issue is that for troubleshooting purposes, I am not certain that is indeed where the python wrapper is located--certainly, using that path doesn't fix it, so I am looking for further troubleshooting tips. # Details below: When booting qgis 2.4, I get               Couldn't load PyQGIS.     Python support will be disabled.               Traceback (most recent call last):       File "", line 1, in      ImportError: No module named qgis.core               Python version:     2.7.6 (default, Mar 22 2014, 23:03:41)      [GCC 4.8.2]          QGIS version:     2.4.0-Chugiak 'Chugiak', exported          Python path:     ['/usr/share/qgis/python', u'/home/aksel/.qgis2/python', u'/home/aksel/.qgis2/python/plugins', '/usr/share/qgis/python/plugins', '/home/aksel/anaconda/lib/python2.7/site-packages/brewer2mpl-1.4-py2.7.egg', '/home/aksel/anaconda/lib/python2.7/site-packages/pandana-0.1dev-py2.7-linux-x86_64.egg', '/home/aksel', '/home/aksel/projects/urbansim', '/home/aksel/eclipse/plugins/org.python.pydev_2.8.1.2013072611/pysrc', '/home/aksel/projects/urbanaccess', '/home/aksel/projects/pandas_sql', '/home/aksel/gdata/gdata-2.0.18/src', '/home/aksel/.qgis/python', '/home/aksel/gdal-1.9.2', '/home/aksel/projects/urbansim/agglomeration', '/home/aksel/anaconda/lib/python2.7', '/home/aksel/anaconda/lib/python2.7/plat-x86_64-linux-gnu', '/home/aksel/anaconda/lib/python2.7/lib-tk', '/home/aksel/anaconda/lib/python2.7/lib-old', '/home/aksel/anaconda/lib/python2.7/lib-dynload', '/home/aksel/anaconda/lib/python2.7/site-packages', '/home/aksel/anaconda/lib/python2.7/site-packages/PIL', '/home/aksel/anaconda/lib/python2.7/site-packages/prettytable-0.7.2-py2.7.egg', '/home/aksel/anaconda/lib/python2.7/site-packages/runipy-0.1.0-py2.7.egg', '/home/aksel/anaconda/lib/python2.7/site-packages/setuptools-5.7-py2.7.egg']      My installed package versions include:               dpkg -l | grep qgis     rc  libqgis-analysis2.3.0   2.3.0+git20140619+0dd02ba~trusty1   amd64   QGIS - shared analysis library     ii  libqgis-analysis2.4.0   2.4.0-0trusty3  amd64   QGIS - shared analysis library     rc  libqgis-core2.3.0   2.3.0+git20140619+0dd02ba~trusty1   amd64   QGIS - shared core library     ii  libqgis-core2.4.0   2.4.0+trusty1   amd64   QGIS - shared core library     ii  libqgis-customwidgets2.4.0  2.4.0-0trusty3  amd64   QGIS custom widgets for Qt Designer     rc  libqgis-gui2.3.0    2.3.0+git20140619+0dd02ba~trusty1   amd64   QGIS - shared gui library     ii  libqgis-gui2.4.0    2.4.0+trusty1   amd64   QGIS - shared gui library     rc  libqgis-networkanalysis2.3.0    2.3.0+git20140619+0dd02ba~trusty1   amd64   QGIS - shared network analysis library     ii  libqgis-networkanalysis2.4.0    2.4.0-0trusty3  amd64   QGIS - shared network analysis library     rc  libqgis2.2.0    2.2.0-3+trusty1 amd64   QGIS - shared libraries     rc  libqgisgrass2.3.0   2.3.0+git20140619+0dd02ba~trusty1   amd64   QGIS - shared grass library     ii  libqgisgrass2.4.0   2.4.0-0trusty3  amd64   QGIS - shared grass library     rc  libqgispython2.3.0  2.3.0+git20140619+0dd02ba~trusty1   amd64   QGIS - shared Python library     ii  libqgispython2.4.0  2.4.0-0trusty3  amd64   QGIS - shared Python library     rc  libqgissqlanyconnection2.4.0    2.4.0+trusty1   amd64   QGIS - shared sqlanywhere connection library     ii  python-qgis 2.4.0-0trusty3  amd64   Python bindings to QGIS     ii  python-qgis-common  2.4.0-0trusty3  all Python bindings to QGIS - architecture-independent files     ii  qgis    2.4.0-0trusty3  amd64   Geographic Information System (GIS)     ii  qgis-common 2.4.0-0trusty3  all QGIS - architecture-independent data     ii  qgis-plugin-globe   2.4.0-0trusty3  amd64   OSG globe plugin for QGIS     ii  qgis-plugin-globe-common    2.4.0-0trusty3  all OSG globe plugin for QGIS - architecture-independent data     ii  qgis-plugin-grass   2.4.0-0trusty3  amd64   GRASS plugin for QGIS     ii  qgis-plugin-grass-common    2.4.0-0trusty3  all GRASS plugin for QGIS - architecture-independent data     ii  qgis-providers  2.4.0-0trusty3  amd64   collection of data providers to QGIS     ii  qgis-providers-common   2.4.0-0trusty3  all collection of data providers to QGIS - architecture-independent files


title: How to set posgis default sequential value in a QGIS "editable" view?

text: **Introduction** In a QGIS project I have a VIEW, that I want to became editable (I'm trying to replicate the versioning system used DB Manager with some tweeks). Therefore I created a few rules to make is so (see below). I'm able to delete and update the features without problems, but while inserting new features, I'm not being able to use postgis default value (sequence) for gid (that in this case is not a primary key) but has a NOT NULL constraint. So, if the user don't fill the gid value, qgis is not be able to commit the changes, if it does... we neve know where thing going to get wrong. **The question** Is there a way I can prepare my view or set qgis form to read the default value? **What I got**               -- The original table     CREATE TABLE "PGHP".infraestruturas     (       gid serial,       nome character varying(40),       classe character varying(40),        geom geometry(POINT, 3763),       "id_hist" serial primary key,       "time_start" timestamp,       "time_end" timestamp,       "user_update" character varying(40)     );          -- Creating the view     CREATE OR REPLACE VIEW "PGHP".infra_portoes AS       SELECT "gid", "nome", "geom"::Geometry(POINT, 3763), "time_start", "user_update"       FROM "PGHP"."infraestruturas_pontos"       WHERE "classe" = 'portoes' AND "time_end" IS NULL;          -- Make the view editable     CREATE OR REPLACE RULE "_DELETE" AS ON DELETE TO "PGHP".infra_portoes DO INSTEAD       DELETE FROM "PGHP"."infraestruturas_pontos" WHERE gid = old.gid;          CREATE OR REPLACE RULE "_INSERT" AS ON INSERT TO "PGHP".infra_portoes DO INSTEAD       INSERT INTO "PGHP"."infraestruturas_pontos" ("gid","classe","nome","geom")         VALUES (NEW."gid",'portoes',NEW."nome",NEW."geom");          CREATE OR REPLACE RULE "_UPDATE" AS ON UPDATE TO "PGHP".infra_portoes DO INSTEAD       UPDATE "PGHP"."infraestruturas" SET          "gid" = NEW."gid",         "classe" = 'portoes',         "nome" = NEW."nome",         "geom" = NEW."geom"       WHERE gid = NEW.gid;


title: Is there a consumer-level handheld GPS that can use standard GIS data as its background layer?

text: I'm shopping around for a handheld GPS, and from what I'm seeing, none of the big vendors (Garmin, Magellan and Delorme) make a unit that can use, for example, a simple georeferenced TIFF or a Shapefile as a background layer on screen. They all want you to buy (or subscribe to) their own closed-off product which basically just repackages data that is often otherwise freely available (like USGS quads) and allows you to use it with their GPS units. Is there a vendor that sells a device like a Garmin GPSMap or Delorme PN which can use freely-available GIS data standards like TIF, SHP, OSM data, and so on? I know Trimble's handhelds can do some of this, but they are much more expensive.


title: How can I add an infowindow to an OpenLayers GeoJSON layer?

text: In my OpenLayers script I refer to an geojson layer. Is it possible to add an info window?If yes, how can I create this. Script is as follows:               var lon = 5,         lat = 52,         zoom = 7,         epsg4326 = new OpenLayers.Projection('EPSG:4326'),         epsg900913 = new OpenLayers.Projection('EPSG:900913');          function init(){                  var myStyles = new OpenLayers.StyleMap({              "default": new OpenLayers.Style({              fillColor: "${getColor}",                 strokeWidth: 1,                          strokeColor: "#000",              fillOpacity: 0.8,              graphicZIndex: 5               },         {             context: {                 getColor : function (feature) {                     return feature.attributes.INW_T > 100000 ? '#ffc000' :                            feature.attributes.INW_T > 10000 ? '#00317c' :                                                               '#FFEDA0' ;                 }             }          })             });                   var map = new OpenLayers.Map('map', {             units: 'm',             numZoomLevels: 19,             controls: [                 new OpenLayers.Control.Navigation(),                 new OpenLayers.Control.ScaleLine(),                 new OpenLayers.Control.MousePosition(),                 new OpenLayers.Control.LayerSwitcher()             ],             projection: epsg900913,             displayProjection: epsg4326 //Is used for displaying coordinates in appropriate CRS by MousePosition control         });              var lay_goo = new OpenLayers.Layer.Google('Google', {             type: google.maps.MapTypeId.SATELLITE,             sphericalMercator: true         });              var lay_osm = new OpenLayers.Layer.Google('OSM');              var geojson_layer = new OpenLayers.Layer.Vector("GeoJSON", {                 styleMap: myStyles,             projection: epsg4326,             strategies: [new OpenLayers.Strategy.Fixed()],             protocol: new OpenLayers.Protocol.HTTP({                 url: "pc2.geojson",                 format: new OpenLayers.Format.GeoJSON()             })         });              map.addLayers([lay_osm, lay_goo, geojson_layer]);                  map.setCenter(new OpenLayers.LonLat(lon, lat).transform(epsg4326, epsg900913), zoom);     }      GeoJson file has the following format:               {     "type": "FeatureCollection",          "features": [     { "type": "Feature", "id": 0, "properties": { "PC2CODE": "10", "PC2NR": 10, "INW_T": 697830 }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 5.016855446988143, 52.349866914447176 ], [ 5.014431962156695, 52.347111770955848 ], [ 5.009350157428187, 52.344472149717674 ], [ 5.012133851358907, 52.344143065780877 ], [ 5.012314670330961, 52.343410242383534 ], more geometries      Hope someone can help? * * * **UPDATE** Selecting an feature is working now. In the function init I added the following 2 things:   1. feature select              function onFeatureSelect(feature){         alert("boom");     }          function onFeatureUnselect(feature){         alert("unBoom");     }        2. selectControl              selectControl = new OpenLayers.Control.SelectFeature(geojson_layer, {         onSelect: onFeatureSelect,         onUnselect: onFeatureUnselect     });     map.addControl(selectControl);     selectControl.activate();      So now I have a popup with 'boom' on my screen. How can I put the data from the geojson layer in the pop-up. Even better, I rather not have a pop-up but want the data to be visible below the map. Similar to http://workshops.opengeo.org/openlayers- intro/controls/select.html (step 4) The code they use:               buildings.events.on({         featureselected: function(event) {             var feature = event.feature;             var area = feature.geometry.getArea();             var id = feature.attributes.key;             var output = "Building: " + id + " Area: " + area.toFixed(2);             document.getElementById("output-id").innerHTML = output;         }     });      Can I refer to a geojson layer with this code? Thanks!


title: Avoid NoData after Focal Statistics Majority

text: I am currently working with some classified land cover rasters (containing 8 land cover classes) in ArcGIS 10.0. I would like to make them look smoother and have therefore used the Focal Statistics Majority tool. This results in a raster which, at a first glance, looks great but when I look closer it is filled with thousands of NoData pixels at the boarders between the different land cover classes. I assume this happens because a cell will receive a NoData-value when there is more than one majority value within the neighbourhood. But I wonder if there is any way to avoid this by, for example, making it **keep** the original value instead of replacing it with NoData when it encounters the problem of having no majority value. Or is there any way to replace the NoData value with the original value after Focal Statistics? Or are there any other recognized, commonly used methods to replace missing data? Would be very grateful for help!


title: Cubist Add-In for ArcMap

text: I'm looking for an ArcMap add-in that will create a raster based on rules from RuleQuest Research's Cubist .model files. Ideally, the add-in will give the user the option of matching input raster data to the variable names defined in the .model file. Does anyone know of such a product? I have done ArcGIS.com and Google searches without any luck.


title: Raster legend in R: how to colour specific values?

text: I have an elevation model plotted in R               r <- raster("example.dem")     plot(r, col = topo.colors(20))      ![Elevation plot](http://i.stack.imgur.com/JaWo6.png) Some of the values are below sea level (0), and I'd like to have those display in red. How can I assign specific ranges to specific colours in the plot()?


title: What suit of components do I need to get installed to start with QGIS?

text: I have a requirement for a GIS product and following advice from firends and colleagues have decided that Quantum GIS seems suitable for what I need. I have input a request to our IT section to install it on our network laptop but this needs to be done by an engineer because of prohibited install functions as is normal on corp networks. Anyway - my question is, i will be using QGIS to interpret things like Ordnance Survey Codepoint with polygone and Boundary data to make bespoke geography shapefiles of our organisational areas (made up from clusters of postcode districts). Could you advise what suit of components i would need to request to be installed to start with (so that i can get up and running without having to raise seperate requests to bolt on plugins at a later date). Any help appreciated - can't wait to get started on it!


title: Transforming EPSG:3857 to EPSG:4326

text: I am new to gdal and have a simple question. I want to transform an image from OpenStreetMap projection to Nasa Blue Marble projection. What I understand is that OpenStreetMap projection is EPSG:3857 and Blue Marble projection is EPSG:4326 (http://www.paulillsley.com/gia/index.html). So, I simply downloaded a sample 256*256 tile like this: http://a.tah.openstreetmap.org/Tiles/tile/0/0/0.png and applied the following command: gdalwarp -s_srs EPSG:3857 -t_srs EPSG:4326 "0.png" "o_bluemarble.png" I received the following error: "Copying color table from 0.png to new file. ERROR 1: Unable to compute a transformation between pixel/line and georeferenced coordinates for 0.png. There is no affine transformation and no GCPs." From where should I start? **Update 1** I got it. I need to define the bounds. Firstly, I got the bounds:               gdaltransform -s_srs EPSG:4326 -t_srs EPSG:3857     -180 85.05     -20037508.3427892 20036051.9193368 0      I used 85.05 as it is the approximation to infinity in Spherical Mercator used by Bing. Then, I used the following commands:               ./gdal_translate -of Gtiff -co "tfw=yes"  -a_ullr -20037508.3427892 20036051.9193368 20037508.3427892 -20036051.9193368 -a_srs "EPSG:3857"  "input.png" "input_tfw.tiff"          ./gdalwarp -s_srs EPSG:3857 -t_srs EPSG:4326 -ts 256 128 "input_tfw.tiff" "output.tif"      The problem now is that by comparing an image downloaded from openstreetmap with Blue Marble, the poles are not aligned properly. I mean here Greenland, not the far pole. What do think the problem is?


title: Python script to create a point on a line with attribute data

text: I have a line feature class with 2 lines (Engineering and Continuous Station series) co-incident on each other. I have created a toolbar(ArcGIS Desktop add-in 10.1) with 3 tools on it, add control point, move control point and delete control point. It's just an empty toolbar with no business logic. When one selects the add control point tool and clicks anywhere on the line feature class, a point needs to be created on the line and a few attributes from the line needs to be brought in to the point. Also the distance of the point location from the beginning of the line needs to be calculated and attributed as well. The Move control point tool should move the points to a different location by specifying with a click on the line. Delete control point should delete both the control points. I would like a python script to put them in the individual tools. Any ideas? A pseudocode would also help me work from my end. Thank you!!


title: JSON format unavailable for GetFeatureInfo service

text: I have Geoserver 2.2.4 installed - which allows GetFeatureInfo to be returned as json If I make the following call http://[servername]/geoserver/[namespace]/wms?LAYERS=[layername]&QUERY_LAYERS[layername]&STYLES=&SERVICE=WMS&VERSION=1.3&REQUEST=GetFeatureInfo&BBOX=299856.403448%2C528892.700948%2C300279.736552%2C529316.034052&FEATURE_COUNT=10&HEIGHT=600&WIDTH=600&FORMAT=image%2Fpng&INFO_FORMAT=application%2Fjson&SRS=EPSG%3A27700&X=249&Y=447&EXCEPTIONS=application%2Fjson I get a exception response of Invalid format 'application/json', supported formats are [text/plain, application/vnd.ogc.gml, application/vnd.ogc.gml/3.1.1, text/html] I have checked getcapabilities for this service and only the following are available               <GetFeatureInfo>         <Format>text/plain</Format>         <Format>application/vnd.ogc.gml</Format>         <Format>application/vnd.ogc.gml/3.1.1</Format>         <Format>text/html</Format>     </GetFeatureInfo>      So is there any extra config I need to do to Geoserver to get it to output in json for GetFeatureInfo?


title: Custom ArcGIS Server Web Service can't find Esri assemblies

text: I have ArcGIS Server 10 installed on a server, with Web ADF Runtime and Web Applications installed, and I have a custom web service that uses a couple of ESRI.ArcGIS assemblies deployed on that server. When I run the web service, I get the following error: > Could not load file or assembly 'ESRI.ArcGIS.Geodatabase, Version=10.0.0.0, > Culture=neutral, PublicKeyToken=......" or one of its dependencies. The > system cannot find the file specified. The web service uses .NET 3.5 and the ESRI assemblies are registered in the GAC. I also tried including them in a Bin folder in the app with no luck. Any help is much appreciated.


title: Transform metadata in xml format to html

text: I extract metadata from the GDB_UserMetadata SDE table. Now I want to transform that xml to html so that I can view it from my browser. To do that I use the ISO.xsl stylesheet found in C:\Program Files\ArcGIS\Metadata\Stylesheets. I add to the beginning of the file:               <?xml-stylesheet type='text/xsl' href='ISO.xsl'?>      It works fine in IE9 but Firefox says:               Error loading stylesheet: Parsing an XSLT stylesheet failed.      Does anyone know WHY?


title: How to create segments/lines by inputting coordinates

text: I have a set of coordinates and I wisht to recreate them in GIS. Basically, I am following from a paper based sketch map of maritime delimitation.


title: Plugin for average distance from node to polyline in QGIS?

text: Is there a plugin available that will calculate this? EDIT 1: The red polyline is the average distance of the point to the black polyline. The red polyline is what I want to display. Alternatively, is there something which would calculate the radius of the circle so I can use a buffer? ![enter image description here](http://i.stack.imgur.com/yHIXF.png)


title: Extracting data from GeoMedia *.mdf database without using GeoMedia?

text: Is it possible to extract data from Geomedia .mdf without Geomedia? Preferably with use of QGIS or ArcGIS for Desktop?


title: Installing pgRouting Ubuntu Lucid

text: Here are the steps i did:   1. Added ppa to repository sources   2. in synaptic marked all pgrouting for postgres 8.4   3. apply (everything was ok)   4. restarted postgres But, i just tried a simple function shortest_path and it seems to do not recognise it: > ERROR: function shortest_path(text, integer, integer, boolean, boolean) does > not exist LINE 1: SELECT * FROM shortest_path(' This is the query: > SELECT * FROM shortest_path('SELECT gid as id,source::integer as > source,target::integer as target,length::double precision as cost FROM > topologia'::text,1, 2, false, false); It should be simple... anything else that I'm missing? Cheers, Marco


title: Query a georss feed

text: I'm trying to consume a georss feed from a C# project. Can I have queries against a #georss feed? For example 'nearest item to Lon/Lat' or 'items contained in bounding box X' .? Thanks


title: ArcGIS Viewer for Flex widget moves inadvertently when placed in upper right

text: Any widget moves inadvertently to the left whenever it is placed in the upper right area of the window? http://www.fairfield-city.org/maps/gis


title: Get feature while editing

text: I have created my custom form for features editing, using `layer.setEditForm("form.ui")` and `layer.setEditFormInit("init")` properties. `init` method receives `dialog`, `layerId` and `featId` as arguments. Everything works ok, but now I need to get a geometry of a new feature before closing the form. Is there any way to do it? Feature id gets assigned to "0" and looks like doesn't exist in the features list before accepting changes.


title: Where is the work in the GIS/RS consulting industry?

text: I'm trying to get an understanding of what type of GIS/RS work organizations are most often bidding out to consultants, and why? For example, is most of the freelance work in web mapping these days because in-house programmers have not caught up with this rapidly expanding field? Maybe all the work involves niche specialty jobs, such as GIS/RS research support for temporary environmental projects because non-profit organizations do not have the expertise. Perhaps, oil and gas jobs are dominating the freelance market because of the fracking boom. **What type of GIS/RS work are private/corporate/governmental organizations most often bidding out to consultants these days, and why?**


title: Intersect, Union are failing on 10.1

text: After a huge help from Blah238. I found exactly what is the problem. I wasted few days checking our data, and trying many things. The problem that I cannot do intersection between two polylines to give a result a new polyline. It was working on 9.3. So I am not sure if it is not supposed to work , or why it is not working on 10.1 So, I modified the code to this. Now this code is generating COM exception on my machine. Blah can you please help if you can                       static void Main(string[] args)         {             //ESRI License Initializer generated code.             m_AOLicenseInitializer.InitializeApplication(new esriLicenseProductCode[] { esriLicenseProductCode.esriLicenseProductCodeStandard, esriLicenseProductCode.esriLicenseProductCodeAdvanced },             new esriLicenseExtensionCode[] { });                  var geom1 = "LINESTRING (2 1, 7 1)".ToGeometry();             var geom2 = "LINESTRING (3 1, 6 1)".ToGeometry();             var targetOperator = (ITopologicalOperator)geom1;             targetOperator.Simplify();                  IGeometry intersectGeometry = targetOperator.Intersect(geom2, geom2.Dimension);             Console.WriteLine(overlapped1.ToWellKnownText());                       m_AOLicenseInitializer.ShutdownApplication();              }              static IGeometry GetOverlappedGeometry(IGeometry sourceGeometry, IGeometry targetGeometry, esriGeometryDimension dimension)         {             IGeometry overlappedGeometry = null;                  IGeometry localSourceGeometry;             IGeometry localTargetGeometry;                  if (sourceGeometry.GeometryType > targetGeometry.GeometryType)             {                 localSourceGeometry = targetGeometry;                 localTargetGeometry = sourceGeometry;             }             else             {                 localSourceGeometry = sourceGeometry;                 localTargetGeometry = targetGeometry;             }                  var targetOperator = (ITopologicalOperator)localTargetGeometry;                  if (targetOperator != null)             {                 targetOperator.Simplify();                      IGeometry intersectGeometry = targetOperator.Intersect(localSourceGeometry, dimension);                      overlappedGeometry = intersectGeometry;             }                  return overlappedGeometry;         }      Please notice that the code is different that Blah code down , that I am using the dimension 1 is the intersection, and not dim0 Because I want a polyline What the problem with 10.1? Why I was able to do it on 9.3?


title: GIS and natural disasters - examples of geo-visualizations and geospatial analysis

text: I stumbled upon NY Times' web map of deaths from tornadoes in US. ![enter image description here](http://i.stack.imgur.com/1vFP4.jpg) Can you point me to some more interesting examples of geo-visualization and/or geospatial analysis of natural disasters and their consequences?


title: What is the best approach to interacting with map layers after a JTX Job Change event when a new MXD is loaded?

text: To further clarify, my question is pertaining to a WMX/JTX job activation from within ArcMap, not Workflow Manager. I have a JTXJobListener class where with a `JobChanged` method and that is successfully called. My problem is with the event order. I can do whatever I want with the map, but if that WMX/JTX job loads a MXD...I lose those changes (changes are on the original map not the new one that is loaded). I'm in need of an event that fires after the job type MXD is loaded into ArcMap. Am I missing an event that I can use? If not, what are the typical workaround(s) to this issue? Hack it using the document events??


title: Multivalue parameter as text in Python toolbox - reading in to imported module function

text: I'm building a Python toolbox with a tool which calls specific functions from a custom module. The main input parameter for this tool is a multivalue list of raster layers. In the execute block of my tool, I use parameter[2].valueAsText to read in said parameter, as normal, and then feed it into a custom module function as follows:               output          = parameters[0].valueAsText     input           = parameters[2].valueAsText     function        = parameters[1].valueAsText     functionname    = "Local" + function     option          = parameters[3].valueAsText     expression      = parameters[4].valueAsText          newGrid = getattr(localfuncs,functionname)(input,option,expression)     newGrid.save(output)      In this case, I've tested it with one custom function (corresponding to 'functionname'):               def LocalMean(input,option,expression):         import arcpy         newGrid = arcpy.sa.CellStatistics(input,"MEAN")         return newGrid      The trouble is that the 'input' (multivalue read in as text) ends up being a semicolon-delimited string of file names, and the function in the custom module can't seem to convert it back to a list of raster layers for Cell Statistics to actually process. As a result I get this **ERROR 000732** :               Script failed because:      ERROR 000732: Input Raster: Dataset Development;Vegetation;Hydrology;Elevation does not exist or is not supported at this location:       I've tried reading in 'input' with .values instead of .valueAsText, so it comes in as a list, but then I get the error that 'cannot concatenate 'str' and 'list' objects' in the getattr line. Any ideas what I can do about this?   * I know this overall structure may seem unnecessarily complicated; but it's a key part of the bigger project. I'm not attached to specifically using getattr here, but solutions which preserve the basic structure, namely calling functions from a custom module using a string of the function's name, would be ideal. Thanks a lot!


title: Missing multipolygon after ImpOSM import to PostGIS

text: I've been testing ImpOSM 2.5.0 with an extract of Washington State (in the U.S.) and am very impressed with the overall result. However, I noticed that fairly prominent lake was missing from the resulting "osm" DB, so I started to dig a bit deeper. I confirmed that the lake is present in the extract, here are it's details:                   <relation id="411923" version="13">                 <member type="way" ref="42114354" role="inner"/>                 <member type="way" ref="42114348" role="inner"/>                 <member type="way" ref="42114344" role="inner"/>                 <member type="way" ref="42114346" role="inner"/>                 <member type="way" ref="42115602" role="inner"/>                 <member type="way" ref="42117265" role="inner"/>                 <member type="way" ref="42125939" role="inner"/>                 <member type="way" ref="52374472" role="outer"/>                 <member type="way" ref="126149886" role="outer"/>                 <member type="way" ref="126149894" role="outer"/>                 <member type="way" ref="52434337" role="outer"/>                 <member type="way" ref="126263156" role="inner"/>                 <tag k="name" v="Moses Lake"/>                 <tag k="natural" v="water"/>                 <tag k="source" v="yahoo_wms"/>                 <tag k="type" v="multipolygon"/>         </relation>      I then checked the DB table definition in geometryc_columns and saw this: > osm=# select * from geometry_columns where f_table_name like '%water%'; > f_table_catalog | f_table_schema | f_table_name | f_geometry_column | > coord_dimension | srid | type   > > -----------------+----------------+-------------------------+-------------------+-----------------+--------+------------ > | public | osm_new_waterways | geometry | 2 | 900913 | LINESTRING | public | > osm_new_waterareas | geometry | 2 | 900913 | GEOMETRY | public | > osm_new_waterareas_gen1 | geometry | 2 | 900913 | GEOMETRY | public | > osm_new_waterareas_gen0 | geometry | 2 | 900913 | GEOMETRY The GEOMETRY type is new to me, but I assume that it is a valid type to store polygons/multi-polygons. I followed the tutorial at http://imposm.org/docs/imposm/2.5.0/tutorial.html and had no problems with any of the steps listed there, but I'm curious if given the nature of this feature, should I have done something more to enable it to be parsed from the extract and created in the DB? Many thanks for any clues you can provide.


title: How to reproject this vector layer?

text: I have a dxf file and use this tool to convert it to shapefile. Then I apply some affine transformations and get a shapefile that does not fit the shapefiles downloaded from osm (EPSG:4326). I know that I have to reproject the shapefile using ogr2ogr (am I right?), but as I began without no clue of what was the original CRS, how can achieve the desired result of all districts in green of the picture on the right to fit as the magenta ones on the left one? Thank you in advance ! ![Cordoba province on CAD \(dxf\) at left, and shapefile after affine at right](http://i.stack.imgur.com/yJKZA.png)


title: Why is sum of st_length() of segments 20% too big?

text: I'm running a query to return the total length of some bike paths, from OpenStreetMap. Compared to the known actual length of these paths, they're all a bit too big - something like 10-30%. I know it may not be possible to down the exact reason, but any possible explanations would be greatly appreciated - I'm new to GIS and could have a basic misunderstanding. The database is PostGIS with OSM extracts loaded in using Osm2pgsql in 'slim' mode. The routes are OSM relations which osm2pgsql converts into a series of lines, for each way with the given relation. My query looks like this:               select route_name,concat(to_char(sum(st_length(way)/1000.0), 'FM99990D0'), 'km')      from planet_osm_line      where route_name like '%Rail Trail' and (tags::hstore -> 'state') is null      group by route_name      order by sum(st_length(way));       Some selected results:                             route_name              | concat      --------------------------------------+---------           Old Beechy Rail Trail                | 60.4km      Great Southern Rail Trail            | 68.5km      Ballarat-Skipton Rail Trail          | 72.2km      East Gippsland Rail Trail            | 123.4km      Murray to Mountains Rail Trail       | 142.5km      Goulburn River Country Rail Trail    | 170.4km      Actual distances are:               Old Beechy: 46km     Great Southern: 49km     Ballarat-Skipton: 56km     East Gippsland: 94km     Murray to Mountains: 116km     Goulburn River Country: 134km      What could account for this discrepancy? (If anything, I was expecting the numbers to be too low, representing missing data in OSM. But they're all too high.) EDIT Now that I actually do the calculation, it's more like 25-40% too high. Here's the osm2pgsql command:               osm2pgsql  --database gis_aus --slim --create --username ubuntu --hstore --hstore-match-only --number-processes 8 [australia-latest.osm.pbf][2]      i ## More info I just measured the distance of this dead straight, flat road: http://www.openstreetmap.org/browse/way/138890161 Google Maps says 8.144km. PostGIS/OSM/st_length says 10.126km. Pretty big discrepancy.


title: Choosing Metadata standard

text: I need help choosing the appropriate Metadata standard for a GDB for a local government. what are your recommendations and why ? what are the main differences between ISO 19139, ISO 19115 and FGDC. Thanks Geog


title: Data Driven Map Book Using ArcGIS

text: I am trying to create a Map book using ArcGIS. I am known to Data driven pages which create pages with GRID by GRID. But I want to create a Map book with the districts of Bangladesh. In every page I want to show one district. There are 64 District. Is there any way that will dynamically create the mapbook where in every page one district polygon will fit in one page while dynamically change few text field derived from data?


title: Exporting shapefile to PostGIS database in QGIS

text: How do I export a vector shapefile to PostGIS database? I am asking what format I have to export it.


title: how to select parts of a shape in QGIS

text: I have to have a Shapefile of France of the bigger regions: Ile-de-France, Bretagne, etc. and that is already included in my shape. But its only shown the Arrondissements (smaller regions) in France and their borders. How can I just show the borders of these bigger regions only? ![Here you can see the shape: Nom_CHF = Name of the smaller region, Nom_region = Name of the bigger region.](http://i.stack.imgur.com/xAmBS.jpg)


title: proj/pyproj converted coordinates offset

text: I'm using pyproj to convert some coordinates from WGS84 to OSGB36. When mapped out the converted and unconverted don't map to the same places on a map. The OSGB36 coordinates are mapped about 100 meters north west of where they ought to be. Does anyone know what might be wrong here? Here's an example of what I'm doing in code               import pyproy     wgs84=pyproj.Proj("+init=EPSG:4326")     osgb36=pyproj.Proj("+init=EPSG:27700")     row = pyproj.transform(wgs84, osgb36, lng, lat)


title: With Python and ArcGIS, how do I add features to a featureclass?

text: In ArcGIS Python code: `CopyFeatures_management` copies features to the same featureclass - that means overwrite to the feature class. How can I add new features to one featureclass or namely different featureclasses and prevent overwriting in the loop?


title: How to prevent base layers from being edited?

text: I've made a local tile server (mapnik + postgis + tilecache). Now i need to make use of some editing tool so that only newly created layer can be edited: users of this tool shouldn't have rights to edit "base" geographic layer (in order not to spoil it). **edit:** I'll try to explain my workflow better: i want to allow users create and edit some _specific_ objects on the map (parts of network infrastructure i.e. routers, optic lines and so on), but the critical feature is to prevent users from editing the geographic map. So, in short, they shoud only be able to edit the layer with our data, but not the data from openstreetmpas (i still need it for being able to update it). I'm using `JOSM` for now, but how can i disable base layer editing?


title: How to find the most spread out locations?

text: Probably a very simple question. I have a list of about a thousand potential geographical locations (lat lon), and of those I need to select the 200 locations that are "most spread out". I think that would be the 200 points with highest total average distance. Think of stores in a city. Is there a defined method to do it? Maybe in an R-package? Thanks to everyone making this the great place to learn it is! /Chris


title: ArcMap - Strange Behavior When Trying To Wire IActiveViewEvents in IDockableWindow

text: I can't seem to wire up IActiveViewEvents for an IDockableWindow. I am using a straight out-of-the-box IDockableWindow which inherits BaseCommand. The snippet below shows what I have added to the autogenerated code. Problem is, when I try to run ArcMap, it (the main ArcMap GUI) never loads. Please see attached screenshot to see what I mean.![bland arcmap gui](http://i.stack.imgur.com/RCTUT.png)                public override void OnCreate(object hook)         {             if (hook != null)                 m_application = hook as IApplication;                  if (m_application != null)             {                 SetupDockableWindow();                 base.m_enabled = m_dockableWindow != null;             }             else                 base.m_enabled = false;                  IMxDocument mxDoc = (IMxDocument)m_application.Document;             IActiveViewEvents_Event activeViewEvents = mxDoc.ActiveView as IActiveViewEvents_Event;             activeViewEvents.ViewRefreshed += new IActiveViewEvents_ViewRefreshedEventHandler(activeViewEvents_ViewRefreshed);         }              void activeViewEvents_ViewRefreshed(IActiveView view, esriViewDrawPhase phase, object Data, ESRI.ArcGIS.Geometry.IEnvelope envelope)         {             MessageBox.Show("ViewRefreshed");         }


title: Tornado Data Points: Linking 2 Points in QGIS on the Same Row

text: So I've got these tornado .csv files that have two latitude & longitude entries with the left-most in the table being the beginning point and the right-most being the ending point of the tornado, as is described here. I'm wondering, how can I link these two points in QGIS, so I get a line?


title: Corrupt shapefile. How to fix

text: I have a shapefile I was working on (ArcGIS 9.3) get corrupted somehow and it gives me the error "Number of shapes does not match the number of table records.". What I would want is to recover this shapefile as it has a lot of edits that other revisions of the file do not have. Earlier I recovered from this error using ogr2gui but the tool now just crashes. I have even tried the command line version **ogr2ogr** but still no luck. This script, Shapefile Repair Tool from the ESRI ArcScript website didn't help either. Any ideas? (except that I stop using shapefiles -- legacy system :-)) * * * Here is the output from ogr2ogr (based on a a suggestion in the answers): ![enter image description here](http://i.stack.imgur.com/aqVlL.jpg)


title: Finding differences between two shapefiles in Python

text: I'm trying to find out whether there were any border changes between two yearly shapefiles. I've heard a lot of praise for Python's open source GIS tools like Shapely/Fiona, and thought I would try those, but I'm at a loss for how to go about implementing this. Is Shapely poorly suited for this task, and, if so, what tool would be better? Any advice you have would be greatly appreciated. Thanks!


title: GeoJSON too bulky - what to do?

text: I am using leaflet.js to allow web users to select a region. Valid regions are US states, Canadian providences, and world countries (except for US and Canada). I constructed a shapefile myself using Qgis and saved it as a geojson. I simplified the geometries as much as I could. The resulting shapefile is 400kb, but the geojson is over a megabyte. This is bigger than I would like. I need to reduce the network overhead involved in transferring this information. What is the right way to do this? The options I can imagine are:   1. Serve the geojson file gzipped, unpack on the client.    2. Parse the shapefile on the client to geojson   3. Generate my own tiles from the shapefile and serve those If anyone could tell me which option is the best (or none of the above) I would appreciate it!


title: How to use stored procedure in Geoserver?

text: I have a MS SQL Server 2008 R2 with and have stored procedure in here. I want to create layer in GEoserver using this. I try:               EXECUTE [dd_base].[dbo].[Request BaseSration]       'param1',       'param2',       'param3',       'param4'     GO      And get `error near key word EXECUTE`.   In Geoserver logs:               ERROR [geoserver.web] - Failed to create feature type     java.io.IOException: Error occurred building feature type      What im doing wrong?