title: Layer Toggling from Multiple Services

text:
I am attempting to modify the Esri sample below that allows for layers of a dynamic server to be toggled on and off. In my case I want to be able to toggle layers from multiple services. http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm My code is below.               <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">                     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">         <meta http-equiv="X-UA-Compatible" content="IE=7" />                  <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>         <title>Explicitly Create Map Service Layer List</title>              <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.2/js/dojo/dijit/themes/claro/claro.css">                                                      This sample loads an ArcGISDynamicMapServiceLayer and presents check boxes for only the layers that should be toggled on and off by users.
               OPPD:
             <input type='checkbox' class='oppl_item' checked='checked' id='0' value='0' onclick='updateOPPLLayerVisibility();' /> Transmission

               XTX-Assets:
             <input type='checkbox'  class='list_item' checked='checked' id='0' value=0 onclick='updateLayerVisibility();'/> Offices

                   Thanks for your help. -Mike Updated: I should point out that I am able to toggle layers from the "layer" service but not from the "oppllayer". They turn off, but never back on.


title: rpy2 installation on Mac OSX

text: I'm desperatly trying and retrying to install rpy2 on my Mac OS 10.6 in order to run SDA4PP plugin on QGIS. My version of R is 2.14.0 and it was obviously compiled with the option _--enable-R-shlib_ since, as I read on a forum, all files in /library/Frameworks/R.framework/Libraries/ share the extension ".dylib". When I run `easy_install rpy2` on the Terminal, here is what I get:               Searching for rpy2     Reading http://pypi.python.org/simple/rpy2/     Reading http://rpy.sourceforge.net     Best match: rpy2 2.2.6     Downloading http://pypi.python.org/packages/source/r/rpy2/rpy2-2.2.6.tar.gz#md5=32d73a3e4acb915ce15d958c9092dcb8     Processing rpy2-2.2.6.tar.gz     Running rpy2-2.2.6/setup.py -q bdist_egg --dist-dir /var/folders/5L/5Li0yCI7EqmkqJ+Ra--M9U+++TI/-Tmp-/easy_install-71n22e/rpy2-2.2.6/egg-dist-tmp-s83lG5     /Library/Frameworks/R.framework/Resources/bin/config: line 142: make: command not found     /Library/Frameworks/R.framework/Resources/bin/config: line 143: make: command not found     R was not built as a library     Traceback (most recent call last):       File "/usr/bin/easy_install-2.6", line 10, in <module>         load_entry_point('setuptools==0.6c9', 'console_scripts', 'easy_install')()       File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/setuptools/command/easy_install.py", line 1671, in main         with_ei_usage(lambda:       File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/setuptools/command/easy_install.py", line 1659, in with_ei_usage         return f()       File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/setuptools/command/easy_install.py", line 1675, in <lambda>         distclass=DistributionWithoutHelpCommands, **kw       File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/core.py", line 152, in setup       File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/dist.py", line 975, in run_commands       File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/dist.py", line 995, in run_command       File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/setuptools/command/easy_install.py", line 211, in run         self.easy_install(spec, not self.no_deps)       File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/setuptools/command/easy_install.py", line 446, in easy_install         return self.install_item(spec, dist.location, tmpdir, deps)       File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/setuptools/command/easy_install.py", line 476, in install_item         dists = self.install_eggs(spec, download, tmpdir)       File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/setuptools/command/easy_install.py", line 655, in install_eggs         return self.build_and_install(setup_script, setup_base)       File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/setuptools/command/easy_install.py", line 930, in build_and_install         self.run_setup(setup_script, setup_base, args)       File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/setuptools/command/easy_install.py", line 919, in run_setup         run_setup(setup_script, args)       File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/setuptools/sandbox.py", line 27, in run_setup         lambda: execfile(       File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/setuptools/sandbox.py", line 63, in run         return func()       File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/setuptools/sandbox.py", line 29, in <lambda>         {'__file__':setup_script, '__name__':'__main__'}       File "setup.py", line 462, in <module>       File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/core.py", line 152, in setup       File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/dist.py", line 975, in run_commands       File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/dist.py", line 995, in run_command       File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/setuptools/command/bdist_egg.py", line 167, in run         self.run_command("egg_info")       File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/cmd.py", line 333, in run_command       File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/dist.py", line 995, in run_command       File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/setuptools/command/egg_info.py", line 177, in run         self.find_sources()       File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/setuptools/command/egg_info.py", line 252, in find_sources         mm.run()       File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/setuptools/command/egg_info.py", line 306, in run         self.add_defaults()       File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/setuptools/command/egg_info.py", line 330, in add_defaults         sdist.add_defaults(self)       File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/command/sdist.py", line 300, in add_defaults       File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/cmd.py", line 319, in get_finalized_command       File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/cmd.py", line 117, in ensure_finalized       File "setup.py", line 155, in finalize_options       File "setup.py", line 319, in get_rconfig       File "setup.py", line 279, in from_string     ValueError: Invalid substring          in string      It says hat R was not built as a library but seems to continue anyway. What does that mean ? What should I do ? Thanks for your help. stan


title: Using field mappings to remove fields from a merged table

text: EDIT: Soreted, thanks :-) I'm trying to combine a (large) number of tables into a merged table, keeping only certain fields. I've tried the below, but it still gives all the fields. Any ideas?               listEventTables = arcpy.ListTables("RS_EVENT_ALL_*")          fieldMappings = arcpy.FieldMappings()          for table in listEventTables:         fieldMappings.addTable(table)          for field in fieldMappings.fields:         if field.name not in ["ROUTE_ID","TRIP_NUM","OFFICE_ID","VOLUME","ACTIVITY","ARRIV_TIME"]:         fieldMappings.removeFieldMap(fieldMappings.findFieldMapIndex(field.name))          eventTable = outGDB + "Merge" # Merge of event tables (has to be in a GDB)          arcpy.Merge_management(listEventTables, eventTable, fieldMappings)


title: QGIS Azimuth and and Distance Plugin

text: Where do I find this plugin? ( I am on v. 1.6 - it does not seem to be installed and I could not find it with the python plugin installer). -Robert


title: Dissolving shapefile python script not working, syntax help please

text: I do not understand why this simple script won't work. I can get it to dissolve in model builder but not from a script that I run from inside the map document. My output results are 4 polygons, just like my input file. I only want one. Any suggestions?               # Import arcpy module     import arcpy     from arcpy import env          # Local variables:     env.workspace="C:\\Test\\shapefiles"          infeatures = "Multipolys.shp"     outfeatures = "C:\\Test\\shapefiles\\Dissolve.shp"          # Process: Dissolve     arcpy.Dissolve_management(infeatures, outfeatures, "", "", "SINGLE_PART", "DISSOLVE_LINES")      correct syntax is:               arcpy.Dissolve_management(infeatures, outfeatures, "", "", "MULTI_PART", "DISSOLVE_LINES")      ArcGIS 10.1 advanced.


title: QGIS Data Management: How to calculate Standard Deviation?

text: does anyone know of a way to find the standard deviation of an attribute lying within any given polygon? The plugin dialog "Join Attributes by Location" gives only the options `Mean`, `Min`, `Max`, and `Sum`. Alternative ways of getting the results are welcome too, of course. I'm using Quantum GIS 1.6.0. Thank you!


title: error while loading osm2po routing sql-script into PostgreSQL

text: please advice what could be wrong in my situation:   * I succesfully generated sql-file using osm2po   * I tried to run it within PostgreSQL and got the following error:              ********** Error **********          ERROR: Table 'BY2_2po_4pgr' does not occur in the search_path     SQL state: P0001     Context: SQL statement "SELECT AddGeometryColumn('','',$1,$2,$3,$4,$5, $6)"     PL/pgSQL function "addgeometrycolumn" line 5 at SQL statement      Working on Win7(x64) with PostgreSQL 9.1 and PostGIS 2.0.1 osm2po ver 4.5.25 Any ideas appreciated!


title: Competing approaches to line & polygon simplification

text: There seems to be a few theoretical options around at the moment for geometric simplification. Douglas–Peucker seems the most established, followed by Visvalingam's approach (used by d3.js). Now there's the relatively new 'Robust Douglas-Peucker' (Pallero?) method. I'm not clear what the relative merits are of these, and I've not had much luck finding libraries for the latter two in open-source environments (R, Python, etc) that would enable me to test them out. So this question is primarily what open-source libraries can anyone point to for alternatives to the classic (but often problematic for topology preservation) Douglas–Peucker. But I think it would also be really useful to have any comments from people with experience of the relative strengths of these approaches, and any links to relevant resources discussing these.


title: Can I validate topology using python script when ArcMap is open?

text: I am testing on validating topology using python.The situation is when I run the script when arcmap is open, an error occurs which indicates the topology has already been opened (FDO error: -2147214980 Cannot acquire a schema lock because of an existing lock), but when I close arcmap,the error disappear and it works properly. Does it means I can't validate a topology when arcmap is open? If can, how can I make it. Thanks in advance.


title: Oracle / SDE: ST_GEOMETRY or SDE Compressed Binary

text: I read data from a SDE database (Oracle) directly. How do I know, which format is used to store the geometry data? Do I have to check the DataType for the geometry column or is this information available in one of the global tables?


title: How to Extract by Attribute Using ModelBuilder with User Input?

text: Using ModelBuilder, I want to create a tool that will let a user choose the value or values that will be used to extract a shapefile. I have a parcel layer with a "Parcel_Type" field. I want the user to be able to choose the type of parcel to extract. So if the user wants to extract the parcels with a type "EL" then he would only have to enter "EL" as a variable. If he wants type "EL" and "CDD" he needs to enter them as multi-variables. That would be the only human interaction with the model. So how can i use those variables in my model?


title: Is the Heatmap Colorramp uniform across different rasters for ArcGIS?

text: SO i have about 16 rasters spanning the same extent and containing the same variable. I use the display symbology in ArcGIS to generate a stretched Color Ramp which is the heatmap i want. As the Colorramp colors adjust to maximum and minimum values within a given raster , does it makes sense to compare two different heatmaps with same colorramp but slightly different statistical distribution ? This is confusing me no end, is there a way to generate a heatmap that is independent of statistical distribution and purely a function a variable value ?


title: geoserver problem to join sql-server table to a layer

text: i have a layer published on geoserver based on a connection to a postgres/postgis Table and i need to add another table existing on sql server to do a data jointure table to table in order to add external data to my layer.. is there any way to do it? tnks in advance to your Help.


title: Export Shapefile To KML - Google Maps Layers/Tiles

text: I need to convert a shapefile (either polygon shp with millions of polygons or polyline shapefile derived from the polygons) into a format to use online in Google Maps. I currently use GDAL codes including MapTileCluster Pro to create image tiles of high resolution rasters to display via the Google Maps web interface, which works very well. My problem is displaying very large vector files that well exceed the limits for KML files in Google Maps (https://developers.google.com/kml/documentation/mapsSupport). I have tried a variety of different methods in converting shapefiles to KML, which is a pretty trivial process for smaller datasets (ArcGIS, ogr2ogr, Global Mapper, etc.). I have also tried burning the vector files to a raster using ogr2ogr and ArcGIS polyline to raster tool; however, the raster looks good either zoomed in or zoomed out, pending the raster size, not not both. I would like suggestions on how to display large vector files (millions of polygons) via Google Maps. Thanks, Matt


title: Is it possible to install qgis plugin in a specific non default directory?

text: Is it possible to install a plugin to a specific directory e.g. `D:\folder` instead of the default one `.qgis\python\plugin`? Furthermore, can QGIS access plugins from different directories and folders?


title: In QGIS, how do I remove a band from a raster?

text: When I process a raster in QGIS it creates a second band. It appears that band has no useful data. I like to use the Raster Colours Tool and it will not accept a raster with anything more than on band. How do I remove the extra band? many thanks in anticipation...


title: How sensitive is Landsat to atmospheric correction?

text: How important is it to correct Landsat for atmosphere, haze and convert DN to reflectance? What impact does it have on the results, say for many of the vegetation indices?


title: How to split a line into a set of equidistant points

text: Used to rely on XTools for this, but in my current environment, I don't have access to it. I'm trying to do this in ArcMap10. The goal is to break a line representation of a stream into a set of equally- spaced points in order to eventually determine z values at those points so that I can determine gradient. * * * My intended workflow is as such.   1. split the stream into points   2. intersect the points with a DEM using GME   3. By determining the distance between the points, I should be able to determine that the gradient is.   4. Seems like it would make sense to integrate the point data back into the original streamlines. Unsure about this step.  * * * I appreciate any critiques of my method, but my priority at this point is converting those streams to points. Thank you!


title: I need to add one table to another table as strings.

text: But all of this two table data is numeric. And one of them is float. So I need to add from the float table only integer and merge it with other table. What to write in field calculator?


title: Generally accepted root mean square (RMS) error for rectifying topographic maps

text: This is a generic inquiry on the common practice/standard for determining the acceptable values of RMS when georeferencing topographic maps. Is there an absolute value? Some literature suggests that it should be "less than or equal to 1/2 of the side of a cell which make up the total resolution of the image."


title: Problem Loading Plug-Ins in QGIS 2.2 on Mac

text: I'm trying to load the 'processing' module in QGIS (2.2.0-Valmiera on Mac OSX 10.8). However, this module and others (e.g. GarminaCustomMap) re failing to load with a message: **ImportError: No module named osgeo** I recently upgraded to Python 3 and have a suspicion this may be causing the problem. Is this likely to be the case and is there a workaround other than downgrading back to Python 2.7 ? I'm using the pre-compiled version of QGIS and I've seen another post on this forum that indicates QGIS includes it's own version of Python, so perhaps the problem lies elsewhere? Thanks


title: Getting coordinates of shortest distance between point and line MS SQL 2008

text: I have a table of point data (POINTS) in a SQL Server 2008 database table (No ShortestLineTo Function!). Each one has a SpatialPoint field of type geography (4326). I have another table of line data (LINES). Each one has a set of points (geography, 4326 as well) and looks something like this: `LINESTRING (-3.6323834096187415 56.610269344608838, -3.6317436657085147 56.610169913782741, -3.631120602112166 56.610079250198808, -3.6304975456164366 56.609988583421483, -3.6302179950805238 56.609929350497836, -3.6298861194017187 56.609789936217744, -3.6292192708989894 56.609439268468428, -3.6290017792165123 56.60930733362, -3.6287490209975957 56.609112972308289)` I know how to get which line is nearest a point and the distance of it... but I can't seem to get the actual coordinates of where the two intersect (If I draw a straight line from the point to the nearest part of the line I am wanting the lat/long of where that is!) I'm hoping there is a fairly easy way of doing this in SQL. I've trawled through the documentation but can't see anything which achieves this. http://msdn.microsoft.com/en-us/library/bb933917.aspx . I must say that the documentation isn't great. Here is my current query which just gives me the distance.               ----For testing     DECLARE @PointID INT     SET @PointID = 1     DECLARE @SearchCount INT     SET @SearchCount = 10     DECLARE @SearchDistance INT     SET @SearchDistance = 15000          SELECT TOP(@SearchCount)          a.PointID,         a.pointGeom.STDistance(b.lineGeom) as [DistanceFromTarget]     FROM          LINES b,         POINTS a     WHERE          a.PointID = @PointID         AND (a.pointGeom.STDistance(b.lineGeom)) < @SearchDistance     ORDER BY a.pointGeom.STDistance(b.lineGeom)


title: Is there any way to get qgis to show a key/legend for categorized colorization (heatmap) scales?

text: I have a shapefile of all of the counties for a state that is being displayed in qgis as a heatmap, colorized on a 12-point scale from red to green. The data producing the colorization is income or housing prices or something like that, age, whatever. A float column. I'm inside of the Layer Properties window of qgis right now for that county layer, and am wanting to produce a key/legend of some kind I can easily display with the maps for interpretation. I could produce this key by hand but it would be time consuming and not worthy of this stackexchange question. Thanks


title: Help importing osm data into spatialite

text: I am trying to import OSM data into Spatialite. The data is a query from overpass called features.osm I'm using spatialite 3.0, and following examples, I have created a new database with:               $ spatialite features.sqlite      then I import the data using               $ spatialite_osm_net -o features.osm -d features.sqlite -T features      This results in the following output:               SQLite version: 3.7.9     SpatiaLite version: 3.0.0-beta               Loading OSM nodes ... wait please ...         Loaded 11 OSM nodes          Verifying OSM ways ... wait please ...         Verified 0 OSM ways          Disambiguating OSM nodes ... wait please ...         No duplicate OSM nodes found - fine ...          Loading network ARCs ... wait please ...         Loaded 0 network ARCs          Dropping temporary table 'osm_tmp_nodes' ... wait please ...         Dropped table 'osm_tmp_nodes'          Dropping index 'from_to' ... wait please ...         Dropped index 'from_to'          VACUUMing the DB ... wait please ...         All done: OSM graph was successfully loaded      However when I open the database and view the contents of 'features' table, its empty. What am I missing here? Perhaps I'm trying to fit a square peg in a round hole? What I want, is to be able to store osm data in the sqlite database and execute queries to retrieve nodes/ways/relations for a specific bounds (just like my original url request).


title: Purpose of building footprints

text: What are the uses (public and private industry) of building footprints? I'm trying to figure out how polygon building footprints can be used. i.e. are they used for determining tax liabilities, etc...


title: How to transform ETRS to EPSG?

text: I have data in the ETRS 89 LAEA format (SRID: 3035). But I have problems to transform it. Example data: N2736 E4541 I want to transform it to EPSG WGS84 (SRID: 4326), to check the coordinates on a map. My transformation looks like this: SELECT ST_AsText(ST_Transform(ST_GeomFromText('POINT(27.36 45.41)',3035),4326)) I get: POINT(-29.0867265338903 12.9940786314927) But the point should be in Germany and not in the atlantic ocean :(


title: Select attributs of wms/wfs layers

text: I want to select polygons in wms/wfs layers (openlayes). I used the code of this example http://openlayers.org/dev/examples/getfeature-wfs.html . Then, when I select a polygon in my the layer, nothing is selected, I don't no why. Could you help me please. Thanks Here is the code : WFS: GetFeature Example (GeoServer) var map, layer, select, hover, control;                   function init(){             //OpenLayers.ProxyHost= "";             //OpenLayers.ProxyHost= "proxy.cgi?url=";             map = new OpenLayers.Map('map', {                 controls: [                     new OpenLayers.Control.PanZoom(),                     new OpenLayers.Control.Permalink(),                     new OpenLayers.Control.Navigation()                 ]             });             layer = new OpenLayers.Layer.WMS(                 "States WMS/WFS",                 "http://v2.suite.opengeo.org/geoserver/ows",                 {layers: 'usa:states', format: 'image/gif'}             );             select = new OpenLayers.Layer.Vector("Selection", {styleMap:                  new OpenLayers.Style(OpenLayers.Feature.Vector.style["select"])             });             hover = new OpenLayers.Layer.Vector("Hover");             map.addLayers([layer, hover, select]);                  control = new OpenLayers.Control.GetFeature({                 protocol: OpenLayers.Protocol.WFS.fromWMSLayer(layer),                 box: true,                 hover: true,                 multipleKey: "shiftKey",                 toggleKey: "ctrlKey"             });             control.events.register("featureselected", this, function(e) {                 select.addFeatures([e.feature]);                 alert("yes");             });             control.events.register("featureunselected", this, function(e) {                 select.removeFeatures([e.feature]);             });             control.events.register("hoverfeature", this, function(e) {                 hover.addFeatures([e.feature]);             });             control.events.register("outfeature", this, function(e) {                 hover.removeFeatures([e.feature]);             });             map.addControl(control);             control.activate();                  map.setCenter(new OpenLayers.Bounds(-140.444336,25.115234,-44.438477,50.580078).getCenterLonLat(), 3);         }     </script>      WFS GetFeature Example (GeoServer) WFS, GetFeature Shows how to use the GetFeature control to select features from a WMS layer. Click or drag a box to select features, use the Shift key to add features to the selection, use the Ctrl key to toggle a feature's selected status. Note that this control also has a hover option, which is enabled in this example. This gives you a visual feedback by loading the feature underneath the mouse pointer from the WFS, but causes a lot of GetFeature requests to be issued.


title: Changes in synchronized replica not shown in ArcMap or ArcCatalog without refreshing

text: I am synchronizing a one-way replica in ArcEditor using Python. I tried adding RefreshActiveView and RefreshCatalog to the code, but I still need to refresh the synchronized database to see the results. Here is a code snippet:               Connection_to_geoDBReplicationTest = "C:\Connection to geoDBReplicationTest.sde"          Connection_to_geoDBRepTest_2 = "C:\Connection to geoDBRepTest_2.sde"          arcpy.SynchronizeChanges_management(Connection_to_geoDBReplicationTest_sde,      "GISUSER.timedTestReplica2", Connection_to_geoDBRepTest_2, "FROM_GEODATABASE1_TO_2",      "IN_FAVOR_OF_GDB1", "BY_OBJECT", "DO_NOT_RECONCILE")          arcpy.RefreshCatalog(Connection_to_geoDBRepTest_2)          arcpy.RefreshActiveView()      Any thoughts? the code does work, but I would prefer the user did not need to refresh the database in ArcCatalog each time...


title: Some related table fields not displaying in ArcPad 8

text: I have an issue that I have been struggling with and I'll try to explain without getting too confusing. I have an AXF that is displaying only some of the fields in a related table on the default attributes page for related tables. So here are the details, I have 6 fields in the related table and a relationship class that relates the table to the relationship class. Here are the specifics of the relationship; feature class is the origin, related table is the destination, relationship is composite, messages are forward, 1-M, Primary key is GlobalID (GUID) to AuditID (GUID). The AXF is checked out from ArcMap. When I open the AXF in ArcPad 8, and select a feature to view the related table attribute page, the list view page is only displaying 4 of the 6 fields (Inspector - text field, Pass/Fail - coded domain, contractor - coded domain, and comments - text field). When I switch to single line view to add data, the only fields I see are Inspector, Pass/Fail and contractor. The comments field is not displayed (even though it was displayed on the list view page). The other fields in the table (AuditID - GUID primary key, AuditDate - date) are never displayed on either view of the attributes table. When I first developed the related tables and relationships, everything was working as expected with related table fields displaying in ArcPad. When I created the production version of the geodatabase and added the related tables and relationships, things are not displaying the same. Any yes, I created the prod database the same way I create the development one. If any one has any insight or an answer to what could be happening, I would really appreciate the help. My client is waiting for this application and I need to get out to the customer ASAP. Thanks. Tim


title: GRASS Geoprocessing in Python Script

text: I´m trying to get some GRASS geoprocessig tools running in a python script outside GRASS. I´m able to import grass.script, but I´m not able to get the tools running yet. Does anybody know what I´m doing wrong?               import os, sys     import subprocess as subp          gisbase = os.environ['GISBASE'] = "C:/GRASS GIS 7"     gisdbase = os.path.join(os.environ['HOME'])     location = "Martin"     mapset   = "PERMANENT"          sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "python"))          import grass.script as grass     import grass.script.setup as gsetup          gsetup.init(gisbase, gisdbase, location, mapset)     grass.run_command("v.hull", input="D:\Python_Test\1.shp", output="D:\Python_Test\5.shp")      It runs up till `grass.run_command`, but as a result I only get `-1073741515` in pythonwin. Once I get this running, I want to combine ArcPy and GRASS tools in one script. Could it have to do something with the fact that I´m using the ArcGIS Python installation (2.6)? Sorry if this is a stupid question, I´m still a python beginner with not too much programming experience.


title: Calculating Maximum Distance from Centre of a Polygon to the Boundary of a Polygon

text: I have a polygon ready in QGIS. What I want to do is to calculate the maximum possible distance in kilometres from the centroid of the polygon up to the boundary of that polygon. I need two things:   * Maximum possible distance covered from the centroid of the polygon up to their boundary   * centre of the Polygon (Lat/Long)


title: Clipping raster by multiple datasets or polygons?

text: I would like to clip a DEM using a grid of polygons. It's probably easier to use multiple polygons in one shape file, but I haven't managed this so I'm trying to use a for loop so I can loop through each dataset in a gdb (each contains only one polygon). Here's my code (doing it in the python window).               #creating a workspace and a list of feature classes     arcpy.env.workspace = "C:/data/lidar/lidar.gdb"     fcs = arcpy.ListFeatureClasses()          #looping through each feature class and creating a raster based on the extent of        #feature class          for fc in fcs:         arcpy.Clip_management("perth", "#", "C:/data/lidar", fc, "", "ClippingGeometry")      My code doesn't execute however, it just sits there, waiting for something else... but what? I can get it to work for one clip, but not with the loop. I'm sure I should be doing something else for the output, to name each new raster by feature class or something... but again, don't know how. Please let me know if I should add any more info.


title: Calculating MCP in QGIS

text: QGIS 1.8.0. Scipy installed. Statsmodels installed. Using Sextante to try to calculate MCP. When I run the MCP calculation from the Toolbox, a layer is added to the file, but the layer doesn't contain any information. The input layer contains a set of points and the field I select from that layer contains OS grid references. Does anyone have any ideas what I'm doing wrong? Any help much appreciated.


title: openlayers detect start of pinchzoom

text: I have a function that i want to call when you start pinchzoom on the map. This function turns off all vector layers to improve performance while panning zooming. I got another function that is called with "moveend" which turns the vector layers back on after zoom pan finishes. I have both these functions already written. I registered "movestart" and "zoomproxy" hack to trigger the layers to be turned off as soon as user starts panning or zooming. Everything works except on a mobile device where pinch zoom does not turn off the vector layers. it does not seem to call my function. I know there is a pinch handler that could possibly be added onto a control and attached to the map. Could you please provide some details on how to do do this and in turn call my function to turn off layers at the start of pinch zoom. Much appreciated. Thanks


title: Examining the covariance between biodiversity and other variables

text: I have som problems with an analysis and would be **very grateful** for any answers or suggestion. The background is: - I want to examine the **covariance between ecosystem services** in an area. I don´t really know if covariance is the correct word, however. I have identified and combined different variables indicating high biodiversity using the weighted overlay and graded the areas from 1-10, whereas 10 is indicating high biodiversity. Now I want to investigate how the biodiversity covariates/coexists/relates (english isn´t my native language) with other variables. The other variables could be biotopes, soil type or other ecosystem services, like recreation. My data consists of: - polygons with the graded biodiversity and also the same areas in a raster. - polygons indicating biotopes, soil type, precipitation etc. - polygons indicating whether an area is used for a certain activity like mushrooming and so on. The polygons are divided into green spaces at a county level. So, what I basically want to do is to se if there are any hot spots where biodiversity are more likely to coexist with an other variable. I would like to visualize it on a map but also get a diagram over the relationships. **How do I do?** ![enter image description here](http://i.stack.imgur.com/wlHNu.jpg) Oh, I noticed I wasnt allowed to post pictures. I hope you understand anyway! Thanks in advance! ![enter image description here](http://i.stack.imgur.com/wwBKQ.jpg)


title: Discrepancy Between Polygon and ImageOverlay

text: I have a map in projection EPSG:26911 that I defined this way (using the proj4leaflet plugin):               var crs = new L.Proj.CRS("EPSG:26911", "+proj=utm +zone=11 +ellps=GRS80 +datum=NAD83 +units=m +no_defs");     crs.scale = function(zoom) {         return 1 / (1024 / Math.pow(2, zoom));     }      I have a rectangle defined as a polygon:               var p = L.polygon([         crs.projection.unproject(L.point(717105,5959423)),         crs.projection.unproject(L.point(747105,5959423)),         crs.projection.unproject(L.point(747105,5920423)),         crs.projection.unproject(L.point(717105,5920423))     ], { "weight": 0 });      If I try to put an ImageOverlay exactly over this polygon with               L.imageOverlay("some_url", p.getBounds(), { "opacity": 0.5 }).addTo(map);      they do not line up. The SVG is in the right location. The img element is not. The error in longitude is greater than the one in latitude. Both location and dimensions of the img do not align with the SVG. With the data from the resulting SVG path element for some zoom level:               d="M155 200L272 200L272 352L155 352z"      The img element style of the overlay is:               transform: translate(148px, 200px); width: 132px; height: 152px;      but should really be:               transform: translate(155px, 200px); width: 117px; height: 152px; //width: (272-155)px;height: (352-200)px;      This would align perfectly (The latitude and height are fine for this particular zoom but that changes if zoomed in further). What is going on that I get this behaviour? How to correct it if something is wrong?


title: Are there any exisiting .NET implementations for WFS that are extendable?

text: I've been told its a bad idea to implement WFS from scratch: Implementing WFS within .NET Does anybody know of any exisiting .net implementations that I can extend?


title: MassGIS Data Layer & PostGIS lat/lon not finding correct gemos

text: I am using the MassGIS House District data layer with `srid 26986`. I then query for the geom containing the lat/lon `42.21, -71.5` which should give me Boston but I got nothing. So I used OpenJump to visualize this and the point is rendering a few hundred miles south of the House District geoms: ![](http://i.imgur.com/Dm7zWmo.png?1) I am guessing there is something wrong with the projection but according to multiple sources this is the correct `srid`: http://www.mass.gov/anf/research- and-tech/it-serv-and-support/application-serv/office-of-geographic- information-massgis/datalayers/overview.html. Any pointers?


title: How to write shapefiles more efficiently in GeoScript?

text: I've created a geoscript (in groovy) to create a shapefile from generated geometries with certain attributes. It's a heatmap consisting roughly 65.000 polygons with an attribute storing the temperature. The final code to write the shapefile looks like that:               dir = new Directory("/my/path")     shp = dir.create('heatmap',                      [                          ["geom", "Polygon", "epsg:4326"],                          ["temp", "float"]                      ]                     )     // ...     temperatures.eachWithIndex{ temperature, index ->         shp.add([geometries[index], temperature])     }      The last line is the issue here. Adding each of the 65k attributes to the shapefile is taking ages. I've found out that (because shapefiles are a proprietary, binary format) adding each geometry causes the shapefile to completely be rewritten from scratch. The result is, that the efford to write records to a shapefile is not linear but exponential to the number of records. That's a huge problem. Is there any way to write the stuff more efficiently to the shapefile? I got all geometries and all attributes stored in arrays, isn't there any way to write them all at once?


title: Image segmentation in SAGA Tutorials

text: I am searching for tutorials for the Image Segmentation modules of SAGA (version 2.0.8). The official wiki from the software doesn't contain any info on this modules, same thing happens in the references (http://www.saga- gis.org/en/about/references.html). Does anyone know where I can find some basic tutorials with examples on how to use those modules? Thanks in advance.


title: Can ArcGIS Desktop 10 stack layers?

text: I have 7 bands of Landsat and I would like to combine all layers into one layer. Can ArcMap do as Erdas software?


title: Routing from individual start point to individual destination point

text: I'm doing routing on android using OpenStreetMap. The routing is working well. But the problem is that I do not know how to use the individual points of the user. I use osm2po to convert the OSM data to a routable graph. At the moment I'm finding the nearest routing point of the user individual selected point. But this is not a satisfying solution. Because it can happen that the user is selecting the middle of the street, but in the most cases the next routing point is at the end of the street. So it can happen that the end point is at the one side or on the other side. **What I tried?** _First_ I tried to connect the routed start/end point with the selected individual point. But that provides sometimes routes where the user has to go back. _Second_ I tried to calculate the distance from the second last point to the last point and to the individual selected point. This works for some examples well, but not for all. So the problem is that the Geom_Way does not represent the line with points in a defined distance. So I thought it is like this start point o---x---x---x---o dest point. Where o are start/dest point and x middle points. But this is only available by curved lines. Straight lines have only o ----------o a start and a destination point. Therefore the second last point in the routed point list can be far away and I can get the following construct: ![enter image description here](http://i.stack.imgur.com/direW.png) I remove the coordinates as long as the distance from the last point is shorter to the destination point as to the second last point. But this can cause that all point will be removed. Otherwise if I do it only once, than I run in the cases that maybe to less points will be removed and therefore the result do not correspond to that what I want. So it is at moment a bit luck to get right result. Is there any possibility to make a routing from an individual point to an individual point by using OSM? I don't want to use neither pgrouting nor storing of routes in the database. It is classically routing: User selects two points and the software is delivering the way from start node to the destination node. **EDIT:** Maybe I calculate the distance wrong. I use UTMCoordinates and not Lat/Long. The distance will be calculated by using the Euclidean distance and I calculate the difference of lat/long from the first two coordinates.


title: Is there a way to change environment settings of a dataset without creating a new one?

text: I am trying to change the environment settings of an existing dataset.   I found a workaround by first changing the environment settings in the SDE- database and then create a new dataset with now correct settings. Now I copy&paste my features from the old to the new dataset. But I guess copying is rather dangerous because some database information might be lost? So I would like to avoid it.   The values I would like to change are:   XY-Tolerance   XY-Resolution   Z-Tolerance   Z-Resolution   Z-min.Domain   M-Tolerance   M-Resolution   I am aware that with changing these values the features will grow/shrink/move a tiny bit.   Any help is appreciated!


title: Where can I get a WMS or WFS for near-real time Wind (atmospheric) data?

text: I've been looking for a good operational wms or wfs free server to access near-real time atmospheric data in QGIS, namely wind vectors. I haven't found anything good yet. Anyone can help? Thanks


title: GEOS Python: Taking Union of several geometries

text: I am using the GEOS/OGR library in Python. I have files full of geometries that overlap, and I want to convert these to files of geometries that don't overlap. The way I have been approaching this is to just read in all of the geometries from a file, and then looping over each geometry and taking the Union() of that with all of the previous geometries. So something like:               def dedup(geometries):        """Return a geometry that is the union of all geometries."""        if not geometries:  return None        current_union = geometries[0].Clone()        for g in geometries:           current_union = current_union.Union(g).Clone()        return current_union      Most of the time this appears to work, but occasionally Union() will return None. My debugging reveals that under these cases:   * IsValid() returns true for both g and current_union   * Intersects() return true between g and current_union   * GetGeometryCount() for current_union typically returns a number over 100.   * I suspect the error might be some kind of memory issue because it seems like the error "moves" depending on context. Ie if I say run this on files 1-100, it might crash on file 20, but if I say run it on files 20-100, it might crash on file 40. I never use Destroy() on any geometries. Task Manager does not show me running out of memory though. Anyway, maybe there is an easier way to do this? Or else does anyone have any idea why it is crashing here? Thanks much in advance!


title: Label background in SLD

text: Is there any possibility to construct SLD style which displays label with rectangular background. Background has to have sizes which automatically fit to sizes of text content. I would prefer not to use any vendor parameters because SLD has to be used in more than one application. This is an example of desired label generated in QGIS (unfortunately QGIS doesn't export label specification from this label configuration): ![enter image description here](http://i.stack.imgur.com/5Ufn3.png)


title: passing a variable into mapfile

text: How can one pass a variable into a mapfile using mapserver with pmapper I would like to learn how generate maps dynamically having different extent, layers, default settings, etc.. by varing a variable in just one mapfile. This variable could have different values, e.g. depending from user&password login. Thank You


title: How to join interrupted river lines?

text: I have a vector map that I converted from a raster, representing the rivers in the map. However, because the colours in the map were very diffuse, the resulting vector map has many interrupted lines. Is there a way to extend the lines until they touch another, and then join the touching ones into a single line? I am using QGIS with GRASS. Thanks


title: Open Source Tools for Mobile GIS app development?

text: I want to create a complete **Map application** with the facilities of edit geometry and attributes of layers. The server and client for the application should be some **open source tools**. The application need to run with **Windows Phone 7, iOS and Android**. Please give me suggestions on the Open Source Tools selection for my development. As a first step i am planning to start with Windows Phone 7.


title: How to create a Hillshade model with multicolor "alà Imhof"?

text: I would like to make a Hillshade-Model with multicolor "alà Imhof". That means, I dont want a "usual" gray hillshade, I would like to use grey-blue and grey-violett from different sun directions. Any idea how I could do that with qgis? Are there any plugins?


title: ArcGIS ModelBuilder: how to wait for Python script to complete

text: I have an Arcgis (10) model which has 2 process that need to be run sequentially. The 1st process is a python script that creates multiple rasters, but that output is not known to Model Builder, therefore I can't use it as a precondition. Or at least not as outline in Example #1 in that page. Maybe there's another route I haven't discovered. The 2nd process needs those rasters in order to operate. How do I let #2 know when #1 is complete so it may start execution? To reproduce build a model with: Process_1: a script which runs PolygonToRaster several times, converting each field in the attribute table to a raster (here, but field list will need to be edited). Process_2: Run LessThanFrequency Spatial Analyst tool on the results (but really the tool doesn't matter).


title: Map is missing when I "export as image" via print composer

text: I have point data on a vector layer that prints accurately via print composer (when I "export as image"), however my map below either does not show up or shows up at an incorrect scale. I used openlayers plugin yahoo street map for the map. I have examples to illustrate what is happening, but can't post them here since this is my first time. I'd be happy to email them to someone if you have ideas as to what might be going on. I'm new to the world of QGIS, so any help on this would be greatly appreciated. Thanks!


title: How to create an ArcObjects point with latitude and longitude?

text: I need to add a point in an existing feature class using .NET API of ArcGIS Server 10 in C# (Visual Studio 2008). I'm using a sample from ESRI Resource Center (ArcGIS_SimpleEdit_CSharp). The following shows the portion of the code that creates the new point using X/Y coordinates.               ESRI.ArcGIS.Geometry.IPoint aoPoint =          serverContext.CreateObject("esriGeometry.Point") as ESRI.ArcGIS.Geometry.IPoint;     aoPoint.PutCoords(actionRecord.Location.X, actionRecord.Location.Y);          ...          // Create a feature and set its geometry and attributes to those specified by the     // passed-in action record     ESRI.ArcGIS.Geodatabase.IFeature feature = featureClass.CreateFeature();     feature.Shape = aoPoint;     feature.set_Value(featureClass.FindField("Name"), actionRecord.name);     feature.set_Value(featureClass.FindField("LocationId"), actionRecord.id);     feature.set_Value(featureClass.FindField(actionRecord.id), "1");     int trackingNumber = feature.OID;          // Commit the new feature to the database     feature.Store();     workspaceEdit.StopEditOperation();     workspaceEdit.StopEditing(true);      But I need to use Latitude and Longitude (with decimal precision) instead of X/Y coordinates. How can I do that? Can I just use lat/lon instead of X/Y? Or I have to convert lat/lon to X/Y before assigning feature.Shape?


title: KML PHP parser to INSERT into database

text: So I have a KML file which has attribute data(Inside the tag with about 12 data points). This file was generated on ArcGIS. I'm trying to write a PHP script to parse this KML file and insert the datapoints within the ExtendedData tag into a db. How do i do this?


title: Using python, how do you "reload cache" an opened Attribute Table

text: Used python to update a shapeFile through cursors. The Shapefile is updated, but there could be an opened Attribute Table. Manually you can hit "reload cache" to update the Attribute Table and see the changes. I would like the python script to reload the cache, so the user does not have to remember to do this.


title: How to create spider diagrams (hub lines) in PostGIS?

text: I'm rather new to PostGIS but I have done a lot of reading. One thing that I have been searching for is a function that allows users to create a "spider diagram" (also called "desire lines" or "hub lines") in PostGIS. As an example, draw lines from a grocery store (point) to all geocoded customer addresses (point) of that grocery store. Of course, though, imagine that there were hundreds of stores and thousands of customers. I would imagine that each store would have a unique ID that each customer point would have embedded within a field so that the software knows the origin-destination connection. Is there a simple ST_ function that will accomplish this task, or does this require combining multiple queries to accomplish the task?


title: Polyline selection of features with angle turns up to a specified angle

text: I'm looking for an automated way to select line features that have specified angle between vertexes. That in order to check water mains layer -steel pipes can have only 45 or 90 degrees turns and I need to check the digitizer work. ArcMap Data Reviewer have a tool for that, but i don't have this extension.


title: Specifying a rectangle as two latitude/longitude pairs, one for center and one for size

text: I am trying to make sense of the Google S2 library for spherical math (it works like this). I need to get a rectangle for searching for nearby entities in a database, based on a point and a distance (say, 10km, the distances do not have to be exact, I filter the entities later). In the S2 library there is a function with the signature:               RectFromCenterSize(center, size LatLng)      Both parameters are latitude/longitude pairs. I am having difficulty understanding what this means (the documentation is unfortunately very poor). The center point I get, but how does the a lat/lng pair specify the size? Any help would be greatly appreciated.


title: Using histogram in ArcGIS 10 with dates and sum of values

text: I have a point feature layer in ArcGIS. I want to add a histogram which shows a histogram for selected points. This works perfectly. Two problems:   * I have a datefield, which spans about three years. I would like the histogram to show totals by month and year. I bypassed the lack of option to do this by calculating year+month/12-1/12. It works, but it's hardly elegant. Also, the X-axis is dynamic, which I don't want. I would like the x-axis to show the whole period, not just months with observations   * I want the graph to show the total for the values in an attribute for the selected features. With a bar graph this seems to work, but it behaves erraticaly. I cannot imagine no-one has done something like this before, but searching Google did not help me out.


title: Compute global DEM topographic indices and compromise projections

text: I would like to compute global topographic indices based on SRTM elevation data. These indices are computed along river/channel networks extracted from a DEM and are a functions of both local slope and upstream area obtained from a flow accumulation routine. For those that are familiar them, the indices I am interested in are a stream power and channel steepness index. To compute these on a global grid (worldwide from ca. 60°N to 60°S) and to be able to compare slopes and areas in different regions of the world, I was thinking about using compromise projections such as a Dymaxion/Fuller map, which would limit both area and angle distortions. These would allow me to treat the earth as a whole and ease the processing. However I have a hard time getting a handle on the distortions these kind of projection induce and the associated uncertainty or bias in slope/area (I would be happy with less than a few percent). Alternatives could be to split the map into small regions where UTM projections would provide good alternatives, but this would mean a more complicated workflow. Another alternative is to go for a conformal projection to get the slopes right and then run a flow accumulation routine that is weighted by a correction grid which would account for changes in area with changes in latitude. **Does anyone have comments or suggestions about these workflows?** As these global estimates are computationally intense I'd better think twice about the right projection to use.


title: A PROBLEM WITH XML Standard Layer Descriptor for GeoServer

text: I wrote an xml in Standard Layer Descriptor for GeoServer, with the objective to map a satellite image with discrete values. I wrote:               < ColorMap type="intervals">       < ColorMapEntry color="#000000" quantity="0" label="b"/>         < ColorMapEntry color="#00FF00" quantity="10" label="c"/>       < ColorMapEntry color="#FFFF00" quantity="20" label="d"/>      < /ColorMap>      The problem is that a value corresponds to a color set in a previous line, for example the pixel value 10 corresponds to #000000 color (but this color has to corresponds to value 0.)


title: arcGIS - viewshed calculation using a DSM and DEM

text: I am fairly new at using arcGIS.   For work we use it only to create viewshed analysis   using DEM - or bare earth terrain. I can create these fine,   However i need to create one showing the effects of vegetation & buildings, I have recieved a DSM of the site,   but if i take it through the normal process.   as we do for the bare earth, it calculates the DSM surface, rather than calculating the view from the terrain,   so for example, where there are clearly trees and buildings,   it shows that you can in fact see the observation point,   even though you know you wouldn't because of the tree and buildings would be covering it.   I cant seem to find any step by step tutorials that can help me out,   I'm sorry for my lack of detail and wording on explaining my problem.   i am really really new to this, and have been thrown in the deep end by work wanting me to find the answer!   Thanks


title: How to find the intersection point of polygon geometry and multilinestring geometry in postgis

text: I have a polygon geometry and multilinestring geometry. How do i find the intersection of both these geometries. Both the geometries are in same reference system. Does st_intersection gives me the intersection point???


title: How to sample elevation data at 30m resolution at every 3m interval?

text: I want to sample DEM data, 30m resolution, at every 3m under a drawn line and wondering if there is any built-in tool within ArcGIS 10.1. My take on this is to convert line (feature) to point and somehow define point interval to be 3m and then retrieve elevation values for each of those points. Please suggest on how to control the point interval or any other way of handling this task.


title: What can I do with this unzipped GDB file in QGIS?

text: I have a zip file that I got from the City department of information technology. Unzipped, it is a directory called `DOITT_ZIP_CODE_01_29JUL2009.gdb` containing a bunch of `.gdbtable` and `.gdbtablex` files. I'm not super seasoned in GIS but I'm pretty sure I ought to be able to open this in QGIS. I can't figure out a combination of parameters that will let me open it, however. I really just need to get the data out, so I'd be happy to use something like GDB Flee but it can't seem to read the .zip and the .gdb is a directory. Note: These instructions (How to migrate GDB data into PostGIS without ESRI apps?) suggest I could use a command line tool, `ogr2ogr` but mine doesn't seem to have FileGDB support. What is my next step?


title: Is there a way of viewing a photo has a point tag from Photo2shape in QGIS?

text: Is there a way to view images (photos) that have location point from Photo2shape by clicking on the point in QGIS?


title: Canadian province boundaries in latitude and longitude

text: Are there any datasets available that give a list of latitude and longitude points for Canadian province boundaries? I don't need anything too detailed as I'm displaying collated data in smallish info graphics.


title: Case studies of Participatory Spatial Planning

text: I am wondering if you know any well implemented geoportals for Participatory Spatial Planning. I am looking for the one related to environmental protection or connected somehow with the topic (but of course not only- if you have any just put it here).


title: How to calculate the number of cells with a given value?

text: I have a raster file where all cells have values between -3 and 7, no data value is -9999. Have can I calculate the number of cells with a specific value e.g. 6? Can I use the calculator?


title: Which UTM system do you recommend for Tamaulipas, Mexico?

text: I'm working with QGIS 1.8.0. Could anyone tell me which UTM system would be better to project a map of Mexico? There are too many to choose from. I have to convert my maps from WGS84 to UTM to do some distance measurements. Please let me know. Regards!


title: ResultObject: Error in getting output

text: I am getting "ResultObject: Error in getting output" message when I run the following code. I know it has something to do with "os.path.join" but can't figure out what. Thanks. Sam               import arcpy     import os              arcpy.env.overwriteOutput = True         CADInput = arcpy.GetParameterAsText(0)         OutputFolder = arcpy.GetParameterAsText(1)         OutputGDB = arcpy.CreateFileGDB_management(OutputFolder, "AllPipes.gdb", "CURRENT")         SpatialReference = r"C:\Program Files (x86)\ArcGIS\Desktop10.0\Coordinate Systems\Projected Coordinate Systems\UTM\NAD 1983\NAD 1983 UTM Zone 17N.prj"         OutputData = arcpy.CreateFeatureDataset_management(OutputGDB, "Data", SpatialReference)         OutputCAD = arcpy.CADToGeodatabase_conversion(CADInput,OutputGDB,"CAD_Converted","1000",SpatialReference)         OutputCADLocation = OutputCAD.getOutput(0)                   layerfld = arcpy.AddFieldDelimiters(os.path.join(OutputCADLocation,"Point"),"Layer")         query = layerfld + "='WM-VALVE-ID'"         arcpy.MakeFeatureLayer_management(os.path.join(OutputCADLocation,"Point"),"Valve_lyr8",query)         outfile = os.path.join(OutputData,"Valve")         ValveFC = arcpy.CopyFeatures_management("Valve_lyr8",outfile)         arcpy.Delete_management("Valve_lyr8")


title: Identify point informaiton openlayer works GeoExplorer not

text: I am using the OpenGeo Suite. I can preview a layer in the GeoServer Openlayer view, I can click on points and see the data from a layer produced from a PostGIS view. However when I do this in Geoexplorer I click and nothing happens. But if I click on a standard layer produced from a table (happens to contain the same geom data, just different fields) I can identify the point data. I should say, i click the point, and in firefox it brings up the little load icon, but that then disappears. **Update** I have narrowed down the issue to be with views with a Where statement that limits records that are only a certain species. Without this where clause the layer allows me to click. Going to try make the view using geoserver rather than Postgresql directly. **Update 2** The above did not work, with the geoserver query. See my SQL below: The issue comes when I place the last where clause. The layer still loads and I can see the points, in geoexploer + openlayers, but I can only click and identify points in the open layers example?               SELECT       taxom_tbl.scientificname,       sheet_tbl.eventtime,       sheet_tbl.eventdate,       sites_tbl.the_geom,       sites_tbl.sitename,       rivers_tbl.rivername,       rmi_group_tbl.rmigroupname,       record_tbl.category_of_taxom,       record_tbl.number_of_taxom     FROM       public.taxom_tbl,       public.sites_tbl,       public.sheet_tbl,       public.rmi_group_tbl,       public.rivers_tbl,       public.record_tbl     WHERE      taxom_tbl.taxom_id = record_tbl.taxom_id AND     sites_tbl.site_id = sheet_tbl.site_id AND     rmi_group_tbl.group_id = sites_tbl.group_id AND     rivers_tbl.river_id = sites_tbl.river_id AND     record_tbl.sheet_id = sheet_tbl.sheet_id AND     taxom_tbl.scientificname = 'Cased caddisfly'      Any suggestions?


title: How do I prevent Google Earth (Pro here) from zooming out to the global level everytime it is unsure of a directions search?

text: This has got to be one of the most annoying things I've dealt with in a while... When I do a google earth pro search to get directions from a pin to say, "groceries",               [Search Google] | Parcel Search (APN)     "from:35.9915465209, -79.977916352 (1600 1618 AUDUBON ST) to:groceries"      google earth prompts (wisely),               Did you mean?     1.) Kroger     2.) Food Lion     ...      and so on. Unfortunately, as it is doing this, it also zooms out from, in my case, a neighborhood level to a satellite level. And not slowly either! Not at all. I'm 10,000 miles away from what I'm studying in less than a second. Is there anyway to prevent this? i.e. Google Earth zooms out to global level **rapidly** by default every time it comes across a user choice (`"Did you mean"`) instance THEORY: One way to get around this would be to change the default location where Google Earth starts. In my case, every time I boot up Google Earth it starts me off somewhere above the Atlantic Ocean between Africa and South America. If I could get it to start out directly above the Southeastern United States or North Carolina, for example, that would possibly solve my problem as this also appears to be where Google is (yep, just checked) taking me ultimately when the dumb-zoom-out finishes. If I could change this "`STARTUP_LOCATION`" value maybe I could prevent this wacked zoom-out effect from happening. EDIT: The hack fix right now is to, after you click the "Search" button, immediately "grab" the map to prevent it from zooming out. You can normally stop it if the timing is right before you're more than 30-100K feet above the ground


title: Why does an OpenLayers map.getNumLayers() return 0 even though I've added a layer?

text: When I try the following code, `OpenLayers` returns a `zero` result. What have I done wrong, here?               var map;          function loadMap () {              // Based on example code: view-source:         //     http://openlayers.org/dev/examples/vector-formats.html              map = new OpenLayers.Map(el);         var googleStreetMap = new OpenLayers.Layer.Google('Google Street Map',                                                            { numZoomLevels: 20 });         map.addLayers(googleStreetMap);         var result = map.getNumLayers(); // Result == 0 :sad-panda:                 }      In the code above, I thought that the `map.getNumLayers()` should return `1` - considering i've asked to add a google street map. Why is it returning zero, please? UPDATE: something else to note: there is also no baseLayer :( I thought this would be the base layer???


title: How to convert geoJSON to python objects?

text: New to the site, and to geoJSON, and to python.   My goal is to read in a file with geoJSON data, and use it to generate shapes to be used in an application that is using python scripting. Python has the ability to read it in, and do some manipulating. I have found some examples, but they are not traversing the geoJSON hierarchy correctly. I'm looking for a library, or instructions, on how to extract the geometry data from the geoJSON data file. In other words, I would like to be able to say "get the list of features..." - then, for each of the features, I'd like to get the geometry, read the type, and the get the coordinates for that particular geometry item. Repeat for each of the items in the list of features. Does that make sense? Any suggestions?


title: APDM - error exporting database from Oracle

text: I have a farily large database on a slow network and I am using a thrid party tool to update data which calculates other fields and so on. I have a guid string with an empty box (weird glyph - seen in shapefile tables before) in the middle of the string for just a few records, seemingly random. {D62D[][]1F1-CA71-4490-B940-046E61989DA6} {A16659DF-7131-4[][]E-8DFF- DBF71257DC08} the empty boxes are not brackets..I just did that for the example - they are empty boxes. Question1. I would like to use python or some other script/sql to run the entire database 300,000 records to see if this is present else where? Question2. What are possible causes? Question3. How would this be related to exporting the database? Thanks. Justin


title: creating an OD cost matrix in QGIS

text: I'm a new user of QGIS with limited programming skills (I prefer using menus...). Can anyone help me finding a resource which will guide me through the steps required to produce an origin-destination (OD) cost matrix ? I'm looking for a step-by-step description, starting from scratch (ie, with my 3 shapefiles: origins, destinations, road network). Of note, I need to compute distances to >1 destinations for each origin. Thanks Mathieu


title: ArcPy Mark ALL duplicated values

text: I'm sorry if this is too similar to other posts but I'm an arcpy newbie and I can't quite get what I need. I have accomplished this task in the field calculator (thanks to another post here, but I now realize that I need to do it using arcpy). I have code that perfectly marks the second, third etc. duplicate(s) but I need it to mark all values that have a duplicate. Basically, I can't figure out how to mark the FIRST instance as well as the rest. Here's the code:               import arcpy          inFeatures = "thephaseIIIlayer"     fieldName = "PhaseIII_ID"          desc = arcpy.Describe(inFeatures)     fields = desc.fields     rows = arcpy.UpdateCursor("thephaseIIIlayer", "", "", "PhaseIII_ID", "PhaseIII_ID A")               i = 0         for row in rows:             if i == 0:              value = row.PhaseIII_ID         i += 1         if i > 1             row.SplitMarker = i         if row.PhaseIII_ID != value:              value = row.PhaseIII_ID             i = 1         row.SplitMarker = i -1         rows.updateRow(row)          del row      del rows      I'm sure this is elementary but I'm running out of time. Thanks in advance.


title: Expected DTD markup was not found

text: I am trying to upload an XML document using python and               arcpy.MetadataImporter_conversion      I keep getting an error: > Expected DTD markup was not found. Line 1, position 3. Failed to execute > (MetadataImporter). I think it's an issue with my XML document, but I'm not sure what. I've been using the same XML document to upload for 4 years now and now I'm getting this error. I haven't made any edits to the XML in that 4 years. I've searched through the internet, but I haven't been able to come up with something that explains what the error is and how to resolve it. Does anyone know what this might mean?


title: ArcGIS 10.1 Converting a model tool to a script tool

text: I have recently created a model tool for a class project and my instructor would like it to be converted to a script tool for practice purposes. I have exported the script from my model and loaded it into a script within a toolbox but there are several things I am unsure about. I have defined the Parameters as they were in the model but when I run the script tool it give me multiple errors. I know that the model doesnt pass model only tools to the script(i.e. Select Data) so im sure my problem stems from that but Im not sure what exatly I need to add to fix the problem. I will attach a copy of my script,tool parameters,tool properties,the original model and the errors I get. I am an amatuer with python so bare with me if Im asking too much. NOTE:the '*' represent the actual values but cant be shared               # ---------------------------------------------------------------------------     # CROB1.py     # Created on: 2013-10-08 11:45:20.00000     #   (generated by ArcGIS/ModelBuilder)     # Usage: CROB1 <ArcSDE_Connection_File_Location> <Select_Your_AP_County> <Select_Your_AP> <Your_Counties> <Your_AP>      # Description:      # This tool creates the layers for management plan map for your AP boundary. The user must still format the Layout View before exporting.     # ---------------------------------------------------------------------------          # Set the necessary product code     import arceditor               # Import arcpy module     import arcpy          arcpy.env.overwriteOutput = True          # Script arguments     ArcSDE_Connection_File_Location = arcpy.GetParameterAsText(0)          Select_Your_AP_County = arcpy.GetParameterAsText(1)          Select_Your_AP = arcpy.GetParameterAsText(2)          # Local variables:     FDEP_SDE_Connection_sde = ArcSDE_Connection_File_Location     Counties = FDEP_SDE_Connection_sde     Aquatic_Preserves = FDEP_SDE_Connection_sde          # Process: Create ArcSDE Connection File     arcpy.CreateArcSDEConnectionFile_management(ArcSDE_Connection_File_Location, "FDEP_SDE_Connection", "******", "****", "", "DATABASE_AUTH", "****", "*****", "SAVE_USERNAME", "SDE.DEFAULT", "SAVE_VERSION")          # Process: Select Data     arcpy.SelectData_management(FDEP_SDE_Connection_sde, "BASE.FL_SHORELINE_AREAS")          # Process: Select     arcpy.Select_analysis(Counties, Your_Counties, "\"NAME\" = '%Select Your AP County%' ")          # Process: Select Data (2)     arcpy.SelectData_management(FDEP_SDE_Connection_sde, "DEP.AQUATIC_PRESERVES")          # Process: Select (2)     arcpy.Select_analysis(Aquatic_Preserves, Your_AP, "\"LONG_NAME\" = '%Select Your AP%'")`      ![enter image description here](http://i.stack.imgur.com/Auca3.png) ![enter image description here](http://i.stack.imgur.com/z4kLd.png) ![enter image description here](http://i.stack.imgur.com/Jt2IW.png) ![enter image description here](http://i.stack.imgur.com/BZ2VF.png)


title: Data of worldwide shore lines and bathymetry

text: Please excuse my probably naive questions because I am new to this stack exchange. Is there a free database with all geolocations for shorelines? Is there a free database for near-shore bathymetry data?


title: QGIS polygon centriods - How are they created?

text: I have been using QGIS to analyses spatial data and I created polygon centroids with the vector geometry tools. Now for a report I have to explain how these centroids were created. I have not been able to find an algorithm or an explanation of how QGIS creates centroids, can anyone help? Thanks in advance Christina


title: How I relate Census Blocks to FIPS Division/Subdivisions

text: I need to be able to relate a Census Block to it's corresponding FIPS Division and Subdivision and I have not found any data file or reference to help me identify that relationship, can you help?


title: QGIS and raster calculator - not working

text: I have installed QGIS 1.8 on a Mac OS v10.8.4 (with GDAL and installed), and trying to create an NDVI map from a three-band GeoTIFF multispectral image. Even the simplest calculation (e.g. band@1*1) creates a grey "image" with Min- Max values on the order of 208e-308 to 208e+308 (infinity?). Any proposed solution? I suspect I may not have the configuration right, gdal or python paths or...


title: Is there a way to prevent losing metadata when generating a spatial view in ArcSDE 10.1?

text: When generating a spatial view in ArcSDE using a script, any previous metadata is dropped when the old view is dropped. Thus, any edits to metadata on the view, are lost. Is there a way to keep the metadata around, or perhaps add the importing of metadata to view script? I'm using Oracle as DBMS. ArcSDE 10.1 and ArcGIS for Desktop 10.2.


title: working with hydrography raster the cost array ignores the end of water

text: We have our maps laid out using hydrography maps from NOAA. We had to run the graphics through several steps to create the water feature raster. I have a process that pulls in that raster, sets a start and end point, and computes a Polyline which provides my distance between points. But we were getting strange results that had to be figured out. I added the cost array to the map and it is a regular, circular growth from the target point out. In a few places it appears to follow rivers but mostly it ignores the existance of land. It reports values as being between 0 and 17xx. I'm concerned about the cost value of 0 as I though no raster can have a value of 0. So is this because I need to convert 0 to NoData? And if that is the case how do I do the conversion?


title: How to highlight polygons within another polygon?

text: I want to symbolize public buildings in OSM data. For Example: There is a polygon and in column "amenity" it has the value "school". But i don't want to highlight this polygon, but the buildings inside this polygon. How can I do this? Thanks!


title: Get a spatial reference object by name from a saved string

text: I am creating an ArcMap 10.2 extension is VS 2012 and C#. I want to give the user the option to select a spatial reference to be applied to a layer - planning to use the Dialog for that. But then, I want to be able to save the name of the SR the user selected to an custom XML settings file so that when they come back to the same section it will be set by default (and they can use the Dialog to change it if needed). This is where I am stuck. My plan was to use that string name and recreate the SR object by see no option for it in something like `ISpatialReferenceFactory3`. As an example, if I run this code on an mxd using a New Jersey projected coordinate system:               ISpatialReference SR = new UnknownCoordinateSystemClass();     IMxDocument Mxd =  (IMxDocument)WestonGISExtension.ExtensionApplicationHook.Document;     ESRI.ArcGIS.Carto.IMap Map = Mxd.FocusMap;     if (Map.SpatialReference != null)         SR = Map.SpatialReference;      then, the SR.Name would produce, say, "NAD_1983_StatePlane_New_Jersey_FIPS_2900_Feet". So, how do I later come back with that string and reproduce the `SpatialReferenceClass`? * * * Thanks guys. Ya, I think you are right in going with the WKID. Here is what I settled on:               ISpatialReferenceFactory3 SpatialReferenceFactory = new SpatialReferenceEnvironmentClass();     ISpatialReference SpatialReference = SpatialReferenceFactory.CreateSpatialReference(SpatialReferenceCode);      Ernie


title: ogr2ogr csv conversion with latlon in one column

text: I have a csv with "lat\,lon" in a single column. I am trying to convert it with ogr2ogr to another format, and cannot figure out how to format the VRT file to accept this format. I cannot do anything other than change the VRT at the moment due to other limitations. I would love to rewrite the csv, but this is the format that I have to deal with for now. I have been pulling my hair out all day, and have yet to figure out a viable solution. example for formating:               name, date, value, latlon     a, 20130101, 0, "100.8\,40.2"     b, 20130101, 1, "101.2\,40.4"     c, 20130102, 1, "100.2\,41.2"     d, 20130103, 2, "102.0\,40.7"     e, 20130104, 3, "100.6\,41.0"      Any ideas would be greatly appreciated. edit for clarification: The data is not a set number of characters, so splitting at a character number does not work right.               a, 20130101, 0, "10.844\,-40.2745"     b, 20130101, 1, "101.2010\,40.411111"     c, 20130102, 1, "-100.27867\,1.24522"     d, 20130103, 2, "-1.04577\,16.745637"     e, 20130104, 3, "100.617417\,-1.0757"      EDIT: Accepted answer actually does not require the intermediate CSV, it can be done straight from original CSV. The INSTR is what I managed to get to work.               <OGRVRTDataSource>         <OGRVRTLayer name="result">             <SrcDataSource>test2.csv</SrcDataSource>             <SrcSQL dialect="sqlite">SELECT name, date, value, SUBSTR(latlon,2,INSTR(latlon,"\,")-1) AS lat, SUBSTR(latlon,INSTR(latlon,"\,")+2,-1) AS lon FROM test2</SrcSQL>         </OGRVRTLayer>     </OGRVRTDataSource>


title: Python query to find records with more than one alpha character in a field

text: Using ArcGIS Desktop 10.2. I have a field in a table of several thousand records. The field is made up of alphanumeric characters. I'd like to perform two queries using python on this field:   1. Identify the records in this field that contain more than one alpha character   2. Identify the records in this field that end with more than one alpha character


title: Draw line drawn from point to an open infowindow?

text: I want the infowindows on my map to be in a fixed location, but that sometimes makes it hard to tell which point was clicked (which point is associated with the infowindow displayed). Is there a way to draw a line from the point to an opened infowindow located in a fixed position or make the selected point stand out from the rest of the non-selected points?


title: Is there any method to choose the value of each pixel according to land cover

text: I have 2 images; one is land cover image (imgA) and monthly mean temperature image (imgB). I'd like to choose value of each pixel from imgB corresponding to imgA. WhaT I expected is each pixel of certain land cover type should have different values in different area. I tried it using zonal statistic in ArcGIS and ERDAS. But zonal statistic give me only one value of each land cover (not in each pixel value). I'd like to keep all original pixel values of imgB according to each land cover. How can I do this using ArcGIS or ERDAS?


title: Performance loss for OpenLayers EPSG transformation? Storing GeoJSON coordinates in lat/lon or in native map projection?

text: For a project the map projection is EPSG:32468 (tiles). On top of the map, two or three GeoJSON LineStrings should be displayed using OpenLayers. Each LineString has about 1500 coordinates. Actually, I would like to store the coordinates of the GeoJSON in lat/lon (EPSG:4326) and then reproject them using OpenLayer's internalProjection and externalProjection, as lat/lon is more "natural"/"human" to think about positions. That is, something like:               var format = new OpenLayers.Format.GeoJSON({       'internalProjection': new OpenLayers.Projection("EPSG:32468"),       'externalProjection': new OpenLayers.Projection("EPSG:4326")     });      Are there any performance issues to be expected if doing so? Or should I instead rather reproject the GeoJSONs in advance, e.g. by using `ogr2ogr`, that is having them already in the special map projection? I do not yet know how many coordinates a LineString will include in future, and importand: the map should also work nicely on iOS 4 (webkit) and recent Android phones.


title: Bulk insert into MS SQL Creating ObjectID's

text: I am running an ETL from a spatial view into publication database. The view has results in duplicate ObjectID's. I started working with the get_ids SP example from ESRI, but that seems to be built more for a single record insert and not a bulk insert. Here is my example...               DECLARE @id as integer     DECLARE @num_ids as integer     EXEC L.i16_get_ids 2, 1, @id output, @num_ids output;           INSERT INTO L.TAXPARCELWCONDOS ([OBJECTID]                ,[PARCELNO]                ,[SHAPE])     SELECT @id           ,[PARCELNO] ,[shape]       FROM [Parcel].[L].[view_TaxParcelwCondos];     END      How can I generate new ObjectID's for the insert. Thanks, Dave


title: Get lat/lon points from image pixels

text: I need to build an application with the following requirement:   1. shows a map .png picture to user.   2. then, users select several points around the map (I can get the x/y pixels from each point)   3. based on these points I want to convert x/y pixels to latitude/longitude values.  The question is: **how can I do this? what do I need to consider?** I think that I can relate a point (x,y) with a predefined lat/lon and then calculate the other points based on the first one. But I'm not sure how can I achieve this. This picture shows more or less what I need.   * green point: point with predefined lat/lon   * red points: points I need to determinate ![image example from where I will take the points](http://i.stack.imgur.com/nlrHJ.png)


title: How to fix distortions for Baden-Württemberg?

text: I'm working in an area in Baden-Württemberg, Germany. I loaded some OSM data in QGIS but the map display is distorted. I tried ftools define projection with many different projections but nothing changed. I tried: - WGS 84/ World Mercator - DHDN / Gauss-Kruger zone 2 - Google mercator - ETRS89 / UTM zone 32N - DHDN / Gauss-Krugerzone 3 - DHDN / Soldner Berlin and many others...but nothing worked. There was no difference visible. * * * _ich bearbeite derzeit ein Gebiet in Baden-Württemberg und habe dazu Daten aus OpenStreet Map in QGIS geladen. Leider wird das Gebiet immer in der Breite verzerrt dargestellt. Ich habe über Rechtsklick auf den Layer und auch über fTools->Aktuelle Projektion definieren schon viele verschiedene Projektionen ausprobiert, jedoch ändert keine was an dieser Verzerrung. Könnte mir jemand helfen, wie ich den Layer richtig darstellen kann? Vielen Dank!_


title: bing Basemap Missing

text: ## 3/26/2014 - Since writing this question, a patch has been released. It can be found here: http://support.esri.com/en/downloads/patches- servicepacks/view/productid/160/metaid/2003 > The bing basemap seems to have been recently removed from the "Add Basemap" > dialogue in ArcMap. I'm using 10.1. I've also heard reports from a coworker > that a bing basemap layer was replaced by the dreaded red exclamation mark > in an existing document she was using. > > Any idea if bing/ esri altered their relationship, or is this just a local > problem on my end? > > Thank you!


title: Nested Iteration with model builder - using nested models

text: I'm new to using model builder and have to do a nested iteration (for every month I have to iterate through 6 parameters). I am thinking of doing that by using nested models. One model doing the interation through monthes and then providing the current month as parameter to the submodel that iterates through the 6 parameters. The linking of the models does not work correctly (boxes are not colored). How can I make the current month value available to the submodel? I just want the month parameter to be available in a function; I don't connect it to a function as input variable. Your help would be greatly appreciated. Thanks, Lea


title: Difference between a *.lyr and layer directly added from *.gdb/sde to mxd?

text: What is the difference between a *.lyr and a layer directly added from *.gdb/sde to mxd? Doing it difference in mxd? Which is better?


title: How to buffer a line with different distances for left/right sides

text: How can I buffer a line in QGIS using one attribute for the left side of the line and one attribute for the right side of the line? I am trying to buffer a river with its bank width, which is different on the right and left side.


title: Dissolve with dominant/majority field

text: I want to dissolve a feature class of land use polygons, joining subparcels in larger parcel polygons. I want the parcel polygon to keep the dominant land use of all subparcels, taking into account the surface that each subparcel takes. Dissolve GP tool lets me calculate statistics over one field (min, max, avg) but I can't find a way to keep the dominant value. I'm using ArcGIS 10.1 Thank you!


title: Mapinfo lat Long calculate

text: I have mapinfo table containing Columns: Lat Long 21.2563 40.1256 21.2565 40.1278 21.2567 40.1288 21.2569 40.1291 21.2571 40.1352 21.2578 40.1380 Now i want to calculate the whole distance like Km or Miles or Feet, How can i do this?


title: How do I layer stack rasters in QGIS?

text: I have some multi-spectral data, where the individual bands are separate Raster files. How do I layer stack these rasters so that I get one raster with 3 bands instead of 3 different rasters? This is quite easy to do in ERDAS and ArcGIS, but I haven't figured out how to do it in QGIS


title: How to check via Arcpy if ArcMap is currently in an edit session or not?

text: I've created a Python add-in button that helps speed up my coworkers workflow by copying one feature class attribute to another. It uses the arcpy.UpdateCursor function to update a row in the target feature class. As it exists now, this button script can be run regardless of the editing mode. Obviously when its run in an edit session, the user can choose to stop editing and not save changes, but this is not the case when the script runs outside of an edit session. How can I add a check to the script that will stop the script from running if ArcMap is not currently in an edit session? This concerns ArcMap 10 & 10.1 Thanks for any ideas Update: I also want to check with other ArcMap users to verify that updates to tables is not normally allowed without being in an edit session. So how is this script running outside of an edit session? This script also brings up another question about the seemingly serendipitous selection order ArcMap performs that just happens to work for me when I update the 2nd feature class table from a list, but that's for another day... Here's the script as it works now (without any 10.1 editor implementation): How to add a check to ensure the user is in an edit session?               def onClick(self):         #Reference mxd         mxd = arcpy.mapping.MapDocument("CURRENT")         #Reference the main Data frame         mm = arcpy.mapping.ListDataFrames(mxd, "MainMap")[0]         #Reference the Water System Valve feature class         waterValves = arcpy.mapping.ListLayers(mxd, "Water System Valve", mm)[0]         #Reference the fire hydrant feature class         fireHydrants = arcpy.mapping.ListLayers(mxd, "Water Hydrant", mm)[0]              #Use the extent of the main DF to select all valves in the current view         dfAsFeature = arcpy.Polygon(arcpy.Array([mm.extent.lowerLeft, mm.extent.lowerRight, mm.extent.upperRight, mm.extent.upperLeft]), mm.spatialReference)         arcpy.SelectLayerByLocation_management(waterValves, "WITHIN", dfAsFeature,"", "NEW_SELECTION")              arcpy.SelectLayerByAttribute_management(waterValves, "SUBSET_SELECTION", "LOCATIONID IS NULL")              fields = ["LOCATIONID"]              row, rows = None, None         rows = arcpy.UpdateCursor(waterValves,fields)         row = rows.next()         valveList = []         append = valveList.append              #Loop through the valves table to update LocationID         while row:             builder = str(row.QSNO)+"-"+ str(row.VALVESEQNO)             row.setValue("LOCATIONID", builder)             append(builder)             rows.updateRow(row)             row = rows.next()              del row, rows              #New selection for fire hydrants         arcpy.SelectLayerByLocation_management(fireHydrants, "WITHIN", dfAsFeature,"", "NEW_SELECTION")         arcpy.SelectLayerByAttribute_management(fireHydrants, "SUBSET_SELECTION", "LOCATIONID IS NULL")              row, rows = None, None         rows = arcpy.UpdateCursor(fireHydrants,fields)         row = rows.next()              #Loop through fire hydrant table to update LocationID         while row:             for locID in valveList:                 construct = str(locID) + "-FH"                 #print construct                 row.setValue("LOCATIONID", construct)                 rows.updateRow(row)                 row = rows.next()              del row, rows, valveList, mxd


title: Storing Polygons in PostGIS (data coming from shape files)

text: We want to store data from shape files in PostGIS all in one table. There will be two columns in the table:   * boundary - The polygon data (How do we store this?)   * mongo_id - Links to a mongo database  It seems if we use shp2postgis it creates a whole set of tables for that shape file. We want to use one table for all boundary data. What is the best way to do this? (Do we need to use a specific srid?)


title: pgRouting - no 'to_cost' values imported (osm2pgrouting)

text: I am struggling with the latest pgrouting & osm2pgrouting V2. The toolchain is installed on my server without any issues, I tried to install it from github and compile it - and I tried it from a stable repo via aptitude as well. Both show the same problems. I try to import a chunk of OSM data into my routing DB. The import runs smooth and it looks very promising, but there is no 'to_cost' value filled in. I did calculate it once by hand, but I would like to see the original data from the import. What bothers me most, is thhat after a quick glimpse on the source code I noticed that osm2pgrouting does not do that.               "COPY " + tables_prefix + "ways(gid, class_id, length, x1, y1, x2, y2, osm_id, the_geom, reverse_cost, maxspeed_forward, maxspeed_backward, priority, name) FROM STDIN"      Where is this 'to_cost' assignment? If I am the first one with this issue, I am doing something terribly wrong - please feel free to give any input on this topic! Thank you! Styp


title: How do I convert 3tm to lat-lon

text: I'm unable to find out a formula for converting 3tm coordinates to lat-lon? 3tm is a system used in Alberta alone, as far as I can tell. The city of Calgary uses that for its opendata, which is what I'm trying to process.


title: How to create a metadata json member for an openlayers layers object and display in extjs grid?

text: I want to do the following: add               metadata: "this is the layer metadata"       ....to my openlayers layer config. This should then be presented in an extjs grid. I can use               alert(layername.metadata);      to display the string inside the config member so I know it works. To display this in the extjs grid I have used the following code               var myData = [];     var x=mapPanel.map.layers;     for (var i=0; i<x.length; i++) {       // alert(mapPanel.map.layers[i].metadata);         myData.push(mapPanel.map.layers[i].metadata);     }          var store = new Ext.data.ArrayStore({             fields: [                {name: 'metadata'}             ]             });          store.loadData(myData);          var myStore = new GeoExt.data.LayerStore({         map: map,         layers: mapPanel.layers     });           var grid = new Ext.grid.GridPanel({             title: "Available Map Layers",             region: "center",             height: 300,             viewConfig: {forceFit: true},             store: store,             columns: [                 {                     header: "metadata",                     dataIndex: "metadata",                     sortable: true                 }             ]         });          var metadataWin = new Ext.Window({                     title: "Map layers",                     layout: 'fit',                     width: '600',                     height: 'auto',                     border: false,                     closable: true,                     collapsible: true,                     x: 450,                     y: 100,                     resizable: true,                     closeAction: 'hide',                     plain: true,                     items: [grid]                });         metadataWin.show();           the grid show the correct amount of rows, but only the first letter is shown....this is probably a newbie javascript error. Can anyone see where i´m going wrong? yours, Rob


title: Stacking attributes in a text field

text: I am trying to stack my text in an attribute table using the field calculator, but it does not seem to be working. My field name is: `Facilities`. My attributes are in this format: `Public Access\Campground` I want the field to read like this:               Public Access     Campground      So I am using this expression to stack the text:               Replace( [Facilities] ,"\",vbnewline)      But when I run it, it doesn't do anything. Can anyone steer me in the right direction?


title: need info on GeoTIFF projection keys

text: I am a programmer (not a cartographer!!) developing an application which needs to read and write GeoTIFF files. I have a number of questions about those GeoTIFF keys which are related to projections. I would ideally like to be able to read/write files which originate from and/or will be read by a maximum number of other GeoTIFF-aware software packages. My primary compatibility target is ARC, however, so if there is anything especially peculiar about files written or read by ARC I would be particularly interested in those details. Also, I need to support only a relatively small number of projections, namely Mercator, UTM, polar stereographic and Lambert conic conformal in that order of importance. I am using a home-brewed projection package based closely on Snyder's USGS reference and code from the GMT package (as we need to maintain co- registration with GMT plots.) I have looked through the GeoTIFF spec at www.remotesensing.org and other related materials in some detail but am still confused on a number of points: (1) The GeoTIFF spec declares various lon/lat keys, almost all of them with deliciously circular definitions, e.g.: "ProjNatOriginLongGeoKey: Longitude of map-projection natural origin." Can someone explain to me the difference between natural origin, false origin and center lon/lat? My limited understanding of the math behind Snyder's projections includes knowledge of the fact that virtually all projections require a 'projection longitude' parameter, for instance. With regard to Mercator, this is the longitude at which all projected x-values will be 0 (likewise for UTM, before the 500000 false easting is applied). So, is this longitude the ProjNatOriginLong or the ProjCenterLong in GeoTIFF jargon? (2) If a GeoTIFF file contains no specified value for a key, e.g., ProjFalseEasting, is there an assumed default value for that key? If so are such values projection-dependent, e.g. default false easting might be 500000 for UTM but 0 for anything else? I have looked at a couple of GeoTIFF files generated by external software and there seems to be a wide variety of quantity of keys specified. The spec says nothing about default values but I suspect that various external readers/writers make many assumptions about these keys (which no doubt differ on a vendor-by-vendor basis). (3) As I noted I am primarily interested in reading ARC files. A sample Mercator GeoTIFF from ARC had a defined ProjectedCSTypeGeoKey of 3395, not listed anywhere in the GeoTIFF spec. This threw me for a while until I started digging around in the ancillary files distributed with libgeotiff and found the line 3395,"WGS 84 / World Mercator",9001,4326,19883,9804,1,0, 4400,8801,0,9102, 8802,0,9102,8805,1,9201,8806,0,9001,8807,0,9001,,,,,, buried in /usr/share/epsg_csv/pcs.csv. Is this file pretty much invariant, meaning that I can count on this entry never changing, or do I _really_ need to write code which parses these interconnected CSV databases everytime I encounter an unrecognized ProjectedCSType in an imported file? Like I said, I only need to support a handful of the most common projections. Thanks very much for any help in clarifying these points! Roger Davis Univ. of Hawaii


title: Collection of polygons from a collection of points

text: I have a set of points, spread over a wide geographical area. I need to be able to create a set of polygons which best represent the clustered points. And I would like to create the clusters based on the maximum number of clusters allowed and/or number of points allowed in a cluster. Any help would be greatly appreciated.


title: Creating a VB.net Dataset in Visual Studio 2010 from an SDE Geodatabase

text: I am building an ArcMap Addin that contains several Windows Forms with controls that need to be bound to a database. I am trying to decide whether or not to use a native SQL Server Database or an SDE Geodatabase. I would like to link the forms to the features on the map, which suggests I should use the geodatabase, but I have not found anyway to bind geodatabase tables and fields to WinForms controls at design-time. Has anyone successfully created a Dataset (xsd) in Visual Studio from an SDE Geodatabase?


title: Need to understand desc.workspaceType to use in conditionals

text: I need to differentiate between two possible types of workspaces for an arcpy script. So I check the `workspaceType`:               rootWorkspace = raw_input('Geodatabase workspace to analyze: ')     desc = arcpy.Describe(rootWorkspace)     wsType = desc.workspaceType     print 'Workspace Type: {}'.format(wsType)      which seems to work fine and prints the correct type. But, if I try to then check the type (so I can, eventually, do different things depending on what it is):               if wsType is 'FileSystem': print 'file system'     if wsType is 'LocalDatabase': print 'gdb'     if wsType is 'RemoteDatabase': print 'sde'     else: print 'not reading this correctly'      I _always_ get `not reading this correctly` (whether I'm inputting a directory or geodatabase). According to Arc help about Workspace properties, `workspaceType` should be a string result (not an Object etc.), so I am confused why a string comparison isn't working.


title: Best spatial statistics software for GIS?

text: I am searching for spatial statistics software which has many powerful features and supports a GIS interface. Can anyone give me some advice?


title: Zooming in close with mixed cached and dynamic services in ArcGIS flex

text: I have an application that uses a cached world basemap overlaid with more local and specific data coming from a dynamic map service. It works well for performance, but some users need to see some very detailed information in the dynamic map service. Is there a technique to allow users to zoom in past the closest scale range of the cached service?