Intersecting a raster with a polygon using PostGIS - artefact error

I'm using PostGIS2.0 to do some raster/polygon intersections. I'm having difficulty understanding which operation I should use, and what the quickest way of performing this is. My problem is as follows:   * I have a polygon and a raster   * I want to find all the pixels that fall within the polygon, and get the sum of the pixel value   * And (updated problem): I'm getting massive values for some pixels that do not exist in the original raster when I perform the query I'm having difficulty understanding whether I should use `ST_Intersects()` or `ST_Intersection()`. I also don't know what the best approach for summing my pixels is. Here is the first approach that I have tried (#1):               SELECT          r.rast      FROM         raster as r,          polygon as p     WHERE         ST_Intersects(r.rast, p.geom)      This returns a list of `rast` values, which I'm not sure what to do with. I tried calculating the summary statistics using `ST_SummaryStats()` but I'm not certain if this is the weighted-sum of all the pixels that lie within the polygon.               SELECT               (result).count,             (result).sum         FROM (                SELECT                  ST_SummaryStats(r.rast) As result              FROM                 raster As r,                  polygon As p              WHERE                 ST_Intersects(r.rast, p.geom)             ) As tmp      The other approach which I have tried (#2) uses `ST_Intersection()`:                SELECT             (gv).geom,                      (gv).val      FROM       (         SELECT              ST_Intersection(r.rast, p.geom) AS gv         FROM              raster as r,              polygon as p                    WHERE              ST_Intersects(r.rast, p.geom)                ) as foo;      This returns a list of geometries that I analyze further, but I assume this is less efficient. I'm unclear on which is the quickest order of operation also. Should I always choose `raster, polygon` or `polygon, raster`, or convert the polygon into a raster so that it is `raster, raster` ? EDIT: I updated approach #2 with some details from `R.K.`'s link. Using approach #2, I have noticed the following error in the results which is part of the reason why I did not understand the output. Here is the image of my original raster, and an outline of the polygon that is being used to intersect it, overlaid on top: ![enter image description here](http://i.stack.imgur.com/pAlk0.jpg) And here is the result of the intersection using PostGIS: ![enter image description here](http://i.stack.imgur.com/xzXci.jpg) The problem with the result is that there are values of 21474836 being returned, which are not in the original raster. I've no idea why this is occurring. I suspect it is related to small numbers somewhere (dividing by almost 0), but it returns the wrong result.


Qgis nightly build - DEM error

I installed Qgis 1.8 several months ago. It's been working like a charm. Earlier today, I decided to check out the latest nightly build. Installed GDAL 1.10 (already had 1.9 installed) and SQLite 3.7.16 first, then the nightly build. It's been running fine, however, I just tried to to some DEM raster analysis...which does not work at all. I get an error message - "An error has occured while executing Python code". Any advice?


Postgis max contains query

I have two tables:               CREATE TABLE periphereies     (       gid serial NOT NULL,       per character varying(60),       geom geometry(MultiPolygon),       CONSTRAINT periphereies_pkey PRIMARY KEY (gid)     )     WITH (       OIDS=FALSE     );          CREATE TABLE archaia_theatra     (       gid serial NOT NULL,       "ΘΕΑΤΡΟ" character varying(254),       "X" numeric,       "Y" numeric,       geom geometry(Point),       CONSTRAINT archaia_theatra_pkey PRIMARY KEY (gid)     )     WITH (       OIDS=FALSE     );      First of all i am trying to write a query that return's me all the periphereies record's that contain at least one archaia_theatra.geom point record.. Then i want to select the periphereies which contains the maximum number of archaia_theatra (compared with all the other perifereies records) I am trying this:               CREATE OR REPLACE VIEW per_max_theatra AS     SELECT count(p.per) FROM periphereies AS p JOIN archaia_theatra AS a ON     ST_Contains(p.geom, a.geom) ORDER BY count(p.per) DESC LIMIT 1      but it's not working Any help? Thx in advance


Detection of geographical trend of a variable

What is the best method to detect and graphically display the spatial trend of a variable? I'm looking for something that tells me the probability that the trend is from "north-west to south-east" or something like that. Someone wrongly (my opinion) suggested me to use kriging interpolation but I think that it is not correct to infer spatial trend by using estimated variables. I can use ArcGis or R. Thanks


MapInfo "shape" file vs. naturalearthdata.com shape file

When i load this map shape file (exported from MapInfo as a shape file)               shp.WashingtonLand<-readOGR("C:\\...\\Maps","WLmap2_polyline")      R replies:               OGR data source with driver: ESRI Shapefile      Source: "C:\Users\Andreas\SkyDrive\Speciale\02. Data\02. Statistik", layer: "WLmap2_polyline"     with 2577 features and 23 fields     Feature type: wkbLineString with 3 dimensions     Warning message:     In readOGR("C:\\Users\\Andreas\\SkyDrive\\Speciale\\02. Data\\02. Statistik",  :       Z-dimension discarded      How do I see what this Z-dimension is? (this may be a separate question): Can this explain why the map won't show with points on, or as a layer on top of another shape file like the ones from Naturalearthdata.com?


Why are some columns not recognized as numeric even though I have a CSVT?

I have problems importing a .csv file. Some Values of the file are not supposed to be formated in text style, but in number style, thus i created an additional .csvt file like explained here. Both files with exactly the same name and the same location are created. The number of columns is the same and I add the .csv file with the "Add Delimited Text Layer" tool. Nevertheless I am not able to choose any columns for a graduated symbology. My .csv file includes 12 rows, of which the 5th, 11th, and 12th column consist numbers. My .csvt file therefore looks like that: _"String","String","String","String","Integer","String","String","String","String","String","Integer","Integer"_ I tried to create it with the standard editor from Windows and Notepad++. Are there any common mistakes done by newbies, like I am one? Thank you for your help!


Simulate a click event on FeatureLayer in ESRI JavaScript API

When my app changes context (user clicks on a tab) I want to programmatically "Select" the first of 6 points in my Feature Layer so I get the blue box around the point and activate the info window. I looked around the API Docs and found the FeatureLayer's selectFeatures method. This method takes a Query object, and a selection method (I'm creating a new selection so I'll use SELECTION_NEW). The function returns a promise, but do I really need any kind of callback? I'm just trying to select a feature. **Here is the definition of my feature layer:**               var projectsAGOL = new esri.layers.FeatureLayer("http://services.arcgis.com/QVENGdaPbd4LUkLV/arcgis/rest/services/rioLocoSites/FeatureServer/0",{          infoTemplate: infoTemplate,         visible: true,         outFields: ["*"]     });      **Click handler for the Tab:**               jQuery("#prjMap").click(function(){         var query = new esri.tasks.Query(); // Create a Query Object         query.where = "OBJECTID = 0"; // Select the first point from the Feature Layer         projectsAGOL.selectFeatures(query, esri.layers.FeatureLayer.SELECTION_NEW); // Apply selection     });      This code does not produce the desired outcome nor does it produce an error. Nothing happens. Am I even using the correct method to make a selection? I'm more familiar with the Leafletjs mapping library. **Update:** Provided jsFiddle


How to bring polygons closer to a point?

I have some scattered polygons with a lot of space between them.   I want to make a thematic map but all that white space doesn't look very good, so I want to bring the polygons closer to the center of the area.   Any idea on how to do that in a automatic way? It could be a raw algorithm, postgis query or python function.   Here is an example: Original:   ![enter image description here](http://i.stack.imgur.com/M51e2.jpg)   Final:   ![enter image description here](http://i.stack.imgur.com/cNzSM.jpg)


ModifiyFeature Control with an array of vectors

I want to put all the drawn vectors in an array and make editable only those which id match with a shapeId var. Do I have to add a new control in the for loop or can I setOptions of the feature to editable?               function initControls(){      colorPoly = document.getElementById('color_picker_'+shapeId).value;           var shapeStyle = {         strokeOpacity: 1,         strokeWidth: 1,         fillColor: colorPoly,         fillOpacity: 0.45,      }           var shapeStyle2 = {         strokeOpacity: 1,         strokeWidth: 1,         fillColor: colorPoly,         fillOpacity: 0.45,         pointRadius: 5,      }           var styleMap = new OpenLayers.StyleMap({         "default": shapeStyle,         "temporary": shapeStyle,         "select": shapeStyle,         "vertex": shapeStyle2      }, {extendDefault: false});           var newShape = new OpenLayers.Layer.Vector( "Editable",{             styleMap: styleMap         });                newShape.events.register("sketchcomplete", newShape, function(){             map.addLayer(newShape);             newShape.id = shapeId;             createdShapes.push(newShape);             alert(createdShapes.length)             toggle = 1;         });           editingToolBar = new OpenLayers.Control.Panel({             displayClass: 'customEditingToolbar',             allowDepress: true         });           var draw = new OpenLayers.Control.DrawFeature(         newShape, OpenLayers.Handler.Polygon,         {             title: "Draw Feature",             displayClass: "olControlDrawFeaturePolygon",             multi: true         });      for (var i = 0; i < createdShapes.length; i++){             if (createdShapes[i].id == shapeId){                 var edit = new OpenLayers.Control.ModifyFeature(createdShapes[i],                 {                     title: "Modify Feature",                     displayClass: "olControlModifyFeature",                     vertexRenderIntent: "vertex"                      });             }         }      editingToolBar.addControls([edit, draw]);      map.addControl(editingToolBar);     }      What is the right way to do it? Thank you very much for your help.


Compass error (can't find proper directories)

> Compass::SpriteException in Sessions#new > > Showing /home/cartodb/cartodb/app/views/layouts/front_layout.html.erb where > line #12 raised: > > No files were found in the load path matching "icons/*.png". Your current > load paths are: /home/cartodb/cartodb/app/assets/images (in > /home/cartodb/cartodb/app/assets/stylesheets/common/header.css.scss) I've googled and done this: "git submodule foreach git checkout master", and then "rvm use 1.9.2@cartodb --create && bundle install"…. I can get to the next error (and the next) by manually adding various png files but this is not ideal. Any suggestions?


Script to "extract by mask" a list of raster files

I'm trying to mask a group of raster files and save the new rasters in a different folder using the same name of the original files. It doesn't sound as a difficult task, but I'm having trouble saving-naming each masked raster inside the "for" loop. Here is what I have so far:               import arcpy     from arcpy import env     from arcpy.sa import *          env.workspace = "C:/rasters/threshold"     mask = "C:/GIS/mesoamerica.tif"          rasterlist = arcpy.ListDatasets("*", "Raster")         for i in rasterlist:             outExtractByMask = ExtractByMask(i, mask)             outExtractByMask.save("C:/SIG/MelasCA_30runs_avg/threshold/mesoamerica/" i)      I need to find a way to use the "i" variable in the outExtractByMask.save. Any idea? Thanks!


What is a SQL Query to all values in a column with Select by Attribute in ArcGIS?

I would like to select all values for an attribute using select layer by attribute to use in model builder and hopefully save the expression for automation purposes. If I have an attribute named COUNTY how do I select all values for this attribute? The end goal is to automate specific layer creation; while avoiding make feature layer and using the field info dialog box. Select layer by attribute(would always be all values in an attribute) Make Feature Layer from selected attributes Apply symbol Output database ![enter image description here](http://i.stack.imgur.com/sqUv4.jpg) I would like to use a SQL expression to select all rows in the county field. *Edit This is a work around to avoid having an array of check boxes in the field info from the make feature layer function. So I would like to select all values in the COUNTY field and make a feature layer from county. So my end attribute table would appear like: ![enter image description here](http://i.stack.imgur.com/SCDsQ.jpg)


How to turn this into a routable network that works with pgRouting?

I'm only asking again since I didn't get any answer and I'm still stuck here... I updated my last question with more info, but it wasn't answered. When I draw a line with snapping enabled and try to run driving_distance etc the network is broken. (When I zoom in enough I find broken lines here and there after importing it with DBManager. Also this question is new since I'm using the plugin Points to Path. Just trying to solve this for a school project.. Old question:   I have exported all buss stops on a route as points from google earth as a .kml file and converted it into a shape file. (GREEN on the attached screenshot) Using the plugin 'Points to Path' I've been able to draw a line between them, which I think is good. (No manual work so far) (RED on the attached screenshot) Now I need to divide that line into segments/nodes or what ever you call them, to be able to specify the cost for each buss journey (I have this in a excel file and think I can integrate them into the attribute table somehow) My problem is turning this into a routable network with costs for each part of the journey for pgRouting+QGIS+PostGIS+Postgresql. How would you do it? Marry x-mas to all gis.stack-exchangers! ![enter image description here](http://i.stack.imgur.com/hvNFN.png)


changing symbology

I have problem with my script. Layers are in one geodatabase, and have names like: orne1942, orne 2003, orne 2009 (the same forpart e.g. orne). Script should changing symbology layers wich have the same forpart (uniform it) in many map documents (.mxd). Mayby someone have idea what I am doing wrong ? (I am just begning my python adventure.... ) my script:               import arcpy     path = (r"C:\program2_D.Nowak\map\\")     arcpy.env.workspace=path     arcpy.env.overwriteOutput=True     orneWZOR=arcpy.mapping.Layer(r"C:\program2_D.Nowak\orneWZOR.lyr")     for mapDoc in arcpy.ListFiles("*.mxd"):        print mapDoc        mxd=arcpy.mapping.MapDocument(path + mapDoc)        print mxd        df=arcpy.mapping.ListDataFrames(mxd, "*")[0]        for df in arcpy.mapping.ListDataFrames(mxd):             orne=arcpy.mapping.ListLayers(mxd, "orne*", df)[0]             arcpy.mapping.UpdateLayer(df, orne, orneWZOR)        mxd.save()        print "done"     del mxd     del lasyWZOR, drogiWZOR, orneWZOR, odlogowaneWZOR, zabudowaneWZOR, laki_pastwiskaWZOR <


SQL server 08 Limitations

The Soil SURvey GeOgraphic (SSURGO) database is a set of very large and complicated shapefiles. We want to load all of the shapefiles for the US into a national SQL database. Are there import limitations for SQL 2008 for Spatial? Also, are there any websites that use a SQL database for interactive thematic mapping? Thanks Bernie


Understanding Geodatabase Archiving and H tables in ArcSDE?

We have ArcSDE 10.0 on MSSQL 2008 with Geodatabase archiving enabled. In the process of updating a topology I deleted the topology, disabled archiving, unregistered as versioned and then recreated the topology. It seems that when I did this a copy of the feature classes in the feature dataset were created at the root of the geodatabase suffixed with an "_H". When I deleted and created the topology again the features classes were copied to the root of the gdb again with an "_H1" suffixed. Does anyone know what's going on? I was told these were the Archiving tables. Please provide links if available.


In leaflet does the addControl automatically handle events via the leaflet API?

I need to add additional overlay layers to be controlled by the controls within the leaflet map boundaries, but the code utilizes a leaflet-custom.js file. I am assuming it handles the event and triggers creating DOM elements for the overlay but I cannot verify as the custom file is a minified file so I don't know what configurations were made. When I add my wms tile layers to the controls the wms tile layers do not display as a result of 403 errors with the Forbidden message, the urls are all modified, and the type changes from images/pngs/jpegs to text/html. Therefore is there any way to programmatically add geolocation with with the events?


how to convert lat and longitude into distance near poles?

I am trying to convert latitude and longitude into meters in polar regions. I am looking for higher accuracy upto 0.00 meters preferably. I tried the haversine formula but it doesnt seem to be accurate enough for small increments in latitude. does anyone know a better formula that can be used near poles?


Can't preview a shapefile in GeoServer 2.2.4

I have problem with previewing layers in GeoServer. I installed Geoserver 2.2.4 (following instructions in manual) and everything was going well. I managed to login to it and create my own new workspace. I've created a new store and published that layer but when I try to preview that layer with openLayers all I see is empty map with no features on it. I've also tried with example on http://docs.geoserver.org/2.2.4/user/gettingstarted/shapefile- quickstart/index.html to see if the problem is with my shapefile but the same thing happens. I really don't know why because all I did was the same as it is written in manual. I hope somebody can help me with that. Thanks


Can "Getting to know ArcGIS Desktop" for version 9 be used as a tutorial for version 10?

I am a GIS n00b. Our company has ArcGIS 10 desktop, and since it is multi-user license, I was allowed to install on my computer. I was given a copy of "Getting to know ArcGIS desktop" but it is for ArcGIS 9. Are the two versions so different that I should just get myself the latest copy for 10? ESRI sells it for about 70 dollars so I'd like to not spend the money, but I'd also like to learn the system as well as possible. Thanks!


How to get the Nth LineString from a MultiLineString in PostGIS?

I need a function that gets the Nth LineString from a MultiLineString in PostGIS, somthing like ST_PointN that gets the Nth point from a LineString.


mixing lon/lat and mercator layers in a MapServer .map file

I have a basic question about my MapServer .map file, which has two layers, each with a different coordinate system, longlat vs. mercator. See my .map file below. If I leave it as shown below, with the "version 2" UNITS/EXTENT active, it correctly draws my "MrSid" in the right place on the earth, but doesn't draw my "shape layer" layer. On the other hand, if I comment out the "version 2" UNITS/EXTENT and activate the "version 1" UNITS/EXTENT, it then draws "shape layer" but not "MrSid". So it's acting like the the UNITS/EXTENT has to match those of the layer for the layer to be drawn. Is that right? If so, how do I mix layers with different UNITS? (By the way, I also have a secondary question about this .map file. If I don't include any PROJECTION entry at the outer/MAP level, it will draw the "shape layer" layer but not the "MrSid" layer. But if I add a PROJECTION, regardless of whether the projection is `"proj=longlat" "ellps=WGS84" "datum=WGS84"` or `"proj=merc" "lon_0=0" "k=1" "x_0=0" "y_0=0" "a=6378137" "b=6378137" "towgs84=0,0,0,0,0,0,0" "units=m"`, it will draw either layer -- but not both at the same time, as per the main issue above. So my secondary question is why it seems to be happy using a default projection with my longlat shape file, but not with my mercator MrSid file.)               MAP       IMAGETYPE   PNG            # version 1       # UNITS dd       # EXTENT      -180 -90 180 90            # version 2       UNITS meters       EXTENT -20037508.34 -20037508.34 20037508.34 20037508.34            SIZE        550 450       INTERLACE OFF       PROJECTION         # "proj=longlat" "ellps=WGS84" "datum=WGS84"         "proj=merc" "lon_0=0" "k=1" "x_0=0" "y_0=0" "a=6378137" "b=6378137" "towgs84=0,0,0,0,0,0,0" "units=m"       END       SHAPEPATH   "../data"            OUTPUTFORMAT         NAME png         DRIVER "GD/PNG"         MIMETYPE "image/png"         IMAGEMODE RGB         FORMATOPTION  INTERLACE=OFF         TRANSPARENT OFF       END            # Start of LAYER DEFINITIONS-------------------------------       LAYER         NAME "shape layer"         DATA dourokukan         STATUS DEFAULT         TYPE LINE              CLASS           NAME "“shape class"           STYLE             COLOR 227 227 127           END         END       END        LAYER         NAME "MrSid"         DATA "c:\mrsid\adams\ortho_1-1_1n_s_nd001_2010_1.sid"         STATUS DEFAULT         TRANSPARENCY 100         TYPE RASTER         PROJECTION           "proj=utm" "ellps=GRS80" "datum=NAD83" "zone=13" "units=m"         END         LABELITEM ""         TEMPLATE VOID       END       # End of LAYER DEFINITIONS -------------------------------     END


ArcMap query layer with Oracle Locator displaying no results

I have an Oracle 11g database setup with Oracle Locator. I have created a table with the this query:               CREATE TABLE geotest (id NUMBER(38) NOT NULL, shape SDO_GEOMETRY);      Then I inserted one point with the this query:               INSERT INTO geotest VALUES(1,SDO_GEOMETRY(2001,3395,SDO_POINT_TYPE(-111.949439,40.722283,NULL),NULL,NULL));      The result is no data in the query layer in ArcMap. It allows me to create the layer, and validates. But then it makes me go through the advanced properties which I suspect means it can't see any of the rows to automatically pull the SRID. Any guidance would be appreciated! **Update** : So when I insert the metadata into the table using this:               insert into user_sdo_geom_metadata values ('geotest','shape',sdo_dim_array(sdo_dim_element('X',-180,180,0.005),sdo_dim_element('Y',-180,180,0.005)),4326);      And creating the spatial index, I can see the following point inserted into the database using this query:               insert into geotest values(1,'test',sdo_geometry(2001,4326,sdo_point_type(0,0,0),null,null));      So it would appear that a point with all 0s work, but anything beside that doesn't. I haven't found anything in the documentation that relates to this, or even any users complaining about that. Any either tricks that may be useful? **Update 2** : Alright it appears that after I drop the index, and create it again, the points then show up. I am not an Oracle expert, so this confuses me, anyone have an explanation for this behavior? I thought once an index was created, as soon as a point is inserted, the index updates.


User defined Coordinate Reference System (CRS) in QGIS is not located where expected?

I have received a shapefile with a user defined projection (i.e., +proj=krovak +lat_0=-32.923433 +lon_0=116.47485 +alpha=111.423433 +k=1.00004 +x_0=44328.529781 +y_0=1345943.211845 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs). The site is located in Australia but after automatic re-projection into GDA94 (the default CRS) it places the site in northern China. I have viewed this particular shape file on the client's GIS system (ArcGIS) and it seems to locate fine. Any suggestions as to what I need to do or am I missing something? I have attempted to manually change the CRS (did not work) and I also saved the layer to a new SHP file and manually chose the CRS but this also did not work.


Create filled contour map with GRASS

## Background I'm trying to make contour/isoline/isochrone maps to show what areas are within walking distance to schools for my pet project to help with the Safe Routes to School program. I followed the pgRouting workshop and underdark's posts (all linked to from my project page) to import OpenStreetMap into a PostGIS database, then used the driving_distance() function to create a point layer that had a cost attribute, then ran the contour plugin of Quantum GIS to create contour lines, which I then styled in QGIS to create this image (pardon the spurious lines, not sure where they came from): ![enter image description here](http://i.stack.imgur.com/6uXTU.jpg) ## What I'd like to do **I'd like to replace the QGIS contour plugin and styling feature with GRASS** , as I'd like to create this image dynamically for a web service, and I don't think QGIS is meant for that (at least performance-wise, I think it may be possible with Python). So I'm trying to figure out how to do this same thing with GRASS, which appears to be used quite a bit in web services. From my reading, it appears I'll want to use something like `v.surf.rst`, though that seems like it would generate more of a heat map with a gradient, rather than the type of image shown above with solid colors for each band (in this case each band is 1/4 mile).


ArcGIS 10 creating a shape file from current dataframe extents in layout view

Where is the tool for this? Have looked around and the closet thing i can find is Toolbox's Grid/Strip Map Index tools under Data Drive Pages. I just want to be able to create a **single** polygon rectangle shp file based on the data frame (in layout view) for any given scale / page setup.


Is it possible to realign polylines from KMZ in Google Earth?

I have a street network that has been extracted from AutoCAD DWG's and converted to a KMZ file. The resulting polylines, when launched in Google Earth, do not visually align with the imagery. I am not sure what the source data is, and not really concerned with anything other than realignment (transformation?). I have ArcExplorer but no other GIS at the moment other than AutoCAD and Microstation, which aren't true GIS platforms. Apologies for the rambling, post, thanks.


How to echo gdal process to screen and pipe to text file in Windows?

gdal_warp and similar give a nice progress summary when run and I want this output to show in the osgeo shell and also pipe to a text file. The issue is when I add the pipe the output doesn't show on the screen. How can I do both?               gdal_translate -expand rgba -of GTiff -a_srs EPSG:3857 -co TILED=YES -co BIGTIFF=YES %1 %2\%3\%3_translated.tif > %2\%3\%3_translate_log.txt      puts the output to a text file but then doesn't show the progress on screen. I tried               Echo gdal_translate -expand rgba -of GTiff -a_srs EPSG:3857 -co TILED=YES -co BIGTIFF=YES %1 %2\%3\%3_translated.tif > %2\%3\%3_translate_log.txt      and               Echo.gdal_translate -expand rgba -of GTiff -a_srs EPSG:3857 -co TILED=YES -co BIGTIFF=YES %1 %2\%3\%3_translated.tif > %2\%3\%3_translate_log.txt      but neither works.


Auto-update the map service & REST in ArcGIS server 10.1

I have one map service which is updating per day so I need to manually overwrite the service in ArcGIS 10.1 In previous versions 10.0 its very easy..just update the .mxd then REST will be auto updated.. Is there any way to auto-update the map service & REST in ArcGIS Server 10.1 I tried the ADMIN API but its not proper way..also there is no settings for service definition file in 10.1.. Any help/idea/workflow will be highly appreciated.. thanks in advance : ) **UPDATE:** The problem is resolved by adding arcgis account.


Can markers changes undo through history/revert to original?

I'm a contributor to a food foraging map and found that many markers are in the ocean. I then also noticed that I had an undo at the top of gmaps and realised I'd moved 5 trees trying to get to my area. Is it possible to see marker/map history at maps.google.com? Is it possible to revert markers to original position? I'm completely open to programming this using the api if necessary - surely this information is somewhere...


What projection to use for Google Maps?

I'm loading a WMS layer which comes in WGS84 into Google Maps. From what I've read so far, I should reproject this layer to Google Pseudo Mercator (either 3857/900913). However, when I save the layer in either one of those two projections, it is not displayed in Google Maps, but I can view it in Data Preview of Geoserver. Others with WGS84 are displayed correctly but with a position shift. Do I really need to reproject the layer? I'm not sure whether it is not just a matter of some inaccuracy.


How to debug a QGis python plugin

I'm trying to write a `python` plugin for `QGis`. I'd like to debug some DB queries and I need a way to display the result. I thought about using a popup to display it, but I don't know how to show a **popup** from inside a `python` plugin. Can anyone suggest me how to do that?


Uninstalling ArcGIS10 License Manager?

I recently uninstalled the ArcGIS 10 from my computer, the software got uninstalled , but I am unable to uninstall the License manager. It is giving me an error "you don't have sufficient access to uninstall ArcGIS license manager 10"..and I am logged in as Admin. Due to this problem I am not able to install the ArcGIS 10.1.


Get layers and apply renderer to layer list from SDE ArcMap

I have the code that gets the layers from SDE, but when i add them to the map they have a different symbology. there is about 80 layers and i am accessing the SDE by getting the workspace from a selected layer in the TOC. The symbology renderer layer files are located in a directory. So all i want to do is loop through the directory and get the renderer for each layer in my list. But my code only gets the renderer for 1 file not for all? How can i compare feature class names so it van get the renderer for each layer by using the feature class name?? I appreciate your time and any ideas.               Public Sub AddSDECoverageLayer()               Dim pMxDoc As IMxDocument     Dim pMap As IMap               Set pMxDoc = ThisDocument                Dim intX As Integer          'Add each FeatureLayer to the map document     'This should assign layer names to the layer it gets from SDE     'But it only gives the first layer in the list a layer name.      'There is about 80 layers so cant do if statement 80 time     'What other way can i do this??           For intX = 0 To ListBox2.ListCount - 1                      Dim xsClass As String            xsClass = ListBox2.List(intX)            Dim xs As String            If xsClass = "PROPERTY_ADMIN.topo_ownership" Then            xs = "MM Ownership"            End If            If xs = "PROPERTY_ADMIN.MM_Rights_of_Way" Then            xs = "Rights of way"            End If                     Dim pFLayerXS As IFeatureLayer                Set pFLayerXS = importData(pFWorkspace, xsClass, xs)                pMxDoc.FocusMap.AddLayer pFLayerXS                pMxDoc.ActiveView.Refresh           pMxDoc.UpdateContents                    Next               End Sub      ## ---------------------------------------------------------------------------               Public Function importData(pWorkspace As IWorkspace, FClass As String, fcName As      String) As IFeatureLayer          'Function to create Feature layer from Feature class     Dim pFeatureWorkspace As IFeatureWorkspace     Dim pFClass As IFeatureClass     Dim pUnknown As IUnknown     Dim pMxDoc As IMxDocument     Dim pFeatureLayer As IFeatureLayer     Dim pDataSet As IDataset     Dim pFLayer As IFeatureLayer                     ' Get the selected layer     Set pMxDoc = ThisDocument     Set pUnknown = pMxDoc.SelectedLayer 'pMxDoc.FocusMap.Layer(0)      If Not TypeOf pUnknown Is IFeatureLayer Then      Exit Function     End If     Set pFLayer = pUnknown               ' Make sure the layer is from SDE and get the parent workspace     Set pDataSet = pFLayer.FeatureClass          Set pFWorkspace = pDataSet.workspace     Set pWorkspace = pFWorkspace     If Not pWorkspace.Type = esriRemoteDatabaseWorkspace Then     MsgBox "Not an SDE feature class"     Exit Function     End If     Set pDataSet = pWorkspace               Set pFeatureWorkspace = pWorkspace     Dim intY As Integer     For intY = 0 To ListBox2.ListCount - 1     Set pFClass = pFeatureWorkspace.OpenFeatureClass _       (ListBox2.List(intY))       Next                    Set pFLayer = New FeatureLayer     Set pFLayer.FeatureClass = pFClass          Dim pGFLayer As IGeoFeatureLayer     Set pGFLayer = pFLayer               Dim intz As Integer     For intz = 0 To ListBox2.ListCount - 1          'This gets the renderer but only for one layer,      'How can i make it get the renderer for all the layers in the list.     'There is 80 layers, in a directory. i just need to assign the renderer     'from this directoryto eac item in the list box          If ListBox2.List(intz) = "PROPERTY_ADMIN.topo_ownership" Then       Set pGFLayer.Renderer = GetRenderer("V:\Arc\Layers\MM Ownership.lyr")            End If       If ListBox2.List(intz) = "PROPERTY_ADMIN.MM_Rights_of_Way" Then       Set pGFLayer.Renderer = GetRenderer("V:\Arc\Layers\MM Rights of Way.lyr")     End If       Next                pFLayer.Name = fcName          Set importData = pFLayer          Exit Function          End Function


WMSgetFeatureInfo problem

I want to get attributes of feature using getFeatureInfo:               if(sss==null){        if (sld==null){          sld= new OpenLayers.Control.WMSGetFeatureInfo({         url: 'http://localhost:8080/geoserver/wms',          title: 'Identify',         layers: myLayer,         queryVisible: true          });        app.mapPanel.map.addControl(sld);        sss=app.mapPanel.map.getControlsBy('title', 'Identify');     }                                        }     for(var i=0;i<sss.length;i++){     alert("BROMACIA");      sss[i].activate();     }     sss[0].events.register("getfeatureinfo", app.mapPanel.map, function showInfo(evt) {     alert(evt.text)});      And nothing heppens.   When i try to do in firebug:               >>> sss[0].events.register("getfeatureinfo", app.mapPanel.map, function showInfo(evt) { alert(evt.text)});      firebug says `undifined`. Whats wrong?


Looking for bathymetry data for Lake Sakakawea in North Dakota

Navionics has a nice web map that has some incomplete coverage of Lake Sakakawea. Garmin's BlueChart looks to have something for about $160, but appears to be only compatible with GPS units. Don't need the entire lake just a few areas of it. Would like the data to be ArcGIS compatible. I have attempted to do raster to vector in ArcGIS taking screen shots of Navionics web map but haven't had much success. Any ideas / help would be most appreciated.


Slow performance on splitting a shapefile by attributes

I've tried to develop some workflows with the ArcPy module for splitting a shapefile based on the unique values in a specified field. The code works as expected except one thing I am not able to figure out.               import arcpy, os     from arcpy import env          #getting user inputs     in_fc = arcpy.GetParameterAsText(0) #'roads.shp'     outfolder = arcpy.GetParameterAsText(1) #r'C:\GIS\Temp\OutSHP'     fieldname = arcpy.GetParameterAsText(2) #"FEATURE"     createfolder = arcpy.GetParameterAsText(3) #true/false     env.workspace = outfolder          #user chosen NOT to create a folder with the name of feature class     #     if createfolder == "false":              with arcpy.da.SearchCursor(in_fc, ["{0}".format(fieldname)]) as cursor: #defining a search cursor             for row in cursor:                      if not arcpy.Exists(os.path.join(outfolder,row[0])): #checking if shapefile already exists                     #Analysis toolbox > Extract > Select GP tool to select features                     arcpy.Select_analysis(in_fc, os.path.join(outfolder,row[0]), ''' "FEATURE" = '{0}' '''.format(row[0]))                 else:                         print "The shapefile with this name already exists"               #user chosen to create a folder with the name of feature class     #     else:             with arcpy.da.SearchCursor(in_fc, ["{0}".format(fieldname)]) as cursor: #defining a search cursor             for row in cursor:                 directory = os.path.join(outfolder,row[0]) #create a path for directory that will be created                 if not os.path.exists(directory): #checking if directory exists                     os.makedirs(directory)                          if not arcpy.Exists(os.path.join(directory,row[0])): #checking if shapefile already exists                     #Analysis toolbox > Extract > Select GP tool to select features                         arcpy.Select_analysis(in_fc, os.path.join(directory, row[0]), ''' "FEATURE" = '{0}' '''.format(row[0]))                     else:                         print "The shapefile with this name already exists"      I've created a script tool in ArcGIS which takes an input shapefile, an output folder, a field name and whether user wants to create a folder for each unique value in the specified field before creating a shapefile there (the folder and the shapefile will have identical name except .shp in the end for shapefiles). The issue is that the tool gets the work done for 5 seconds when user chooses to create folder with the unique name for each feature class and for around 3 _minutes_ if the shapefiles are created directly in the output folder. I am having hard times trying to find out anything that could stipulate this behaviour in the code.


QGIS field calculator and Postgres permissions

I’ve given user x the following               GRANT ALL ON ALL TABLES IN SCHEMA y TO x;     GRANT ALL ON ALL SEQUENCES IN SCHEMA y TO x;     GRANT ALL ON ALL FUNCTIONS IN SCHEMA y TO x;      However in QGIS they dont have access to check/tick the 'update existing field' button. They can chose a field to update and write an expression for its update e.g $area but the OK button remains greyed out. If I as administrator load the layer, the check/tick box appears and I can write and run expressions. I'm sure its a permissions thing in PostGIS. Si ![update exisiting field](http://i.stack.imgur.com/QwRjJ.png)


Check if a land parcel (polygon) has access on a road or not

I have a feature layer with land parcels as polygons. Polygons (land parcels) are either adjacent in all its around sides by other polygons but some of them have a road a which is not actually a feature layer representing roads but is just an empty space between parcels. In this case, parcels have access to roads. The question is how can I automattically check if a polygon has access onto a road using VBA and AcrObjects. Thanks Deme


How to import ECW into my postgis database with raster2pgsql (windows)

I'm working on windows 7 64 bits, postgis 2.01. I have to import ECW files into my postgis database. Unfortunatly, my postgis seems to has been compiled without gdal ecw support.When i do a raster2pgsql -G, ECW does not appears. I have tried to follow instructions erected in this following post :   How to add ECW support to GDAL bundled with PostGIS Windows So I paste the raster2pgsql.exe into my C:\Program Files\PostgreSQL\9.1\gdal- data folder. And i paste gdal19.dll from C:\Program Files (x86)\Quantum GIS Lisboa\bin toward C:\Program Files\PostgreSQL\9.1\bin. I rename the dll like libgdal-1.dll. But it does not work and i can't import ecw with raster2pgsql.I have an error message saying : application error.For information/. Moreover, when i do a SELECT postgis_full_version(); "POSTGIS="2.0.1 r9979" GEOS="3.3.5-CAPI-1.7.5" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.9.1, released 2012/05/15" And my qgis 's gdal has been also compiled with gdal 1.9.1. Moreover, for information, my GDAL_DATA (environment system variable) pointed to C:\Program Files\PostgreSQL\9.1\gdal-data Have you got any idea? How to use ECW with postgis? I have to use this ECW format. My client give to me data with this format and i did not convert raw data in ECW with a proprietary software.. Thank you!


How to print a WMS map with chosen scale and WMS zoom level?

I am trying to print a WMS map in QGIS. If, while in the print composer, I chose a "25000" scale, the composer chooses a WMS layer that actually shows a 1:50000 map. To get down deep at the 1:25000 WMS map in the print composer preview, I have to trick it by telling the composer to use a smaller scale, but then I don't get the scale I want. How does QGIS chose its WMS zoom level? I need to chose a scale AND a specific WMS zoom level. I tried the "Lock layers for map item" check box but it is not what I hoped for. Is there a way to accomplish this or is this feature missing? Any other open source alternative to get the same result would be fine if QGIS is not able to do that. Thank you very much.


How do you store brief cartographical tips, information, possible future designs that you find?

I find inspiring maps and/or brief, 1-line design tips (i.e. "when satellite image is used as a basemap, I like to desaturate the tarnation out of it" that I may want to consider later using in a project or as inspiration as a design for a future map, from a variety of sources (blogs, tweets, forums, here) during my daily internet browsing and online interaction. I'm curious to hear how each of you, especially cartographers and others specializing in map design store all of this information ? Right now, I store these bits of information across the sources that I find it on: favorited tweets, bookmarks in my browser (do you use tags ?), pinboard, favorited gis.se questions, and a text file (with the tidbit of information and the URL of where I found it). I occasionally notice that I ended up bookmarking it in a different place, or not knowing that I had that information already saved somewhere until after I needed it. Where do you find it efficient to store these tips ? Do you only look at these saved tips when you're looking for something specific or is it beneficial to occasionally review them without a specific goal in mind ?


QGIS 2.2 Crash dumped on Windows 8.1

After I installed QGIS 2.2 via OSGeo4W, as I click the icon of QGIS, then it shows this up, ![enter image description here](http://i.stack.imgur.com/hijmL.png) so I can't open QGIS 2.2 Here's some look like troublesome lines in my installation log,               2014/03/23 13:42:15 io_stream_cygfile: fopen(/etc/setup/setup.rc) failed 2 No such     file or directory     2014/03/23 13:42:15 Current Directory: C:\Users\Heinz\Installation files     2014/03/23 13:42:15 Root Directory: C:\OSGeo4W64     2014/03/23 13:42:15 Could not open service McShield for query, start and stop. McAfee may not be installed, or we don't have access.     2014/03/23 13:42:17 root: C:\OSGeo4W64     2014/03/23 13:42:17 Selected local directory: C:\Users\Heinz\Installation files     2014/03/23 13:42:17 Menu name: OSGeo4W     2014/03/23 13:42:17 net: Direct     2014/03/23 13:42:19 site: http://download.osgeo.org/osgeo4w/     2014/03/23 13:42:19 mbox note: Unable to get setup.ini from <http://download.osgeo.org/osgeo4w/>     2014/03/23 13:43:00 site: http://download.osgeo.org/osgeo4w/     2014/03/23 13:43:00 io_stream_cygfile: fopen(/etc/setup/installed.db) failed 2 No such file or directory     2014/03/23 13:43:01 io_stream_cygfile: fopen(/etc/setup/timestamp) failed 2 No such file or directory      How to fix this problem？ I am working under Windows 8.1 64-bit * * * **Update#1** I follow the suggestion of the answer in the post, How to debug QGIS installation problems on XP?, download Microsoft Visual C++ 2010 Redistributable and then install qgis 2.2 using OSGeo4W package, and here's the same part of the installation log,               2014/03/23 16:17:39 io_stream_cygfile: fopen(/etc/setup/setup.rc) failed 2 No such file or directory     2014/03/23 16:17:39 Current Directory: C:\Users\Heinz\Installation files     2014/03/23 16:17:39 Root Directory: C:\OSGeo4W64     2014/03/23 16:17:39 Could not open service McShield for query, start and stop. McAfee may not be installed, or we don't have access.     2014/03/23 16:17:40 root: C:\OSGeo4W64     2014/03/23 16:17:40 Selected local directory: C:\Users\Heinz\Installation files     2014/03/23 16:17:40 Menu name: OSGeo4W     2014/03/23 16:17:40 net: Direct     2014/03/23 16:17:43 site: http://download.osgeo.org/osgeo4w/     2014/03/23 16:17:43 io_stream_cygfile: fopen(/etc/setup/installed.db) failed 2 No such file or directory     2014/03/23 16:17:43 io_stream_cygfile: fopen(/etc/setup/timestamp) failed 2 No such file or directory      I can successfully launch Qgis browser, but I still have the same dumped message that I can't launch qgis desktop. * * * **Update#2** I have uninstalled the 64-bit version and installed the 32-bit OSGeo4W package. I have checked the installation log, just like the one I post in **Update#1** , and the rest part of it is fine. I still got the same error message, but unlike the 64-bit version message, the same mbox would appear after I click the confirm button, this time I just have to click **confirm** in the mbox one time. And I can still launch qgis browser. **Are there someone successfully launching qgis 2.2 on windows 8.1 x64 computer？**


How to create multi-ring buffers automatically in QGIS?

I'm wondering if anyone knows of a tool or plugin for QGIS that allows for multi-ring buffers. I've found a post about doing multiple buffers one by one, but was hoping there was a way to do this all in one place. I know in ArcMap that you can set the number of buffers you want and distance, so just hoping there's something out there in QGIS to accomplish this.


How do I change the ArcGIS Server Web Adaptor name?

If I decide I want to change the Web Adaptor name, is it as simple as going to the Web Adapter tab in the Server Manager and clicking unregister? And then would I just rerun the Web Adaptor install and choose a different name? Or what is the proper way of changing Web Adaptor names? Thanks.


Draw polygon shape via Qbutton

Ideally; a Ui Qbutton is needed that will activate map canvas editing to add a polygon via the classic mouse click rubber band method. Upon a concluding right click with the active tool, editing would be closed and the feature would be added to a designated layer. Novice python skills amplify my want to just 'drag and drop' the "Add Feature" resource from the tool bar into the developing plugin Ui (unfortunately not so easy). I'm wondering if there is a (relatively) simple means of connecting to existing code via imports for enabling use into a new plugin? Thanks for considering. [I hope to implement this tool connection and user QLineEdits from the Ui into " _create polygon reference, add feature polygon_ " sections of code in the following posting: Blank Shapefile Output : Solved!]


Styling based on hex color codes within table?

I have a table of polygons named 'testtable'. Within it is a column 'color', which has hex codes. I want to style the polygons based on the hexcode values.. is this possible? I was trying something like this, but it's obviously not working.. # testtable{ polygon-fill: {color}; } Thx,


Errors while running Region Group tool

I am getting an error while using Region Group on a large dataset. The errors are specified below: > ERROR 999999: Error executing function.   >  The table was not found. [VAT_final002]   >  A column was specified that does not exist.   >  A column was specified that does not exist.   >  ERROR 010005: Unable to allocate memory.   >  ERROR 010067: Error in executing grid expression.   >  Failed to execute (RegionGroup).   > I am currently running ArcGIS 10.1. I have 4 GB of total RAM. The raster I'm processing has 154242 columns and 97288 rows with 30x30 cell size (approximately 500 MB file size). All values = 1 or "nodata". Does anyone have a solution to this other than having to process in small sections?


Changing symbology/color in kml when exported from arcGIS/QGIS

I have marked some points and used symbology in ArcGIS/QGIS... when I export the file to kml, the color/symbology changes and only single color/symbol remains. Is there any possible way that the symbol/color that I use in Arc or qgis may retain in kml as well... NO KNOWLEDGE OF PROGRAMMING... :( any tool or software (easy) will be a great help... regards,


Spatial Join Python Command to summarize attributes

I am trying to run the Spatial Join function through the python shell in ArcGIS 10. When you do the point-and-click method of spatial join, you are given a tool window with an option that asks "How do you want the attributes to be summarized?" However, the python syntax doesn't show a parameter for this option. How do I control the attribute summarization through python? Why is there no parameter for this? Any suggestions are much appreciated, thanks, mike


How to copy a feature class within the same GDB

I'm trying to copy/clone a feature class within the same file gdb using C#. I've figured out that this won't work with IDataset or IFeatureDataset. So far I only found IGeoDBDataTransfer.Transfer but this is for copying between different workspaces. Copying and pasting geodatabase datasets ArcObjects 10.1 I know I could do the whole things with a featureBuffer, but that's a very long winded way. And I don't want to use geoprocessing like CopyFeatures. Yeah, I know I'm fussy ;-) If any of you got an idea how to get round this I would very much appreciate it! Many Thanks in advance!


Postgis 2.1 error after update

After a usual update progress - "apt-get upgrade" - I can not connect with qGIS to my PostGIS DB anymore. Error in the qGIS logfile:               Your database has no working PostGIS support.      Erroneous query: SELECT postgis_version() returned 7 [ERROR:  could not load library "/usr/lib/postgresql/9.3/lib/postgis-2.1.so": liblwgeom-2.1.2.so: cannot open shared object file: No such file or directory]     Retrieval of postgis version failed      After asking for my version using `SELECT PostGIS_full_version();` This occured:               ERROR:  could not load library "/usr/lib/postgresql/9.3/lib/postgis-2.1.so": liblwgeom-2.1.2.so: cannot open shared object file: No such file or directory      CONTEXT:  SQL statement "SELECT postgis_lib_version()"      PL/pgSQL function postgis_full_version() line 19 at SQL statement      How can I fix that? Thats my environment: xUbuntu 14.04, PostgreSQL 9.3, Postgis 2.1, QGIS 2.3,


Does Shooting star 1.05 not consider reverse_cost?

> **Possible Duplicate:**   >  PGRouting with 1.05 library in Postgres 9.1 Shooting star pgrouting lib 1.05 with postgres 9.1. Dijkstra and A-star working fine but "SHOOTING STAR" not considering "reverse_cost". Also if i try long route then it gives server disconnected error. Please help


Problem with showing Shape file in Geoserver

I have a number of Shape files from a customer. I can read them with both ogrinfo and QGIS. They don't have a prj-file, but I know that the projection is EPSG:3006. When I add them as layers in Geoserver, I declare the projection to be EPSG:3006 in the box "Declared SRS" by inputing "EPSG:3006". I set "SRS Handling" to be "Force declared". (It makes no difference if I add a .prj-file with a projection definition.) I can then calculate the bounds successfully. When I try to preview the layer in Openlayers, I get an empty map. When I try to load the layer as WFS, I get an empty result. There are no error messages in the logs as far as I can see. I have tried to change the log level. If I run ogr2ogr and save them as new shape files, they work in Geoserver. If I export them to a new shape file from QGIS, they work in Geoserver. Is there a way I can use ogr or QGIS to show my customer what the problem is?


Distance between DB field and Point using PostGIS

I'm using Postgresql 9.0 with PostGIS 2.0 extension. I've got the table and geographic field `location`:               =# SELECT * FROM geography_columns;      f_table_catalog | f_table_schema |   f_table_name   | f_geography_column | coord_dimension | srid | type       -----------------+----------------+------------------+--------------------+-----------------+------+-------               _dev   | public         |          objects | location           |               2 | 4326 | Point               =# \d objects                                            Table "public.objects"          Column     |            Type             |                           Modifiers                                ----------------+-----------------------------+---------------------------------------------------------------      ...      location       | geography(Point,4326)       |       And have got records with coordinates:               =# SELECT ST_X(location::geometry), ST_Y(location::geometry) FROM objects;       st_x  | st_y       --------+-------             |            -73.01 | 15.01      -73.02 | 15.02      -73.03 | 15.03     (4 rows)      I want to grab records within distance in meters from Point(-70 15). I've calculated this distances to each point (just for know it):               =# SELECT ST_Distance(ST_GeographyFromText('SRID=4326;POINT(-70 15)'), ST_GeographyFromText('SRID=4326;POINT(-70.01 15.01)'));        st_distance         ------------------      1543.03968305103     (1 row)          =# SELECT ST_Distance(ST_GeographyFromText('SRID=4326;POINT(-70 15)'), ST_GeographyFromText('SRID=4326;POINT(-70.02 15.02)'));        st_distance         ------------------      3086.04520065436     (1 row)          =# SELECT ST_Distance(ST_GeographyFromText('SRID=4326;POINT(-70 15)'), ST_GeographyFromText('SRID=4326;POINT(-70.03 15.03)'));       st_distance        ----------------      4629.016529543      Now I see the closest point in 1543 meters and farthest point in 4629 meters. I've used very similar query to example from here: > Query and measurement functions use units of meters. So distance parameters > should be expressed in meters, and return values should be expected in > meters (or square meters for areas). >   >   >     -- Show a distance query and note, London is outside the 1000km > tolerance >       SELECT name FROM global_points WHERE ST_DWithin(location, > ST_GeographyFromText('SRID=4326;POINT(-110 29)'), 1000000); >                 =# SELECT location FROM objects WHERE ST_DWithin(location, ST_GeographyFromText('SRID=4326;POINT(-70 15)'), 5000);      location      ----------     (0 rows)      and I didn't get locations within 5000 meters. More than that I cannot calculate distances in meters from location to Point:               =# SELECT ST_Distance(location, ST_GeographyFromText('SRID=4326;POINT(-70 15)')) FROM objects;        st_distance         ------------------           323718.841976209      324792.390871594      325869.606072403     (4 rows)      There numbers are a lot bigger than numbers from distance in Point to Point example. I'm guessing something wrong with my column because I cannot even grab points with same coordinates:               =# SELECT location FROM objects WHERE ST_DWithin(location, ST_GeographyFromText('SRID=4326;POINT(-70.01 15.01)'), 5000);      location      ----------     (0 rows)


Multipoint routing logistics software solution?

I work for a state health program and am looking for the most efficient way to route inspectors from restaurant to restaurant. This is something like the travelling salesman problem, but with additional complexities. We have 75 inspectors, making less than 8 hour round trips from 17 different offices, inspecting ~18,000 businesses at 1.25 hours an inspection (not counting travel time). These businesses either need inspected annually, 3 times a year, or 5 times a year depending on their assigned risk level. Does anyone have any ideas/suggestions for this? I am talking to Telogis and Viamente as far as getting quotes for using their products but am interested in looking into all avenues. It's possible this is not on the right Stackexchange, if you know of a more appropriate venue I'd appreciate knowing that as well.


How to generalize a polygon file and maintain topology in QGIS?

my problem: I have a polygon-file in shape-format, which I need to generalize. How can "split" the polygons into lines, generalize and than "rebuild" the polygons, so that I can ensure, that there are no topological errors like "slivers". Please give a rookie some adive howto do this in quantumgis. Thank you very much Ps: I already tried: Vector -> Geometry Tools -> polygones to lines Vector -> Geometry Tools -> simplfy geometries here I can already see on the screen, that I am producing overlaps and gaps nevertheless now I try Vector -> Geometry Tools -> lines to polgones and here the program show an error and crahes ![enter image description here](http://i.stack.imgur.com/i6Wov.png)


Trying to convert to EPSG:27700 (Ordnance Survey) projection, unable to do so

I'm trying to code an interface that allows a user to draw a vector shape on openstreetmap, which is then converted to a WKT string, processed by the server and sent of as a WFS query to emapsite (which provide the Ordnance Survey data, including a veru detailed vector layer of the UK). However the issue I'm having is that when I draw a polygon around all of the UK (which should obviously return data), I'm not getting data returned (as in the server says there are no vectors there). However when I draw a polygon in the south- west corner of Africa (just off the coast of Nigeria), I'm getting a huge amount of data returned. Ordnance Survey uses EPSG:27700 (OSM uses EPSG:90013), which I don't really understand, but I imagine that I'm not doing projection conversions that are necessary. code below: http://pastebin.com/wi4CUAmc


WMS blank map returned

I am facing this problem 3th day and I really don't know where is the problem, so please help me. Here is my REQUEST: http://geoportal.cuzk.cz/WMS_SM5V_PUB/service.svc/get?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&LAYERS=SM_STP_HRBITOV&STYLES=&CRS=EPSG%3A102067&BBOX=-895000,-865000,-623000,-620000&WIDTH=1600&HEIGHT=610&FORMAT=image/png& Here is Capabilities file: http://geoportal.cuzk.cz/WMS_SM5V_PUB/WMService.aspx?service=WMS&request=getCapabilities Can somebody please explain me why blank map is returned? Thank you


Obtaining *rendered* OSM data

I'd like to produce a simple walking map with some points of interest. Ideally, I'd like to use the rendered OSM data, as you can get from the page. Using the QGIS OSM plugin, I can only download a fraction of my area, and it is tricky to download a few PNGs at a high enough zoom level and stitch them together from OSM's "Export" tool. I only need to do this a few times, so I don't really see much point in downloading all the XML/Shapefile data, and re- rendering with Mapnik. Is there an easy way of getting hold of the already- rendered raster data fro a given region at a given zoom level in a format that I can easily use with QGIS/GDAL/OGR?


How to get the data type of each column from a postgis table

I need to get the column data types of all columns in a table, including the geometry types. What I wanted to know is if there is a function or SQL that gives something like this:               column_name | data_type     ------------+--------------     gid         | integer     descr       | character varying(32)     class       | character varying(10)     area        | double precision     geom        | geometry(Polygon,3763)      From a few answers on stackexchange and gis.stackexchange I know that I can get some of the information with the following query:               SELECT          g.column_name,         g.data_type,         g.character_maximum_length,         g.udt_name,         f.type,         f.srid     FROM           information_schema.columns as g JOIN          geometry_columns AS f               ON (g.table_schema = f.f_table_schema and g.table_name = f.f_table_name )     WHERE         table_schema = 'my_schema_name' and         table_name = 'my_table_name'      Result:               column_name | data_type         | character_maximum_length | udt_name | type    | srid     ------------+-------------------+--------------------------+----------+---------+------     gid         | integer           |                          |          |         |     descr       | character varying | 32                       |          |         |     class       | character varying | 10                       |          |         |     area        | double precision  |                          |     geom        | USER-DEFINED      |                          | geometry | Polygon | 3763      But, is there a proper more practical way to retrieve the information in the format I need? Or must I enter the "world" of `CASE WHEN` structures and string concatenation to gather all column attributes in one single column in that format? My fear is if a non expected data type surprises me by needing other attribute from the information_schema.columns table. I.e, in the example table before, I did not used any `numeric (15,2)` data type, that would need to use another attributes (numeric_precision and numeric_scale) to be parsed by a CASE WHEN.


How to get ArcMap reference without launching the application

I need to get hold of ArcMap properties in order to change the data source of the layers within it. I have developed a similar utility earlier utilizing ICommand, but I was curious if I could get a reference to ArcMap application outside of it and change the layer sources and display the new map. I am using the following code but it instantly launches ArcMap and after that I have no hold on the application i.e. if I terminate my application, ArcMap is still running in background. Is it possible to get a silent, invisible reference to ArcMap? Thanks in advance!               IApplication pApp;     IDocument pDoc;     IMxDocument pMxDoc;     string MXDPath = "C:\\NORMALTEMPLATE\\OLD_Normal.mxd";          pDoc = new MxDocumentClass(); //ArcMap launches here     pApp = pDoc.Parent;          pApp.OpenDocument(MXDPath);     MessageBox.Show("Doc opened");


How do you Select an existing vector Layer and Edit it, using python?

I'm developing a small plugin that needs to be able to select a vector layer programatically based on what layer the user has selected. However I'm not sure how to do so. I believe I found the two elements I need to make it work: setCurrentLayer and selectedLayer from the QgisLegendInterface, but I'm not certain how they work or how they are implemented, I cannot either find any examples of them other than in the API. Am I close? Or is there a better/proper form of doing this?


Select by attribute

In my shapefile, I have a bunch of features and one field is a integer numerical attribute. I'd like to select all of the features whose value is a multiple of another value. For instance, I have a field with typical values of 100, 101, 102, 103, 104, 105, 106, etc. (up to 1000) and I would like to select all features with a value that is a multiple of 5.


Mapserver: labels and tiles

I'm developing map with Mapserver to be rendered in tiles and testing output with Ka-map. Most of the time labels split on two tiles are matching, but sometimes they're not.   I configured Ka-Map like               $tileWidth = 256;     $tileHeight =256;     $metaWidth = 4;     $metaHeight = 4;     /* $metaBuffer = Buffer size in pixels to add around metatiles to avoid      * rendering issues along the edge of the map image      */     $metaBuffer = 256;      but even large buffer of 256 pixels doesn't protect label from occasional splitting.   What good practices do exist to make sure labels are placed deterministically?


'Exceptions.NameError' > "Name 'sheet_count' is not defined" Error in Python Code

I know this is something simple but for some reason I am having trouble remembering. In my code I am getting a name is not define for sheet_count. This means I would have to define at top correct. For Example: Is it sheet_count = true? My code is below:               import arcpy, os, sys, string     from os import path as p     from arcpy import mapping as m          #Make parameters for people to choose mxd and folder of PDFs to compare          mxdList = string.split(arcpy.GetParameterAsText(0), ";")     pdf_path = arcpy.GetParameterAsText(1)          #Use Search Cursor to go through Attribuite Table to get Sheet number info          for mapDoc in mxdList:         arcpy.AddMessage(mapDoc)         mxd = arcpy.mapping.MapDocument(mapDoc)         for lyr in m.ListLayers(mxd, "*, Grid"):             if lyr.description == "*, Grid":                 max_list = []                 rows = arcpy.SearchCursor(lyr)                 for row in rows:                     max_list.append(row.Sheet_ID)                 sheet_count = max(max_list)                 arcpy.AddMessage('Sheet count: %s'%sheet_count)                 print 'Sheet count: %s'%sheet_count             else:                 arcpy.AddError('No Layers in %s match data source'%mapDoc)


How do I find the points of intersection between a small circle and a great circle?

I only actually need to intersect a great circle _arc_ i.e. the shortest path between two points, with a given small circle. I found this tutorial for intersecting two great circle arcs, but unfortunately it doesn't cover small circles.


How to pass a layer to a thread in PyQGIS?

In my plugin, a user can select one of the loaded layers from a combobox, and then proceed to do further calculations. These calculations are done in a separate thread, "WorkerThread". My question is that how can I pass the selected layer to my thread? Since this layer is variable and is based on the selected layer in combobox, I'm not able to initialize it like this:               def initGui(self):         ...         self.dlg.ui.find_cc_Button.clicked.connect(lambda: self.find_cc(layer)) # won't work, since layer is selected during "run".      "run" segment of my code, where user selects the layer from combobox is this:               def run(self):         # show the dialog         self.dlg.show()         self.dlg.ui.progress_bar.setValue(0)         self.dlg.ui.progressBar.setValue(0)         self.dlg.ui.layerCombo.clear()         self.dlg.ui.lts_combo.clear()              layers = QgsMapLayerRegistry.instance().mapLayers().values()         for layer in layers:             if layer.type() == QgsMapLayer.VectorLayer and layer.geometryType() == QGis.Line:                 self.dlg.ui.layerCombo.addItem( layer.name(), layer )       And the thread is:               def find_cc(self,layer):              self.WorkerThread.start() # I want to pass the layer to this thread          class WorkerThread(QThread):     """docstring for WorkerThread"""     def __init__(self):         super(WorkerThread, self).__init__()         # self.arg = arg          def make_column(self,layer,name):         index = layer.fieldNameIndex(str(name))         if index == -1: # field doesn't exist             caps = layer.dataProvider().capabilities()             if caps & QgsVectorDataProvider.AddAttributes:               res = layer.dataProvider().addAttributes( [ QgsField(str(name), \                 QVariant.Int) ] )             layer.updateFields()             return 0  # so I know if the column already existed or did I create it for the first time         return 1               def run(): #does the job         self.find_connected_components(layer)


Creating separate Polylines from Points using ModelBuilder and Python Script Tool?

I have a list of coordinate points (long and lat) of 4 locations (points 0, 1, 2, 3) saved as a feature class shapefile. I want to create a polyline that will connect points 0 and 3 and create a second polyline that will connect points 1 and 2. I've found several example scripts for creating points to polylines, but none that split them. Does anyone have any ideas that might work?


Google Map API 3 with OSM overlay

I'm using GeoXml3 to parse XML files in Google Map and would like to add OSM as custom maptype. I fiddled with this example but it hides completely the original Google layers. I've found a couple of other examples but unfortunately all of them are using the V2 API.


What are the pros and cons of using the ArcGIS Viewer for Flex vs. creating your own GIS application vs creating your own framework?

Simple question, but perhaps hard to answer. I have broken the title question into three distinct questions in order to clearly identify what we are considering for options each time we build an GIS web application in Flex.   1. What are the pros and cons of using the ArcGIS Viewer for Flex application as a starting point for GIS applications?    2. What are the pros and cons of creating your own application from scratch using the ArcGIS API for Flex? Note: This would be a focused application. In this case it is not intended to be a reusable application from which other applications could be configured / built.   3. What are the pros and cons of creating your own custom framework using the ArcGIS API for Flex from which multiple applications could be built? While the primary goal would be to build an application that meets the customers needs a secondary goal would be to have a reusable framework from which other applications can be configured / built, much like the Flex Viewer. Unlike many other decisions the choice to use one method over the other is not an easily reversible one. Assume you will have to live with this decision for a very long time (years).


ArcGIS Server 10.1 Integrated Windows Authentication with Token based

In ArcGIS Server 10.1 on Windows 7 and IIS, if wanting to secure services within an Intranet with Active Directory is that Integrated Windows Authentication http://resources.arcgis.com/en/help/main/10.1/index.html#//015400000517000000 ? If using Integrated Windows Authentication, does that dictate that web applications wanting to consume the services re-code their app if they do token based access? I'm involved with setting up AGS 10.1 and configuring and will have numerous 3rd party web app/desktop apps wanting to consume services. Base question is once configured are we setting the policy that any app that want gis services have to do it one way or the other?


how to find the point in a country furthest from a boundary

i'm trying to find the point in south africa furthest from the sea or a landward boundary. my method thus far:   1. i obtained a first guess at the centre of the inscribed circle and the three segments of boundary this circle might touch using a compass and 1:2 500 000 map.    2. i then clipped these three segments of boundary from a data set of boundary coordinates supplied by national geo-spatial information (WGS84; decimal degrees; 9 decimal places; roughly one point for every 40 metres of boundary).   3. i converted the boundary coordinates to radians and used cartesian equations (distance between two points and centre of a circle through three points) to iteratively improve the centre of my circle and the three boundary points it touches. (obviously, i'm ignoring curvature; i'm effectively finding the centre of the base of the spherical cap defined by the inscribed circle -- i.e. a point approximately 16km underground.) my questions:   1. is it reasonable to plug lat-long coordinates expressed in radians into cartesian equations to find the centre of the base of the spherical cap defined by the inscribed circle (given that the surface distance represented by one radian varies with latitude, and that the base of the spherical cap in question is roughly 800km in diameter and spans latitude 30S)? what order of error might be involved here?   2. is it reasonable to assume that the three boundary points tangential to the base of the spherical cap will likewise be the three boundary points closest to the actual point in the country furthest from a boundary?   3. i have the feeling i'm not even asking the right questions here. i guess there must be a better way to find the point in a country furthest from a boundary ... cheers, william


Is pre-1990 historical block-level census data available online?

I'm looking for historical block-level data for Chicago. According to this Census bureau document, historical block-level census data exists for major cities going back to 1960, and even back to 1940 (though only for housing statistics.) Only 1990 - 2010 is available on the census website. Do digital copies of historical census block boundaries and stats exist? Are they available anywhere? If not, where are the analogue versions of this data stored? And what is the most granular level of historical census data that is available digitally?


Help identifying a coordinate system

I have some "latitude" and "longitude" data that describes the Silverstone motor racing circuit in the UK. The coordinates look something like this:               latitude     longitude     +03124.27986 +00061.07652     +03124.27902 +00061.06950      +03124.27866 +00061.06632      +03124.27734 +00061.05942      +03124.27722 +00061.05852      +03124.27710 +00061.05780      These are clearly not "real" degrees & minutes latitudes and longitudes, since the latitudes aren't even valid, and the longitudes are clearly wrong for a place in the UK. Any help in identifying the coordinate system used here would be much appreciated! EDIT: Another set of coordinates in the same format, for a Singapore racetrack looks like               latitude     longitude     +00077.47468 -06231.29347      +00077.47699 -06231.29440      +00077.47890 -06231.29519      +00077.47957 -06231.29553      +00077.47959 -06231.29644


Hölzel projection - prj.file

Is there a prj-file-defintion available for the Hölzel-projection? (http://dl.maptools.org/dl/libproj4/manual.pdf#page=58, page 58)?


gdaltindex Limitations

I was wondering if there is a size, or count limitation with gdaltindex. I ran the operation from within OSGeo4W via a Python script, and from within QGIS 2.2 (Windows) and had issues processing a directory with 880 GeoTiffs. The file size of the tiffs are ~ 205MB each. However, when I processed a sub- sample (four tiffs) the operation ran perfect, from within QGIS and OSGeo4W. Any help would be appreciated.


Displaying only points within a polygon I created in QGIS?

Thank you in advance for any advice you might give me. I am new to qgis and believe what I'm asking is probably fairly basic. I am trying to map policing activity in NYC for two areas: one area in the Bronx and another in Manhattan. I want to display ALL of the activity but only WITHIN a couple of square blocks that I am interested in (not the whole precinct - which I have a shapefile for with boundaries already set). My assumption, is that I create a polygon outlining the block areas I want. But then, how do I attach those boundary coordinates to my csv database on police activity (that dataset has x y coordinates representing police activity)? And then, how do I only display the activity within the boundaries rather than all of the activity that exists throughout NYC? Thanks so much for any links, resources or explanations that might lead me to answering these questions


Can I avoid setting up a proxy for geoserver, apache?

I'm using Apache (port 80) and Geoserver (port 8080) on Windows 7. I guess I need to set up a proxy if I want to use WFS, since they're on different ports. My kind of silly question is, can I avoid it? If I re-set my website on Geoserver's www file, is everything going to work fine? Does Geoserver share the same characteristics with Apache? If Geoserver's www file is a bad idea can you please help me set up a proxy? I never done it before, so if you have a link with an analytical tutorial, it would be great... Thanks,


How can I set the base layer of map before initialization?

I have been using `map.setBaseLayer(layer);` to switch to my preferred map layer, using the localStorage variable `layer` that is stored in my web browser, upon initialization of the map. But I realize that this is creating unnecessary calls to load the default (first layer) map tiles that I may not need if the preferred layer is the second or third one. Is there a way that I can pre-select the base layer to be displayed (before map initialization), without changing the order of the map layers?


How can i merge lines with same name and intersect each other?

I have shp file with 50k lines (roads). Many roads have same name like 'high road' . some of them are the same road (they intersect each other) and some are located in different places of the city. I want to merge all lines with same name and that intersect to single road. How can I do that? I have available SQL 2012 spatial with geometries and geographic data of roads and QGIS with shp file, Someone told me in other post to use dissolve, but it looks like dissolve works on polygons only (i don't have selection for line vector layer) Thank you.


How to find coordinates for a lot of locations based on the town or village name?

I have got an Excel spreadsheet with roundabout **15,000 locations** , which are only identified by the towns or villages **name** and the country. I am intending to present these on a world map. Therefore, I need to know, whether there is a tool, which can **find the coordinates** for me based on the location's name. Pasting every name into google maps is no solution due to the high number of locations. Thank you for your help and I wish you a satisfying Christmas!!


How to install GDAL/OGR with GRASS vector support?

The GRASS 6.4.3Svn for Windows that i have in my machine does not have GDAL/OGR support. Is there any library (libgrass) for Windows to add into existing GRASS installation. If not, how to build or install GRASS with OSGEO4W installer including GDAL/OGR support?


How to minimize the number of nodes in a polygon?

I'm building a web application that will be transferring polygons from server to client. Initially, the shapefile is coming from an external source that I have no control over. Often, I find polygons with way too many points to describe a straight line. The result is, the size of the payload increases and therefore the fetch takes longer. This obviously isn't an issue with only a few polygons, but it will add up as more shapes are added to my dataset and I'd like to optimize bandwidth. ![too many points - qgis](http://i.stack.imgur.com/DqYHJ.gif) Is there a plugin, or native QGIS function that will take some kind of tolerance/variance as input, and produce (approximately) the same polygon with much fewer actual points?


Do I get the same result when merging and clipping DEM geotiff files using different steps?

I merged and clipped 12 GeoTif Files with GMTED2010 Data (15 Arcsec) obtained from Earthexplorer to get a large map covering Europa and the Near and Middle East. First I tried Variant A) Raster – Misc – Merge => Input whole Folder – Output as GeoTiff File – Load Into Canvas. After that I had planned to clip the resulting merged Layer using a Rectangle Polygon as Mask Layer. Sadly the program crashed during merging so I then tried this way: Variant B) Raster – Misc – Build Raster Catalogue => Input whole Folder – Output as vrt – Load in canvas I then clipped this vrt-Layer using my rectangle square and loaded the resulting geotiff File into the Canvas. Is there a difference between the resulting merged and clipped DEM geotiff File or do I get the exact same Geotiff File no matter which variant I use to produce it?


Where should the data update date be entered into the FGDC metadata form (esri)?

if you've edited data recently (a gdb feature class), either spatial or tabular, and you want to capture the "update date" and possibly a note about what was updated, without overwriting the "publication date" or "edition" feilds in the metadata, where should it go? Perhaps i'm interpreting the meaning of the publication/edition dates incorrectly and that's what they're for...? any known/definitive answer to this?


I have a dozen years' GIS experience. Is it worth it to pursue a post-grad certificate in Accounting?

I've been working in GIS since 1998 - I've been at my present position for nearly eight years now. Right now my wife is suggesting I start a post-graduate certificate in accounting. It would take about two years, and then I could take the CPA exam, etc. Does anyone know of job out there where I could take advantage of both disciplines? Otherwise, I'd simply be starting out as an accountant around age 40 - I'm not sure I see the point of that. Anyone have any suggestions here? Much appreciated.


Set Data Driven Scale from Arcpy

Is there a way to set the data driven scale from arcpy? Looking at the documentation for the `DataDrivenPages` class, it doesn't seem to be accessible from outside of ArcMap. The script I run within the current map document exports the maps as jpgs based on the `Name` and `Page Number` fields I set, and at the `Data Driven Scale` I specified. When I put the same script into a model (with the necessary adjustments made) and run it from ArcCatalog, I get the same result, except the maps are now at `Best Fit` scale, which is the default for data driven pages.


ArcGIS Javascript Legend Is not Showing

I am trying to add a legend, and it gets to the console.log, but it fails at on the line after it. It does not show any errors saying it failed, but it wont continue past that line. `map[map_div_id]` holds the map (we have multiple maps on the page). Any Ideas?               //add the legend     dojo.connect(map[map_div_id],'onLayersAddResult',function(results){       var layerInfo = dojo.map(results, function(layer,index){         return {layer:layer.layer,title:index};       });            if(layerInfo.length > 0){         console.log(layerInfo);              var legendDijit = new esri.dijit.Legend({           map:map[map_div_id],           layerInfos:layerInfo         },"legendDiv");              legendDijit.startup();       }     });


openlayers - export map to canvas problem

I am trying to make a export control to export the map as image file. I found this example: http://dev.openlayers.org/sandbox/camptocamp/canvas/openlayers/examples/exportMapCanvas.html so i added the control to the map and the function               function exportMap() {         var canvas = OpenLayers.Util.getElement("exportedImage");         exportMapControl.trigger(canvas);     }      I also added the ExportMap.js file:               http://dev.openlayers.org/sandbox/camptocamp/canvas/openlayers/lib/OpenLayers/Control/ExportMap.js      but, i am getting this error, when i am trying to run exportMap():               Uncaught TypeError: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': No function was found that matched the signature provided. ExportMap.js:128      What that mean? how can i fix it?


OpenLayers SelectFeature - Manually set feature as selected/unselected

In the OpenLayers SelectFeature, how can I manually set a feature as selected/unselected and have it reflect the appropriate color? For instance, when my application loads, it sends back the existing select state which I want to set on the polygons. Thanks!


Spherical Mercator to Cylinder mercator?

Hello I want to create an overlay for google maps. As far as I know google maps using Spherical Mercator, so the system where I read the maps use Mercator but is not specified which (spherical or cylinder) type it use. When i create the images, i get some information in common. That means I have an offset. I want to try to solve this using cylinder mercator coordinates, but i don't know how can i transform google coordinates to Cylinder Mercator coordinates. Thank you in advance.


How to force sql server to use the spatial index?

I'm beginner with SQL Server (2012). I created a spatial index, and I'm trying to force SQL Server to use that index to solve the query. Here's what I have: DECLARE @g geography SET @g = geography::STPointFromText('POINT(-79.25161 43.735965)', 4326) SELECT * FROM CUSTOMER WITH(INDEX(idx_Geography)) where HomeGeog.STDistance(@g) The spatial index (idex_Geography) is created for HomeGeog. I'm getting this error: Msg 102, Level 15, State 1, Line 5 Incorrect syntax near '('. I'm not sure where the error is... Thanks for you help!


QGIS & GeoTIFF clipping Error "-srcwin 5897 137 0 0 falls outside raster size of 11083x4158 or is otherwise illegal."

I'm trying to clip a GeoTIFF file and unfortunately I'm getting the following               Error "-srcwin 5897 137 0 0 falls outside raster size of 11083x4158 or is otherwise illegal."       From another post here I found out my projection was not set correctly. I did set the projection by clicking CRS status window at the bottom right and selecting Enable "on the fly" and WGS 84 and then apply. I'm still getting the same error. Any idea how to fix that ?


Is Geoserver's "styler" plugin dead?

The "Styler" plugin for Geoserver promised flexible styling of your data, using the GeoExt library: ![GeoExt Styler](http://i.stack.imgur.com/hLOQG.png) The user guide tells you to first install the REST plugin, and then extract the styler zip file into the /data/www Geoserver directory. However, the download page for Geoserver 2.2 does not include the REST plugin. Installing older versions (I'm using Geoserver 2.2) failed for me, with one error saying "This web site needs a different Google Maps API key" (from /geoserver/www/styler/ - I have a Google Maps API). REST seems to have disappeared recently: versions up to 2.0.3 contained the option to download the REST zip package, whereas after that there is no mention of REST, and the installation guide remains. I did find some evidence that REST may have died, however: > This feature is no longer updated as an independent GeoServer download, but > is available as part of the OpenGeo Suite. For more information on its > development see OpenGeo project page If Geoserver's "styler" plugin really is dead, then I should probably change the question to something more general like "how do I make OpenGeo's Styler work on Geoserver?" Just wanted to check with others who've had similar experience. **Context** I've set-up Geoserver on an AWS EC2 instance (testing map can be seen here). What I'm trying to do is to make those boring grey polygons colourful and interesting, based on their attributes. I've tried exporting the sld that discribes the style below into Geoserver, but, at present, this does not work. ![styled-polys](http://i.stack.imgur.com/euvA5.png) Apologies for such a verbose question!


upload table to ArcGIS Server

We are building a process which will allow users to submit a table of GPS data to update our central repository for all GPS data. Let's say that the target is simply a SQL data table. At first I thought about trying to accomplish this with an SQL INSERT wrapped in a Python script (exposed a GP tool). However, a colleague suggested that we somehow just get the table to the server and let integration services handle the Insert/append to the SQL table. My question is then, how to create a simple file retrieval service? I'm comfortable with the Python/GP service aspect of ArcGIS server. Basically it would be just the user submitting a table and placing it in a known location on the server. EDIT: I should add i'm not looking to upload a file from HTTP location; it must allow access to 'local' files on the user's system.


Speed of editing attributes in QGIS from a Python plugin

I'm trying to edit the value of an attribute for each feature in a layer using a QGIS Python plugin. I've found that doing this outside of editing mode is much slower than while editing (even including committing the edits). See code below (lines interchangeable at the same point in a loop). The difference in speed for my sample dataset is 2 seconds (edit mode) vs 72 seconds (not edit mode). Modifying an attribute in edit mode:               layer.changeAttributeValue(feature.id(), 17, QtCore.QVariant(value))      Modifying an attribute outside of edit mode:               layer.dataProvider().changeAttributeValues({ feature.id() : { 17 : QtCore.QVariant(value) } })      Is this an expected behavior? I don't need the user to be able to undo the changes, so I don't think I need to use edit mode. **Edit 1:** See full code below with both versions included (but commented out):               def run(self):         try:             # create spatial index of buffered layer             index = QgsSpatialIndex()             self.layer_buffered.select()             for feature in self.layer_buffered:                 index.insertFeature(feature)                  # enable editing             #was_editing = self.layer_target.isEditable()             #if was_editing is False:             #    self.layer_target.startEditing()                  # check intersections             self.layer_target.select()             self.feature_count = self.layer_target.featureCount()             for feature in self.layer_target:                 distance_min = None                 fids = index.intersects(feature.geometry().boundingBox())                 for fid in fids:                     # feature's bounding box and buffer bounding box intersect                     feature_buffered = QgsFeature()                     self.layer_buffered.featureAtId(fid, feature_buffered)                     if feature.geometry().intersects(feature_buffered.geometry()):                         # feature intersects buffer                         attrs = feature_buffered.attributeMap()                         distance = attrs[0].toPyObject()                         if distance_min is None or distance < distance_min:                             distance_min = distance                     if self.abort is True: break                 if self.abort is True: break                      # update feature's distance attribute                 self.layer_target.dataProvider().changeAttributeValues({feature.id(): {self.field_index: QtCore.QVariant(distance_min)}})                 #self.layer_target.changeAttributeValue(feature.id(), self.field_index, QtCore.QVariant(distance_min))                      self.calculate_progress()                  # disable editing             #if was_editing is False:             #    self.layer_target.commitChanges()              except:             import traceback             self.error.emit(traceback.format_exc())         self.progress.emit(100)         self.finished.emit(self.abort)      Both methods produce the same result, but writing via the data provider takes much longer. The function classifies proximity of building features to nearby fields (purple) using pre-created buffers (brown-ish). ![Proximity](http://i.stack.imgur.com/9tBRG.png)


Best Way to Handle Many Raster Files in QGIS?

I have a project with a large number of raster files, but it is becoming very slow. I wonder which is the best way to handle all this. I'm simply georeferencing these files creating .wld file (geoTiff is better?) and than I open them as raster. Am I too naive?


Calculating area

I have a polygon layer. I toggled to edit mode. I added a new column, while number (integer) and called it "area". I then use the field calculator - geometry - $area to populate the polygon area for my polgyons. Under Layer Properties - first tab - the unit is millimetre In metadata tab: Extents: In layer spatial reference system units : xMin,yMin 114.53,-38.7888 : xMax,yMax 153.639,-9.22883 Layer Spatial Reference System: +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs Can anyone tell me what the area is calculated in? km2, acres, hectares or what?


Input data format and read multiple files into Grass 6.4.1

I am trying to read in multiple (hundreds, thousand) LiDAR ascii files into Grass. They contain elevation data. I think I have managed one, and I can make a map of elevations, using File, Import Raster Map, Multiple formats using GDAL. The format is as follows:               ncols         1000     nrows         1000     xllcorner     562000.000     yllcorner     7124000.000     cellsize      1     nodata_value  -9999.0     108.93 108.92 108.97 108.99 109 109.01...     ...     ...      1000 lines, 1000 columns, representing 1 sq km with values at every 1 m. Files are called               572000-7144000_dem_1m.asc     572000-7145000_dem_1m.asc     572000-7146000_dem_1m.asc      etc. My question is, how do Y read in multiple files? I have tried concatenating them, no luck. Thank you for your help.. regards, Szilard


Finding polygon parents

I have a PostGIS table full of polygon geometries. Some of these polygons are contained inside other polygons in the same table. I need to find which polygons have parents and self-relate them to their parent. How do I go about this? Can I use `ST_Contains()`?


Batch join non-spatial csv to shape files

I have 173 point shape files from soil testing and 173 non spatial csv files with lab ressults (one csv for each shape file) that need joining. The files are located in a library with folders named after each client, and the corresponding csv file is located in a sub folder of the client folder. I can join each csv with the corresponding shape in qgis, but the number of files makes this solution not feasible. What i would like to achieve is a script that loops through each client folder, pics out the csv file and joins the data to the shape file by the sampleID fields. My final goal is to loading all of this data in to a postgresql database table. Can any one point me to a solution for this problem?


Error in LineEdit when show parsing value as string

I m trying to make QGIS plugin to open xml, parse it and then show value i parse from xml to line edit, i use this code :               from PyQt4 import QtCore, QtGui     from ui_testparse import Ui_testparse     import xml.etree.ElementTree as ETree     # create the dialog for zoom to point               class testparseDialog(QtGui.QDialog):         def __init__(self):             QtGui.QDialog.__init__(self)             # Set up the user interface from Designer.             self.ui = Ui_testparse()             self.ui.setupUi(self)                  opendata = self.ui.btnCari             QtCore.QObject.connect(opendata, QtCore.SIGNAL('clicked()'),self.openxml)                        def openxml(self, event=None):                  #open dialog             openfile = QtGui.QFileDialog.getOpenFileName(self, 'Open File', '*.xml')                  self.ui.lineLokasi.setText(openfile)                  #call XML data             self.isiData(openfile)              def isiData(self, nmsatu):             #open teks with read mode             openteks = open(nmsatu, 'r').read()                  self.ui.textXml.setText(openteks)                  #Parse XML from Above             self.parsenow(openteks)              def parsenow(self, parse):             element = ETree.fromstring(parse)             xml_obj = ETree.ElementTree(element)             for title_obj in xml_obj.findall('.//{http://www.isotc211.org/2005/gmd}dateStamp/'                  '{http://www.isotc211.org/2005/gco}Date'):                     #print element                     list1 = [element]                     Str1 = ''.join(str(e) for e in list1)             self.ui.lineSkala.setText(Str1)      And the xml file i parse have a format like this:               <gmd:dateStamp>           <gco:Date>2013-12-12</gco:Date>        </gmd:dateStamp>        <gmd:metadataStandardName>           <gco:CharacterString>ISO 19115</gco:CharacterString>        </gmd:metadataStandardName>        <gmd:metadataStandardVersion>           <gco:CharacterString>ISO19115:2003</gco:CharacterString>        </gmd:metadataStandardVersion>      I want to show Date Value (2013-12-12) inside `<gco:Date>2013-12-12</gco:Date>` to lineEdit but instead of show date (2013-12-12) it show like some random code like this :               <Element '{http://www.isotc211.org/2005/gmd}MD_Metadata' at 0xd3e3c30>      Can someone help me


Calculating std dev for ruggedness using QGIS?

I have a DEM raster image and a vector layer with 200+ grids. Using QGIS, I got the terrain ruggedness index for the DEM layer. Now, I want the std dev (i.e. variation in ruggedness) for each of the 200+ grids. Using zonal statistics, I only get the mean. Please help.


How to visualize the Xdata attribute in AutoCAD?

I have converted my GIS data to CAD using data interoperability. The tags (attruibutes)would appear as Xdata in AutoCAD. How can I Show These attributes there? your assitance is appreciated in advance.


Best practice in writing automated tests for QGIS plugins

I'm looking for some best practice advice on writing automatic tests for QGIS plugins written in Python. I have written tests for Python scripts in the past using PyUnit (the `unittest` module), but have never done so for an application with a GUI. I've found a page describing how to use PyQt4.QTest to do unit tests on Qt widgets (http://www.voom.net/pyqt-qtest-example), but I'm struggling to see how I can use this with a widget that has been designed to run from within QGIS. The section on "Testing" in the PyQGIS documentation is notably absent. The best I have so far is:   * Keep the actual processing of data in isolated modules or functions, and write unit tests for those;   * Perform basic testing of the UI using QTest;   * Pray that it all holds together when using the plugin from within QGIS. Surely there is a better way?