title: Error from ps.map in GRASS. How to fix?

text: I'm trying to learn how to use `ps.map` in GRASS. I thought that running it in interactive mode from the command line would be a good place to start, but I'm getting the following error:               > ps.map                                                                                ~     Traceback (most recent call last):       File "/Applications/GRASS-6.4.app/Contents/MacOS/etc/wxpython/gui_modules/menuform.py", line 59, in <module>         import globalvar       File "/Applications/GRASS-6.4.app/Contents/MacOS/etc/wxpython/gui_modules/globalvar.py", line 76, in <module>         import wx       File "/Applications/GRASS-6.4.app/Contents/MacOS/etc/python/wx/__init__.py", line 45, in <module>         from wx._core import *       File "/Applications/GRASS-6.4.app/Contents/MacOS/etc/python/wx/_core.py", line 4, in <module>         import _core_     ImportError: dlopen(/Applications/GRASS-6.4.app/Contents/MacOS/etc/python/wx/_core_.so, 2): no suitable image found.  Did find:         /Applications/GRASS-6.4.app/Contents/MacOS/etc/python/wx/_core_.so: mach-o, but wrong architecture      UPDATE: In response to Markus's comment that terminal messages on GRASS startup might help to diagnose the problem, the following two chunks provides all terminal output from GRASS startup. Chunk 1: from starting /Applications/Grass-6.4.app to GUI Startup window.               Last login: Sat Mar 23 10:08:40 on ttys002     gregory@Gregorys-MacBook> '/Applications/GRASS-6.4.app/Contents/MacOS/grass.sh'; exit     Rebuilding Addon HTML manual pages index...     Rebuilding Addon menu...     dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/osascript) is code signed with entitlements     Python 2.6.7 found.     Cleaning up temporary files ...     Starting GRASS ...      Chunk 2: from selecting a location/mapset in the GUI startup window and clicking "Start GRASS".                         __________  ___   __________    _______________              / ____/ __ \/   | / ___/ ___/   / ____/  _/ ___/             / / __/ /_/ / /| | \__ \\_  \   / / __ / / \__ \             / /_/ / _, _/ ___ |___/ /__/ /  / /_/ // / ___/ /             \____/_/ |_/_/  |_/____/____/   \____/___//____/            Welcome to GRASS 6.4.2 (2012)      GRASS homepage:                          http://grass.osgeo.org/     This version running thru:               shell (/bin/zsh)     Help is available with the command:      g.manual -i     See the licence terms with:              g.version -c     If required, restart the GUI with:       g.gui wxpython     When ready to quit enter:                exit          gregory@Gregorys-MacBook> Mar 23 11:31:05 Gregorys-MacBook.local pythonw2.6[2520] <Error>: CGContextRestoreGState: invalid context 0x0     Mar 23 11:31:05 Gregorys-MacBook.local pythonw2.6[2520] <Error>: CGContextRestoreGState: invalid context 0x0     Mar 23 11:31:05 Gregorys-MacBook.local pythonw2.6[2520] <Error>: CGContextRestoreGState: invalid context 0x0     Mar 23 11:31:05 Gregorys-MacBook.local pythonw2.6[2520] <Error>: CGContextRestoreGState: invalid context 0x0     Mar 23 11:31:05 Gregorys-MacBook.local pythonw2.6[2520] <Error>: CGContextRestoreGState: invalid context 0x0


title: Why is this GRASS script (from GRASS WiKi) causing an error?

text: I'm trying to run a script from the GRASS WiKi to create a simple map using `ps.map`. I'm confused because it's generating an error that the output was not set, when it appears to me that it is set at the beginning of the script. The script and error follow. The first code box contains the contents of the file spearfish.map, which is referenced as the input value in the second code box.               # Simple ps.map example using the Spearfish dataset     g.region rast=elevation.10m          ps.map output=spearfish.ps << EOF     paper us-letter       end     scale 1:120000     raster elevation.10m     colortable       where 2 6.75       end     text 50% -7% Spearfish County, ND (Mount Rushmore)       fontsize 16       end     mapinfo       where 4.5 7.25       end     vlines roads       where label ~ 'highway' OR label = 'interstate'       color grey       end     vpoints archsites       symbol basic/triangle       end     end     EOF      The command for running the script and the error it generates are below:               > ps.map input=spearfish.map                                                          ERROR: Required parameter <output> not set:         (PostScript output file)      UPDATE: Based on ShaunLangley's comment, I tried `ps.map output=out.map`. This seems to have started ps.map in interactive mode and I was able to enter the rest of the script one line at a time. That did create a map as a postscript file, so I'm headed in the right direction. I'll close this thread as solved and open a new one more targeted on the question of how to run the commands as a script.


title: Get min-max values of a raster and populate two parameters with the values in tool validation script

text: I am customizing the script tool behaviour of a custom script and would like to get the min-max values from a raster `self.params[0]` and populate the next two parameters, `self.params[1]` and `self.params[2]`, with these values. Here is what I have so far but of course, it doesn't work.                 def updateParameters(self):         """Modify the values and properties of parameters before internal         validation is performed.  This method is called whenever a parmater         has been changed."""              if self.params[0].altered and self.params[0].value:             paramInRaster = arcpy.Raster(self.params[0])             minVal = paramInRaster.minimum             maxVal = paramInRaster.maximum             self.params[1].value = minVal             self.params[2].value = maxVal         return


title: Can I convert an IFeature to ILayer and add it to the map?

text: I want to use `FeatureClass.Search()` to get a specific Feature and I want to convert this one to `ILayer` and set it to the Map, is there any way to do that?


title: Plot a Raster of Weather data in Leaflet JavaScript Map without generating server-side tiles?

text: I want to show different weather data I have as binary arrays on a server using leaflet. But I do not want to generate tiles on the server. For each point in an a array I have the coordinates in another array. I also have the proj-string for the projection. Is it possible to retrieve the arrays from the server and dynamically generate the map for leaflet in the client? If so, how?


title: What does "unsupported bin funcion type" error in ERDAS mean?

text: I want to open a set of .img files in ERDAS which are output files of zonal statistic function in ARCGIS. Before running the function, all images can be opened in ERDAS. After calculating zonal mean, the output files cannot be opened in ERDAS. Following 2 errors appeared: "image contains unsupported bin function type Use imageinfo-calculation statistics option to reset bin function to direct or linear" and "Invalid bin function type". What do they mean? Is there anyone who can help me to solve the problem? Thank you very much


title: Is there a way to automate POI collection from websites?

text: I am searching for an easy method to get lots of points geotagged/georeferenzed into several shape files. I am working at a project where I need to collect all parcel shops in germany (but I will try it with Berlin first) of the 5 most important service providers. They are all not willing to give me any data of their locations but they all have a web formular to search the shops in a specific region. I like to create 1 shape file for each company with all their shops in Berlin. Do you have another idea how to do that while avoiding to search and add every single point (or just using google maps and tag/screenshot the points)? To have an impression of the material I use: ![UPS Parcel shop localiser](http://i.stack.imgur.com/iK4CA.jpg) The points you can see on the map (and on the left side with some explanation) need to be transferred into QuantumGis.


title: ArcObjects 9.2: TableToTable tool fails depending on output location

text: The code I am writing for a button (ArcObjects 9.2, Visual Studio 2005) takes the attributes for selected points in a shapefile and writes them to a table:               Dim pGp As GeoProcessor = New GeoProcessor     pGp.OverwriteOutput = True     Dim pParams As IVariantArray = New VarArrayClass     ...     Dim strFolderName As String = "C:\temp"     Dim strTableName As String = "TandE_data2.dbf"     With pParams         .RemoveAll()         .Add(pTELayer) 'A point SHP with at least one feature selected         .Add(strFolderName) '("in_memory")         .Add(strTableName) '("TandE_data2")     End With     pGp.Execute("TableToTable_conversion", pParams, Nothing)      As written, the process will fail at the pGp.Execute statement on the third execution, with the message               A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in SDtools.dll      appearing in Visual Studio's output window. If the output is directed to an in_memory workspace table instead of a DBF (using the values seen in the code comments), the code always runs to completion. What changes do I need to make to the code for it to output to a DBF consistantly?


title: Is it possible to convert ArcGIS .mxd to QGIS .qgs without having ArcGIS installed?

text: I was reading **How to convert an .mxd file to a .qgs file?**. It looks as though this only works with ArcGIS 10. I would like to do this, but am unable to install things on the computer that has ArcGIS. Is there a way to import to QGIS without using mxd2qgis (that requires ArcGIS 10)?


title: How can i figure out to convert this points to latlong?

text: I got below data in sql server, Learned that data is collected under zone IIIa considering Lambert Conformal conic projection in India. The data is generated from Spatial Cadastre Software. Also learned that XPos and YPos units are in meters. Expectation: All the below data combined should draw a polygon in google maps. Please guide us to convert this points to latlons or any suggestion on how to draw polygon in google maps. It should be plotted in India- AndhraPradesh(State)-Karimnagar(Dist)-Peddapur(Village)               PointName   Xpos    Ypos     _0  192         388.6016     _1  189.7742    409.8918     _10 299.5876    382.3074     _11 329.6552    355.2643     _13 334.9612    350.492     _14 373.8721    315.4951     _15 396.8649    294.8151     _16 403.9396    288.452     _17 467.6119    231.1844     _19 536.5903    169.1445     _21 375.0864    452.0209     _3  198.4302    327.0963     _4  202.1399    291.6124     _6  210.3013    213.548     _7  210.7959    208.8169


title: Can I use Map Quest/ Open Street map to get the local names?

text: I am using the reverse geocoding service provided by Map Quest. For a sample coordinate of N 53.27, E 8.123333, I receive the state of "Lower Saxony". According to Wikipedia, and a user of my service, the German answer is Niedersachsen. Using the Map Quest API, is there any way to change the language of the results service? Alternatively, if I can't do that using the Map Quest API directly, is there a web based translation service that could be suggested to make that translation? Thanks!


title: CartoDB - Infowindow issues on fullscreen / iPad

text:
We're just about ready to go with our first ever CartoDB visualisation, namely a map of the museums in Britain. Unfortunately I'm having a rather large issue with infowindow positioning in either desktop fullscreen or when viewed on an iPad. In short, when clicked on fullscreen then the infowindows appear about 1,000 miles south of their marker. On an iPad it seems to be around 1,000 miles north of their marker. The code for the infowindow is as follows:
     x
     <divclass="cartodb-popup-content">
{{destination_name}}

county

{{county}}

Type of Museum

{{destination_type}}

description

{{description}}

Visit the Museum's Website

      I've tried everything I can think of but to no avail, so any help would be most appreciated! The URL for the visualisation is at http://www.historic- uk.com/HistoryMagazine/DestinationsUK/Museums/ Thanks, Jason


title: MapServer: Output angled label with Cairo/PDF

text: We're trying to output a PDF with the Cairo driver.   When printing a label with ANGLE set to follow, auto or an attribute, it fails regularly. Has anyone experienced this before? A solution or workaround? /Kristian


title: MultiListBox array error

text: I have created a MultiListBox control which is populated with a list of all currently loaded TAB file names in MapInfo. The user selections are then read from the MultiListBox and added to another array (so I can use these in an INSERT command later on). However the problem I am getting is when I select records from my MultiListBox. As an example I have selected 3 TAB files (3 records) from my MultiListBox but my array size is only 2. If I select 5 records from my list my array size is only 4 and so on. When I select just the 1 record from my list my array size is saying 0. If someone could help I would be very grateful. Cheers Rob O'Brien Here are some code snippets to help.               Dim i as integer     Dim j as integer          i = NumTables()          ReDim TableArray(i)          For j = 1 to i     TableArray(j) = TableInfo(j, TAB_INFO_NAME)     Next          Print "Table Array no. of records: " + UBound(TableArray)          ' code to read the values selected in the MultiListBox     Dim iSel, j As Integer          j = 0     iSel = ReadControlValue(1)          Do Until iSel = 0     j = j + 1                    Redim SelectionArray(j) ' re-size our array. Now = 1     SelectionArray(j) = iSel         iSel = ReadControlValue(1)                Print "Selection Array items selected: " + SelectionArray(j)                  Loop          Print "MultiListBox no. of selected records: " + UBound(SelectionArray)


title: Output polygon data from postGIS and read it on Google Maps API

text: So, I have a group of polygons stored in PostGIS. I'm trying to build a web application with Google Base maps (using Google Maps API). Now, How do i output the polygons in the right format so that Google Maps API can read it? I know about ST_Askml which outputs the data as KML, but what is the Google Maps function to read a kml on the fly? Or is there an alternative to outputting it as kml? Can i pull out the co-ordinates of each point on a polygon and load it onto the API on the fly?


title: Joining Points and Polygons

text: I am new at using arcGIS 9.3.1 and am having trouble joining data. I have a shapefile of census tract polygons and a separate file of points that are crimes in Chicago in 2010. The crime points were part of a separate excel file that I uploaded and converted into a point-shape file. I now am trying to see how many of the crimes occurred within each census tract but when I try to do "join" it gives me the error: Can't create output feature class. Why am I getting this? Is there another way to do this? I've tried everything I can find on the internet. Thanks so much!


title: How to merge Waypoints from many GPX files?

text: I have a large number of Waypoint-layers (gpx) and would like to merge them. Is there a way to do so using QGIS? Thank you!


title: How to test if geometry is inside another?

text: I need to tell whether geometries from a shapefile are inside other geometries or not. For example, I want to test if there are trees (represented as points in `trees.shp`) inside the urban areas (reprensented as polygons in `area.shp`) What's the easiest way to proceed? I loop over the points, and within this loop, I have a nested loop over the polygons. Then, I test if my point geometry is inside the polygon with the `Within(Geometry geo)` method from OGR. It's very long, not optimized at all. What should I do to fasten the computation? Thanks               def PointsInPolygons(self, pointsLayer, polysLayer):         nbInside = 0         total = pointsLayer.GetFeatureCount()         for i in range(total):             pointFeat = pointsLayer.GetFeature(i)             pointGeo = pointFeat.GetGeometryRef()                  for j in range(polysLayer.GetFeatureCount()):                 polyFeat = polysLayer.GetFeature(j)                 polyGeo = polyFeat.GetGeometryRef()                      if pointGeo.Within(polyGeo):                     nbInside+=1                     break


title: WFS reprojection problems

text: In geoserver i have a layer in EPSG:4326. In OpenLayers i add it on map as WFS:                           markerLayer = new OpenLayers.Layer.Vector('Markers',{             strategies: [new OpenLayers.Strategy.BBOX()],             protocol: new OpenLayers.Protocol.WFS({                  version: "1.1.0",                 url:  "/geoserver/wfs",                 srsName:"EPSG:4326",                 featureType: "markers",                 featureNS: "http://www.opengeospatial.net/cite",             }),             projection:new OpenLayers.Projection("EPSG:900913"),             styleMap: new OpenLayers.StyleMap({                 externalGraphic: url_servlet+'img/marker.png',                 graphicWidth: 20, graphicHeight: 24, graphicYOffset: -24,                 title: '${tooltip}'             })/*,             eventListeners: {                     beforefeatureadded: function(e) {                         e.feature.attributes.annotation =                             window.prompt("annotation", "no comment");                     }                 }*/         });     app.mapPanel.map.addLayers([markerLayer]);      My map in OL in EPSG:900913. So when i says to WFS projection=900913 i exepcted that features reproject and will show on my map. But its show somewhere outside OSM extent. And in WFS layer i see features with coords like this:                   POINT(62.01759636987174 56.767130970984326)      So how reproject wfs correctly? **UPDATE** I change protocol to HTTP and get gml:                           protocol:new OpenLayers.Protocol.HTTP({                 url: "/geoserver/ows?service=WFS&request=GetFeature&typeName=cite:markers&srsName=EPSG:900913&outputFormat=GML2",                 format: new OpenLayers.Format.GML()             }),      And now i get something interesting: My layers and Google Base layer: ![enter image description here](http://i.stack.imgur.com/w16dM.jpg) Same place with OSM base layer: ![enter image description here](http://i.stack.imgur.com/P9qfa.jpg) You see that there is no more red markers. And i have only question What a hell going on?


title: ArcGIS 10 trouble displaying raster correctly

text: I think I've come across a Bug in ArcMap 10 in displaying rasters. This particular model comes from the USGS GAP Species dataset with metadata hosted here. **I'd like to know if anyone else has experienced this issue or if this is something I have to pursue with ESRI support.** File type: ESRI GRID The Value field in the model is limited to a domain containing 1, 2 or 3, which represents a seasonal distribution of the given species (see metadata below). ![enter image description here](http://i.stack.imgur.com/XxWiS.png) **When added to the map, I'm getting arbitrary values in this field.** You'll notice that all raster cells are grey and seem to fall within the 1-3 value domain. ![enter image description here](http://i.stack.imgur.com/TtT4Z.png) I've gone into the properties to change from 'Stretched' symbology to 'Unique Values' when I'm prompted to build raster attribute table (which fails). The distributor of the dataset suggested to try the geoprocessing tool to build the attribute table, but it yeilds this error message. I went into the source tab and confirmed that the raster _pixel type is signed integer_ and the raster only contains _one band._ ![enter image description here](http://i.stack.imgur.com/pp9Fp.png)


title: Ways to transform from DWG/DXF to GIS (Experiences are welcome)

text: I've got tons of DWG/DXF files with information (in several layers) dealing with:   * Contour lines and elevation (lines)   * positions of antennas (points)   * protection areas (polygons)   * administrative boundaries (lines)   * roads (lines)   * rivers (lines)   * fences (lines)   * ... All this information have been inserted into these CAD files in a non-standard way (not-unified names or colors in layers), and now I want to translate it into GIS (SHP files or into a PostGIS Server). I'm investigating which is the best way to translate these data in the easiest way. I'm considering:   * create GDAL scripts with Python (http://www.gis.usu.edu/~chrisg/python/2009/)   * create scripts with Teigha libraries (http://www.opendesign.com/guestfiles/TeighaFileConverter)   * use ArcGIS Desktop (with Python scripts) (http://www.slideshare.net/cageyjames/python-scripting-with-arcgis)   * use QGIS or gvSIG (http://www.qgis.org/, http://www.gvsig.org)   * use GlobalMapper (http://www.globalmapper.com/)   * use GeoKettle (http://www.spatialytics.org/projects/geokettle/)   * ... I'd be very grateful if anybody could share their experiences with the CAD2GIS translation. Thank you very much in advance.


title: Spatialite - get geometry from WKB

text: I have a table of WKB HexString values, of the form: `01010000000812368FA5D106C01C25B4DAE5AE4A40` in a column called 'Centroid' in spatialite I want to create a geometry from these values. When I run: `select GeomFromWKB(x'01010000000812368FA5D106C01C25B4DAE5AE4A40');` I get a valid geometry. However, if I run: `select GeomFromWKB('x'||"'"||Centroid||"'") from table;` I get invalid geometries. It seems that it is impossible to insert these hex values as binary values. I think may be due to Sqlite thinking that the bracked value in the second statement is a string literal and not being able to transform it into a blob/binary literal. Does anyone have any solutions either within spatialite itself or using a third party library in python or something? Note that I have also tried: `select GeomFromEWKB(Centroid) from table;` I seem to recall doing this successfully before in PostGIS, but I'd rather use spatialite if possible.


title: ArcGIS Buffer accuracy problem

text: world, once again I encounter something very strange with ArcGIS. I perform a buffer analysis on one side of a polyline. There seems to be a serious accuracy problem and I can't figure out what the cause is. So I hope to find some expertise out there...What I tried without success:   * change distance settings from 'Field' to 'Linear unit'   * change distance settings from 'Field' to 'Linear unit'    * change end type settings from 'ROUND' to 'FLAT'   * run check geometry tool on the line feature   * I made a copy of the line and shorted it to area of interest which had some effect but didn't resolve the problem entirely. Especially around the sharp angle the buffer still takes a shortcut!  The buffer is lurching up to 4 meters on the wrong side! See the picture I attached to get an better impression of the problem. Does anyone have an idea what might me causing this behavior? I'm using ArcGIS 9.3.1. with WinXP. ![buffer on the left side, hatches in meters](http://i.stack.imgur.com/Q54Ax.png) # UPDATE See also my comment below. I performed the described series of actions (divide, intersect,..) to increase the accuracy level of the source data, placing a vertex every 3 meters along the line. There still remains inaccuracy, again the buffering around the rough turn especially is giving me trouble. See second pic.![enter image description here](http://i.stack.imgur.com/oxWcl.png) Cheers, LarsVegas


title: why can't i export geometry data from a shapefile?

text: I saved the layer using "vector save as" box but even when adding GEOMETRY=AS_XY in the layer box, the csv only showed the id and no gemetry data.


title: PostGIS transform geometry with long crs

text: How do i transform a geometry to a new geometry with a crs like `urn:ogc:def:crs:EPSG::25832` `st_transform(geom,integer srid)` obviously doesn't work since my srid is a string found a solution               ST_Transform(geom,                  ST_SRID(                          ST_GeomFromGeoJSON(                            '{"type":"POINT",                              "coordinates":[0,0],                              "crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG::25832"}}}'                             )                         )                     )


title: Opacity contrl for mapbox map with several layers

text: This is an example of how opacity can be changed for a Mapbox.JS map: https://www.mapbox.com/mapbox.js/example/v1.0.0/opacity/ The example shows only one layer used. With barely any experience in JavaScript, h* _ow would I go about changing the opacity of the active base layer, if I have multiple of them?_ * I have this now:                L.control.layers({         'Name of layer': L.tileLayer('/tiles1/z{z}/{y}/{x}.png').addTo(map),         'Name of other layer': L.tileLayer('/tiles2/z{z}/{y}/{x}.png')         }).addTo(map);      How to correctly set the variable to the selected layer?


title: SLD: OGC Filter set, but symbolizer expected

text: I have a problem with one of my SLD files and do not know what is causing the problem. The error message is pretty clear: `line 18: cvc-complex-type.2.4.a: Invalid content was found starting with element 'ogc:Filter'. One of '{"http://www.opengis.net/sld":Symbolizer}' is expected.` However, when I look into the example of the cookbook for attribute based or for zoom based polygons then I cannot figure out why I am getting the error. Have a look at the code below... I don't know why a symbolizer is expected in line 18, even though the example in the cookbook has the structure the same way as I do, or not!? Any suggestions on how to overcome the problem? I am running Geoserver in version 2.3.2 Cheers, Tom               <?xml version="1.0" encoding="ISO-8859-1"?>     <StyledLayerDescriptor version="1.0.0"      xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd"       xmlns="http://www.opengis.net/sld"       xmlns:ogc="http://www.opengis.net/ogc"       xmlns:xlink="http://www.w3.org/1999/xlink"       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">       <NamedLayer>         <Name>Baggrund NO2</Name>         <UserStyle>           <Title>Baggrund NO2</Title>           <FeatureTypeStyle>             <Rule>               <Name>4,75 - 5,31</Name>               <Title>4,75 - 5,31</Title>               <MinScaleDenominator>23000</MinScaleDenominator>               <MaxScaleDenominator>1000000000</MaxScaleDenominator>               <ogc:Filter>                 <ogc:PropertyIsEqualTo>                   <ogc:PropertyName>Type</ogc:PropertyName>                   <ogc:Literal>1.0000</ogc:Literal>                 </ogc:PropertyIsEqualTo>               </ogc:Filter>               <PolygonSymbolizer>                 <Fill>                   <CssParameter name="fill">#1a9641</CssParameter>                   <CssParameter name="fill-opacity">0.40</CssParameter>                 </Fill>               </PolygonSymbolizer>             </Rule>           </FeatureTypeStyle>         </UserStyle>       </NamedLayer>     </StyledLayerDescriptor>


title: Removing Null Values

text: I want to mosaic Landsat 8 scenes but the final product has dark areas on overlaps and on the background of each scene. Help to remove the dark areas. Thank you in advance


title: Mapserver - Error setting up simple WMS/Mapcache service

text: I've got a Ubuntu 12.04 computer with Mapserver and all other software on it. I have tried to set up a simple WMS / Mapcache service but have not succeeded. I can browse to the automatically generated demo page, and they work per se, but all I get are red tiles (i.e. broken) I think there's something wrong in the configuration files, regarding referencing map or layers. Mapcache.xml: http://paste.org/67836 simple.map: http://paste.org/67837 I get this error message:               [Mon Oct  7 15:41:30 2013].708630 msWMSLoadGetMapParams(): WMS server error. Invalid     layer(s) given in the LAYERS parameter. A layer might be disabled for this     request. Check wms/ows_enable_request settings.     [Mon Oct  7 15:41:30 2013].708691 mapserv request processing time (msLoadMap not     incl.): 0.000s     [Mon Oct  7 15:41:30 2013].708712 msFreeMap(): freeing map at 0x18fa670.


title: How to delete coordinate system from raster file with prj.adf?

text: How can I delete the coordinate system from a raster file like .adf which is multiple files? I found a file with tha name "prj.adf" so if I delete this file is it enough? In shapefiles usually Ι delete the .prj file and thene I define the projection again, if necessary.


title: Problem reducing the width of the attributes fields of a shapefile using python

text: I have a shapefile with rather long attribute widths (which is resulting in a rather large file). I am trying to trim it in python, here is my code:               layer = qgis.utils.iface.activeLayer()     layer.startEditing()     fields = layer.dataProvider().fields()     for eachField in fields:         eachField.setLength(9)#Set the field length         print eachField.length()#print it, the result of this is 9         layer.updateFields ()          layer.commitChanges()            for eachField in fields: # The code I use to check it works, which gives the orig length         print eachField.length()      The code seems to change the length of the attribute field but then when I run a check I get the original length again. I have tried various different ways of doing this with the same results, the issue seems to be getting the edit to "stick". Does anyone know how I can get the layer to update to match the changes I have made to the layers fields? I haven't been able to find a way of doing this in the docs, thanks for your time.


title: Will ArcGIS Pro have (better) ModelBuilder?

text: An earlier **Q&A** provided some reassurance that **ArcPy** code would have re-use value with **ArcGIS Pro** : > **ArcGIS Professional Extensibility.** Here are our current thoughts about > extensibility for ArcGIS Pro. You can write and run Python scripts in ArcGIS > that call geoprocessing tools and use an exhaustive suite of scripting > functions available in the ArcGIS Python API, ArcPy, to automate your GIS > tasks. However, it makes no mention of whether ArcGIS Pro will enable model building to automate workflows using a GUI that is either (equivalent to) the existing ModelBuilder or a major improvement on it to address **previous enhancement requests** from others and I. Has anyone heard the **road ahead** for ModelBuilder (or at least model building) in ArcGIS Pro?


title: Visibility On-Off of Label Layer in arcgis javascript 3.7

text: I am using ArcGIS JavaScript 3.7 API's and i am using agsjs.dijit.TOC control and it is working fine but when i added Label Layer in my map that time Label layer is coming fine but TOC is not working Properly. While Pressing the checkbox to On-Off the Layer it is working fine but regarding the feature layer i added one Label layer that is not getting On-Off Can anyone tell me how to Switch-Off or On the Label Layer. Thanks in Advance. I am Pasting some code..                   Var load = function () {         require(["dojo/_base/Color", "esri/symbols/TextSymbol", "esri/renderers/SimpleRenderer", "esri/renderers/ScaleDependentRenderer"],         function (Color, TextSymbol, SimpleRenderer, ScaleDependentRenderer) {         var statesColor = new Color("#666");         var fieldLabel = new TextSymbol().setColor(statesColor);         fieldLabel.font.setSize("4pt");         fieldLabel.font.setFamily("arial");              statesLabelRenderer = new SimpleRenderer(fieldLabel);         return statesLabelRenderer;       });         }         var layers = [];           var layer = new esri.layers.FeatureLayer(url, {             mode: esri.layers.FeatureLayer.MODE_ONDEMAND,             outFields: ["*"]                                             });         layers.push(layer);              layerInfo.push({ layer: layer, title: item["LookupDisplayDesc"], boxLabel:     item["LookupDisplayDesc"], id: layer.id, checked: layer.visibleAtMapScale, slider: true });          if (item["LookupLongDesc"] != null && item["LookupLongDesc"] != "") {         var fieldNames = item["LookupLongDesc"].split(",");         var labelFields = "";     for (var i = 0 ; i < fieldNames.length ; i++) {         labelFields = labelFields + "${" + fieldNames[i].trim() + "},";     }         labelFields = labelFields.slice(0, -1).trim();         load();         var labelLayer = new esri.layers.LabelLayer();         labelLayer.addFeatureLayer(layer, statesLabelRenderer, labelFields);         layers.push(labelLayer);         }     }     map.addLayers(layers);                dojo.connect(map, 'onLayersAddResult', function (results) {                     if (layerInfo.length > 0) {                         var legendDijit = new esri.dijit.Legend({                             map: map,                             layerInfos: layerInfo                         }, "legendDiv");                         legendDijit.startup();                     }                     toc = new agsjs.dijit.TOC({                         map: map,                         layerInfos: layerInfo                     }, 'LayerDiv');                     toc.startup();                                 });


title: Bulk importing raster data into GeoServer

text: I have more than 1000 world images in tiff format. I need to create the raster layers for those images in GeoServer 2.4-RC2 on Windows XP OS and set it as a backdrop in my web application. Is there any way for bulk importing in GeoServer? or any way to group those images into one raster store? or Is there any opensource to do this job? Please suggest me.thanks in advance.


title: How to do dissimilarity index in GIS?

text: Can anybody help me to find out how dissimilarity index can be used for transport study, and is there any method in QGIS or ArcGIS for Desktop through which it can be performed ?


title: Extract values from raster based on weighted average area using polygon grid

text: EDIT: I am using Armap 10 sp 5 I have found similar questions but they were either unanswered or somewhat different to what I am asking. I have a raster with cell values 1-5 and a polygon shape file with regular grid of squares the same size. All I need as output is a table with the polygon ID and the raster value. I tried to use the zonal tool but in the option it does not have a weighted average based on the area that each raster cell occupies in the polygon grid cell. For example in a grid cell I might have two raster cells, one of value 2 that occupies 30% of the area and one value 5 that occupies 70%. My result would be 2*.3+5*.7=4.1 instead of 3.5 that I get with zonal tools.


title: How to read OpenLayers event object features?

text: This is part of an interface that uses a box to select features on a WMS Layer. This then writes the name of the features to a div as a list.               var recycling = new OpenLayers.Layer.WMS(          "Recycling Sites",         wmsurl+'?',          {layers: 'GeoserverWorkspace:recycling', 'format':'image/png', 'transparent':'true'},         {'opacity': 1.0, 'isBaseLayer': false, 'visibility': true}         );             select = new OpenLayers.Layer.Vector("Selection", {styleMap:                  new OpenLayers.Style(OpenLayers.Feature.Vector.style["select"])             });          map.addLayers([osmap, recycling, select])               var recycling_wfs =  new OpenLayers.Control.GetFeature({                 protocol: OpenLayers.Protocol.WFS({                 url: wfsurl,                 version: "1.1.0",                 featureType: "recycling",                 featurePrefix: "GeoserverWorkspace",                 srsName: "EPSG:27700",                 geometryName: "wkb_geometry",                 maxFeatures: 50,                 click: true                 }),                      box: true     });           map.addControl(recycling_wfs);            recycling_wfs.events.register("featuresselected",this, showInfo);          recycling_wfs.activate();          function showInfo(e) {              // assign features object to a variable              var features = e.object.features;              //properties are accessed by using the attibutes property         var selectedSites = "";                  for(var fid in features){               var site = features[fid].attributes;               var siteName = site.name;               selectedSites += siteName + " ";             }              document.getElementById('responseText').innerHTML = "Recycling Site: " + selectedSites;     }      I am confused about the event object that is returned by the featuresselected event, to the callback function showInfo(). According to the OpenLayers documentation this should be an array. So if I select 2 features I should be able to access the first name by doing the following               var name = e.object.features[0].attributes.name;       However this returns an error of e.object.features[0] undefined. I am able to get the feature name if I use a For..In and iterate through the event.object.features object. Then use the resulting fid to access the feature, like so var name = e.object.features[fid].attributes.name Is this the correct way to access the event.object's features or have I missed somthing?


title: Error when providing "Python init function" from Python script in QGis

text: ## Problem I am using QGis and Python scripting to programmatically set a layer's edit form and "Python init function". It appears that the Python init function is called correctly in one situation (when QGis is just opened) and incorrectly at other situation (when I disable the plugin and enable it again). I already mentioned the problem here, but decided that it deserves a question on its own: Import error when utilizing QGIS's Python Init function ## Detailed description of problem I wrote a plugin that on a button press loads a layer and sets its editor form:               layer.setEditorLayout(QgsVectorLayer.UiFileLayout)     layer.setEditForm("C:\\Users\\rauni\\.qgis2\\python\\plugins\\Test1\\metsad.ui")     layer.setEditFormInit("Test1.metsad.formOpen")      I add that my plugin is located in "C:/Users/rauni/.qgis2/python/plugins/Test1" and my sys.path contains the following entries:   * u'C:/Users/rauni/.qgis2/python',   * u'C:/Users/rauni/.qgis2/python/plugins', Now if I do like this:   1. Enable the plugin (from "Manage and install plugins")   2. Close QGis   3. Open QGis   4. Press the button (which loads the layer and sets the editor form)   5. Draw a feature   6. Right-click to end drawing Then the method formOpen in file C:/Users/rauni/.qgis2/python/plugins/Test1/metsad.py gets called correctly, and the custom form is shown. On the other hand, if I do like this:   1. Disable the plugin (from "Manage and install plugins")   2. Enable the plugin    3. Press the button (which loads the layer and sets the editor form)   4. Draw a feature   5. Right-click to end drawing Then I get the following error: > Error occured in the following code: if hasattr(Test1.metsad,'DEBUGMODE') > and Test1.metsad.DEBUGMODE: reload(Test1.metsad) > > Traceback (most recent call last): File "", line 1, in AttributeError: > 'module' object has no attribute 'metsad' It appears that some part of QGis code is seeing "Test1" as a module and "metsad" as an attribute, instead of seeing "Test1.metsad" as a module. ## Remark If I add category C:/Users/rauni/.qgis2/python/plugins/Test1 to my PYTHONPATH and change command to               layer.setEditFormInit("metsad.formOpen")      , then the problem goes away. But it seems to me that it is more natural to add only the whole plugins directory to PYTHONPATH, not every script directory individually. Can anyone provide insight why the error occurs?


title: ArcSDE Database Refactoring Tools?

text: We are using liquibase as evolutionary DB change management tool in our applications, it works great when we use it in "common" database schemas. But we also work with GIS applications using esri arcSDE 9.3 platform over Oracle and in this case, all (or almost all) tables (both GIS and 'alphanumeric' tables) in the schema are managed (create table, grants, etc.) through arcSDE. So when we want to create new feature classe, now we use arcCatalog, and this way, it's not possible to manage the feature classes’ changes directly through SQL using liquibase or other automate refactoring tool. So if we cannot use liquibase to manage changes, at least we want to execute the management operations over our features through command line. We’ve started looking for tools that avoid the use of arcCatalog, and then try to automate the changes using scripts, we are investigating these possibilities:   1. Try to capture the SQL that arcCatalog/arcSDE is executing each time we make a change in one Feature Class monitoring the oracle connection. It outcomes us a too complex set of SQL instructions that involves indexes, versioning tables, etc. so we give up this way.   2. Use the sdelayer and sdetable admin commands installed on arcSDE server.   3. Use the data management tool: a python based library to manage the feature classes, but it has to be executed from a machine with the desktop version installed. These last two options will provide a way to manage features from command- line, but our target is to find/develop a tool to manage changes similar to the way liquibase do. But with these tools we will have to find a tool that let us map each SQL DDL operation to an arcSDE command, and currently no db refactoring tool provides this (currently we have check liquibase, dbdeploy, flyway). Anybody had solved this problem of evolutionary change management with arcSDE? Any insight of another way to face this problem?


title: Determining gradient of road segment

text: I've a shapefile of roads data. It contains information about terrain of road segments, i.e., hilly, flat, undulating, etc. I want to determine gradient of every road segment. I know this might require corresponding raster data and a lot of image processing. I also understand that I can use GRASS for this kind of analysis. But I've never attempted a task like this before. For those who have, is GRASS my best bet? And, must I get the corresponding raster data? Is there a way I can do this without having to get my hands dirty with image processing algorithms. In case I must get the corresponding raster data, is there a source I can get reliable raster data that is not more than 4 years old? Your contribution will be highly appreciated. **UPDATE:** There will be a need to split a road segment that has both ascending and descending gradients. Overlaying the roads vector onto a raster layer is one of the options I think can work. But I don't have the raster data. Any idea where I can get raster data with sufficient accuracy and resolution will be appreciated. Can GRASS accomplish the splitting, and the analysis. I'd prefer open source tools for now as I'm still experimenting. **UPDATE:** The purpose of the analysis is to come up with an algorithm that calculates economic well being of a point on a map, taking into account its accessibility (distance from the road, terrain, among other factors). Also, the algorithm is to also aid in decision making in relief food distribution. **UPDATE:** I've got some material here on terrain analysis. Any advice is still welcome.


title: > - operator and "Shape_Area" field in a geodatabase

text: this might be a pure python problem or a problem with arcpy. please help me out:                   min_area = float(GKPROZ_functions.min_of_field(out_name,"Shape_Area"))         print area_max         if min_area > area_max:             print "success!"         else:             print "failed."                          if min_area > 100:             print "success!"         else:             print "failed."              print str(min_area)      output:               100     failed.     success!     100.018289077      min_of_field returns the minimum value of the field "Shape_Area" of the whole feature class. it is (apparently) 100.018289077. however if i check that with area_max (supposedly 100) it says it's smaller (failed!). if i check it with 100, it says it's bigger(success!). what mistake am i making here? thanks in advance.


title: QGIS error when open project when layer via accesses the database

text: I changed from QGIS 1.7.3 to 1.8.0. Problem is that I can´t open QGIS Projects, QGIS crashes when there are layers involved loaded via access- database connection. I used eVis. What can I do?


title: It is possible to add A* to the pgrouting plug-in?

text: I am using pgrouting layer plug-in as described in this post: http://underdark.wordpress.com/2011/12/18/osm2po-part-2-pgrouting-on-osm-the- easy-way/ I am now able to calculate the shortest path using Dijkstra algorithm. I would like to know if it is possible to add to the pgrouting plug-in the A* shortest path algorithm. Thank you. Selini


title: How to resize the map item in QGIS print composer without changing scale?

text: Is it possible to lock the scale in the QGIS 2.0.1 print composer? Every time I resize the map, the scale is adjusted. This makes trying out different map layouts really annoying.


title: Mobac .mbtiles files get a no tile_data error

text: The symptom of my problems is that when my ios code tries to access the map I get a tile_data error. The maps appear to generate normally. I have a sample mobac created mbtiles file and it works in xcode like it should. I have created my own mobac maps and they   * preview in finder and xcode ok   * appear to have valid data and structure when opened by a sqlite utility app however they   * throw the no tile_data error when the simulator is run   * come up as blank previews in MapTiler (from maptiler.com) FWIW I get the same problem with maps produced on win7 and my mac. I have tried using mobac versions 1.9, 1.9.11 and 1.9.16 as well as 2A1 I got tripped up briefly by my jdk version but I've got that straight. I can't see what else I need to do. If there's an alternate tool that's newbie friendly let me know. I've created really detailed maps in QGIS with filters and styles and layers. I want to be able to use it as an alternate source to OpenStreetMap but if I can't even get a basic map to generate I'm a bit concerned!


title: What are nodes in ArcGIS and how do you create them?

text: I want to create a elevation profile of a cross section so a polyline on ArcGIS. I wanted to regularly space around 1000 points per 1700m long xsection and extract elevation data for each node/point from the underlying LiDAR raster to create a graph showing elevation vs distance. However, at the moment I am having to use the intersect function with my 0.2m interval contours, which is ok but then it only extracts an elevation where the contour intersects the cross section. So is it possible to create these regularly spaced nodes/points along the xsection, if so how do I do it? Thanks Duncan


title: QGIS saving shape file wrong utf8 encoding in DBF?

text: I'm using QGIS for some SHP processing. When i save the file, the DBF utf-8 text encoding is wrong: Source DBF               à0è0ì0ò0ù0  HEX: C3A0 30 C3A8 30 C3AC 30 C3B2 30 C3B9 30       Saved DBF               Ã 0Ã¨0Ã¬0Ã²0Ã¹ HEX: C383C2A030C383C2A830C383C2AC30C383C2B230C383C2B9


title: I upgraded to SP5. The service "ArcGIS Server Object Manager" not start. How to fix this?

text: I updated my ArcGIS Server from the SP4 to SP5. On a Windows 7 OS. But I cannot to start the "ArcGIS SOM" service. An error appears in a popup. Because of this, the following error occurs in "ArcGIS Server Manager" (the administrator by browser): "Manager Could not connect to the GIS Server. PLEASE CHECK That the server is online and Functioning properly. Some Manager operations will not be available until the next time you log in to GIS Manager When the server is available." What can I do to start the "ArcGIS SOM" service? Thanks!


title: MapScale not being persisted properly in mxd when programmatically changed outside of ArcMap environment

text: I am trying to change the scale of a map in an mxd OUTSIDE of ArcMap in a standalone Windows application. The problem is the scale is never persisted - the best code I have come up with is the following:               private void UpdateMapScaleInMxd(double scale, string mxdFullPath)             {                 IMapDocument mapDocument = new MapDocumentClass();                 mapDocument.Open(mxdFullPath, "");                 IPageLayout pageLayout = (IPageLayout)mapDocument.ActiveView;                      IGraphicsContainer graphicsContainer = (IGraphicsContainer)pageLayout;                 graphicsContainer.Reset();                 IMapFrame mapFrame;                      IActiveView tmpActiveView = null;                      IElement element = graphicsContainer.Next();                 while (element != null)                 {                     if (element is IMapFrame)                     {                         mapFrame = (IMapFrame)element;                         tmpActiveView = (IActiveView)mapFrame.Map;                              mapFrame.ExtentType = esriExtentTypeEnum.esriExtentScale;                         mapFrame.MapScale = scale;                         tmpActiveView.Refresh();                     }                          element = graphicsContainer.Next();                 }                      mapDocument.Save(false, false);                 mapDocument.Close();             }      I check the mxd by opening it up in ArcMap and the map scale has changed i.e the data frame now has a fixed scale and the scale combobox is greyed out. So now I try to export the map as a PDF in code - and the most frustrating thing is - it exports the map at the previous scale that was set - NOT the scale I just changed it to! So infuriating - if anyone can help me understand where I am going wrong that would be great. UPDATE: In the code above I am using the IMapDocument - and I think there are limitations (according to the help): > The IMapDocument interface provides properties and methods for reading map > document files (*.mxd, *mxt, _.pmf) and writing and saving changes to map > document files (_.mxd). However, since it is not tied to the ArcMap > application, application-specific functionality in the MapDocument will not > be persisted. Examples of application specific functionality are toolbar > settings, UI customizations, VBA projects, and ArcMap graphs. For desktop > developers who need to use this functionality, the MxDocument interface > located in the ArcMapUI library is a better choice. I am now thinking that changing the map scale can not be persisted properly using the IMapDocument interface.


title: ArcGIS tool with the same result like r.sun in GRASS

text: I'm interested if there is any ArcGIS tool which give us the same result like GRASS command r.sun. I need to get drop shadows. You can suggest and some other software. Thank you.


title: Didn't find route with pgRouting

text: I try to using pgrouting to find route, first I'm using assign_vertex_id and when I calculate the shortest route, i didn't find the route in my pgAdmin data output, and in the messages :               "row number -1 is out of range 0..-1     Total query runtime: 15 ms.     0 rows retrieved."      the code:               SELECT * FROM shortest_path('        SELECT gid AS id,                source::int4 AS source,                target::int4 AS target,                length::float8 AS cost         FROM jalan', 1,10, false,false);      and then i didn't use assign_vertex_id but there's an error, (i'm following step on), the code:               CREATE TABLE node AS         SELECT row_number()OVER (ORDER BY foo.p)::integer AS id,                foo.p AS the_geom        FROM (                    SELECT DISTINCT road_ext.startpoint AS p FROM road_ext           UNION            SELECT DISTINCT road_ext.endpoint AS p FROM road_ext        ) foo        GROUP BY foo.p;      > error: "ERROR: syntax error at or near "OVER" i hope that someone can help me about problem, thanks (hesty.wul@gmail.com)


title: Passing a variable from a script to ModelBuilder

text: I have a model that passes a variable to a python script. The script uses that variable to query some directories and return a list of paths. What I want to know is: how can I then use each of those paths as the parameter in a subsequent operation? Is the bridge between python and ModelBuilder a one-way street?


title: What is the best practice for reading data from a raster band with Java and GDAL?

text: After using GDAL with Python for a year or so now, I'm getting back into Java and trying to figure out how to use GDAL with it. I am wondering if anyone has had experience with reading data from a raster band with GDAL and Java. I can read the dataset and band in as follows:               Dataset theDataset = gdal.Open("k:/dem.asc", gdalconst.GA_ReadOnly);     Band theBand = theDataset.GetRasterBand(1);      ...but I am not sure how to read data from `theBand`. From the API documentation it seems that I have to set up an array first, which means I have to know how many elements are in the block of data that I want to extract from the band. Like this:               double[] arr = new double[3];     theBand.ReadRaster(0, 0, 3, 1, arr);      I guess it works fine if you only want to extract one row of data, as above, because you end up with a one-dimensional array. Referencing elements is pretty easy. But if I want to extract a multi-row block of data, it has to be forced into a one-dimensional array. Something like this:               double[] arr = new double[9];     theBand.ReadRaster(0, 0, 3, 3, arr);      Then if I want to reference an individual raster cell in the array I just extracted (for example, if I want to process the block cell-by-cell), I need to convert my two-dimensional grid coordinate (proxy of easting and northing) into a one-dimensional integer array index. I guess it's not too difficult to write a little method to convert from a grid reference to essentially a vector reference, but it just seems kind of convoluted, especially after being used to using grid references directly in Python-numpy-GDAL. So is this the only way to extract data from a band in Java/GDAL? From what I can tell, it is, but I am hoping there is a more intuitive way of processing large blocks of data.


title: Source of change in network dataset shared between two computers?

text: We are analyzing the distance between census tract centroids and stores in the city. I am relatively new to ArcGIS. This post has been significantly edited since I gathered new information (original text is preserved below). I originally asked about potential version differences between ArcGIS 10 and 10.2, but I have since discovered that the source of the differences between my and my colleague's results were our network datasets. Although I was using the ND she provided me, somehow there was a change. When running the analysis with her version of the ND, I would get 269 route results. Running it with my version I got 265 results. I built a new ND and also got 265 routes, so we will go with that. But what could have happened to change/corrupt my colleague's network dataset so that it still functioned in the analysis, but gave different results? All files are using the GCS_North_American_1983 coordinate system. [original post:] When I run the Closest Facility (cut off at 2000 meters) on my machine, I get 265 route results. When my colleague runs on her machine (version 10), she gets 269 route results. I have expanded my search distance and found that my version will find the four additional routes, but in my version they are further than 2000 meters from the tract centroid. It seems that our two versions place 4 of the stores in a slightly different location--all our distances for routes to these 4 stores are slightly different. We are using the same base files: census tracts, centroids, geo- coded stores, address locator. The only difference I can see is when we have our Network Analyst "add locations"--her version appears to have fewer options than mine. What might be the source of this issue? We are trying to decide whose results to use. Is there a known difference in facility location between versions 10 and 10.2? Does anyone have suggestions on how I could try to figure out where the differences are? Right now I'm trying to pull all the various X and Y coordinates into Excel and compare there. Any suggestions would be most appreciated! Thank you! Like I said, I'm relatively new to ArcGIS. I'm happy to provide additional detail on request--I wasn't sure what would be helpful. UPDATE: I have re-run the analysis on my computer using her files and using my files. I get the same results (269 routes from her files, 265 from mine). The X and Y coordinates of our store points and our centroid points are exactly the same (to the 11th decimal place).


title: Understanding arcpy.Describe IOError?

text: I am trying to find out if an mxd contains any schematic diagram layer through a python script tool. I am looping through all the mxds those are added to the python script tool and in each mxd checking each layer whether it's a schematicdiagram layer or not. My actual code in .py file looks like this:               import arcpy     mxdList = string.split(arcpy.GetParameterAsText(0), ";")     outXLSpath = arcpy.GetParameterAsText(1)          mxdCount = 0          for mxdpath in mxdList:         if "'" in mxdpath:             mxdpath = mxdpath[1:-1]         else:             mxdpath = mxdpath              mxdCount = mxdCount + 1              mxd = arcpy.mapping.MapDocument(mxdpath)         (filepath,filename)= os.path.split(mxd.filePath)              arcpy.SetProgressorLabel("Extracting Layers for " + str(mxdCount) + " of " + str(len(mxdList)) + " MXDs \"" + filename[:-4] + "\"... ")         arcpy.AddMessage("Extracting Layers for " + filename + "..." )         lyrList = arcpy.mapping.ListLayers(mxd)              for lyr in lyrList:             if not lyr.isGroupLayer:                 longNameList = lyr.longName.split("\\" or "//")                 if len(longNameList)>1:                         descTemp = arcpy.Describe('\\'.join(longNameList[:-1]))                         if (not descTemp.dataType == "GroupLayer") and descTemp.dataElementType == "DESchematicDiagram":                             arcpy.AddMessage("Schematic Layer")      The above code is throwing error for group layer it encounters in the list of layers. Following is the error being encountered by the tool!!               Traceback (most recent call last):   File "C:\ANM\ArcGIS\Tools\MyTools\ExportLayerList3-1-Test.py", line 34, in <module>          descTemp = arcpy.Describe('\\'.join(longNameList[:-1]))        File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\__init__.py", line 1234, in Describe      return gp.describe(value)   File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\geoprocessing\_base.py", line 374, in describe     self._gp.Describe(*gp_fixargs(args, True)))      IOError: "Boundaries" does not exist Failed to execute (ExtractLayerList2)      . surprisingly the same code is working fine if I test it in ArcMap's Python window. Would someone highlight the issue and suggest the solution.


title: How to use different popup styles in the same leaflet web map for different dynamic map layers

text:
I am very new to javascript, CSS and HTML. I have been playing around with leaflet and have been trying to figure out a way to customize popups for different features in my map. Is there a way to do this? I did some googling and saw that I could create custom style popups in the style section of my page, but haven't figured out how to apply them:                .Custom-popup .leaflet-popup-content-wrapper {      background: rgba(0,0,0,0.7);      border: solid 3px white;      color: white;      font-size: 14;      width: 300px     }     .Custom-popup .leaflet-control {     position: relative;     z-index: 7     pointer-events: auto;     }      I also have this code that specifies the content of the custom popup:               OHS.bindCustom-popup(function (error, featureCollection) {       if(error || featureCollection.features.length === 0) {         return false;       } else {         return 'OSMI ID = ' + featureCollection.features[0].properties.OSMI_ID + '
' +         'Sign Type = ' + featureCollection.features[0].properties.Sign_Type + '
' +          'Structure/Post Type = ' + featureCollection.features[0].properties.Structure_Type + '/' + featureCollection.features[0].properties.Single_Post_Type + '
' +         'Clearance = ' + featureCollection.features[0].properties.sgn_signclr + '
' +          'Sign Location = ' + featureCollection.features[0].properties.Sign_Located_On + '
' +         'County = ' + featureCollection.features[0].properties.County + '
' +         'Route = ' + featureCollection.features[0].properties.Route + '
' +         'Post Mile = ' + featureCollection.features[0].properties.Mile_Post + '
' +         ''+ 'Open Overhead Sign Images'+ '
' +         '' + 'Report Error/Make Suggestion' + '' + '

' +       '';       }     });       But this doesn't work - no popup appears. If I change 'OHS.bindCustom-popup' to 'OHS.bindPopup', I get the popup in the standard leaflet style. I know this code is probably not very concise but as I mentioned I am just starting out with this. Any feedback would be appeciated! I would ultimately like to have custom popups for each dynamic map layer or feature layer.


title: How can I find closest point on a polygon from a point

text: I have a point that may be inside or outside of a polygon, I need to find the nearest point on the polygon boundary from the point. ![Example image](http://i.stack.imgur.com/lU0kt.jpg) Point(x,y) may be inside or outside of the polygon, shortest distance between polygon ABCDE and point(x,y) is marked as red line, the intersecting point is Point (m,n). I need the value of m and n. I have ABCDE and Point(x,y)


title: What is the expected margin of error for points plotted on EPSG:3857 projection?

text: I am using the projection EPSG:3857 to plot out points on the map. Since the Earth is closer to the shape of an ellipsoid instead of a sphere, I am interested to find out what is the range of error if I were to plot some points using this spherical mercator projection. Using examples of prominent points of interest such as the tip of Mount Everest, Statue of Liberty, etc, would be helpful.


title: Font Formatting in Advanced Label Expression ArcGIS/Python

text: Almost have this quandry figured out, but inevitably a new problem has popped up. I finally have the "code" part down to do what I want, but now the font formatting isn't acting properly. When I use a simple expression with font tags I can create this image. ![enter image description here](http://i.stack.imgur.com/Htzwb.jpg) However, when I use the advanced expression as follows, it returns the garbled image after. I'm using the tags the same way and can't find any reason they shouldn't be working. Without quotes I get a syntax error. EDIT - Trimmed code to focus on issue area. Font tags were improperly placed, see answer 1.               if float([Percentage_Complete]) >= 90:     lab1 =  "<bol><clr green='255'>" + lab1 + "</bol></clr>\n"     if float([Percentage_Complete1]) >= 90:     lab2 =  "<bol><clr green='255'>" +  lab2 +  "</bol></clr>\n"     if float([Percentage_Complete2]) >= 90:     lab3 =  "<bol><clr green='255'>"+  lab3 + "</bol></clr>\n"     if float([Percentage_Complete3]) >= 90:     lab4 =  "<bol><clr green='255'>"+  lab4+  "</bol></clr>\n"      ![enter image description here](http://i.stack.imgur.com/yfloG.jpg)


title: How to auto populate multiple fields in attribute table?

text: i have Feature Class Buildings, it has many fields like this(Region_id,Region_Name,Governorate_Name,Village_id,Village_Name,Building_id,Building_Hight,Building_Area,Floor_No,Residential_Units_No_Commercial_Units_No,Administrative_Units_No_Other_Units_No) my challenge is to reduce the time for populate values, i need when i finished create building polygon, then select it to auto populate parameters of attribute values.


title: How can I get the corners of a polygon in latitude and longitude?

text: How can I get the corners of a polygon -a square/rectangle, to be precise- in latitude-longitude format by using its geom value -or some other way, perhaps-? Thanks.


title: How geowebchache + georss works?

text: In connection to my previous question I have another one. I have created feed using this schema: http://georss.org/gml Now I have a problem with < updated > tag. It occurs two times (in head and in every entry). I understand that while changing one feature I have to change date two times (head and feature entry). How geowebcache recognizes this? Will it check tags for every feature and compare it with internal "last checked" value? If there is mismatch, geowebcache expire certain tiles?


title: Where Clause problems when all parts are user input variables

text: I have written some generic user ipnut code for a toolbox script (ArcGIS 10.0) but because everything is a variable I don't know how to write the SQL whereclause. Please can someone help and suggest how to do this. I have posted the code below but please ignore the other lines, they're working. The only part that does not work is the Select Layer By Attribute sections. All paths etc. are input by the user and citiesL is just "citiesL". There are also a few lines of code with the # before them because I've tried them and they don't work. Any help would be greatly appreciated. Thanks               # import system modules     import arcpy, os, arcpy     from arcpy import env     arcpy.env.overwriteOutput = True          # get user supplied path, layers and fields     path = arcpy.GetParameterAsText(0) # path is H:\working\Findsites.gdb     cities = arcpy.GetParameterAsText(1) # cities Layer is cities Feature Layer cities.shp     citiesL = "citiesL"     counties = arcpy.GetParameterAsText(2) # counties Layer is counties Feature Layer counties.shp     countiesL ="countiesL"     interstates = arcpy.GetParameterAsText(3) # interstates Layer is Feature Layer interstates.shp     crimeField = arcpy.GetParameterAsText(4) # crimeField is fieldname 'CRIME_INDE' SQL expression     crimefieldindex = arcpy.GetParameterAsText(5) # crime index is CRIME_INDE and is a string 0.02     #whereClause = '"' + crimeField + '" =' + workforceindex"     #whereClause3 = '"' + workforceField + '" >= ' + "'" + workforceindex + "'"     whereClause3 = "\"%s\" = '%s'" % (workforceField, workforceindex)     farmField = arcpy.GetParameterAsText(10) # farmField is fieldname 'NO_FARMS87' SQL expression     farmfieldindex = arcpy.GetParameterAsText(11) # farmfieldindex is the NO_FARMS87 field and is Double integer is 500     #whereClause4 = "'"' +farmField + '" >=' + farmfieldindex"     #whereClause4 = '"' + farmField + '" >= ' + "'" + farmfieldindex + "'"     whereClause = "\"%s\" = '%s'" % (farmField, farmfieldindex)     maxKmInterstate = arcpy.GetParameterAsText(12) # interstate WITHIN_A_DISTANCE linear unit     nearestInterstate = arcpy.GetParameterAsText(13) # Near Table Analysis table generated     targetFeatures = "cityListL" # cities spatial join layer     joinFeatures = "countiesL" # counties spatial join layer      cityListFC = arcpy.GetParameterAsText(14) # narrowed down cities list temporary     cityListL = "CityListL" # the feature layer of the generated cityList feature class     outputLayer = arcpy.GetParameterAsText(15) # ootput          #altwhereclause1 = "CRIME_INDE = 25000"     #altwhereclause4 = "NO_FARMS87 = 500"               # make a layer from the cities feature class     arcpy.MakeFeatureLayer_management(cities, citiesL)          # select layer by location to interstates     arcpy.SelectLayerByLocation_management(citiesL, "WITHIN_A_DISTANCE", interstates, maxKmInterstate, "NEW_SELECTION")          # Here is the ESRi suggested code for select layer by attribute where clause - doesn't work though     # whereClause = '"' + crimeField + '" = 25000 AND "NO_FARMS87" >= 500")     arcpy.SelectLayerByAttribute_management(countiesL, "NEW_SELECTION", whereClause3 + "AND" + whereClause4)          # from selection above select cities intersecting counties     arcpy.SelectLayerByLocation_management(citiesL, "INTERSECT", countiesL, "", "SUBSET_SELECTION")          # save selected features     # arcpy.CopyFeatures_management(citiesL, cityListFC)          # arcpy.Select_analysis(citiesL, cityListFC, "")     arcpy.FeatureClassToShapefile_conversion(citiesL, path)          # make temp cities list feature layer so that the output can be spatially joined to counties     # arcpy.MakeFeatureLayer_management(cityListFC,cityListL)          #arcpy.AddField_management(citiesL, "CITYNAME", "TEXT", "", "", "25")     #arcpy.AddField_management(citiesL, "CRIMEINDX", "DOUBLE", "", "", "")     #arcpy.AddField_management(citiesL, "HAS_UNI", "TEXT", "", "", "3")     #arcpy.CalculateField_management(citiesL, "CITYNAME", "!NAME!", "PYTHON")     #arcpy.CalculateField_management(citiesL, "CRIMEINDX", "!CRIME_INDE!", "PYTHON")     #arcpy.CalculateField_management(citiesL, "HAS_UNI", "!UNIVERSITY!", "PYTHON")     #arcpy.DeleteField_management(citiesL,["NAME", "LABEL", "CLASS"])     #arcpy.DeleteField_management(citiesL,["CRIME_INDE", "LABEL", "CLASS"])     #arcpy.DeleteField_management(citiesL,["UNIVERSITY", "LABEL", "CLASS"])     #arcpy.DeleteField_management(citiesL,["ID", "LABEL", "CLASS"])     #arcpy.DeleteField_management(citiesL,["POPULATION", "LABEL", "CLASS"])     #arcpy.DeleteField_management(citiesL,["TOTAL_CRIM", "LABEL", "CLASS"])          # Generate NearTable_analysis to find closest interstate distance     arcpy.GenerateNearTable_analysis(citiesL, interstates, nearestInterstate, maxKmInterstate)          # join new city list layer to generated Near Table     arcpy.AddJoin_management(citiesL, "NEAR_FID", nearestInterstate, "IN_FID")          # Run the Spatial Join tool, using the defaults for the join operation and join type     arcpy.SpatialJoin_analysis(targetFeatures, joinFeatures, outputLayer, "#", "#", "#")          # arcpy.FeatureClassToShapefile_conversion(citiesL, path)          #arcpy.CopyFeatures_management(cityListL, ouputLayer) # cityListFC)     #fieldmappings = arcpy.FieldMappings()     #fieldmappings.addTable(targetFeatures)     #fieldmappings.addTable(joinFeatures)     #NameFieldIndex = fieldmappings.findFieldMapIndex("NAME")     #fieldmap = fieldmappings.getFieldMap(NameFieldIndex)          # spatially join the narrowed down city/road and counties layers remove unwanted fields and rename others     # arcpy.SpatialJoin_analysis("cityListL", "countiesL", "H:/working/Findsites.gdb/FoundCities", "#", "#", "")     # create new fieldMappings          # Get the output field's properties as a field object     #field = fieldmap.outputField          # Rename the field and pass the updated field object back into the field map     #field.name = "COUNTYNM"     #field.aliasName = "COUNTYNM"     #fieldmap.outputField = field     # replace old field map in mappings object with new one     #fieldmappings.replaceFieldMap(NameFieldIndex, fieldmap)          # delete fields no longer applicable     #v = fieldmappings.findFieldMapIndex("AREA")     #fieldmappings.removeFieldMap(v)     #w = fieldmappings.findFieldMapIndex("POP1990")     #fieldmappings.removeFieldMap(w)     #x = fieldmappings.findFieldMapIndex("POP_SQMILE")     #fieldmappings.removeFieldMap(x)     #y = fieldmappings.findFieldMapIndex("SQ_MILES")     #fieldmappings.removeFieldMap(y)     #z = fieldmappings.findFieldMapIndex("X")     #fieldmappings.removeFieldMap(z)     #a = fieldmappings.findFieldMapIndex("Y")     #fieldmappings.removeFieldMap(a)     #b = fieldmappings.findFieldMapIndex("X_1")     #fieldmappings.removeFieldMap(b)     #c = fieldmappings.findFieldMapIndex("Y_1")     #fieldmappings.removeFieldMap(c)     #d = fieldmappings.findFieldMapIndex("PERIMETER")     #fieldmappings.removeFieldMap(d)     #e = fieldmappings.findFieldMapIndex("GAVPRIMARY")     #fieldmappings.removeFieldMap(e)     #f = fieldmappings.findFieldMapIndex("NearRoad_OBJECTID")     #fieldmappings.removeFieldMap(f)     #g = fieldmappings.findFieldMapIndex("NearRoad_IN_FID")     #fieldmappings.removeFieldMap(g)     #h = fieldmappings.findFieldMapIndex("NearRoad_NEAR_FID")     #fieldmappings.removeFieldMap(h)          #Run the Spatial Join tool, using the defaults for the join operation and join type     # arcpy.SpatialJoin_analysis(targetFeatures, joinFeatures, outputLayer, "#", "#", fieldmappings)          # order and rename final output fields where appropriate     #arcpy.AddField_management(outfc, "INTERSTATEkm", "SHORT", "3", "1", "")     #arcpy.AddField_management(outfc, "COUNTY", "TEXT", "", "", "14")     #arcpy.AddField_management(outfc, "WORKFORCE", "LONG", "", "", "")     #arcpy.AddField_management(outfc, "FARMS", "LONG", "", "", "")     #arcpy.CalculateField_management(outfc, "INTERSTATEkm", "!NearRoad_NEAR_DIST!", "PYTHON")     #arcpy.CalculateField_management(outfc, "COUNTY", "!COUNTYNM!", "PYTHON")     #arcpy.CalculateField_management(outfc, "WORKFORCE", "!AGE_18_64!", "PYTHON")     #arcpy.CalculateField_management(outfc, "FARMS", "!NO_FARMS87!", "PYTHON")     #arcpy.DeleteField_management(outfc,["NearRoad_NEAR_DIST", "LABEL", "CLASS"])     #arcpy.DeleteField_management(outfc,["COUNTYNM", "LABEL", "CLASS"])     #arcpy.DeleteField_management(outfc,["AGE_18_64", "LABEL", "CLASS"])     #arcpy.DeleteField_management(outfc,["NO_FARMS87", "LABEL", "CLASS"])     #arcpy.DeleteField_management(outfc,["OBJECTID_1", "LABEL", "CLASS"])     #arcpy.DeleteField_management(outfc,["Shape_Leng", "LABEL", "CLASS"])     #arcpy.DeleteField_management(outfc,["Join_Count", "LABEL", "CLASS"])     #arcpy.DeleteField_management(outfc,["TARGET_FID", "LABEL", "CLASS"])                    print arcpy.GetMessages()     print "\n*** LAST GEOPROCESSOR MESSAGE (may not be source of the error)***"; print arcpy.GetMessages()     print "Python Traceback Info: " + traceback.format_tb(sys.exc_info()[2])[0]     print "Python Error Info: " +  str(sys.exc_type)+ ": " + str(sys.exc_value)          # save selected features FINAL OOTPUT here     # arcpy.CopyFeatures_management(citiesL, outputLayer)          print arcpy.GetMessages()


title: Machine Learning Algorithms for Land Classification

text: I am interested in learning what software exists for land classification using machine learning algorithms (e.g. k-NN, Random Forest, decision trees, etc.) I am aware of the randomForest package in R and MILK and SPy in Python. My specific questions:   * Generally speaking, what open-source or commercial products exist for land classification using decision-tree based machine learning algorithms?   * More specifically, are there any trusted GUI-based nonparametric decision tree algorithms for land classification (i.e. especially Random Forest, although others welcome)?


title: how to square the pixels of a GeoTiff

text: I have a GeoTiff that has been supplied to me with non square pixels (I suspect due to reprojection to lat lon at some point). However the next step in my processing chain requires a Arc ASCII grid as input and so I need square pixels. To save me trying to guess the original projection can any one tell me how to use GDAL to resample my image so the pixels become square?


title: how do i get coordinates from a polygon like a drive time map

text: I want to do this locally in Javascript without using an ArcGIS service. The ideas is to get census group block and block data under drive time polygon overlays. An example of how the drive time overlays are created is here Create drive time polygon around a map point I can use the polygon vertix coordinates in some script with local CSV or JSON data about census blocks to see if the are with these polygons. Can someone provide some script that does this??


title: What's the correct transformation for Lambert Conformal Conic for Wyoming?

text: I am a newb in QGIS. I have loaded QGIS 1.8 (Lisboa) and practicing with a number of maps for portions of the state of Wyoming. My maps are mostly in UTM 12N NAD 27 & NAD 83 some are in decimal degrees and one is Lambert Conformal Conic NAD 83 with false Easting and False Northing offsets. There is no problem handling the maps in UTM 12N NAD 83 to overlay on those in UTM 12 NAD 27. But I cannot find a CSR Transformation for the Lambert Conformal Conic for Wyoming. The list contains practically all the states but not Wyoming. Am I blind, or am looking in the wrong place, or is it simply not there? Help would be greatly appreciated. Thank you.


title: How to enter formula into ArcGIS Raster Calculator?

text: i have the following formula:               L = (l/22,1)^m      (l = Flow length) m is calculated like this: m = 0,5 when slope is >4 degrees m = 1,2 * sin^1/3a when slope is <4 degrees (a = slope in degrees) I already have the slope_deg and flow_length layer. Now I want to enter the formula to the raster calculator. I am new into ArcGIS and I dont know how i can implement it.


title: Remove parts of line that fall within a polygon

text: I have a polygon and two lines. How can I remove the portion of each line that falls within the polygon?               # polygon     coords <- matrix(c(-1.798123, -1.793072, -1.805767, -1.804129, -1.798123, 55.68066, 55.67369, 55.67508, 55.68139, 55.68066), ncol=2)     myPolygon <- Polygons(list(Polygon(coords)),  "myPolygon")     myPolygon <- SpatialPolygons(list(myPolygon))     proj4string(myPolygon) <- CRS("+proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0")     plot(myPolygon)               # lines     line1 <- matrix(c(-1.79880, -1.79517, 55.67737, 55.67920), ncol=2)     line2 <- matrix(c(-1.80231, -1.80679, 55.67764, 55.68004), ncol=2)     line1L <- Line(line1)     line2L <- Line(line2)     my.lines <- Lines(list(line1L, line2L), ID="my.lines")     myLines <- SpatialLines(list(my.lines))     proj4string(myLines) <- CRS("+proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0")     plot(myLines, add=T)      ![enter image description here](http://i.stack.imgur.com/kNDg6.jpg)


title: Zooming the map after filter

text: I have wms layer and after i do cql filter on this. And now i want to see result. I want map zoomed to this result. My code.               ex=layer.getExtent();     map.zoomToExtent(ex);      But getExtent() returns wrong bounds. In Geoserver i have layer settings               Native SRS=70066     Declared SRS=900913     Reproject native to declared      In OL when create map i write projection: EPSG 900913; What im doing wrong? I ll try do transformation               ex=layer.getExtent().transformation(map.projection, map.displayProjection);      projection=70066 displayProjection=900913 But it nothig to change. Maybe im gonna do it whis Capabilities?


title: Syntax of WFS request in OpenLayers

text: I am in need of the correct syntax for loading WFS layer using OpenLayers. I have gone through many examples on the OpenLayers site and other examples, but can't figure out how to use the necessary and optional options like strategies, protocols etc


title: Projection - once again

text: I have a shape file with nature preservation areas (Biosphärenreservate) in Germany. I think the projection must be something like gauss-krüger zone 4 Pulkovo or something like that. When I reproject it to UTM-33N WGS84 it reprojects but is not exactly accurate. The borders don't quite match my other shape (the other file) http://www.projektidee.org/images/extern/biosph-res-2010.prj.zip http://www.projektidee.org/images/extern/gebiet_UTM33.dbf.zip Could anyone here help me with that problem. That would be nice! best regards desputin


title: Efficient WMS or TMS Loop for Radar data?

text: I'm looking for an efficient way to loop radar data from a Tilecache or WMS Server. Right now, I make an array of layers and increment through them, but this seems inefficient since I end up with a lot of layers for what should be just one layer. I saw this post: http://gis.stackexchange.com/a/20836/7387, however, I'm not sure how to go about implementing what is suggested...                         {Destroy Layers} |10|11...19|20| {Start Loading Layers}     |---------------------------------------------------------------------------|                                ↑             Timespan           Current Possition      Can you do this on a single layer? A simple example to follow would be very helpful. Thanks!


title: Demographic Info within 3 miles of longitude and latitude

text: I want to get demographic information within three or five miles of a location given its longitude and latitude. The demographic info I am looking for include number of people, age distribution, income distribution, race distribution etc... Thank you


title: Why is Shapely not installing correctly?

text: I am trying to run Shapely on a new machine, and tried both installing it from source, using the installer on its webpage, and using `pip install shapely`. Every reference I try to make from the library except `from shapely import *` throws the error `WindowsError: [Error 126] The specified module could not be found`. Has anyone had a similar experience when trying to leverage Shapely, and figure out how to get it to function correctly? **Python Error Thrown:**   `WindowsError: [Error 126] The specified module could not be found`   **Environment:**   Windows 7 64-bit   Python 2.7


title: How to store point data (height) for each point in a linestring in openlayers

text: I am reading GPX files into OpenLayers. I would like to be able to save the edited route back to GPX including the height and time information that the original file contained (or use SRTM data to fill in new elevations). Is there an easy way to do this or is it going to be create a geometry.point to store each vertex of my linestring? Thanks in advance, Jon


title: How do I get road intersection symbology to display properly?

text: so, I'm finding that at intersections of roads, I am unable to get correct display by making changes in the road symbols themselves in Arc 10. Sometimes one road will display on top of the intersecting road, and sometimes vice versa--I haven't found any apparent pattern to the display. There must be another way to do this. ???


title: ArcGIS Desktop 10 ModelBuilder iterations

text: ![enter image description here](http://i.stack.imgur.com/Wfo5s.png) Hi all I have some home range estimates for fish that I made using the adehabitat pkg in R. However, a lot of them overlap land, so I need to subtract the area where they overlap with land ("BaseMap") from the total area to get the "water" estimate. I tried with one file, and I think if I use the intersect tool, then the calculate area tool in arcmap, I can get the area of intersection(overlap), and eventually subtract that from the total values I got from R. The problem is, I have a bunch of fish, and want to automate the process, or else I'll be stuck clicking my life away. I've tried to build a model using the iterate feature classes option in ModelBuilder, but I don't think it's actually iterating. Plus, I get an error for Calculate areas: "000641 : Too few records for analysis. This tool requires at least feature(s) to compute results", which I don't understand because I've run it with only feature and it works fine. I'll attach my model attempt here. My goal was to calculate the total area of my KUD shapefiles, and then the area of intersection with the basemap, which I will eventually subtract. Any advice would be greatly appreciated.


title: Get the geometry from the lasso selection tool

text: I'm building an Add-in solution in ArcGIS 10 that contains a custom tool. I'd like to borrow the functionality of the lasso selection tool without reinventing the wheel. Is there a way to intercept the geometry of the lasso selection area from the mouse up event? I want to pass the geometry of the lasso area to a spatial filter. I know how to get control of the lasso tool with the following code in my custom tool class:               private ITool m_SelectTool;     protected override void OnActivate()             {                          UID uid = new UID();                 uid.Value = "esriArcMapUI.SelectByLassoTool";                 ICommandItem commandItem = ArcMap.Application.Document.CommandBars.Find(uid, false, false);                 ICommand command = commandItem.Command;                 m_SelectTool  = (ITool)command;                         }


title: How to Clear Selected Features in Arcmap using Python

text: Clear Any Selected Features using python to prevent error if user has a recorded selected before running the tool.               arcpy.SelectLayerByAttribute_management(Table,"CLEAR_SELECTION")          rows = arcpy.SearchCursor(Table, " \"Name\" LIKE 'Albert%' ", "", "Name;")      Edited to show answer.


title: Tiger geocoder / postgis - get county from point

text: Looking for some help with getting the county for a lat / lon. I have postgis / tiger geocoder installed and can reverse look up a point and get the addresses. I would like to get the county the addresses are in. Thanks. I have.. geocoder=# SELECT pprint_addy(r.addy[1]) As st1, pprint_addy(r.addy[2]) As st2, pprint_addy(r.addy[3]) As st3, array_to_string(r.street, ',') As cross_streets FROM reverse_geocode(ST_GeomFromText('POINT(-77.03 38.90)',4269),false) As r; st1 | st2 | st3 | cross_streets   ------------------------------------+----------------------------+-----+-------------------- New York Ave, Washington, DC 20005 | H St, Washington, DC 20005 | | H St NW,13th St NW (1 row) And would now like to get the county for that point. thanks.


title: Does PostGIS/pgrouting actually come with street info?

text: I've been looking at getting a new GIS setup going, involving QGIS/PostgreSQL/PostGIS/pgrouting, and so far it has been relatively easy. One thing I want to be able to do is to work out travel times, but before I go ahead and learn all the SQL I want to know, does PostGIS/pgrouting actually come with street info? It seems a bit optimistic that they would contain street directories for the entire world, so my question is where does one actually get that info? Are there open source databases available that contain that kind of information? Also, I really only need Australian data, but being a data junky I won't say no to anything extra :D.


title: How do I get osgeo4w apache install to allow my regular windows account access?

text: I have just installed QGIS server on my Windows 7 machine. The installation went fine after some googling to find all the bits and pieces that needed to be done and I can fetch my get capabilities document and see the test.qgs project I added to the server. However I can't seem to successfully connect to the service in QGIS, I get the error below. ![enter image description here](http://i.stack.imgur.com/HN4TG.png) Is there something on the apache configuration that I have missed which would allow or deny users access to the service? Thanks **EDIT** : _Platform: Windows 7, and installed Apache through the OSGEO4W Installer._ Okay so I installed apache and QGIS Server through an admin account which was setup by our service desk then it was taken away after the install. So when I run QGIS under my normal account I get the error in the above picture. I asked for the admin account again, chose to open QGIS by going "Run as administrator" and everything worked just fine. I could connect to the wms and see my test service. How do I modify apache to allow access for my regular windows account? Ando


title: ArcObjects - IXMLPropertySet2.SaveAsFile XSL Translate Error

text: I'm stuck on this issue and really unsure what the problem is. I am trying to simply save the (IXMLPropertySet2)IMetadata.Metadata using the IXMLPropertySet2.SaveAsFile() method with the following code:               metadataToolControlVM.CurrentMetadata.SaveAsFile("C:\\Program Files (x86)\\ArcGIS\\Desktop10.2\\Metadata\\Translator\\ARCGIS2FGDC.xml", "", false, "C:\\Temp\\test.xml");      Which produces the following error when that code is called: _An exception of type 'System.Runtime.InteropServices.COMException' occurred in ArcCatalog_MetadataTool.dll and wasn't handled before a managed/native boundary Additional information: Namespace 'urn:schemas-microsoft-com:xslt' does not contain function 'utc'._ As far as I can tell from this microsoft site, it should in fact contain the utc function. I have been spinning my wheels on this for a while now, I can't see what's wrong here. Anyone able to offer insight?


title: Openlayers - Geoserver - tranforming srs of layers to match the base layer

text: I have the following two layers and Open Street Map (OSM) layer. A part of the script is given below. My problem is when I view the results from the browser both the layers fall on a wrong coordinates. I think this is because they are originally ESPG 3006 but the base layer (OSM) is ESPG:3857. Now I want to transform the two layers to match with the base layer ESPG. Can i do this without using any GIS software? Please Help.               vagar_alla = new OpenLayers.Layer.WMS(                     "vagar_alla", "http://localhost:8000/geoserver/myProject/wms",                     {                         height: '489',                         width: '512',                         layers: 'myProject:vagar_alla',                         styles: '',                         srs: 'ESPG:3006',                         format: 'image/png',                         transparent:true,                         tiled: 'true',                         tilesOrigin : map.maxExtent.left + ',' + map.maxExtent.bottom                     },                     {                         buffer: 0,                         displayOutsideMaxExtent: true                          }                  );       adresspt = new OpenLayers.Layer.WMS(         "adresspt", "http://localhost:8000/geoserver/myProject/wms",         {             height: '512',             width: '458',             layers: 'myProject:adresspt',             styles: '',             srs: 'ESPG:3006',             format: 'image/png',             tiled: 'true',             transparent:true,             tilesOrigin : map.maxExtent.left + ',' + map.maxExtent.bottom                    },         {             buffer: 0,             displayOutsideMaxExtent: true         }      var osm = new OpenLayers.Layer.OSM();                        map.addLayers([osm,vagar_alla,adresspt]);     );


title: Gdal/Ogr - OGRLayer.Intersection() Question

text: I was trying to perform intersection on two feature classes (shape file format) using OGRLayer.Intersection(), but have problems making it work with C# bindings. I am not able to figure out on how to pass the arguments SWIGTYPE_p_GDALProgressFunc callback and OSGeo.OGR.SWIGTYPE_p_void callback_data. Can someone please help me figure out on how to handle these. I keep getting the error "Attempt to dereference null GDALProgressFunc". I am not sure what that means. Please share an example on how to call Intersection routine or some other routine which takes above mentioned argument types. Thank you, Dheeraj Reddy Mamidi


title: PostGIS Dissolve/Union close polygons

text: I have approximately 1 million polygons that have been split by lines. However, this has caused one half of a polygon to be separated by approximately 50cm from its other half. After doing a lot of attempts using a variety of methods I still have not come up with a reliable solution. I would like to end up with individual features which have had the closest polygons merged together to create one feature. It probably needs to be based on a tolerance or buffer. 1) Using Union and SnapToGrid as explained by Paul Ramsey in another question (What is the best way to join lots of small polygons to form a larger polygon?)                CREATE TABLE merged AS      SELECT ST_Union(ST_SnapToGrid(the_geom,0.0001))       FROM parishes      GROUP BY county_name;      This did a great job of doing a union on the parts of each polygon, however, I was left with just one feature. So my 1 million polygons and been merged into a MultiPart. Is there a way to stop this from happening? 2) Using Topology I then wondered if I might be able to use topology within PostGIS 2.0. I found this very difficult to implement as there are very few examples.                -- Create a topology     SELECT CreateTopology('new_topology', 27700, 'geom'));          -- Add a layer     SELECT AddTopoGeometryColumn('new_topology', 'public', 'original_polygons', 'topogeom', 'MULTIPOLYGON');      This creates the edges and faces but how should I now use this to create a new polygon layer? 3) ST_Snap - it seems this will snap a geometry to another geometry. I could not get this to work as I was trying to snap to the same geometry. This may work though as I could snap the points on one side of the polygon to its matching set and then dissolve. Are there any other options or advice on how to achieve what I am after?


title: Intersect line (LLH) with any LLH plane

text: I have a LLH (Longitude, Latitude, Height) **point** with an **elevation angle** and **azimuth** (actually it is a receiver point). I believe I can make a **line** with this information. **What I want is to intersect this line with any LLH plane** (constant latitude or constant longitude or constant height). For example intersect it with Latitude = 3. After the intersection **I want to retrieve the LLH point** where it intersected. Is this possible? Maybe using spherical coordinates equations?


title: How get the link or file from uploads forder of feature service arcgis

text: I have succeeded in adding a file to arcgis server with the upload method of a feature service on arcgis server. But i can't see how to download what i have uploaded to. Do you have any idea on how I can have a link ? (like the printTask button) or to get the file ?


title: Extraction of contour lines starting from 0 elevation

text: I need your help regarding extraction of contour lines in QGIS. I am new to QGIS (in GIS actually). I followed the tutorials on extracting contour lines from DEM (which I downloaded from cgiar.srtm) using qgis. Everything went well except that there is no contour line with 0 elevation. The contour lines started with the elevation of 10. I checked the DEM file and the minimum value is 0. How do I set the QGIS so that the resulting contour lines starts with 0 elevation (and that there is a contour line with 0 elevation)? Thank you very much for your help. Jake


title: How to set labels on saga gis contour shape files WITHOUT using saga_gui?

text: I'm generating approximately 16K map segments from _non-terrestrial_ data. The final output will have three elements: Contour lines at 10 meters, and 100 meters, as well as a graticule. I've got it all scripted out using saga_cmd, except for one last part. _**QUESTION:_** **Without using saga_gui** , how do I set labels on the 100 meter contour lines, so that they come out in the final SVG product? That is, if a given 100 meter contour line represents 200 meters altitude, I want "200" to appear on that line in the SVG, just like it would in a normal topographical map. I already know how to do this in the GUI, but there's no way I'm going to do it manually 16K+ times! The current scripting follows these steps:   1. Extract a block of XYZ data from the database.   2. Convert that XYZ data into a saga grid.   3. Use splines to fill in the gaps of the grid.   4. Generate the 10m contour lines.              saga_cmd libshapes_grid 5 -INPUT gridfile -CONTOUR shapefile \     -ZMIN -300 -ZMAX 7100 -ZSTEP 10        5. Generate the 100m contour lines. (Same as above, but -ZSTEP is set to 100.)   6. saga_cmd libshapes_tools 12 to generate the graticule.              saga_cmd libshapes_tools 12 -LINES shapefile \     -X_EXTENT_MAX xmax -X_EXTENT_MIN xmin \     -Y_EXTENT_MAX ymax -Y_EXTENT_MIN ymin \     -DISTX interval -DISTY interval        7. saga_cmd libio_shapes 17 to blend the three shape files generated above into one SVG file.              saga_cmd libio_shapes 17 -FILE svgfile \     -SHAPES "shape10m;shape100m;shapegraticule"        8. Sed command to change the colors on the three shapes as they appear in the SVG to, respectively, black, red, and maroon.


title: Creating water surface from vector line in QGIS

text: I want to create a raster surface representing the flood level in a creek based on output from a 1D hydraulic model. I receive a 3D profile of the water surface in a creek line as a 3D Polyline (AutoCad format) from our hydraulic modelers. Each vertex of the polyline represents the coordinates and level of the water surface based on cross- sections used in the modelling. I want to import the string into QGIS and generate a water surface as a raster for analysis - for example depths, extents, comparison of flood level to building floor levels, etc). Basically I want to extend a surface horizontally and perpendicular from the string until it intersects a nominated raster surface (existing ground), along the length of the string. I would assume that the elevation varies linearly between each vertex of the polyline (which would be accurate enough for my work). Is there a way to generate this surface in QGIS? I would appreciate any guidance. Thanks PS I have edited this question to hopefully make it clearer.


title: Error 001156. increasing the length of text limit

text: I'm fairly new to ArcGIS for Desktop and i want to import my excel table to my personal gdb but i end up getting an error code:001156 and my import fails. I soon found out that it was the lengthy structural descriptions in my table. Is there anyway that I can increase the text cap within ArcCatalog. im not really good with Python either. So a fairly straightforward guide would be very much appreciated!


title: How to modify script published as GPService in ArcGIS Server?

text: In ArcGIS 10.1 before publishing script as a new GPService I have to run it in ArcMap. It is a good solution when I handle small amount of data. When I want to change something in my script I have to run all processes again. I have found my script in ArcGIS Server in GPServer catalog in C:\arcgisserver\directories\arcgissystem\arcgisinput. When I try to edit it I cannot save any changes. I tried to solve this problem by stopping service and changing permissions to catalogs. It is annoying to run all processes in order to change one small thing. Does anyone have idea how to save changes?


title: Splitting large polygons

text: We need to split large complex polygons into smaller chunks ( Where the area <= x). The tricky bit is that they can only be split where the distance from one side of the polygon to the other is <= y which in this case is 80 metres. They can still be split if the area is not <= x, we just try and reduce the larger chunks to smaller chunks so the more that are <= x the better..