How to extract cell values from a raster file with Idrisi Taiga?

I need to convert raster cells into points. I use Idrisi and I need to generate a table containing xy (coordinates) and z (cell value).


Why does aggregate polygons consistently error out?

I'm using aggregate polygons on a dataset with three large study areas. It did not work. So I split it into separate areas and did it again. Two of the three areas (which were smaller than the third) aggregated correctly. The third I split into municipalities (since it had a few in it) and then aggregated each separately, apart from two, which refused to aggregate. The error message was not forthcoming, it just says "Background processing has encountered a serious error and is unable to continue. And then it allows me to send an error report to ESRI, which I have, though it's been almost innumerous times. So I used grid index features and made a grid over one municipality and then split the data by that grid. I ended up having to do 5 x 5 km grids (making 42 index polygons) because anything bigger would not process properly. That actually sort of worked, except for five of the grids which would not. I tried vainly to do 'multipart to singlepart' which worked for some of them, though in this case, I had to further subdivide each 5x5 grid into 4 more indices. In that case, quite a few actually processed, but there is one or two stubborn grids which will not process at all and produce the same error. I even went into each grid's data and used the editing toolbar to merge some of the polygons together manually, before using aggregate polygons. Has someone else had similar trouble? Are there any workarounds or suggestions? Because I will otherwise have to repeat the process two or three more times (as it is a time-series project). ![A comparison screenshot of a subset of the data](http://i.stack.imgur.com/uygjO.png) **edit:** I tried dissolve and it does sort-of do what we want, though is there any way to add a distance value to it like aggregate polygons has?


How to get bounding box coords?

How to get coords for NW and SE if we have about 4-5 pixels on the image with assigned latit/longit? I'm working on javascript app which would overlay that image on Google Map then. Thanks.


ArcGIS 10.1 Upgrade Geodatabase Check Version

Hi I am trying to check the version of filegeodatabase before upgrading to 10.1, I have a list of file geodatabases and some of them are already in 10.1. Can anyone suggest me how to update only those with version less than 10.1? I am using python script to do this: arcpy.UpgradeGDB_management(r"C:\Test\Base.gdb", "PREREQUISITE_CHECK", "UPGRADE")


Split 3D line feature at vertices based on slope change

I've already asked a question about this subject, but now I think I'm almost getting to the point. I have to split roads in ramps to calculate LS factor (RUSLE - soil erosion) These are the steps that I'm trying to do: 1. Create a DEM using Topo to Raster 2. Convert the roads (polyline features) to 3D features using Interpolate shape (ArcGIS 10.1) 3. Split line at vertices. But now the problem begins... There are too many vertices in each polyline, is there a way to "clean" these vertices leaving only the ones where the slope abruptly changes (from going up to going down)? Or maybe create points at the Z min and Z max? Or any other ideas? Thank you very much! I hope you understand!


Editing vector data over the net: WFS or PostGIS?

I'm using QGis to update the attributes of a large vector dataset (~20,000 polygons) stored in PostGIS. I'm going to have to do that to other large datasets so the idea is to bring in more people, each editing a separate table (no concurrent editing). I'm wondering what would be the best option: Have the users connect directly to PostGIS and edit the data? Or publish the data in GeoServer and use WFS? Are there any gains in speed if I use WFS (cache, load only polygons in visible window)? Or would the extra layer (geoserver) slow me down? I'm using QGis as a desktop client.


Why can't I open a .xls with QGIS in OSX?

I'm trying to open an `.xls`with QGIS 1.8 in a Mac, I'm loading the vector layer from `Add new vector layer`etc. etc. the procedure works in Windows but not in Mac where I have an error `Invalid source file`. Where is the problem?


GeoWebCache: Is there a way to empty the cache only for a certain zoom level?

This is a follow-up to this question. In short, I was overambitious in seeding and now my /usr filesystem is full. Take a look at the cache occupancy broken down by zoom level. (Data is OSM South America slice by Geofabrik, imported by osm2pgsql.)               [root@opengeosa opengeo_southamerica]# du -sk EPSG_900913*     4       EPSG_900913_00     8       EPSG_900913_01     16      EPSG_900913_02     36      EPSG_900913_03     236     EPSG_900913_04     832     EPSG_900913_05     3236    EPSG_900913_06     11088   EPSG_900913_07     32828   EPSG_900913_08     110464  EPSG_900913_09     392380  EPSG_900913_10     1487876 EPSG_900913_11     5303356 EPSG_900913_12     20030184        EPSG_900913_13     15776620        EPSG_900913_14     8828    EPSG_900913_15     189778220       EPSG_900913_16     7932    EPSG_900913_17     3764    EPSG_900913_18     492     EPSG_900913_19     200     EPSG_900913_20     352     EPSG_900913_21     [root@opengeosa opengeo_southamerica]#       So, I would like to empy the misbegotten level 16 cache and leave all others. Is this doable? Could I just `rm -rf EPSG_900913_16/*` or would that be a Very Bad Thing™? Or should I just empty the entire cache and reseed only through level 14?


Get displaylevels/zoom level javascript API

Is there any way using JavaScript API to get the current "displayLevels" of the basemap or "basemap zoom level" or "basemap scale" of the map and if it was more/less than certain number I change the Layer to another layer?               function(             Map,             FeatureLayer             ){          map = new Map("map", {                basemap: "topo",                center: [-85.416, 49.781],                zoom : 5,                logo: false});     if (map zoom level == ***) {           layer1 = new FeatureLayer(                     "http://testServer/arcgis/rest/services/test/MapServer/0", {                             mode: FeatureLayer.MODE_ONDEMAND                             });                  map.addLayer(layer1);     }          else {     layer2 = new FeatureLayer(                     "http://testServer/arcgis/rest/services/test/MapServer/1", {                             mode: FeatureLayer.MODE_ONDEMAND                             });                  map.addLayer(layer2);          }


WFS Layer error

I get this error with 1.7.*-Wrowclaw   _**Error downloadinghttp://www.igmi.org/wfs_server? SERVICE=WFS&REQUEST=GetCapabilities&VERSION=1.0.0 - server replied: Bad Request_**   can i resolve localy or is necessary work on server?   thanks


How to port QGIS C++ plugins to other QGIS installations?

I developed a C++ plugin for QGIS using VC++ express 2008 and a QGIS dev release (1.9.90 alpha), my plugin works fine on this release and now I want to port it to other QGIS installations, so I copied the generated dll to the plugins directory of a QGIS 1.7.4 installation but it didn't get recognized by the extension manager. Anybody can help with this? Thx!


High Mountain hillshade is not "natural"

after generalizing my DHM and extraction of different color-hillshades, I got something like this: ![experimental_hillshade](http://i.stack.imgur.com/6d1Eq.png) Its not very good, but I used the idea of Imhof generalizing and coloring the hillshade (multishade). Its "digital-round-smooth" like "organic" and not "natural-edged-hard" like I want it to. (Sorry for that kind of english :) I mean, in natural its a very steep and hard mountain range, and not a hilly "hobbit-land" :) Do you have any Idea, how to construct it more natural? Thanks! Martin


Filegeodatabase fanout

I tried to fanout data but it is all in the same FGDB. So, is it possible to do this? I need to write data for every time different amount of different area into different, but schematic same filegeodatabse. Best regards.


How to automatically plot intermediate contours with QGIS, GRASS GIS or SAGA GIS?

I'm mapping a steep mountain range. My main contour interval is 50 m and my intermediate contour interval is 10 m. In steep areas, the interval of 10 m is too small, so I need to leave of the 10 m-interval and use 20 m or 25 m instead. Is there a way, to do that automated in QGIS, SAGA GIS or GRASS GIS?


Expression does not evaluate to column or table name?

This is my code:               Include "MAPBASIC.DEF"     Include   "MENU.DEF"          Dim s_filename As String     s_filename = FileOpenDlg("","","TAB"," Open Table Interactive")      Browse * From s_filename       I want to open a file from my computer.


Rotating annotation by angle using center point of annotations (with baseline alignment) in ArcMap

Is it possible to rotate annotation (in ESRI Annotation FeatureClass) by angle so that new position would be calculated based on annotation center point (not alignment, as it is set to baseline, center)? OR alternatively- would it be possible to change annotation alignment to center/center without moving annotation? I have thousands of annotations and I would like to update their rotation based on updated angle field in database. All annotations have VERTICALALIGNMENT set to “baseline”.


ST_Within for TIN or 3D objct in PostGIS

I would like to query if a point is located in the TIN object. My TIN object is closed (convex hull) object (i.e. surface of a round object). I tried to use `ST_Within`, but the error message returns as: > ERROR: Unknown geometry type: 15 - Tin My query is as follows:               SELECT ST_Within(mypoint,mytinobject) As mypointinmytinobject     FROM     (SELECT ST_GeomFromText('POINT(x,y,z)', SRID) As mypoint,     (SELECT geom FROM mytintable WHERE gid=1) As mytinobject     ) As myobjects;      What are the equivalent 3D query functions like `ST_Within` for 3D TIN object in PostGIS? It is a complex 3D anatomical region. It is not solid, it is a surface. If it is represented as Polyhedralsurface, how could we query if a point is located inside this closed surface (or a region). Do I need to make it solid body. Could it be done in PostGIS?


Python Label Expression: Only show text after a particular symbol

I have a bunch of point data that needs labeling. However the attribute used for labeling is more complex than is needed in the map. Example of the attribute field for labeling:   * 15/8-9a,    * 001/15-2   * 8/19-13 What we need to see labeled is any number and/or letter found after the "-" symbol. So from the above example: **9a, 2, 13** will be displayed on the map. I know this can be done with slicing but since the number of characters after "-" is variable I'm struggling a little with the expression. I do not want to add a new field so am exploring writing a label expression. Does anyone know what the expression might look like to handle this?


editor tracking updated in attribute table, but not in sql server database

When I enable editor tracking and make modification on an object, I can find the edit user and edit time, but I cannot find the data updated in the sql server database. Is it because of the versioning? If yes when will the data updated in the sql server database? If no, what is wrong with my sql server database? The following pictures are attribute table in ArcMap and table value in sql server. ![enter image description here](http://i.stack.imgur.com/1vcFx.jpg) ![enter image description here](http://i.stack.imgur.com/KayAO.png) I am using ArcMap 10.2.2 and sql server 2008 r2.


QGIS Projections

I am new to the GIS world and have faired pretty well with ArcGIS 9.3, learned and still learning on the job. I would like to get a better handle on QGIS though. I linked the files from my dropbox. I tried the on the fly projection and changing the projection of the following file: http://db.tt/Nuc9Bni4 I need the aforementioned file to project and line up with the following boundry file: http://db.tt/Ij6MEyDz Thanks in advacnce for any input.


How does TomTom store trackpoint information on its internal drive?

How does TomTom stores tracks and trackpoints on its internal drive? I maintain an open source computer forensics tool and would like to extract the data from both files and unallocated space. My experience with Garmin GPS devices is that they all use the same internal data format, and I suspect that TomTom devices do the same.


Display Access query in ArcMap

Hi I have an access database and have some built in queries in the database. The same data is stored in geodatabase with the spatial information. Now I want to follow this process: Access->push out query->open arcmap mxd ->display results. Is there a way to do this? I am using MS access 2010 and ArcGIS 10.1. Any help on this is most welcome. Thanks


problem adding pop-up to GeoJSON layer in Leaflet

I'm new to working with the Leaflet API and am running into trouble with creating popups for a GeoJSON layer. I've looked at the following post as a reference and am still having difficulty: binding nested arrays as geojson popups in leaflet My GeoJson data looks like:               {         "type": "FeatureCollection",         "features": [             {                 "geometry": {                     "type": "Point",                     "coordinates": [                         -73.97364044189453,                         40.66893768310547                     ]                 },                 "type": "Feature",                 "properties": {                     "lon": -73.97364044189453,                     "lat": 40.66893768310547,                     "version": "1.1",                     "t": 1381167616,                     "device": "iPhone3,3",                     "alt": 67,                     "os": "6.1.3"                 }             },             {                 "geometry": {                     "type": "Point",                     "coordinates": [                         -73.96121215820312,                         40.66240692138672                     ]                 },                 "type": "Feature",                 "properties": {                     "lon": -73.96121215820312,                     "lat": 40.66240692138672,                     "version": "1.1",                     "t": 1381171200,                     "device": "iPhone3,3",                     "alt": 45,                     "os": "6.1.3"                 }             }              ]     }      My leaflet js is as follows:               // create a variable to load Stamen 'toner' tiles     var layer = new L.StamenTileLayer("toner");          // initialize and set map center and zoom     var map = L.map('map', {         center: new L.LatLng(40.67, -73.94),         zoom: 12     });          // create the map      map.addLayer(layer);          // on each feature use feature data to create a pop-up     function onEachFeature(feature, layer) {              if (feature.properties) {                  var popupContent;             popupContent = feature.properties.t;                  console.log(popupContent);             }         layer.bindPopup(popupContent);     }          // grab the processed GeoJSON through ajax call     var geojsonFeature = (function() {             var json = null;             $.ajax({                 'async': false,                 'global': false,                 'url': "/data/test_random.json",                 'dataType': "json",                 'success': function (data) {                     json = data;                 }             });             return json;         })();          // create an object to store marker style properties     var geojsonMarkerOptions = {         radius: 10,         fillColor: "rgb(255,0,195)",         color: "#000",         weight: 0,         opacity: 1,         fillOpacity: 1     };          // load the geojson to the map with marker styling     L.geoJson(geojsonFeature, {              style: function (feature) {             return feature.properties && feature.properties.style;         },              onEachFeature: onEachFeature,              pointToLayer: function (feature, latlng) {             return L.circleMarker(latlng, geojsonMarkerOptions)         }     }).addTo(map);      The `console.log(popupContent);` call within the `onEachFeature` function is returning data, however when I click on the GeoJSON points in the map I get the following error: `Uncaught NotFoundError: An attempt was made to reference a Node in a context where it does not exist.` I've tried looking into this with no success so far. Any advice would be appreciated, thank you.


Selecting a suitable GIS for my project

I need to develop a web-based map using existing shape files. Using the web- map, we must be able to select a region and produce contours for that selected region. Can any one suggest the best open source solutions for this?


Merge multiple linestring features into a single multilinestring

Using QGis or ogr2ogr how do I convert a vector file containing multiple linestrings features into a single multilinestring feature? At the moment I've been doing this manually by converting the data to GeoJson and editing it manually.


How to troubleshoot a slow IIS and hanging ArcGIS Server?

Our ArcGIS Server 10.0 SP 4 website has been hanging lately where everything gets delivered except the map. When I try and check the REST Endpoints they it hangs and then fails. When I stop the IIS, that takes 2-3 minutes to stop, which is not normal. Sometimes it takes 2 or 3 stop/starts of IIS to get the server back working again. I've made sure ArcGISWebServices is in Admin group as well as all necessary server groups. I looked in the system log for the latest crash and it reads: > @ 8:18 AM "A worker process with process id of '13516' serving application > pool 'ArcGISApplicationsAppPool' has requested a recycle because the worker > process reached its allowed processing time limit. > > @8:30 (approx when I began investigating the issue) "A worker process '7616' > serving application pool 'ArcGISApplicationsAppPool' failed to stop a > listener channel for protocol 'http' in the allotted time. The data field > contains the error number." Any ideas on what I can do to further troubleshoot are appreciated. Specs. WinServer 2008 IIS 7 AGS 10 SP4


python qgis.core import error caused by spatialite libraries

I have an error when trying to import qgis.core to python:               >>> import qgis.core     Traceback (most recent call last):       File "<stdin>", line 1, in <module>     ImportError: /usr/lib64/libspatialite.so.2: undefined symbol: GEOSBufferParams_destroy      Also DB Manager in QGIS can't work with spatialite due to this error: "/usr/local/lib64/pyton2.7/site-packages/pyspatialite/_spatialite.so: undefined symbol: GEOSSimplify" pyspatialite seems to work fine:               >>> from pysqlite2 import test     >>> test.test()     .....................................................................................................................................................................................................................     ----------------------------------------------------------------------     Ran 213 tests in 2.892s          OK      The issue arose after updating QGIS from 1.7 to 1.8, where pyspatialite (and some other packages) is no longer provided within QGIS. I searched the web but wasn't able to find sollution. Any idea on how to fix it? OS: openSUSE 12.1; python 2.7.2-7.17.1; QGIS 1.8.0-7.2; spatialite 3.0.1-9.1; GEOS 3.3.5-1.1; pyspatialite 3.0.1.


How to resize a point on zoom out?

I've added a point on map like this but it is static in size. How to resize that point on zooming? Map on zoom out ![enter image description here](http://i.stack.imgur.com/oxpNp.png) Any guidance and help is appreciated.


How to calculate new point coordinates from distance and angle?

I want to calculate the coordinates of a new point. What I have: The source point coordinates, the distance (meters) and the angle For example: I want to create a point within 100 meters and 45 degree from my source point I use wgs84 as coordinate system. My question now is if it's possible to calculate a new point with the given attributes above and when its possible how I can do that. Kind regards


Need to create custom map based the spatial Database

I need to create a custom map in .net 2008 c# webapplication based the spatial database(sqlserver 2008) without using any third party tools For example in sqlserver 2008 i am create a map using this SQLCode               declare @ll geometry     set @ll= geometry:: STGeomFromText('LINESTRING (80.2341763 13.0521737, 80.2340631 13.051794, 80.2340366 13.0516397, 80.2338632 13.0508963, 80.2337334 13.0503032, 80.2336701 13.0500048, 80.2335762 13.0496237, 80.2335511 13.0495047, 80.2334451 13.0490013, 80.2332654 13.0482409, 80.2332448 13.048186, 80.233076 13.0473876, 80.2329141 13.0465558, 80.2327947 13.0459422, 80.2327233 13.0455756, 80.2326847 13.0453771, 80.2326169 13.045029, 80.2325305 13.0445849, 80.2325185 13.0445234, 80.2324469 13.0439813, 80.2324085 13.0435336, 80.2324161 13.0432134)',4326)     select @ll as Geometry       after this excution in sqlserver2008 its display the some image , i want same image display in .net webapplication . Please any one help in this process


Multiple Country Codes? - World Geocoding Service (ArcGIS REST API)

Using single field geocoding, (ArcGIS REST API) I am having an issue with the World Geocoding Service when it comes to getting results that include both USA and US territories, like Puerto Rico for example. Code: `http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/findAddressCandidates?find=puerto rico&SingleLine=puerto rico&sourceCountry=USA&f=json&outFields=Loc_name&callback=esriDojo.io.script.jsonp_esriDojoIoScript10._jsonpCallback` In the geocode request string above, I am limiting results to USA only ('sourceCountry=USA'), however I get a result that doesn't include Puerto Rico (the commonwealth) - only Puerto Rico, Texas. This is the same if I change my search parameter to "San Juan" - I would like to get San Juan, PR as a result, along with the rest of the 'San Juan' location in CONUS. Esri Help states that you can limit the 'sourceCountry' parameter to "USA" for only results in the US, but problematically this means CONUS, not Puerto Rico or other "US" territories like Virgin islands, Mariana Islands, etc. Esri also has a specific country code geocode limiter for Puerto Rico (PRI) however I cannot find a way to combine this with (USA) into one request which would limit return results to only USA, PRI together. It seems to allow one country code per request, currently. Since this is a web map focused solely on USA and territories, with full extent set to CONUS (including PR and Hawaii), it doesn't make sense for me to remove the 'sourceCounty' parameter altogether. We don't want international results to come up (and they will) since the results are typically ordered by total population. Can anyone recommend a different approach (or updated geocode string) to limiting the results to only USA and Puerto Rico? Is there a way to combine multiple 'sourceCountry" parameters to account for USA & PRI into one geocode request? Thanks in advance


How to customize Directions widget of ArcGIS Viewer for Flex 3.4 using Flash Builder 4.6?

I want to customize the Directions widget in order to be suitable for my application. However, I do not know how to show a Directions widget without signing in to resources in http://www.arcgis.com. Is this possible to do?


Unable to select FLOAT precision when adding column

I'm trying to do the lessons in the training-manual at qgis.org. I,m having some problems with 3.3 Ratio Classification http://www.qgis.org/en/docs/training_manual/vector_classification/classification.html according to the training-manual its supposed to look like this![image1](http://i.stack.imgur.com/lXJQ9.png) but mine look like this ![image 2](http://i.stack.imgur.com/H0TSS.png) I am unable to select precision and width of FLOAT. I'm using QGIS 2.2 Valmiera on an iMac. Please exude my bad english.


Adding shp files to PostGIS in QGIS 2

I followed this tutorial to set up Postgresql 9.1 and PostGIS 2 on my Ubuntu Server 12.04. I also installed pgAdmin III on my Windows 7 client. I set up a database landarch and user chadmwade, granting all privleges. I am able to connect to the postgres and the landarch databases with pgAdmin III and in QGIS. I am getting the following error when attempting up add this shp file to the database. Is someone able to guide me in addressing this error? I haven't had much luck with Google. ![this](http://i.stack.imgur.com/8iEnX.png)


Join Issue with Attributes Table

I am trying to Join a Mineral Database (excel) into my Attributes table. Once I do and check the Attributes, it shows up as "NULL". What is causing that, what am I not doing? Can anyone offer suggestions/ideas as I am trying to link the .shp to that Mineral excel/database. Thank You, Zoran


How would you use change the projection within KML file?

I have created some KML files by converting the projection with both ARC and MapWindow. I'm looking for ways to automate exporting the data from our application with coordinates in State Plane "ESRI:102272" to something that can be used in Google Earth. While I'm not a GIS Pro or a Web Developer, I know just enough to export and create maps. I'm looking to create some kml files to share on our webserver. Can proj4js be used to convert the coordinates within the file? Any thoughts on this process would be greatly appreciated.


OSM Map projection doesn't seem to change

I have the following OpenLayers map:               Proj4js.defs["EPSG:31258"] = "+proj=tmerc +lat_0=0 +lon_0=13.33333333333333 +k=1 +x_0=450000 +y_0=-5000000 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m +no_defs";     var googleProj = new OpenLayers.Projection("EPSG:900913");     var salzburgProj = new OpenLayers.Projection("EPSG:31258");     var bounds = new OpenLayers.Bounds(426249,294999,426251,295001);     var maxZoom = 19;     var minZoom = 15;     var res = [4.77731426696777,2.38865713348389,1.194328566741945,0.5971642833709725];          mapCOD = new OpenLayers.Map({         div: "mapCODs",         allOverlays: true,         maxExtent: bounds,         projection: salzburgProj,         allowSelection: true,         controls: [new OpenLayers.Control.PanZoomBar(), new OpenLayers.Control.Navigation()]     });          var layer = new OpenLayers.Layer.OSM(             "layer1",             "tiles/input/${z}/${x}/${y}.png",             {zoomLevels: maxZoom, zoomOffset: minZoom, resolutions: res}         );               mapCOD.addLayer(layer);      I have produced tiles with mapnik using EPSG:31258, so I would like to change the default projection of the map from 900913 to 31258. The problem is that "projection" parameter is not taken into account and if I perform a `console.log(mapCOD.getProjection())`, I obtain "EPSG:900913". Another proof that map projection remains 900913 is that I have to perform a coversion to get the correct map center:               var center = bounds.getCenterLonLat();     mapCOD.setCenter(center.transform(salzburgProj,googleProj), minZoom);      What am I missing?


How to clip a Oracle query layer directly in a Python script?

I have a query layer directly running from ORACLE database in a MXD. I want to clip this layer with a layer being created in another MXD in a Python based tool. My question is to do this clip analysis, do I have to make a layer of this query layer locally or I can clip it directly from the query layer? I have success doing it with `MakeFeatureLayer_management` but then creating a layer of 6-7 million records every time this tool runs does not appear efficient and fails the whole purpose of creating query layer. SDE was never implemented for this project and setup was done before I joined the project. Alternatively I tried to run the model in query layer MXD but it will work stand alone and results in error with Python.


How do you write a Python script for repairing data sources in ArcGIS 10

So, I have about 50 mxd's with all broken layers that I have been going through and manually resetting. The data was moved from another computer and the folder structure was changed so it isn't just a simple process of changing (example): "F:\Data\Rivers.shp" to "C:\Data\Rivers.shp" it is more like : "F:\Data\Rivers.shp" to C:\Data\Park\Water\Rivers.shp and so on for all kinds of data (boundaries, veg cover, roads, etc.) each in their own sub-folder. I wanted to make a script that I could run repeatedly whenever I opened one of these mxd's that would at least repair some of the more common layers that are found in most of my mxd's, and then I could manually repair the rest. That way I at least save myself _some_ time. I have been using something along the lines of :               import arcpy     mxd = arcpy.mapping.MapDocument("CURRENT")          for lyr in arcpy.mapping.ListLayers(mxd):         if lyr == "Rivers": #Should this be the layner name in TOC or FC name?             lyr.replaceDataSource(r"C:\Data\Park\Water", "SHAPEFILE_WORKSPACE", "Rivers")      The idea then would be to somehow add multiple "replace" scripts in the above for other common layers that are in my mxd's. However the above script doesn't even fix the Rivers layer. How can I get it to work, and also add in other layers to be repaired that have different file paths? Sorry, I am a total novice at this stuff and I am probably going about it all wrong. Thanks.


How to upgrade PostGIS in OSGEO-Live Xubuntu virtual machine?

I have downlaoded the OSGEO-Live 6.0 virtual machine running Linux Xubuntu. I have it running through VirtualBox on a Windows machine. It currently comes preinstalled with a lot of GIS software, including PostGIS 1.5. I would like to upgrade PostGIS to 2.x. Having not used linux much, what is the best method to upgrade PostGIS from 1.5 to 2.x on the Xubuntu virtual machine? Since I just downloaded the Live- DVD, we can assume there is no data that needs to be retained.


Use psycopg2 to do loop in postgresql

I use postgresql 8.4 to route a river network, and I want to use psycopg2 to loop through all data points in my river network.               #set up python and postgresql connection     import psycopg2          query = """         select *         from driving_distance ($$             select                 gid as id,                 start_id::int4 as source,                 end_id::int4 as target,                 shape_leng::double precision as cost             from network             $$, %s, %s, %s, %s         )     ;"""               conn = psycopg2.connect("dbname = 'routing_template' user = 'postgres' host = 'localhost' password = '****'")     cur = conn.cursor()     while True:         i = 1         if i <= 2:             cur.execute(query, (i, 1000000, False, False))             i = i + 1         else:             break     rs = cur.fetchall()     conn.close()     print rs      The code above costs a lot of time to run even though I have set the maximum iterator i equals to 2, and the output is an error message contains garbage, ![enter image description here](http://i.stack.imgur.com/zZLhU.png) I am thinking that if postgresql can accept only one result at one time, so I tried to put this line in my loop,               rs(i) = cur.fetchall()      and the error message said that this line has bugs, ![enter image description here](http://i.stack.imgur.com/IVU23.png) I know that I can't write code like **rs(i)** , but I don't know the replacement to validate my assumption. So should I save one result to a file first then use the next iterator to run the loop, and again and again? I am working with postgresql 8.4, python 2.7.6 under Windows 8.1 x64. * * * **Update#1** I can do loop using the code below, and the result follows,               import sys     import psycopg2          query = """         select *         from driving_distance ($$             select                 gid as id,                 start_id::int4 as source,                 end_id::int4 as target,                 shape_leng::double precision as cost             from network             $$, %s, %s, %s, %s         )     ;"""               conn = psycopg2.connect("dbname = 'routing_template' user = 'postgres' host = 'localhost' password = '****'")     cur = conn.cursor()          rs = []     i = 1     while i <= k:         cur.execute(query, (i, 1000000, False, False))         rs.append(cur.fetchall())         i = i + 1          for record in rs:         print record          conn.close()               [(1, 2, 0.0), (2, 2, 4729.33082850235), (3, 19, 4874.27571718902), (4, 3, 7397.215962901), (5, 4,      6640.31749097187), (6, 7, 10285.3869655786), (7, 7, 14376.1087618696), (8, 5, 15053.164236979), (9, 10, 16243.5973710466), (10, 8, 19307.3024368889), (11, 9, 21654.8669532788), (12, 11, 23522.6224229233), (13, 18, 29706.6964721152), (14, 21, 24034.6792693279), (15, 18, 25408.306370489), (16, 20, 34204.1769580924), (17, 11, 26465.8348728118), (18, 20, 38596.7313209197), (19, 13, 35184.9925532175), (20, 16, 36530.059646027), (21, 15, 35789.4069722436), (22, 15, 38168.1750567026)]     [(1, 2, 4729.33082850235), (2, 2, 0.0), (3, 19, 144.944888686669), (4, 3, 2667.88513439865), (5, 4, 1910.98666246952), (6, 7, 5556.05613707624), (7, 7, 9646.77793336723), (8, 5, 10323.8334084767), (9, 10, 11514.2665425442), (10, 8, 14577.9716083866), (11, 9, 16925.5361247765), (12, 11, 18793.2915944209), (13, 18, 24977.3656436129), (14, 21, 19305.3484408255), (15, 18, 20678.9755419867), (16, 20, 29474.8461295901), (17, 11, 21736.5040443094), (18, 20, 33867.4004924174), (19, 13, 30455.6617247151), (20, 16, 31800.7288175247), (21, 15, 31060.0761437413), (22, 15, 33438.8442282003)]      but if I want to get this look of output,               (1, 2, 7397.215962901)     (2, 2, 2667.88513439865)     (3, 19, 2522.94024571198)     (4, 3, 0.0)     (5, 4, 4288.98201949483)     (6, 7, 7934.05149410155)     (7, 7, 12024.7732903925)     (8, 5, 12701.828765502)     (9, 10, 13892.2618995696)     (10, 8, 16955.9669654119)     (11, 9, 19303.5314818018)     (12, 11, 21171.2869514462)     (13, 18, 27355.3610006382)     (14, 21, 21683.3437978508)     (15, 18, 23056.970899012)     (16, 20, 31852.8414866154)     (17, 11, 24114.4994013347)     (18, 20, 36245.3958494427)     (19, 13, 32833.6570817404)     (20, 16, 34178.72417455)     (21, 15, 33438.0715007666)     (22, 15, 35816.8395852256)      What should I make a little change in the code？


Problem with WMS layer from SAGIS: Invalid format/can't parse XML

Can you help me the following problem: I try to load WMS layer from SAGIS (Salzburg GIS) into Qgis: http://www.salzburg.gv.at/themen/se/sagis/download.htm for example: Geoland WMS               http://service.salzburg.gv.at/ArcGIS/services/Geoland_WMS_Land_Salzburg/MapServer/WMSServer      added "?version=1.1.1" to the url connect The dirctory of the availble layers appers ID-0 - layers ID-1 - Polygondecker ID-3 - Orientierunskarte and so on till ID-41 - Landesgrenzen chose the first directory: 0 - Layers (or any other, does not matter) click "connect" (Hinzufügen) following report appears:               Antwort: (<)?xml version="1.0" encoding="UTF-8" standalone="yes" ?>     (<)!DOCTYPE ServiceExceptionReport SYSTEM "http://schemas.opengis.net/wms/1.1.1/exception_1_1_1.dtd">      (<)ServiceExceptionReport version="1.1.1">      (<)ServiceException code="InvalidFormat">     Can't parse XML request.      (<)/ServiceException>     (<)/ServiceExceptionReport>      edit: When I add the suggestion from Brad: ?request=getcapabilities&service=WMS&version=1.1.1& still the same message as above appears I expect to see the chosen layers, but i can only see it in the layer dialog. whenever doing a click on the layers (e.g. zoom to selected layer) the same error message as above appears. Thanks a lot.


how activate qgis features selection toolbar in the main window

How can i activate and desactivate qgis features selection toolbar in the main window using a signal in a python plugin?


How to speed up osm2po when using as java lib?

I'am trying to utilize osm2po as java lib for calculation of distances matrix between some set of points (lat/lon) and for each pair of points I call the following method that code is based on sample provided at osm2po.de web-site:               public int getDistance(GeoPoint source, GeoPoint target) {             int res = Integer.MAX_VALUE;             int sourceId = graph.findClosestVertexId(source.getLatitude(), source.getLongitude(), 1);             int targetId = graph.findClosestVertexId(target.getLatitude(), target.getLongitude(), 1);                  router.traverse(graph, sourceId, targetId, Float.MAX_VALUE, params);                  if (router.isVisited(targetId)) { // Found!                 int[] path = router.makePath(targetId);                 float distKm = 0.0f;                      for (int segmentId : path) {                     RoutingResultSegment rrs = graph.lookupSegment(segmentId);                     distKm = distKm + rrs.getKm();                 }                      res = (int)(distKm * 1000);             }                  router.reset();             return res;      But I noticed that it takes about 2-3 seconds per one point to calculate whole distance matrix (I have 10-25 points per matrix in average) that looks not too fast (30-60secs per matrix). Could someone advice what could be improved here - especially I am not sure in correct usage of reset() call - when actually it should be done? - it's not too much documentation on osm2po usage within java...   Also I would appreciate any performance tips to improve this code. One more guess I have is that findClosestVertexId() is expensive enough call and cashing its results for subsequent calls could improve the situation.


How to change the case of input text (xtype: "textfield")

I have an input box which asks users to input a UK postcode but which specifies that this must be in lower case, for example so16 0as. Some users find this frustrating as they would just like to copy and paste a post code into the textfield; the copied postcode may contain upper case letters ie SO16 0AS. This will return an error. The input code is as follows:               items: [{                 xtype: "textfield",                 width: 220,                 name: "search_lc",                 value: "",                 emptyText:'Enter Postcode (e.g. so16 0as)',                 fieldLabel: "Find",                 allowblank: false             }],      I have tried to use **fieldStyle: 'text-transform:lowercase'** both below the fieldLabel and above it but this doesn't work. I'mm thinking that this should be a fairly simple thing to resolve but I am experiencing a 'can't see the wood for the trees moment'! Any help gratefully received! Many thanks, Red.


How to label adjacent pages in data driven pages

I'm trying to create a mapbook using `ArcGIS 10.1` data driven pages. Its quite large and I want to create match lines or labels so that if you are looking at a page, there is text/labels showing you which page is adjacent to the top, bottom, left, right. If I remember, correctly, this option was part of the data driven pages toolbar in 10.0, but it doesn't seem to be there now?


How to create polygons from a polyline graticule?

I'd like to make a polygon shapefile out of a polyline shapefile showing a graticule. However, using the "Line to Polygon" tool results in a peculiar...something: ![enter image description here](http://i.stack.imgur.com/UXuiD.jpg) Other standard tools like "Buffer" etc. seem to work just fine with the polyline shapefile. Anyone experienced this before? Edit: I've just added another latitude to close the graticule and then used "Polygonize". It reached 50% and then crashed: ![enter image description here](http://i.imgur.com/VIfbv05.jpg) The log says: "Uncaught error while executing algorithm Traceback (most recent call last): Traceback (most recent call last): File "C:/PROGRA~1/QGISVA~1/apps/qgis/./python/plugins\processing\core\GeoAlgorithm.py", line 202, in execute self.processAlgorithm(progress) File "C:/PROGRA~1/QGISVA~1/apps/qgis/./python/plugins\processing\algs\Polygonize.py", line 87, in processAlgorithm total = 50.0 / float(len(polygons)) ZeroDivisionError: float division by zero" If there is something wrong with the original script, what can I do? Edit 2: Using "Polygonize" with the cleaned vector layer resulting from "v.clean" gives me the following as a result: ![enter image description here](http://i.imgur.com/1NOHC4z.jpg) The "v.clean" error layer is completely blank. Which tool should I use in order to split the resulting lines from "v.clean" at each intersection with another line?


r.sim.water G_malloc error

I've been trying to run r.sim.water on a 3 meter LiDAR-generated DEM I have, but keep getting G_malloc errors:               r.sim.water --verbose elevin=meterDEM.final@Sediment_Simulation dxin=centDEM.dx@Sediment_Simulation dyin=centDEM.dy@Sediment_Simulation depth=sim.water.depth disch=sim.water.discharge err=sim.water.error nwalk=1000      My error message:               ERROR: G_malloc: unable to allocate 43608 bytes at main.c:488      I'm running GRASS 6.4.2 on Windows. I've tried using a Ubuntu install on VirtualBox, and it fails out without any error at all. I tried ratcheting down the number of walkers (hence nwalk=1000), but that doesn't seem to help. I can't really think of what to try next.


How to maintain schema when copying feature from layer 1 to layer 2, where both layers have same schema?

If I load two unique layers, wherein each layer contains unique data, but both layers share the exact same schema, why is it when I copy a feature from layer 1, and paste it into layer 2, the attributes to not transfer exactly as they should? What happens is when pasting a feature from layer 1 into layer 2, the layer 2 attributes of said feature has the data offset by 2 columns, e.g.- > layer 1 schema   >  id   >  clave   >  name   >  address   >  tel * * * > layer 2 schema   >  id   >  clave   >  name   >  address   >  tel A record from layer 1 like this:   > clave; 666   >  name; JOE BLOW   >  address; 123 ANYSTREET   >  tel: 867-5309   >  email; joe@blow.com Transfers to layer 2 like this:   > clave;   >  name;   >  address; 666   >  tel: JOE BLOW   >  email; 123 ANYSTREET So, the actual data is being offset by two columns, and the two columns that are passed over, the data from those columns does not show up anywhere. Clearly, this is not the way it should be behaving, perhaps others have had the same problem? Thanks, Eric Jarvies


How to add polygon in MySQL database

I have a table which contains an field `zoneShape` of the type `Polygon`. When inserting some geometry in this field, in phpmyadmin it says: affected 1 row. The row is added, but the geometry field says it's size is 0B. Which can't be accurate, cause it has multiple points. This is the Insertion code:               SET @g = 'POLYGON(50.866753 5.686455, 50.859819 5.708942, 50.851475 5.722675, 50.841611 5.720615, 50.834023 5.708427, 50.840744 5.689373, 50.858735 5.673923, 50.866753 5.686455)';     INSERT INTO zone SET zoneShape = PolygonFromText(@g)      As you can see; the first and last point are the same, so the polygon is closed. Can anyone help me with adding this polygon to the database? Thanx


MODIS images set CRS and reproject

I am developing a plugin which reads MODIS images, and I know that MODIS images are in sinusoidal projection and I need to set that CRS and project the image to WGS84 (epsg 4326) in python. I search and find QgsRasterProjector class but I don't understand how to use this class. Is there another way? I also tried the processing commands but there isn't Assign Projection command in processing, just the warp.


Hyperlinking in QGIS - Add Data to current window

I am looking to add to my current action in QGIS so that a hyperlinked file will open in the current QGIS window, rather than in a new window. Here is what my action looks like:               "C:/Program Files (x86)/Quantum GIS Wroclaw/apps/qgis/bin/qgis.exe" "C:\Users\Ryan Garnett\Dropbox\SpatialData\Imagery\Landsat\%Image"      I am hoping I can use this as a means to share data so that users can load in satellite images basked on a click with the Hotlinks plugin. Thanks, Ryan * * * Thanks Nathan, I tried this, but it did not load the file. It came back with the following error: C:\Users\Ryan Garnett\Dropbox\SpatialData\Imagery\Landsat8020_nad83_utm_30m_123457.jp2 is not a valid or recognized raster data source This is what I have written in the action: qgis.utils.iface.addRasterLayer("C:\Users\Ryan Garnett\Dropbox\SpatialData\Imagery\Landsat\%Image") With is set to Python. I have noticed in the error that there isn't a \ in between Landsat and the file name, plus the file name has been cut short, from 028020_nad83... to Landsat8020_nad83... Any thoughts? My other way is still working to load it into a new


Is it possible to load automatically a customization file in qgis?

I have customized QGIS menu and toolbars thanks to the customization option and I have created a configuration.ini file that I can load on several machines. Now, is it possible to create a project and automatically load a specific config.ini file for that project? I didn't found anything in the project properties or in the option menu, but maybe there is another way. BTW: QGIS 2.1 Master with Debian 7.2 Thanks


3d earth mapping with javascript or browser plugin

I am currently working to develop a web-based mapping application. A lot of the mapping tools such as google maps are 2d imagery. I know that google earth has a 3d browser plugin, but a requirement of this project as that I need to be able to host my own map server (I know I can with Google Earth, but the enterprise edition is pricey). Are there any good alternatives to a 3d mapping engine for the browser (I've looked into using worldwind for the browser, but that only supports applets for the web)?


What is the difference between Astar and Dijkstra algorithms in Pgrouting?

I would like to know what is the difference between A* algorithm and Dijkstra at finding the shortest path at pgrouting. Which one is faster ,has better performance and returns better results. Also i would like to know if it is possible for pgrouting to take into account that a road is one way when it computes the shortest path thus not traversing it Sorry for my english thanks in advance john


Does SearchCursor reset work in ArcGIS 10.0?

In a script I have designed a function that is used multiple times on different search cursors to search through a whole table. Function variables: p - a list of points: actually a list of two-element lists with point coordinates, e.g. [[4710000.0, 3300000.0], [4715000.0, 3305000.0], [4710000.0, 3310000.0], [4705000.0, 3305000.0], [4715000.0, 3300000.0], [4715000.0, 3310000.0], [4705000.0, 3310000.0], [4705000.0, 3300000.0]] c - a SearchCursor on a table with point coordinates The function is supposed to search through the table with a cursor and return a list of points from the table that are also on the "p" list.               def ptsrch(p,c):         list = []         for i in c:             currpt = [i.getValue("X_GRID"),i.getValue("Y_GRID")]             if currpt in p:                 list.append(currpt)         c.reset()         return list      It works fine on the first use of each SearchCursor. Even though at the end of the function the cursor is supposed to reset, it doesn't. In ArcGIS 10 Desktop help reset() is listed as a method: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000v00000068000000 I found a worrying post from 2008 on ESRI Forums: http://forums.esri.com/Thread.asp?c=93&f=1729&t=250536 in which it is stated that "As far as I know, the Reset Method has never worked. I was told 2-3 years ago that it would be operational in a "future release". Apparently that time hasn't come yet!" That one though refers to ArcGIS 9.3 or earlier. I have also found a blog post: https://omniolocalia.wordpress.com/tag/arcpy- da-searchcursor/ which praises the possibility to reset cursors in ArcGIS 10.1, mentioning that it was previously impossible. So, has anyone encountered a similar problem? Instead of a SearchCursor I can of course load all tables to Python lists and keep them in memory, though I'm afraid of a memory overload - the total number of rows in these tables will be almost 400000 (right now I'm testing on a small chunk of data, so the total number of rows is 500).


Calculating distance and/or time taken to travel from population centre to nearest hospital in QGIS

I'm trying to find out how long it would take to travel by car from each of the Lower Layer Super Output Areas (LSOA) in Norfolk, England to the nearest Hospital (or just what the distance is and I can estimate drive time, if the former is too difficult/impossible!). Any suggestions how I can do that using QGIS, OSM road data and/or Ordnance Survey Meridian 2 road data, population weighted centroids for each of the 2011 Census LSOA areas and hospital locations? I have all of the above in QGIS (see image below). There are 537 LSOA and four hospitals in total. Is there a way to work out the time taken and/or distance to travel without having to do it one by one? ![enter image description here](http://i.stack.imgur.com/C4ZNa.jpg)


Mapping Tables for Parcel IDs

I am working on a residential real estate database in MS ACCESS. I currently have residential property’s tagged by parcel ID’s. I am trying to run a query to pull in multiple sales data from various tables. I need to somehow map in street mapping to only pull data for all property’s within a mile radius. Can anyone explain to me how I can find this mapping? I can program this in access – I just can’t locate the mapping for this project. Thanks, Derrick PS - location - US, Indiana


Using line of sight or something similar to identify where lines go through hills

When QCing power infrastructure I am having to zoom into every gap and check to make sure the line makes sense (not going through the mountain). I typically check for odd spacing between the pylons and zoom into the imagery. What I want to accomplish is have some tool identify where the 'line of sight' would intersect with the DTED_Level_2. Is there a tool in ArcMap 10.1 that can accomplish this? I have 3D Analyst installed.![View checking the line makes sense](http://i.stack.imgur.com/5qciV.jpg) ![View from google earth](http://i.stack.imgur.com/nrygI.jpg)


Esri Android Basemap with kml

I created a kml using the kmllayer. When I set the map with a basemap and use the addLayer() method the kml is not shown. I can see the kml layer without a basemap. Can someone post sample code on using basemap with kml? am using ArcGISTiledMapServiceLayer as basemap


How to display data from a feature?

I want to display data based on the feature currently selected/clicked on. I am following a tutorial from http://www.qgisworkshop.org/html/workshop/plugins_tutorial.html. It initially shows you how to use the Textbrowser to display the coordinates currently clicked on and developing that functionality further, it allows you to see the information regarding a respective feature. I have the following function which as per example in the above mentioned tutorial is set to retrieve the respective data. In the example it refers to the field name "NAME" which from what I can understand refers to the name of the field in the attribute table for the respective layer in question. My attribute table structure is as follows: field names:               objectid     str_add_id     building_number     building_name_id     street_name_id     etc etc      The field I wish to retrieve is that of the "str_add_id" therefore using his example in the tutorial: His Example:               def updateTextBrowser(self):         # if we have a selected feature         if self.selectList:             # find the index of the 'NAME' column, branch if has one or not             nIndx = self.provider.fieldNameIndex('NAME')             # get our selected feature from the provider, but we have to pass in an empty feature and the column index we want             sFeat = QgsFeature()             if self.provider.featureAtId(self.selectList[0], sFeat, True, [nIndx]):                 # only if we have a 'NAME' column                 if nIndx != -1:                     # get the feature attributeMap                     attMap = sFeat.attributeMap()                     # clear old TextBrowser values                     self.dlg.clearTextBrowser()                     # now update the TextBrowser with attributeMap[nameColumnIndex]                     # when we first retrieve the value of 'NAME' it comes as a QString so we have to cast it to a Python string                     self.dlg.setTextBrowser( str( attMap[nIndx].toString() ))      In my example, I basically replaced the nIndx = self.provider.fieldNameIndex('NAME') changing the "'NAME'" to "'str_add_id'". Unfortunately however upon clicking on the feature I do not get the requested data. I still receive the X and Y coordinates of the point clicked on in the layer. Any ideas as to what I could be doing wrong? I have attached my whole plugin code below:               # -*- coding: utf-8 -*-     """     /***************************************************************************      testplug                                      A QGIS plugin      Test plugin through builder                                   -------------------             begin                : 2013-05-08             copyright            : (C) 2013 by Test             email                : cedric.ramirez@gibraltar.gov.gi      ***************************************************************************/          /***************************************************************************      *                                                                         *      *   This program is free software; you can redistribute it and/or modify  *      *   it under the terms of the GNU General Public License as published by  *      *   the Free Software Foundation; either version 2 of the License, or     *      *   (at your option) any later version.                                   *      *                                                                         *      ***************************************************************************/     """     # Import the PyQt and QGIS libraries     from PyQt4.QtCore import *     from PyQt4.QtGui import *     from qgis.core import *     from qgis.gui import *     # Initialize Qt resources from file resources.py     import resources     # Import the code for the dialog     from testplugdialog import testplugDialog               class testplug:              def __init__(self, iface):             # Save reference to the QGIS interface             self.iface = iface                     #A reference to our map canvas             self.canvas = self.iface.mapCanvas()                     #Change                     # this QGIS tool emits as QgsPoint after each click on the map canvas             self.clickTool = QgsMapToolEmitPoint(self.canvas)                  # create our GUI dialog             self.dlg = testplugDialog()                  # create a list to hold our selected feature ids             self.selectList = []             # current layer ref (set in handleLayerChange)             self.cLayer = None             # current layer dataProvider ref (set in handleLayerChange)             self.provider = None                  # initialize plugin directory             self.plugin_dir = QFileInfo(QgsApplication.qgisUserDbFilePath()).path() + "/python/plugins/testplug"             # initialize locale             localePath = ""             locale = QSettings().value("locale/userLocale").toString()[0:2]                  if QFileInfo(self.plugin_dir).exists():                 localePath = self.plugin_dir + "/i18n/testplug_" + locale + ".qm"                  if QFileInfo(localePath).exists():                 self.translator = QTranslator()                 self.translator.load(localePath)                      if qVersion() > '4.3.3':                     QCoreApplication.installTranslator(self.translator)                  # Create the dialog (after translation) and keep reference             self.dlg = testplugDialog()              def initGui(self):             # Create action that will start plugin configuration             self.action = QAction(                 QIcon(":/plugins/testplug/icon.png"),                 u"Test Plugin through builder", self.iface.mainWindow())             # connect the action to the run method             QObject.connect(self.action, SIGNAL("triggered()"), self.run)                  # Add toolbar button and menu item             self.iface.addToolBarIcon(self.action)             self.iface.addPluginToMenu(u"&testplug", self.action)                  # connect our custom function to a clickTool signal that the canvas was clicked             #result = QObject.connect(self.clickTool, SIGNAL("canvasClicked(const QgsPoint &, Qt::MouseButton)"), self.handleMouseDown)             #QMessageBox.information( self.iface.mainWindow(),"Info", "connect = %s"%str(result) )                  # connect our select function to the canvasClicked signal             #result = QObject.connect(self.clickTool, SIGNAL("canvasClicked(const QgsPoint &, Qt::MouseButton)"), self.selectFeature)             #QMessageBox.information( self.iface.mainWindow(),"Info", "connect = %s"%str(result) )                  QObject.connect(self.dlg.ui.chkActivate,SIGNAL("stateChanged(int)"),self.changeActive)                  # connect to the currentLayerChanged signal of QgsInterface             result = QObject.connect(self.iface, SIGNAL("currentLayerChanged(QgsMapLayer *)"), self.handleLayerChange)             # QMessageBox.information( self.iface.mainWindow(),"Info", "connect = %s"%str(result) )              def handleLayerChange(self, layer):             self.cLayer = self.canvas.currentLayer()             if self.cLayer:                 self.provider = self.cLayer.dataProvider()              def changeActive(self,state):             if (state==Qt.Checked):                 # connect to click signal                 QObject.connect(self.clickTool, SIGNAL("canvasClicked(const QgsPoint &, Qt::MouseButton)"), self.handleMouseDown)                 # connect our select function to the canvasClicked signal                 QObject.connect(self.clickTool, SIGNAL("canvasClicked(const QgsPoint &, Qt::MouseButton)"), self.selectFeature)             else:                 # disconnect from click signal                 QObject.disconnect(self.clickTool, SIGNAL("canvasClicked(const QgsPoint &, Qt::MouseButton)"), self.handleMouseDown)                 # disconnect our select function to the canvasClicked signal                 QObject.disconnect(self.clickTool, SIGNAL("canvasClicked(const QgsPoint &, Qt::MouseButton)"), self.selectFeature)                             def unload(self):             # Remove the plugin menu item and icon             self.iface.removePluginMenu(u"&testplug", self.action)             self.iface.removeToolBarIcon(self.action)              def handleMouseDown(self, point, button):             self.dlg.clearTextBrowser()             self.dlg.setTextBrowser( str(point.x()) + " , " +str(point.y()) )             #QMessageBox.information( self.iface.mainWindow(),"Info", "X,Y = %s,%s" % (str(point.x()),str(point.y())) )                   def selectFeature(self, point, button):             # QMessageBox.information( self.iface.mainWindow(),"Info", "in selectFeature function" )             # setup the provider select to filter results based on a rectangle             pntGeom = QgsGeometry.fromPoint(point)             # scale-dependent buffer of 2 pixels-worth of map units             pntBuff = pntGeom.buffer( (self.canvas.mapUnitsPerPixel() * 2),0)             rect = pntBuff.boundingBox()             # get currentLayer and dataProvider             self.cLayer = self.canvas.currentLayer()             self.selectList = []             if self.cLayer:                 self.provider = self.cLayer.dataProvider()                 feat = QgsFeature()                 # create the select statement                 self.provider.select([],rect) # the arguments mean no attributes returned, and do a bbox filter with our buffered rectangle to limit the amount of features                 while self.provider.nextFeature(feat):                     # if the feat geom returned from the selection intersects our point then put it in a list                     if feat.geometry().intersects(pntGeom):                         self.selectList.append(feat.id())                      if self.selectList:                     # make the actual selection                     self.cLayer.setSelectedFeatures(self.selectList)                     # update the TextBrowser                     self.updateTextBrowser()             else:                 QMessageBox.information( self.iface.mainWindow(),"Info", "No layer currently selected in TOC" )                   def updateTextBrowser(self):             # if we have a selected feature             if self.selectList:                 # find the index of the 'NAME' column, branch if has one or not                 nIndx = self.provider.fieldNameIndex('objectid')                 # get our selected feature from the provider, but we have to pass in an empty feature and the column index we want                 sFeat = QgsFeature()                 if self.provider.featureAtId(self.selectList[0], sFeat, True, [nIndx]):                     # only if we have a 'NAME' column                     if nIndx != -1:                         # get the feature attributeMap                         attMap = sFeat.attributeMap()                         # clear old TextBrowser values                         self.dlg.clearTextBrowser()                         # now update the TextBrowser with attributeMap[nameColumnIndex]                         # when we first retrieve the value of 'NAME' it comes as a QString so we have to cast it to a Python string                         self.dlg.setTextBrowser( str( attMap[nIndx].toString() ))                  # run method that performs all the real work         def run(self):             # set the current layer immediately if it exists, otherwise it will be set on user selection             self.cLayer = self.iface.mapCanvas().currentLayer()             if self.cLayer: self.provider = self.cLayer.dataProvider()                  # make our clickTool the tool that we'll use for now             self.canvas.setMapTool(self.clickTool)             # show the dialog             self.dlg.show()                            # Run the dialog event loop             result = self.dlg.exec_()             # See if OK was pressed             if result == 1:                 # do something useful (delete the line containing pass and                 # substitute with your code)                 pass      Thanks in advance!


OGR/GDAL threading results in low core utilization

I'm trying to process some raster data using ogr/gdal and I can't seem to get full utilization of all the cores on my machine. When I only run the process on a single core, I get 100% utilization of that core. When I try to split into multicore (in the example below, by chunking the x offsets and putting them in a queue), I get pathetic utilization on each of my 8 cores. It seems like it only adds up to 100% utilization across each core (e.g. 12.5% on each). I was concerned that using the same datasource was the bottleneck, but I then I duplicated the underlying raster file for each core... and core utilization is still crap. This leads me to believe that ogr or gdal is somehow behaving like a bottleneck shared resource but I can't find anything online about that. Any help would be much appreciated! This is the "helper" function that runs inside each Worker thread:               def find_pixels_intersect_helper(datasource, bounds_wkt, x_min, x_max):         bounds = ogr.CreateGeometryFromWkt(bounds_wkt)         rows_to_write = []         for x_offset in range(x_min, x_max):             for y_offset in range(datasource.RasterYSize):                 pxl_bounds_wkt = pix_to_wkt(datasource, x_offset, y_offset)                 pxl_bounds = ogr.CreateGeometryFromWkt(pxl_bounds_wkt)                 if pxl_bounds.Intersect(bounds):                     rows_to_write.append(['%s_%s' % (x_offset, y_offset), pxl_bounds.Centroid().ExportToWkt()])


How to clip roads to exclude those within a flood zone?

I have OSM road network data in QGIS along with a shapefile showing the possible extent of a flood. My question is: is it possible to exclude all of the roads that are in the flood zone (so as to pretend that they are flooded/impassable) and generate a road network that can then be used for routing? My initial thought was to use the clip function but it simply clips the road network shapefile to the same overall shape as the flood shapefile, not just the sections that would actually be flooded. This screenshot may help explain a little more... ![enter image description here](http://i.stack.imgur.com/rd6PX.jpg)


How to move / offset point locations using ModelBuilder or ArcPy

I have a number non-georeferenced CAD layers (see this question) that have text annotation features. I have created a model to convert the text to points, but after converting the annotation to a Point featureclass, I see that the CAD text anchor points do not coincide with the center of the CAD text (which is where the points belong). Therefore, I would like to **programatically** (using ModelBuilder or ArcPy) [move] a feature relative to its current location (delta x,y) using a measured X,Y value that I will provide. This would allow me to move the GIS points back to where they belong, instead of the offset CAD anchor point. Any ideas on how I can accomplish this task? **UPDATE:** @PolyGeo gave an excellent answer using _SHAPE@XY_ IN 10.1, but currently I am running 10.0. Any 10.0 ideas?


How to add Esri legends for basemap within Leaflet JS?

I have a map with the Esri REST population density basemap. I also have 5 geoJSON layers with a legend. What is a method to display the Esri legend when my geoJSON layers are turned off and my basemap is turned on? The legend can be found here. http://server.arcgisonline.com/ArcGIS/rest/services/Demographics/USA_Population_Density/MapServer/legend


QGIS 2.0.1 - problems to add layers - encoding?

I have just installed standalone QGIS 2.0.1 on a PC with Windows 8. But, when I open it and try to add layers nothing happens? I browse to find the file I want and click 'open' but it doesn't turn up as a 'dataset' under 'source'. My first thought was that it is something with the encoding (it says 'system'). The encoding on my other PC with QGIS 1.8.0 is set to 'UTF-8'. I installed QGIS 2.0.1 on another PC with Windows 8 a few months ago, and it works fine. What can I have done wrong? Can it be something with the settings? I have tried with both .shp and .ecw-files.


How to Convert PDF files into ArcGIS Metadata?

I got a set of shapes with some additional informations looking like extracted/exported metadata, such as sources, extents, summary, descriptions, contacts... All in digital pdf and without XML files I could try to play around with. Is there a way to get these information into ArcGis Metadata ? I was wondering how I could set up a metadata template with the differents types of information contained in the Pdf or if I could append the FGDC Metadata with specific field. I will welcome any suggestions or even links to tutorial. Edit: Sorry, I realised what was not clear: I would like to create an xml formular (never done that, is there some kind of wizard/tutorial for it?) with different topics such as: Name, Fullname, sources, contacts, extents, scale of production, date of creation and date of update, related legislation, "legal rights", geometry... Then I'd like to import this formular as template for metadata and then filling the box then would be done by Hand. I guess another way around would be to modify an existing ArcGis Metadata template. is there a tool to do that? Thanks! New edit: Here is a screenshot of the type of categories I’d like to get in a form/template. Well it's in german, but it says things like 1_General Information (sub: Editors, actualisation, contact...), 2_ sources, 3_related regulations, 4_scale, 5_ right of use, 6_technical Parameters, DCM... ![Dokumentation](http://i.stack.imgur.com/WhUfG.jpg)


Where to download Print Widget for ArcGIS Flex Viewer 3.4?

I would like to download the Print Widget for ArcGIS Flex Viewer 3.4 which contains Scale Units like below: ![enter image description here](http://i.stack.imgur.com/FGNjl.png) Does anyone know where I can do that, please?


How to use Sharpmap to display spatial data from MS SQL Server 2008

Can anyone show me a step by step example on how to use Sharpmap to display MS SQL server spatial data using C# as the programming language? Please note I have exploit some of the example online but nor seem to be displaying data from MS SQL server 2008.               using System;     using System.Collections.Generic;     using System.ComponentModel;     using System.Data;     using System.Drawing;     using System.Linq;     using System.Text;     using System.Windows.Forms;     using System.Data.SqlClient;     using SharpMap;     using SharpMap.Geometries;     using SharpMap.Layers;     using SharpMap.Data.Providers;          namespace sqlcnx     {         public partial class Form1 : Form         {     // we start with the connection string            static string connstr = "user id=Youssef;password='';"+      //user id = name of your PC and because I use windows authentification I don't need passowrd                      "server=YOUSSEF-PC\\SQL;"+     //write your PC name + \\SQL (my PC is YOUSSEF)                      "Trusted_Connection=yes;"+                 "database=test;connection timeout=10";     //my database name is 'test' , the connection timeout is the time in second that the proram will waite for the server to connect before generating an exeption             SqlConnection myConnection = new SqlConnection(connstr);             Map map;             VectorLayer vly= new VectorLayer("vly", new SharpMap.Data.Providers.SqlServer2008(connstr, "quartier", "shape", null));          // 'quartier' is the name of the table in my database and 'shape' represente the geometry column in that table                       public Form1()              {                 InitializeComponent();             }                  private void Form1_Load(object sender, EventArgs e)             {                 map = new Map(pictureBox1.Size);     // we give the map the pictureBox size, don't forget to add a pictureBox to your form in the designer ;)                      vly.Style.EnableOutline = true;                 vly.Style.Outline = Pens.Black;                 vly.Style.Fill = Brushes.Red;     //the style of our vectorlayer color contour ..etc                     map.Layers.Add(vly); // add layer to the map                map.ZoomToExtents(); //zoom to extentto see all the map                map.BackColor = Color.White;                pictureBox1.Image = map.GetMap();     //affect the map to the pictureBox             }              }     }


How to create a QGIS action which copies features between layers?

i tried (i never tried before...) to write a simple python code like action in QGIS on my "XXX" vector layer that:   1. open a layer "YYY"   2. copy the selected feature on my "XXX"layer   3. paste the selected feature in the "YYY" layer Point 1) work ok, but point 2) don't work Here is my code:               qgis.utils.iface.addVectorLayer("/home/stefano/Documenti/YYY.shp", "YYY", "ogr");     qgis.utils.iface.actionCopyFeatures()


MapServer: Legend antialias

Is there a way to set `ANTIALIAS` for legend images in MapServer? Setting it up for symbols works pretty well, but all replies to `GetLegendGraphic` requests turn out a bit ugly and pixelated. I tried to include an `ANTIALIAS` directive in the `LEGEND` section but the interpreter complains about it. **Update** : This is happening with MapServer 6.2.1 and with any sort of map file and or data. Here's a snippet with a typical `LEGEND` section:               LEGEND       STATUS ON       KEYSIZE 22 20       KEYSPACING 7 7       LABEL         TYPE truetype         FONT FreeSans         SIZE 10         COLOR 0 0 0         ANTIALIAS TRUE       END     END      Thanks.


How to make gdalbuildvrt available in processing modeller?

I would like to make a model in QGIS that builds a virtualraster from several raster files. Unfortunately the gdal function is not available on the modeller. So, my question is: how to make this function available? It is necessary to construct a python script? If so how can I indicate the several raster files? Thanks.


How to create a link in the message body of email with Python?

I want to send an email with python that contains as a link in the body of an email as well. This link is actually a path to a file. If a receiver clicks on link It should open a folder where the file is. Thank you.


after reinstall geoserver how to locate old geoserver files

i have published lots of Arch GIS map on Geo server software. but few days ago because of some problem in my system i have uninstalled Geo server 2.1.4 from my system. but i kept a copy of my Geo server folder. Now i have again installed the same version of Geo server in my system. now the question is how to relocate my work folder in Geo server. i don't want to publish again all those files.


Resolving invalid workspace error

I have been using a third party ArcGIS tool called Landscape Fragmentation Tool. I originally had some troubles getting it to work correctly. Approximately 3 weeks ago I thought I had resolved those issues and understood how to prevent any error messages and an incomplete execution of the tool. However, I am now back in the position where I cannot make this tool work anymore. I keep getting this error: > Executing: Landscape_Fragmentation_Tool NLCD_reclass_bfpads1 90 > C:\Users\Beth\Documents\ArcGIS\lftmod\landfragmod.gdb > C:\Users\Beth\Documents\ArcGIS\lftmod\landfragmod.gdb\lfttestsat > > Start Time: Sat Oct 12 18:00:14 2013 > > Running script Landscape_Fragmentation_Tool... > > OUTPUT DATASET NAME IS: > C:\Users\Beth\Documents\ArcGIS\lftmod\landfragmod.gdb\C:\Users\Beth\Documents\ArcGIS\lftmod\landfragmod.gdb\lfttestsat > > DATA EXTRACTED FROM LAND COVER > > EDGE FRAGMENTATION IDENTIFIED > > INTERIOR, PATCH, AND PERFORATED FRAGMENTATION IDENTIFIED > > CATEGORIZING CORE FOREST PATCHES... > > File > "C:\Users\Beth\Documents\Landscape_Fragmentation_SA\Landscape_Fragmentation_SA\LFT_SA_Arc10.py", > line 334, in               arcpy.ASCIIToRaster_conversion (fragMap_6c, FragMap, "INTEGER")       > : ERROR 000875: Output raster: > C:\Users\Beth\Documents\ArcGIS\lftmod\landfragmod.gdb\C:\Users\Beth\Documents\ArcGIS\lftmod\landfragmod.gdb\lfttestsat's > workspace is an invalid output workspace. > > ERROR 000581: Invalid parameters. > > Failed to execute (ASCIIToRaster). > > Completed script Landscape_Fragmentation_Tool... > > Failed to execute (Landscape_Fragmentation_Tool). > > Failed at Sat Oct 12 19:02:49 2013 (Elapsed Time: 1 hours 2 minutes 35 > seconds) I am sort of at my wits end with this. I have been trying to resolve this since Wednesday. The tool creates a temporary workspace folder and the intermediate steps are stored in this folder.   Any help is greatly appreciated.


How to combine Spatialite Databases

I'm trying to combine a few Spatialite Databases into a single database, so that I can properly reference them, etc. I don't care about referencing them to one another (No foreign keys, etc), but I would like to get them all into a single database. Any suggestions on how I might accomplish this? As an example, say I'm trying to combine the key tables from this spatialite database with the ones here. I want to ensure that the geometry information is copied. I'm running on Windows 7, and would prefer to not use a different OS to accomplish this.


Error 193 while running gdal_calc.py using subprocess.call in Python

The following code works when used with cmd prompt:               C:\gdal_calc.py -A C:\a.tif --outfile=C:\result.tif --calc="A+1"      When I want to run the same code with subprocess:               import subprocess          subprocess.call(['C:\\gdal_calc.py', '-A', 'C:\\a.tif', '--outfile=C:\\result.tif', '--calc="A+1"'])      The following error results: [Error 193] %1 is not a valid Win32 application Please help me. I am highly frustating with it. This problem is basically the syntax error when the parameters are fed up into subprocess.call method what I think. Here is the reference: http://www.gdal.org/gdal_calc.html gdal_calc.py file is here: http://svn.osgeo.org/gdal/trunk/gdal/swig/python/scripts/gdal_calc.py


Customizing right click (context) menu of selected feature using ArcPy?

I want to confirm whether arcpy can customize the right click menu of the selected feature, which means I want to remove the default items and add in my own item. The following pictures show what I want to do: (1) picture 1 - the default when right click a selected feature ![enter image description here](http://i.stack.imgur.com/srbGy.png) (2) - picture 2 - what I want when right click a selected feature ![enter image description here](http://i.stack.imgur.com/KTGWM.png)


Layer stacking in ERDAS?

When I am doing layer stacking of the liss iv image and ndvi generated from the same image, the output generated is white (flat) in ERDAS Imagine. How to solve the problem?


How to get initial datas after bind time Slider to map , ArcGIS JavaScript API

Like this example:https://developers.arcgis.com/en/jav..._layerDef.html , I have added my featureLayer to my map, and bind the timeSlider with the timeExtent = featureLayer's timeExtent. After bind timeSlider to the map, the points display normally, but i cannot get detail datas of these points. Like the above example, when i click the play button, in the 'timeExtentChange' function of the timeSlider, i can get the datas of the points normally. My question is that how can i get the initial datas of the points after i bind timeSlider to map and before i click the play button. This is my code. Code: function initSlider(results) { var timeLayers = dojo.map(results, function (result) { return result.layer; }); var timeExtent = new esri.TimeExtent(); timeExtent = results[0].layer.timeInfo.timeExtent;                   var timeSlider = new esri.dijit.TimeSlider({             style: "width: 800px;"         }, dojo.byId("timeSliderDiv"));              myMap.setTimeSlider(timeSlider);              timeSlider.setThumbCount(1);         timeSlider.createTimeStopsByTimeInterval(timeExtent, 1, 'esriTimeUnitsHours');         timeSlider.singleThumbAsTimeInstant(true);         timeSlider.setThumbIndexes([0]);         timeSlider.setThumbMovingRate(1000);         timeSlider.setLoop(true);         timeSlider.startup();                   //add labels for every other time stop         var labels = dojo.map(timeSlider.timeStops, function (timeStop, i) {             return timeStop.getHours();         });         timeSlider.setLabels(labels);                   //search the initial datas         var timeQuery = new esri.tasks.Query();         var timeE = new esri.TimeExtent();         timeE = myMap.timeExtent;              timeQuery.timeExtent = timeE;              dojo.forEach(timeLayers, function (layer) {             var mappedField = layer.renderer.attributeField;                  layer.queryFeatures(timeQuery, function (featureSet) {                 var timeDatas = dojo.map(featureSet.features, function (feature) {                     return [feature.attributes["RG_id"], Number(feature.attributes[mappedField])];                  });              });         });              //search datas in the timeSlider's event.         dojo.connect(timeSlider, "onTimeExtentChange", function (timeExtent) {             timeQuery.timeExtent = timeExtent;             var yearlyLayerProduction = '';                  dojo.forEach(timeLayers, function (layer) {                 var mappedField = layer.renderer.attributeField;                 layer.queryFeatures(timeQuery, function (featureSet) {                     var chartDatas = dojo.map(featureSet.features, function (feature) {                         return [feature.attributes["RG_id"], Number(feature.attributes[mappedField])];                      });                 });             });         });     }      I also found this example seemed resolved this question, but i haven't find the different of the these two examples. https://developers.arcgis.com/en/jav...reetTrees.html


How to add sfcgal to an already postgis enabled database

I have a postgres 9.1 database with postgis 2.1, and I recently needed to add sfcgal to it, so i rebuilt postgis 2.1, but I can't find out how to update the postgis extension in postgres without dropping all data. Is there a way to do that ?               ALTER EXTENSION postgis UPDATE;      returns a notice saying i'm already at version 2.1.0 Thanks for any tips


Maxent out of bound error?

I selected my climate data from wordclim ( tile 29 ) and then used QGis to convert the data to .asc format . My occurrence data is in degree decimal.But when I run Maxent on any layer it says that the occurrence points are out of environment bound. What should I do ??


How to perform a clean re-installation due to dll errors

Following a virus, Qgis won't run and errors saying missing dll. I manually replaced the first missing dll but it now complains about a second one. I suspect that if I simply replace this one it will just keep complaining about them all. I have tried to remove and reinstall Qgis but this didn't fix the problem. Is there a way to clean de-install? Or a quick way to replace all the dlls? Thanks Graham


Is there any sld styles for OpenStreetMap in ArcGis 10.1?

I want to display OpenStreetMap any possible way. 1) This map must be similar to the official OpenStreetMap. 2) Also I must cache data. So I need the WMTS protocol. This is vital. I can not use Geoserver for my purpose because I can not find sld styles for points. So I want use ArcGIS Server. But I don't know about sld styles for ArcGIS.


How do I add a shapefile in ArcGIS via Python?

I am trying to automate various tasks in ArcGIS Desktop (using ArcMap generally) with Python, and I keep needing a way to add a shape file to the current map. (And then do stuff to it, but that's another story). The best I can do so far is to add a _layer_ file to the current map, using the following ("addLayer" is a layer file object):               def AddLayerFromLayerFile(addLayer):      import arcpy      mxd = arcpy.mapping.MapDocument("CURRENT")      df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]      arcpy.mapping.AddLayer(df, addLayer, "AUTO_ARRANGE")      arcpy.RefreshActiveView()      arcpy.RefreshTOC()      del mxd, df, addLayer      However, my raw data is always going be shape files, so I need to be able to open them. (Equivantly: convert a shape file to a layer file without opening it, but I'd prefer not to do that).


Format and value of Esri Technical Certification?

Starting mid-January you will be able to register for a series of **Technical Certifications from Esri** and I was interested in doing this, but have not been able to find out too much information about it online. Does anyone know the format of the test? From the Skills Measured section I get the impression that you will be working on a computer but I could not find anything definitive. My only other question is if anyone has even heard much about this and how much weight it is going to carry? I got a notification about this once a couple months back but otherwise I have not heard anything. Just curious if anyone in their jobs or GIS circles are being told/recommended that they need to get this or if people are just different for now.


How to create more than one mean coordinate in QGIS?

I have a point shapefile with several thousands of points in it. I've split the points up into spatial groups using a vectorgrid and pointcount. I wish to create a mean coordinate for each group of points. However, where there are more than 200 points in each group, I wish to add two new points that are evenly distributed amongst the group. Is it possible to create two or more new points using the 'mean coordinates' tool in QGIS? Further issues i'm having with this method:   * How do I get my new point (generated by the mean coordinate) to 'snap' ontop of a pre-existing point   * Groups are created based on their pointcount. Where I have two groups of points that are spatially apart, yet with the same pointcount, each point is placed in the same group - is there a way to alter this - perhaps with a weighted mean? Any suggestions are greatly appreciated, thanks.


Checking numeric values in a field and then grouping it out in the where clause

Building a desktop application using C#.net and arcobjects. I'm trying to retrieve records from a shape file using IQueryFilter. Having trouble writing the where clause in my scenario. The scenario is as follows. There are 3 attribute field called "StreetName", "TypeID", "Allowed" in the shape file. The "StreetName" field can have street names such as "Main Avenue", "Robert street", "5th Street" , "ST 6N","CR 7" etc. I need to only retrieve the streets which have a number in it. ( so in this case it will be just "5th Street" , "ST 6N","CR 7") . Once the streets with numbers are retrieved I need to group it according to the "TypeID" field. The "TypeID" field is of type double. Then I need to check for a given "TypeID" whether all the records in the "Allowed" field is the same. ( The "Allowed" field just has 2 different values either Yes or No) If there are records that are not equal in the "Allowed" field for a given "TypeID" I need to get those as the query result. Example values from the attribute table. ( Record Number column is added for illustration purposes only) ![alt text](http://i.stack.imgur.com/lU3hT.jpg) So according to the example data, record 4 ( which has a Yes in the "Allowed" field where all the others of that "TypeID" has No) and record 9 ( which has a No in the "Allowed" field where all the others of that TypeID has Yes) should be the result of the query. I can select the numbered streets by using a where clause like this.               IQueryFilter spatFilt;          spatFilt.WhereClause = "ST_NAME LIKE '%1%' OR ST_NAME LIKE '%2%' OR ST_NAME LIKE '%3%' OR ST_NAME LIKE '%4%' OR ST_NAME LIKE '%5%' OR ST_NAME LIKE '%6%' OR ST_NAME LIKE '%7%' OR ST_NAME LIKE '%8%' OR ST_NAME LIKE '%9%' ";      After that I'm stuck on how to group according to TypeID and then select the invalid records.. Any help in writing the where clause in the query will be greatly appreciated. (I need only the invalid records. So in this case it should be just 4 and 9)


Cross-browser marker animation in OpenLayers

Currently I'm trying to implement animated markers in OpenLayers. I'm using PNGs for the markers, set by the `externalGraphic` style property on an `OpenLayers.Layer.Vector`. I need to be able to make the graphic pulse, grow, blink, etc. which means controlling its size and position. With the SVG renderer I can get a reference to the `image` element by using the Geometry's `id` property. However with the VML renderer (IE8 doesn't support SVG) I can't seem to find a way to get a reference to the `rect` element, which is what (I _think_ ) I need to manipulate to do the animation. Am I thinking about this wrong? Can I change the feature's style on the fly? Should I just use animated GIFs (ugh)? `OpenLayers.Layer.Markers`? Something else? What if I could get away with _not_ supporting IE8 -- is working with the `image` a good way to go? Edit: I also need to support selection and clustering of the markers...


Searching Open Source tool to load raster data into Oracle spatial

I'm looking for a tool to load raster data into oracle spatial. I found several commercial products but no open source tool. Is there anything available in the open source world?


Needing a python script to spatially join points to line segments with merge rules and a frequency count

I have a data that contains 4 years of fatal crash point incidents. Within the data set there is a field for the "Death Count" and "DWI Related," where death count is the number of deaths resulting from the crash and DWI related is simply a 1 or 0 to denote whether or not the crash was a DWI related incident. I also have the year that each crash occurred in the table. My final deliverable should provide the total number of crashes per line segment (basic join count), total number of deaths per segment (sum death count on merge rule), and the total number of crashed that were DWI related (sum DWI Related on merge rule). However, and this is where it gets tricky for me: I also need to count how many crashes happened **per segment PER YEAR**. I know I the long way of doing it where I break the data up into groups by year run the spatial joins and then do an intersect. But does anyone know of a way I can get the frequency count during the spatial join (to clarify, the frequency count is for how many crashes happened per year, per line segment)? It seems like there should be a way since basically it is just table manipulation, but I'm stuck.


Help with "Combine" tool in ArcGIS

I have two raster layers. Layer A has a cell size of 1020 m. There are 31,840 rows in the attribute table, each corresponding to a different 1020 m x 1020m cell. Layer B has a cell size of 30 m. The attribute table associated with this only has two entries - value (0,1) and count of value. I want to combine the two layers such that I have the ID of the 1020 m x 1020 m cell from layer A that spatially overlaps the values from layer B. After reading How to find the area of raster values within polygon zones? I used the "combine" tool. But the number of rows in the output are not what I would expect. Instead of the new layer having the same number of rows as layer A (31,840), there are considerably fewer (only ~22,000). The graphic below shows an example - two similar areas with roughly the same amount of missing data in layerB. An output from the Combine tool was produced for one of these areas, but not for the other! I don't understand what could have gone wrong! Any ideas? ![Left: two areas with similar amounts of missing data. Right: Only one of the two areas got a result from the Combine tool.](http://i.stack.imgur.com/bAqO4.png)


Stretched raster symbology not working in ArcGIS for Desktop?

I have some DEM rasters (from the same data source so I think they're uniform in all file specifications) that I'm symbolizing using the same stretched color ramp. I set the stretch type to min-max, then edit high/low values to cover the low - high values for these rasters (0 - 128 in this case). For most of the rasters this works perfectly to create a nice seamless map, however for 3 of the rasters it is still not using the same symbology resulting in big ugly seams. Any ideas on what may be causing this? I'm using ArcMap 10.2.2.


Work around to create feature-linked annotation from standard annotation?

I have one standard annotation feature class that I have used to label the contract names of 6 feature classes. I'm in a tough position where I've been asked to remove a few hundred records from about 2000 records spanning over the 6 different feature classes. This would create 200 orphaned annotations in my standard annotation feature class and I need to have the flexibility to bring these annotation back just in case. Since the labels are meant for a data driven map book, the labels and leader lines have been painstakingly positioned manually. I don't want to have to recreate all these labels as "feature-linked" because I would have to re-position them all. Since the text field from the annotation layer has a corresponding text field in the feature classes, I should theoretically be able to create a link between the two with a relationship table. I have no idea how to do this or if it is even possible to retro-actively create a feature-linked annotation. Has anyone done this or have any answers on how to do this?


Where to find comprehensive descriptions of tools in QGIS, SAGA, Orfeo, etc. toolboxes?

There exists a large number of tools for QGIS (e.g. SAGA, GRASS, ORFEO etc.) - however none of these have sound description of the aim of the tool, the algorithm itself, differences to other similar tools and a hints for the interpretion of the result. How can I judge which tool to use if I do not know this essential background information? This leads to a great problem that many people use sophisticated analyses but apply wrong (or only standard) parameters or thresholds as they do not know which parameter to adjust. ESRI provides simple explanations for their tools (also they seem not to be written by experts but programmers), taudem has useful description - It would be great to have similar descriptions for the other available opensource tools too! Many, many thanks to all the programmers - but after working so hard could you please please please add half a page to describe the approach, add references, and explain (shortly) your parameters and the results and codes? Any hint where to get background information on the different morphology/hydrology tools is highly appreciated! Thanks a lot!


GPS capable rangefinders or cameras that can capture lat / long data from a distance?

Anyone have experience using this technology? i.e. field verifications of structures where you need to capture the lat / long of a house that is 1000 feet from the road with limited access.


Concatenate an object ID and string to publish gp service with field calculator?

I have a simple model which concatenates and object id and a string, to create something like 1SRS2567, the concatenate function of OID and the string field are able to be passed in VB, but not python, which is preventing me from publishing my gp service. I believe the issue is that python is reading the OID as unicode, any ideas or workarounds suggested? I would like to maintain this structure in using an OID because features will be added to a map service which maintain these fields.


Plot coordinates and draw a heat map on a GADM map

I am trying to plot insect Resistance data collected at multiple sites on a spatial GADM map. My data looks like this: ![enter image description here](http://i.stack.imgur.com/Er3FU.png) I would like to build a heat map (with increasing resistance=increasing temperatures) but I have difficulties to overlay the data on the gadm map.               adm <- getData('GADM', country='SWE', level=2)          map<-plot(adm, bg="white", axes=T)       Any help or advice would be very much appreciated.


Has anyone completed an ESRI Summer (Student) Internship

Taking a look into the ESRI Summer Internship program today, I was hoping to find a little more on this subject than what I have been able to find. I was actually hoping that perhaps there are some community members here on gis.stackexchange.com who have worked at ESRI as a student, work for ESRI currently, and/or know of the program itself, can share something about the project they worked on, the experience of working for ESRI and anything else that may be interesting or useful to know.


Is there a way to get at C's OGRLayer.Intersection() or OGRLayer.Clip() in Python?

I am working with OGR in Python and noticed that the C libraries have useful Intersection() and Clip() functions as part of the Layer class. Is there any way to get at these functions in Python? I know that these functions exist on the Geometry level but I'm looking specifically at the Layer. Thanks!


What are some Domain Specific Languages (DSLs) for GIS?

I'm curious what sort of domain specific languages (DSLs) are used in GIS. The only one I can think of is the DOCELL language that was provided in ArcInfo Workstation GRID, but is no longer supported.


Removing Image Stripes / Scan Line errors

I have some seabed bathymetry data derived from seismic reflection profiles in a 2.5D dataset (closely spaced lines). The data was gridded by another worker in SMT Kingdom suite; I'm not familiar with the process, but the result is quite high resolution, but contains scan line errors/striping int he direction of the survey lines. After some extensive searching via google I'm aware that this can be fixed by using fast fourier transforms (FFT) though I have no idea how to implement this! I have ArcMap installed on my main desktop machine and would prefer a solution on this, though I do also have GRASS on another machine. I've attached Images to try and illustrate the problem at hand. Raw Survey data: http://imgur.com/tWNUr5t Inline: http://imgur.com/ZtDMcxJ I can't post the crossline image, but it is in the album on imgur


Removing 0 values when labelling an integer field

I am trying to do a simple labelling exercise however I am a bit stuck on how to remove unwanted '0' values. I have three fields which I would like to display in a stacked label i.e. on three lines. However the third field has a number of 0 values which I would like to disappear - i.e. instead of having: Field One Field Two 0 I would like to have: Field One Field Two Blank Any ideas welcomed - as you will guess I am fairly new at this so all help appreciated.


Problems Creating Flood Model from Sub Bottom Data with HEC-RAS

I am looking to build a paleo flood model from Sub-bottom data. I've created a TIN in ArcGIS from the SBP data and tried to use Hec Geo Ras to model the stream. I can visualise it and export it, but when I come to re- import it stalls every time with a " _object reference not set to an instance of object" message_. I've no idea how to resolve this issue. All I want to do is flood the paleo-channels up to the present day sea-level in a simple animation. Any suggestions or options in GRASS?


Merge Error 000594 in ArcMap - falls outside of output geometry domains

I'm trying to merge together 5 different point feature classes into one using the Merge tool in ArcGIS desktop 10. It successfully merges 3 of them but not the other 2. It comes back with an error 000594: Input feature1: falls outside of output geometry domains. These 2 feature classes are furthermost away, but still close to other feature classes. How do I extent out the output geometry domain? I'm not seeing anything like that in the environment settings.


Did not find registered control

I am using `ESRI Arc GIS` with `C#`. I dragged 2 control `licence and axMapControl`. When I run the program following error occurs. `Did not find a registered ActiveX Control in C:\Program Files (x86)\Arc Gis\com\esriContr`