VB/Python script to populate a field with maximum value among other fields

I am using ArcGIS 10. I have a little experience with python but i feel that python in ArcGIS is slightly different. VB will work fine as well. Problem: I have n different columns called 'percent_1', 'percent_2','percent_3' and 'percent_4'.... 'percent_n'. They contain percentages. I have a new field called 'Class_t'. I want to check which one among 'percent_1..n' is highest and then want to put 'x' in 'Class_t' field. If more information is required, feel free to inquire. I need it asap. Its final step of my project. Thanks a lot in advance. Cheers Ns


getsubcurve from multipart polyline ArcGIS

I have code which analyzes multipart polylines (roads) from the beginning towards the end. The algorithm "moves along" the road. My multipart polylines include circular junctions and branches so they can't be represented by simple polylines. The problem is that when my code proceeds along the multipart polyline, it jumps from one part to the the other, completely remote part. Since my code uses "GetSubcurve" method, I thought defining consecutive order of parts would solve my problem. Even though I created multipart polylines by adding geometries in desired order (in python), the problem still exists. I appreciate your suggestions,


QGIS Server Capabilities Response doesn't contain any Layers (Fedora 15 64-bit)

I'm having similar issues running QGIS Mapserver under a fresh install of Fedora 15 (64-bit). The XML response from GetCapabilities will not show the individual layers inside the QGIS project, just the 'project' layer. All the layers show up just fine under QGIS (1.7.1). For some reason QGIS Mapserver isn't able to parse my project file or find the shapefiles the same way as QGIS does. Shapefiles are located in my HOME directory. The QGIS project file is in /var/www/wms as per the sample configuration file included in /etc/httpd/conf.d/gis-mapserver.conf Shapefiles are readable by everyone, so is the project. By the way, everything works perfectly under a fresh install of Ubuntu 11.04 32-bit (QGIS 1.7.0 and QGIS-Mapserver 1.7.0) but for some reason I'm up against a brick wall when it comes to Fedora 15 (64-bit). httpd log files don't show anything out of the ordinary. I tried moving the shapefiles into /var/www/wms but Apache (httpd) didn't like that at all. Any ideas? Here's the procedure I used under Fedora 15 (64-bit) to get where I am. Further down is the procedure I used for Ubuntu 11.04 (32-bit) which worked.               $su -c 'yum update'     $su -c 'yum install httpd'     $su -c '/etc/init.d/httpd start'      Tested apache by going to localhost in firefox got a Fedora test page . . .               $su -c 'yum install qgis qgis-python qgis-mapserver'      run qgis to test (installed qgis 1.7.1 and qgis-mapserver 1.7.1) Copied over QGIS projects and shapefiles from another Linux box into my HOME directory, made sure they were readable by everyone Followed instructions in README file located here: /usr/share/doc/qgis-mapserver-1.7.1/qgis-mapserver-README.fedora               $cd /var/www     $su -c 'mkdir wms'     cd wms      copied a qgis project into the new wms folder restarted httpd               $su -c '/etc/init.d/httpd restart'      http//localhost/wms/name_of_qgis_project?service=WMS&version=1.3.0&request=GetCapabilities (The colon : after http above is missing because evidently I'm only allowed a maximum of 2 links in this post) XML response shows only the 'project' layer and none of the shapefile layers inside the qgis project * * * If it helps anyone, here is the procedure I used to get QGIS Mapserver working on Ubuntu 11.04. I started from a fresh install and didn't compile anything from source. This worked for me.               $sudo apt-get update     $sudo apt-get install nedit     $sudo nedit /etc/apt/sources.list      Added to the bottom of the /etc/apt/sources.list file:               deb     http://qgis.org/debian natty main     deb-src http://qgis.org/debian natty main      Then               $sudo gpg --keyserver keyserver.ubuntu.com --recv 1F9ADD375CA44993     $sudo gpg --export --armor 1F9ADD375CA44993 | sudo apt-key add -     $sudo apt-get update      Got an error message: W: GPG error: http://qgis.org natty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C2A22E8244865A03               $sudo apt-get install apache2 qgis libfcgi-dev libapache2-mod-fcgid qgis-mapserver      WARNING: The following packages cannot be authenticated! libqgis1.7.0 python- qgis-common python-qgis qgis-providers-common qgis-providers qgis-common qgis qgis-mapserver qgis-plugin-grass-common qgis-plugin-grass (I installed these packages without verification) Tested apache by going to localhost in firefox It should say "It Works!" Copied over QGIS projects and shapefiles from another Linux box into my HOME directory, made sure they were readable by everyone Made a new folder inside /usr/lib/cgi-bin and copied one QGIS project into it, along with wms_metadata.xml and qgis_mapserv.fcgi restarted apache               $sudo /etc/init.d/apache2 restart      Tested GetCapabilities http//localhost/cgi- bin/new_folder_goes_here/qgis_mapserv.fcgi?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities (The colon : after http above is missing because evidently I'm only allowed a maximum of 2 links in this post) Was able to add the WMS Layer from inside QGIS without any problem. However, I still cannot get it to load using ESRI ArcCatalog or ArcMap.


unable to call shp2pgsql using python

I am unable to call shp2pgsql using python as I have to pass various options like `(-s -a -i)` and I am not getting the required output .. Method I am using is               p1 = subprocess.Popen(["cmd", "/C", "shp2pgsql","-a","-s 4326","roads.shp" "roads", ">","roads.sql"],stdout=subprocess.PIPE)          >>>p1.communicate()[0]      as my intension is to add the features of the shapefile into the already existing table in the database I am done with the environment settings.. roads.shp is the name of the shapefile roads is the table name and roads.sql is the sql file name..


How do I create a convex hull in ArcGIS Desktop?

I would like to be able to create a convex hull in ArcGIS Desktop 9.x, but I cannot find an appropriate tool. How does one go about creating one? I am interested in answers for all license levels: ArcView, ArcEditor and ArcInfo.


Quality estimation of a spline interpolation with barriers

I interpolated the age of minerals for the Inner Tien Shan mountains (Kyrgyzstan) using the ArcGIS tool "spline with barriers". I use ~ 200 points for my interpolation. The barrier that I use is a fault map (polylines, green in example). For my further interpretations, I would like to estimate the quality of my interpolation. At the moment I am using the point density for this purpose, but this is only correct for regions where no barriers are (see example below). Is there a solution, where I can calculate the point density with taking my barriers into account or are there maybe different approaches to estimate the quality of my interpolation? Example: Here D1,D2 and D3 have all the same point density of 36.5%, whereas my interpolation quality is different in each region. ![enter image description here](http://i.stack.imgur.com/B1WCo.png)


Symbolising One-to-many relationships

I have a polygon feature class which has various extent areas with a name which is unique I also have a table (in an FGDB) that has the extent names with a score value. But there can be many score values per extent. I want to visually represent the score values either by colour symbology or pie/bar chart symbology in ArcGIS (I have an ArcInfo license too). It's one of these questions that get bounced round the ESRI forums quite a bit, so I was wondering if anyone here had any suggestions or any work arounds that they have done in the past? Thanks Rob


Can anyone share their experience with SpaceNavigator 3D mouse?

I was wondering if any of you had a chance to use any of the 3Dconnexion products in GIS setting? What are your experiences? Is something like SpaceNavigator worth investing into? Update: Apparently, one million of them on the market.


How to pass an argument to an event function in OpenLayers?

I am loading to my map two KML layers for which I add a quasi-similar featuresadded event :               layerICPE = new OpenLayers.Layer.Vector(         "ICPE (Installations Classées pour la Protection de l'Environnement)", {             projection: "EPSG:4326",             strategies: [new OpenLayers.Strategy.Fixed()],             protocol: new OpenLayers.Protocol.HTTP({                 url: "kml/icpe.kml",                 format: new OpenLayers.Format.KML({                     extractStyles: false,                     extractAttributes: true                 })             }),             styleMap: styleICPE         }     );          layerICPE.events.on({         featuresadded: function(evt) {             $.ajax({                 type: "GET",                 url: "appel_bdd.php?layer=icpe",                 async: true,                 dataType: "json",                 success: function(data) {                     var taille = evt.features.length;                                   for (var i = 0; i < taille; i++) {                         var feat = evt.features[i];                         feat.attributes = data[feat.attributes.ID.value];                     }                     evt.object.redraw();                 }             });         }     });          layerVoieFerree = new OpenLayers.Layer.Vector(         "Voies ferrées", {             projection: "EPSG:4326",             strategies: [new OpenLayers.Strategy.Fixed()],             protocol: new OpenLayers.Protocol.HTTP({                 url: "kml/voie_ferree.kml",                 format: new OpenLayers.Format.KML({                     extractStyles: false,                     extractAttributes: true                 })             }),             styleMap: new OpenLayers.StyleMap({                 'default': styleVoieFerree             })         }     );          layerVoieFerree.events.on({         featuresadded: function(evt) {             $.ajax({                 type: "GET",                 url: "appel_bdd.php?layer=voie_ferree",                 async: true,                 dataType: "json",                 success: function(data) {                     var taille = evt.features.length;                                   for (var i = 0; i < taille; i++) {                         var feat = evt.features[i];                         feat.attributes = data[feat.attributes.ID.value];                     }                     evt.object.redraw();                 }             });         }     });      The only different thing is the value of the variable in the url. Since I will have to add this event to 16 layers, I would like to create a generic function with this value in parameter. I have isolated the function :               ajoutAttributs = function(evt) {         var nomlayer = 'icpe';         $.ajax({             type: "GET",             url: "appel_bdd.php?layer=" + nomlayer,             async: true,             dataType: "json",             success: function(data) {                 var taille = evt.features.length;                               for (var i = 0; i < taille; i++) {                     var feat = evt.features[i];                     feat.attributes = data[feat.attributes.ID.value];                 }                 evt.object.redraw();             }         });     };          layerICPE.events.on({         featuresadded: ajoutAttributs     });      I can't figure how to pass 'nomlayer' as an argument to the function. I have tried :               ajoutAttributs = function(nomlayer, evt) {...};          layerICPE.events.on({         featuresadded: ajoutAttributs('icpe', evt)     });      ==> Uncaught ReferenceError: evt is not defined               ajoutAttributs = function(nomlayer, evt) {...};          layerICPE.events.on({         featuresadded: ajoutAttributs('icpe')     });      ==> nomlayer gets the correct value but evt is undefined What am I doing wrong ? How can I pass an argument to this function and avoid typing it 16 times ? Thanks.


How to use 931 GP service with v10 Map Services?

Pinched the code from this profiler sample. Having some trouble setting it up with my custom Esri Flex application. My Flex application is using the Web Mercator Aux Sphere WKID and is using v10 map services, and therefore is 3857 WKID. When using the tool within my application, I get a 500 error. This is the request is sends:               http://sampleserver2.arcgisonline.com/ArcGIS/rest/services/Elevation/ESRI_Elevation_World/GPServer/ProfileService/execute?f=json&Display_Segments=true&Image_Width=600&Input_Polylines={%22features%22%3A[{%22geometry%22%3A{%22paths%22%3A[[[16616585.72030409%2C-4240972.45511179]%2C[16390943.612806262%2C-4351041.775842438]]]%2C%22spatialReference%22%3A{%22wkid%22%3A3857}}}]}&Image_Height=250      sampleserver2 is on a 9.3.1 setup.   If I swap out the 3857 at the end of that link for the older 102100, I get a correct JSON response. **So how do I get around this?** I cant see an equivalent service on the v10 sample servers.   My environment is all v10, and I would prefer to keep my app within the newer 102100 WKID. _Further info on the change in WKIDs._


How to obfuscate data when using Google Maps?

I've been working on a google map (v3 of the api) that is plotting 120 markers or so (or will do shortly) - see http://www.mediwales.com/mapping. If you view the source the map data is for all the see, is it possible to hide this? I'm not worried about the code that is generating the map, just the data. The data is grabbed from a Wordpress cms. Here's the code that's generating it all:


ArcGIS Server output directory to mime or not to mime

> **Possible Duplicate:**   >  What are the consequences of setting the SupportedImageReturnTypes to MIME > in ArcGIS Server What are the downsides of changing a map service to MIME only? The developer summit perf video says that it is faster and scales better just using MIME. What things break from not having the image written to disk if anything? List of broken things:   1. WMS   2. WFS   3. WCS I'm also noticing when setting layer definitions the js api posts if the get request is too long and tries to send back the url instead of the mime type. if it's mime only the url json prop is empty. With arcobjects, if you try doing IMapServerLayout.ExportLayout the url property isn't set but the mimeData property is set.


Arcgis -> python -> ctypes -> c++ dll tool cancels itself, why?

Since optimizing my python-ctypes-dll based geoprocessing tool, it seems to cancel itself a lot. Followed by arcmap reporting a pure virtual function call (which is odd, because you'd think any such bug would show up in ArcSOCP, right..?) I'm currently working on the presumption that I've done something stupid in my DLL and have some good old C++ undefined behaviour going on. But if anyone has other suggestions as to why tools can cancel their own execution at runtime, I'm all ears. I'm using the intel compiler, multithreading with openmp and the stlport standard library, for what it's worth.


Build Network Dataset with python comtypes

I know this isn't possible in arcpy, so I thought I'd give it a stab using comtypes. I am trying to translate some of the VB.NET code to create a network dataset from the help docs: http://resources.arcgis.com/en/help/arcobjects- net/conceptualhelp/index.html#/How_to_create_a_network_dataset/0001000000w7000000/ I'm trying to automate this process for an engineer as he is not very experienced with GIS. He will always be using a file geodatabase with one line feature class as edge features (fc name will vary) and two point feature classes as junction features (sources and sinks to act as origins and destinations). Once the network is built, he can use other script tools I am providing him to do the whole analysis. I think I am pretty close as I am able to create the edge and junction features, but my code is failing at one of the last steps which is getting the extension for the IFeatureDatasetExtensionContainer interface via the FindExtension method. The help docs say I can use the esriGeoDatabase.esriDatasetType constant but this seems to be causing an error: http://resources.arcgis.com/en/help/arcobjects- net/componenthelp/index.html#//0025000002ww000000 here is where it is failing:               # create network data set based on data element     fdxc = CType(fdsGDS, esriGeoDatabase.IFeatureDatasetExtensionContainer)     fdx = fdxc.FindExtension(esriGeoDatabase.esriDatasetType(7))  # get error here     dsc = CType(fdx, esriGeoDatabase.IDatasetContainer2)     netds = CType(dsc.CreateDataset(nd), esriGeoDatabase.INetworkDataset)      Here is my error:               Traceback (most recent call last):       File "\\arcserver1\GIS\_Resources\ESRI\Python\BMI_Library\arcobjects\network_dataset.py", line 114, in <module>         create_nd(gdb)       File "\\arcserver1\GIS\_Resources\ESRI\Python\BMI_Library\arcobjects\network_dataset.py", line 98, in create_nd         fdx = fdxc.FindExtension(esriGeoDatabase.esriDatasetType(7))     COMError: (-2147220729, None, (u'The specified feature dataset extension type was not found.', u'Esri GeoDatabase', u'esri_csGeoDatabase.hlp', 0, None))      And here is my full code if that helps:               def create_nd(gdb):         arcpy.CheckOutExtension('Network')         getModule('esriGeoDatabase.olb')         getModule('esriDataSourcesGDB.olb')         import comtypes.gen.esriGeoDatabase as esriGeoDatabase         import comtypes.gen.esriDataSourcesGDB as esriDataSourcesGDB              # create new empty data element for buildable network dataset         nd = NewObj(esriGeoDatabase.DENetworkDataset,                     esriGeoDatabase.IDENetworkDataset2)         nd.Buildable = True         nd.NetworkType = esriGeoDatabase.esriNetworkDatasetType(1)              # open feature dataset and create IGeoDataset interface         pWSF = NewObj(esriDataSourcesGDB.FileGDBWorkspaceFactory, esriGeoDatabase.IWorkspaceFactory)         gdbWSF = CType(pWSF, esriGeoDatabase.IWorkspaceFactory)         print gdbWSF.WorkspaceDescription, gdbWSF.WorkspaceType         gdbFWS = CType(gdbWSF.OpenFromFile(gdb, 0), esriGeoDatabase.IFeatureWorkspace)         print gdbFWS         openFWS = gdbFWS.OpenFeatureDataset('FlowNet')         fdsGDS = CType(openFWS, esriGeoDatabase.IGeoDataset)         print fdsGDS              # copy feature dataset's extent and spatial reference to network dataset element         deGDS = CType(nd, esriGeoDatabase.IDEGeoDataset)         deGDS.Extent = fdsGDS.Extent         deGDS.SpatialReference = fdsGDS.SpatialReference         print deGDS.Extent              # get flow lines         arcpy.env.workspace = os.path.join(gdb, 'FlowNet')         lines = arcpy.ListFeatureClasses('*', 'Polyline')[0]                # create data element         dataElement = CType(nd, esriGeoDatabase.IDataElement)         dataElement.Name = 'FlowNetwork'         print dataElement.Name              # specify edge features         edgeNet = NewObj(esriGeoDatabase.EdgeFeatureSource,                          esriGeoDatabase.INetworkSource)         edgeNet.Name = lines         edgeNet.ElementType = esriGeoDatabase.esriNetworkElementType(2)     ##    edgeNet.SourceType = esriGeoDatabase.esriNetworkSourceType(3)     ##    edgeNet.UsesGeometryInConnectivity = True              #set edge feature's connectivity (Any Vertex)         edgeFS = CType(edgeNet, esriGeoDatabase.IEdgeFeatureSource)         edgeFS.UsesSubtypes = False         edgeFS.ClassConnectivityGroup = 1         edgeFS.ClassConnectivityPolicy = esriGeoDatabase.esriNetworkEdgeConnectivityPolicy(0) # any vertex                   # add sources and sinks as junctions         # make origins         sinkNet = NewObj(esriGeoDatabase.JunctionFeatureSource,                          esriGeoDatabase.INetworkSource)         sinkNet.Name = 'Sinks'         sinkNet.ElementType = esriGeoDatabase.esriNetworkElementType(1)     ##    sinkNet.SourceType = esriGeoDatabase.esriNetworkSourceType(2)     ##    sinkNet.UsesGeometryInConnectivity = True              # set connectivity         sinkElm = CType(sinkNet, esriGeoDatabase.IJunctionFeatureSource)         sinkElm.UsesSubtypes = False         sinkElm.ClassConnectivityGroup = 1         sinkElm.ClassConnectivityPolicy = esriGeoDatabase.esriNetworkJunctionConnectivityPolicy(0) # honor              # make destinations         sourceNet = NewObj(esriGeoDatabase.JunctionFeatureSource,                          esriGeoDatabase.INetworkSource)         sourceNet.Name = 'Sources'         sourceNet.ElementType = esriGeoDatabase.esriNetworkElementType(1)     ##    sourceNet.SourceType = esriGeoDatabase.esriNetworkSourceType(2)     ##    sourceNet.UsesGeometryInConnectivity = True              # set connectivity         sourceElm = CType(sourceNet, esriGeoDatabase.IJunctionFeatureSource)         sourceElm.UsesSubtypes = False         sourceElm.ClassConnectivityGroup = 1         sourceElm.ClassConnectivityPolicy = esriGeoDatabase.esriNetworkJunctionConnectivityPolicy(0) # honor              # add attributes (Length, Cost, Units)         evalNetAttr = NewObj(esriGeoDatabase.EvaluatedNetworkAttribute,                              esriGeoDatabase.IEvaluatedNetworkAttribute)         newAttr2 = CType(evalNetAttr, esriGeoDatabase.INetworkAttribute2)         newAttr2.Name = 'Length'         newAttr2.UsageType = esriGeoDatabase.esriNetworkAttributeUsageType(0) # cost         newAttr2.DataType = esriGeoDatabase.esriNetworkAttributeDataType(2) # double         newAttr2.Units = esriGeoDatabase.esriNetworkAttributeUnits(3)  # feet         newAttr2.UseByDefault = True              # create network data set based on data element         fdxc = CType(fdsGDS, esriGeoDatabase.IFeatureDatasetExtensionContainer)         fdx = fdxc.FindExtension(esriGeoDatabase.esriDatasetType(7)) # fails here         dsc = CType(fdx, esriGeoDatabase.IDatasetContainer2)         netds = CType(dsc.CreateDataset(nd), esriGeoDatabase.INetworkDataset)              # build network dataset now that it's created         netBuild = CType(netds, esriGeoDatabase.INetworkBuild)         for item in [edgeNet, sinkNet, sourceNet]:             netBuild.AddSource(item)         netBuild.AddAttribute(newAttr2)         netBuild.BuildNetwork(fsdGDS.Extent)         arcpy.CheckInExtension('Network')         return          if __name__ == '__main__':              gdb = r'C:\Users\calebma\Desktop\NA_Testing\test2.gdb'         create_nd(gdb)         print 'done'


Creation of drainage ditch in ArcGIS - Line with a certain slope

I have a digital terrain model and a list of problematic points, in which water accumulates. It's not important how I obtained these points (by observing or some algorythm). I would like to use these problematic points like start point of drainage ditch and then continue this ditch with a certain slope (let's say 3%), but this ditch has to respect the DTM. Then I have a network of existing flows and I would like to connect these ditches with it. My idea is to find the nearest flow for each problematic point and then connect it. But I really don't know how to do that with my specified slope. Does anybody have an idea how to do that (or just some hint how start)?


How to create least-cost path between two polygons with GRASS?

I am completely a beginner in GRASS but I would like to use it to have the cumulative cost of moving between two polygons. More exactly, I would like **to get the smallest cost from any point situated at the edge of one polygon (polygon A) to any point situated at the edge of another polygon (polygon B)**. Until now, I used the function `CostDistance` and `CostPath` of ArcGIS like this:               CostDistance("start_polygon", "costs.tif", "", "outCostLink.tif")     CostPath("end_polygon", "outCostDist.tif", "outCostLink.tif", "EACH_ZONE","FID")      I would like to do the same thing with GRASS. I think that the function `r.cost` allows to do this. But the problem is that I don't understand how to specify in parameters the two polygons in GRASS ? I have :   * a cost raster where each cell has a cost value.   * a shapefile for the first polygon   * a shapefile for the second polygon Have you got an example of how to use `r.cost` with two polygons ? Thanks very much for your help.


FIeld calculator gives integer not a real as requested

Two fields "population" and "F06_popula" (both integers) were used in calculating a new field pct-diff. I asked that the new field be a decimal with a width of 10 and precision of 3. The result has no decimals. See the graphic. But the Layer Properties indicates that pct-diff is a real with 3 decimals. Why are the decimals not visible? ![enter image description here](http://i.stack.imgur.com/2VdrW.gif) Thanks -


Calculating percentage of polygons within specific areas using ArcGIS for Desktop?

I have a parcel layer and I am trying to determine the percentage of each parcel that falls within specific zones. I tried tabular intersect but it just returned an empty output. I'm using ArcGIS 10.2 for Desktop.


ogr2gui geojson to csv do not export coordinates

I tried to convert ogr2gui to convert geojson files to csv. The geojson file contains point data only. The resulting csv only contains attribute data, no coordinates. Is there a way to get the coordinates from geojson file using ogr2ogr?


r.composite gives blank image output in GRASS GIS

While running r.composite in GRASSGIS GUI command the image formed looks absolutely blank. The data I used is listed here below. IRS-LISS III Multispectral coverages. (i.e. band 2, 3 and 4 for Blue, Green and red respectively) Still hopeless. No way to resolve the issue. Please help...........


Is there a way to QGis read an SDE.ST_GEOMETRY field?

![SHAPE](http://i.stack.imgur.com/Se1MB.png) this is the type and name that Qgis displays for me when I connect with a oracle table,it is not displayed as a geo column, there is a setting I'm missing? Can Qgis Read this type of data?


STCentroid Question

Hi I'm not sure if I should ask in here or another SE site, however I was wondering if anyone knew if it is possible to configure the results from a STCentroid select statement? If I run a select statement at the minute, I will get overly precise responses i.e. POINT (399419.42500005924 90290.17500002397) I just need to grab the numbers before the decimal, I don't need the detail provided. Any help would be greatly appreciated. Thanks Steve


What is the best way of refreshing the view after drawing graphics?

I draw a polygon on button click to highlight a feature. Then I need to refresh the ActiveView to show the new polygon. This lines do work:               mapControl.ActiveView.ScreenDisplay.StartDrawing(StartDrawing(mapControl.ActiveView.ScreenDisplay.hDC, (System.Int16)ESRI.ArcGIS.Display.esriScreenCache.esriNoScreenCache);     mapControl.ActiveView.ScreenDisplay.DrawPolygon(feature.Shape);     mapControl.ActiveView.ScreenDisplay.FinishDrawing();     mapControl.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewAll, feature.Extent, null);      But it always reloads every layer. I tried nearly all ways of calling `PartialRefresh` with other `esriViewDrawPhase` but none of them did show the new polygon. Is there a better solution than to redraw with `esriViewDrawPhase.esriViewAll`? **Update** I used an `ILayerExtensionDraw.AfterDraw` to test the draw phases and the AfterDraw only gets hit for `PartialRefresh()` with `esriViewAll`. The extension is added to all layers in MapControl.Layers. I expected that it gets hit everytime? On which layer does `mapControl.ActiveView.ScreenDisplay.DrawPolygon(feature.Shape);` draw so that the AfterDraw isn't even raised? _**Answer_** Thanks to Kirk here is the solution, which shows the new added graphic without reloading any layer.               IGraphicsContainer con = _mapControl.Map as IGraphicsContainer;     if (con != null)     {       IFillShapeElement fillShapeElement = new PolygonElementClass();       fillShapeElement.Symbol = fillSymbol;       IElement element = (IElement)fillShapeElement;       element.Geometry = feature.Shape;       con.DeleteAllElements();       con.AddElement(element, 0);       _mapControl.ActiveView.ScreenDisplay.Invalidate(feature.Extent, true, _mapControl.ActiveView.get_ScreenCacheID(esriViewDrawPhase.esriViewGraphics, null));     }


Building Floor Plan map using OpenLayers and json

How to show map of building floor plan using OpenLayers and json. moreover, i want to know that how to change features dynamically with zoom based from json files. Let's take example, Initial the polygon of building feature shows then, second zoom, detailing map with more features like sitting arragement with desk and chairs, then third zoom, more detailing with attributes of each sitting arragement. Above mention zoom level have different type of symbology of each. How to make this, pl. help me on this.. Regards GIS User


Is there a sample ArcGIS Server service for US zip codes?

Esri provide a sample ArcGIS Server instance which contains states, block groups, etc. Is there a similar publicly-accessible ArcGIS Server instance anywhere which contains US zip codes?


Automatic script to update selected records in QGIS

I am after some advice on how to produce a script that a user can run in QGIS. The script will be run against newly created feature/s (Point, Line or Polygon) that will perform not only a spatial join to populate the Ward, Parish and Postcode fields, but also populate a field called CREATED with the current date/time. I haven't got a clue where to start to produce such a script, what platform to build it in on but i'm guessing that its possible? All ideas welcomed. Med


Gdalinfo and QuantumGIS does not recognize Spatial Reference even though Python does

I apply the following Spatial Reference to a file:               spatialRef = osr.SpatialReference()     spatialRef.ImportFromEPSG(3411)         outraster.SetProjection(spatialRef.ExportToWkt() )          geotransform = (-3850000.0, 25000.0 ,0.0 ,5850000.0, 0.0, -25000.0)     outraster.SetGeoTransform(geotransform)      If I use "icechart.GetGeoTransform()" and "icechart.GetProjection()" in Python, the output looks correct.               >>>icechart = gdal.Open(r'C:\Users\max\Desktop\test\icechart_persistencemap.tif')     >>>icechart.GetProjection()     'PROJCS["NSIDC_Sea_Ice_Polar_Stereographic_North",GEOGCS["GCS_Unspecified datum based upon      the Hughes 1980 ellipsoid",DATUM["D_",SPHEROID["Hughes_1980",6378273,298.279411123064]],     PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Stereographic_North_P     ole"],PARAMETER["standard_parallel_1",70],PARAMETER["central_meridian",-45],PARAMETER     ["false_easting",0],PARAMETER["false_northing",0],UNIT["Meter",1]]'          >>>icechart.GetGeoTransform()     (-3850000.0, 25000.0, 0.0, 5850000.0, 0.0, -25000.0)      However, gdalinfo tells me that there is no Spatial Reference defined, neither does QuantumGIS. When I get the Projection and Geotransform from another file, rather than defining it manually, gdalinfo finds the Spatial Reference:               outraster.SetGeoTransform(icechart.GetGeoTransform())     outraster.SetProjection(icechart.GetProjection())      Also when I reproject the raster above with gdalwarp, gdalinfo and QGIS recognize the Spatial Reference:               os.system('gdalwarp -s_srs EPSG:3411 -tr 25000 -25000 -t_srs EPSG:3575 -of GTiff '      + infile + ' ' + outfile)       So what is wrong with the first lines of code in this post? Any advice?


gdal2tiles generates small picture inside 256x256 tile

I've used gdal2tiles for generating tiles in number of different polar projections and always experienced the same problem — strange small picture inside normal 256x256 png with the rest of space transparent. I'm using `-p raster` option. That's how one particular tile looks like http://grab.by/uNHw And here is the whole map view. ![how whole map with such tile looks like](http://i.stack.imgur.com/1gHpv.png) Looking for suggestions. Gladly will switch to other utility/program that can generate tiles properly in non-mercator projections. Source geotiff I use are arctic and antarctic maps:   * http://www.ngdc.noaa.gov/mgg/bathymetry/arctic/ibcaoversion3.html   * http://www.ibcso.org/data.html Sample command I use: `gdal2tiles.py -z 3 -p raster ibcso_background_hq.tif`


Can't start Geoserver on Tomcat7

I deployed the geoserver.war on tomcat7 but when I try to start the service I get this error : > FAIL - Application at context path /geoserver could not be started   * OS : Windows7 professional    * some lines of localhost log :  4 mars 2014 04:08:40 org.apache.catalina.core.ApplicationContext log INFO: No Spring WebApplicationInitializer types detected on classpath 4 mars 2014 04:08:41 org.apache.catalina.core.ApplicationContext log INFO: Initializing Spring root WebApplicationContext 4 mars 2014 04:09:04 org.apache.catalina.core.StandardContext listenerStart GRAVE: Exception lors de l'envoi de l'évènement contexte initialisé (context initialized) à l'instance de classe d'écoute (listener) org.geoserver.platform.GeoServerContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'restWrapper' defined in URL [jar:file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%207.0/webapps/geoserver/WEB- INF/lib/rest-2.2.5.jar!/applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'storeFileFinder' defined in URL [jar:file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%207.0/webapps/geoserver/WEB- INF/lib/restconfig-2.2.5.jar!/applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class org.geoserver.data.util.CoverageStoreUtils at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111) at org.geoserver.platform.GeoServerContextLoaderListener.contextInitialized(GeoServerContextLoaderListener.java:18) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1256) at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:714) at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:219) at javax.servlet.http.HttpServlet.service(HttpServlet.java:647) at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:212) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:611) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1852) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'storeFileFinder' defined in URL [jar:file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%207.0/webapps/geoserver/WEB- INF/lib/restconfig-2.2.5.jar!/applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class org.geoserver.data.util.CoverageStoreUtils at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:288) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowi


Transforming multiple LineStrings to shape for ST_Contains

I want to find cities, villages etc inside each region of Poland. For most of them querying something like this is enough:               ...     AND ST_Contains((SELECT way FROM planet_osm_polygon WHERE osm_id = -130919), way)     ...      _(where second`way` is `way` of city I check against selected region)_ But there are two relations in database, that reside in `planet_osm_line` instead of `planet_osm_polygon`, so they are described as multiple rows for one id. The one I'm currently interested in is `-130935`. When I query `planet_osm_line` for it, I get 27 rows, each one with it's own way. How to convert them to single shape that I can put into `ST_Contains()`? I guess that those rows describe parts of one shape. I'm using `postGis` 2.1 and data imported from http://download.geofabrik.de/europe/poland.html, parsed using osm2pgsql (latest) with default settings. So far I've tried `ST_BdPolyFromText` and `ST_BdMPolyFromText` with concatenated `LineStrings` as parameter - unfortunately with no luck. **UPDATE** Managed to do this:               SELECT St_GeomFromText(St_MakePolygon(St_AddPoint(          (         SELECT              string_agg(ST_AsText(way), '\n')          FROM             planet_osm_line         WHERE             osm_id = -130935         ), ST_StartPoint(             (                 SELECT                  ST_AsText(way)             FROM                 planet_osm_line             WHERE                 osm_id = -130935             LIMIT 1             )         )     )))      Unfortunately, as you probably can see, line isn't closed, so I'm trying to manually close it. This results in error:               ERROR: parse error - invalid geometry     State SQL: XX000     Tip: "010300000001000000B" <-- parse error at position 19 within geometry


Searching free data source: Shapes of counties worldwide

I want to create a map with openlayers, that contains a vector layer, with all "counties" of all countries of the world. "County" doesn't mean any strict political term here. I just want to split the earth into areas of ~500 - ~2500 km2 (or even much larger in sparsely populated areas), while these areas should have names, that are common to the people living there. Now I'm searching data sources.   * The data should be free   * Each county information should contain the name in one of the languages spoken in this county.   * It is not important, that the borders are exact - it is just used for a visual selection of some counties, the user wants to do something with   * It must be complete for each country, that is available (no areas without a "county").   * For now, it would fit to have those data available for Germany, Austria and Switzerland, but it would be fine to find a solution, that would allow us, to add other countries without having another data import and maintainance workflow for each country.


How to replace non-English characters in attribute tables using Python?

I have a few shapefiles where some of the attributes contain the non-English characters ÅÄÖ. Since some queries doesn't work with these characters (specifically ChangeDetector), I tried to change them in advance with a simple script and add the new strings to another field. However, change in characters works fine but not updating the field with arcpy.UpdateCursor. What is an appropriate way of solving this? I have also tried to do this via the Field Calculator while posting "code" to the codeblock, with the same error. ~~Error message:   _Runtime error Traceback (most recent call last): File "", line 1, in File "c:/gis/python/teststring.py", line 28, in val = code(str(prow.Typkod)) UnicodeEncodeError: 'ascii' codec can't encode character u'\xc4' in position 3: ordinal not in range(128)_~~ Code:               # -*- coding: cp1252 -*-     def code(infield):         data = ''         for i in infield:     ##        print i             if i == 'Ä':                 data = data + 'AE'             elif i == 'ä':                 data = data + 'ae'             elif i == 'Å':                 data = data + 'AA'             elif i == 'å':                 data = data + 'aa'             elif i == 'Ö':                 data = data + 'OE'             elif i == 'ö':                 data = data + 'oe'             else:                 data = data + i         return data               shp = r'O:\XXX\250000\DB\ArcView\shape.shp'          prows = arcpy.UpdateCursor(shp)          for prow in prows:         val = code(unicode(str(prow.Typkod), "utf-8"))         prow.Typkod_U = val         print val         prows.updateRow(prow)      The values of Typkod are of the type: [D, D, S, DDRÄ, TRÄ] etc. I use ArcMap Basic (10.1) on Windows 7. EDIT: New Error message:   _Runtime error Traceback (most recent call last): File "", line 1, in File "c:/gis/python/teststring.py", line 29, in val = code(unicode(str(row.Typkod), "utf-8")) UnicodeEncodeError: 'ascii' codec can't encode character u'\xc4' in position 3: ordinal not in range(128)_ `>>> val `'DDRÄ'   `>>> type(val) `type 'str' EDIT2: It appears as if the output from the function is wrong somehow. When there's ÅÄÖ involved it returns `data = u'DDR\xc4'` and not (as was my intention) `data = 'DDRAE'`. Any suggestions on what might cause this?


ArcGIS Server Object Extension (SOE) RestOperation configuration

How would you accept a call to a RestOperation with string and reply back with a json array of the column names in the table holding this information? So, if string is 'owners' then get names of col1,col4,col9,col10, if string is 'zipcode' get name of col9. etc... New to the SOE, and excited for some guidance, thanks.


How to add csv file in QGIS 2.0 using Delimited Text Layer Plugin?

I used to import csv files in previous versions of QGIS using the format below, but when I upgraded to QGIS 2.0 the delimited text layer plugin was changed and I can't import the file anymore. The plugin can't also detect the x,y or long lat field unlike in previous versions. Any ideas how to add the file? Thanks ![Format](http://i.stack.imgur.com/CV9V4.png) ![Sample](http://i.stack.imgur.com/pZdLK.png) Heres what it looks in Text Editor: ![enter image description here](http://i.stack.imgur.com/0EFqG.png)


Routing problem finding shortest route to line

inspiration on how to solve this problem. (Ascii art, I don't have points to insert picture) I need to find Z Z = Shortest route from X Using Road (no point exists here) O = The points that makes the line X = Start point Y = Closest point on line (Can't be used) The problem right now is: The nearest point (Y) from X will give a long route. Route from X to Points (O) on line also returns a long route. Any idea on how I can find Z ??                   O(Point)         | ||     Line| ||       O2----------O2 (closer line but no road to this line so this can't be used)         | ||         | ||         |Y||         X (Start point)         | ||         ||         | ||    ||   ||Road         | ||    ||   ||         | ||    ||   ||         |Z||----||----Road         | ||    ||         | ||    ||------------- Road         | ||         | ||Road         | ||         | ||         O (Point)      Is there anyway I can take the line and add more points to it on every 5 meters? So the Line would look like O-O-O-O-O-O instead of O---------O Setup: I have a postgres 9.3 with postgis 2 The database has all X (points) All Lines (linestring) And all roads (Export from openstreet) (can't get pgrouting to work right now) And a local osrm server running.   * Niels


OpenLayers doesn't proxy WMS requests to Geoserver

I had an issue with WMS requests from OpenLayers to Geoserver via Proxy.php. My OL version is 2.12 and my Geoserver is 2.4.0. I set the variable OpenLayers.ProxyHost as shown in OL documentation, but the requests go directly to the remote IP not passing through Proxy.php. I read on forums that OpenLayers WMS requests have this problem, and suggest to use this getURL class:               var proxyHost=OpenLayers.ProxyHost="proxy.php?url=";     var myWMS = OpenLayers.Class(OpenLayers.Layer.WMS, {              getURL: function (bounds) {             var url = OpenLayers.Layer.WMS.prototype.getURL.call(this, bounds);             if (OpenLayers.ProxyHost && OpenLayers.String.startsWith(url, "http")) {                 url = OpenLayers.ProxyHost + encodeURIComponent(url);             }             return url;         }     });      Are you aware of this? is it a bug of OpenLayers? Does OL need a fix?


Combine Leaflet with Geoserver WMS map

I'm not very skilled within the GIS world, however, I would like to know if it's possible to use this map: http://wfs- kbhkort.kk.dk/k101/wms?service=WMS&version=1.1.0&request=GetMap&layers=k101:theme- startkort&styles=&bbox=12.451709828167994,55.63150896601625,12.64714535243575,55.72503797474024&width=512&height=495&srs=EPSG:4326&format=application/openlayers within leaflet? I've looked at the API for leaflet and can see that it is possible to use custom maps/tiles with the tileLayer option. However, I cannot get it to work. Can someone point me in the right direction?


Problems with lat long projection

Hi this seems like it should be an easy problem, but its been giving me a headache. I have a .xls spreadsheet with about 60,000 rows. Most of them have Latitude and Longitude. I simply want to display these as points in Arc10. I've tried making a .dbf in arccatalog and creating a feature class from XY data. The first times I tried this the rows that had no lat/long were given 0,0. The problem is the scale is about 1:1e200+ feet... so the points with correct lat/long are all together but so tiny I can't even zoom into them. So the second time I just took out all the rows without lat/long. Now the points show up but compared to the old points and the counties they are not lined up and they are tiny... I've also tried using it as a .csv and as the .xls and in QGIS. I went through all the rows and took out the lat/long points that were entered incorrectly (not in decimal degrees) as well... On the map there little red point way off where it should be, and it is actually 40,000 points on a scale of 1:19 feet instead of 1:3,000,000ish... The projection is the same as the other layers and when I click on individual points they have the same lat/long, just in different spots.


Attempting to bring 2,300 .sid files into one raster

I've tried all of the raster tools within ArcToolbox with no luck having such a large number of files. There are about 7GBs worth of MrSID files totaling about 2,300. Most tools fail or process too slowly when I try to upload all the files. Even more than 10 files seems to slow Arc down too much. I don't know whether it's my procedure or computer that's causing problems. Please provide whatever advice you have. Thank you.


How are minor tributaries determined?

What are the criteria to determine if river A is a major or minor tributary to another River B? Is stream order the only deciding factor i.e. the highest order is the main stem, one less order is a major tributary and one more lesser order is a minor tributary? I haven't been able to find any literature on this online.


I have a PostGis database with a multipolygon geography (as opposed to geometry) column. I'd like to fill it with the country border data available from http://thematicmapping.org/downloads/world_borders.php The query I tried is               insert into "countries"     select "un", "iso3", "name", "region", "subregion",       ST_GeogFromText( 'POINT(' || "lon"::varchar || ' ' || "lat"::varchar || ')' ),       ST_Transform( "the_geom", 4326 )     from "world";      Where "world" contains an import of the raw (geometry) data from the link. However, it complains about unknown input geometry SRID -1. I have tried explicitly setting it to 900913 via ST_SetSrid, but that didn't change anything (and I'm not even sure it's the correct SRID to use, just guessing). So my question is: How do I get a country border data set into my geography column?


Establishing survey marks

We are currently getting some new survey marks established in the main town of our shire, we have been told that there are different orders based on accuracy: 1st, 2nd and 3rd both for horizontal and vertical. In the main town we already have a few good 1st order horizontal but very few 1st order vertical marks, and we where told that they would just shoot from these marks to make the new ones. My question is: How do they establish a 1st, 2nd or 3rd order mark in a town that doesn't already have a good mark to use; and how do you know it's right? _I know this might not be directly GIS related but to me surveying is important to GIS._


QGIS GRASS plugin: r.composite quality loss

When using the r.composite tool within the GRASS plugin in QGIS, the result raster has a cell size of 150x150 while the input rasters have a cellsize of 30x30. Can this be overcome somehow or is this a consequence of the tool? Data used: Landsat 8, QGIS version: 1.8.0, Operating system: Windows 7.


georectification via SLD is not appearing at the correct place

I am trying to georectify layers on the fly (feeded by Geoserver) in OpenLayers. To do so, we have created a style (SLD) in Geoserver that does the georectification provided that we feed it a projection and coordinates via the GET request (`env` variable):               <?xml version="1.0" encoding="ISO-8859-1"?>     <StyledLayerDescriptor version="1.0.0" xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">         <NamedLayer>           <Name>GeorectifyCoverage</Name>           <UserStyle>             <Title>Georectify Coverage</Title>             <Abstract>Warps image to specified GCP</Abstract>             <FeatureTypeStyle>               <Transformation>                 <ogc:Function name="gs:GeorectifyCoverage">                   <ogc:Function name="parameter">                     <ogc:Literal>data</ogc:Literal>                   </ogc:Function>                   <ogc:Function name="parameter">                     <ogc:Literal>gcp</ogc:Literal>                     <ogc:Function name="env"><ogc:Literal>wms_gcp</ogc:Literal></ogc:Function>                   </ogc:Function>                   <ogc:Function name="parameter">                     <ogc:Literal>targetCRS</ogc:Literal>                     <ogc:Function name="env"><ogc:Literal>wms_crs</ogc:Literal></ogc:Function>                                   </ogc:Function>                   <ogc:Function name="parameter">                     <ogc:Literal>transparent</ogc:Literal>                   <ogc:Function name="env"><ogc:Literal>wms_transparent</ogc:Literal></ogc:Function>                                   </ogc:Function>                    </ogc:Function>               </Transformation>                    <Rule>                <RasterSymbolizer>                  <Opacity>1.0</Opacity>                </RasterSymbolizer>              </Rule>                  </FeatureTypeStyle>           </UserStyle>         </NamedLayer>     </StyledLayerDescriptor>      I then display the layer over an OSM map with and pass the coordinates of the georectification through the `env` argument:               var wms5 = new OpenLayers.Layer.WMS("Geotiff5", "http://mydomain.com/foobar",                         {                             layers: data[0].imagename+":"+data[0].imagename,                             styles: "georectify2",                             env: "wms_transparent:false;wms_crs:EPSG:900913;wms_gcp:"+getGCP(pixel,coord3),                             transparent: true                         },                         {                             singleTile: true,                              isBaseLayer: false,                             displayOutsideMaxExtent: true                         }                     );      where               getGCP(pixel,coord3)="[[[0, 0], [725801.41007875, 5861382.4105691]], [[0, 450], [725725.04490808, 5858019.2685367]], [[600, 0], [725801.41007875, 5861382.4105691]], [[600, 450], [733521.52808368, 5859280.356713]]]"      I get a result where the layer is rectified, but the it doesn't appear at the right place, and the image is not cropped. I did a screenshot of the result. The polyon represents where the image should be, and the picture is just a random image I used for testing purposes. One can see that the upper left and lower right corner are missing. I don't know if using a SLD is the most elegant solution, but it is the only one I found to do it on the fly. Any Ideas? ![The result of the georectification via SLD](http://i.stack.imgur.com/LGUif.png)


Purple anomaly on imagery

Can someone please tell me what this purple anomaly is on the imagery that we just received. The only thing I have done processing wise is to build the pyramids when they first came into ArcMap. Other than that, I have not done anything. I also should add that the purple dissapears when zoomed in to an extent past 1:10000, and gets larger as you zoom out. Any help would be great. Thanks![alt text](http://i.stack.imgur.com/oXIBg.jpg)


Does Quantum GIS recognize QDGC information?

Good morning! So a bit of background on what I am working on: We are in the process of assisting a wildlife institution in South Africa with trying to take their information and surfacing it in a commercially available BI tool. As part of their data they store Quarter Degree Grid Cell information about an extremely endangered mammal (Not Rhinos). They do not want to specify precisely where they spotted the animal due to the risk of poachers getting hold of the co-ordinates and poaching the animal. The problem: I have not come across a tool that naively recognizes QDGC information, and I don't want to start writing custom code for them as they don't have the skills to support the solution should something go wrong in future. This means that the solution that we will deliver will not be sustainable, which is definitely not ideal. What I would like: So my question is does Quantum GIS recognize QDGC information? If not, could the functionality be built in to the tool? If still not, could you please point me in the right direction? Looking forward to hear from you. Kind regards, Colin


How to call Leaflet FullScreen plug-in from code

I'm currently using Leaflet along with leaflet.fullscreen to provide a full screen map. I've got it working nicely with the button but I can't work out how to "call" the function manually from my Javascript code. I've tried: `map.fullscreenControl.toogleFullScreen();` but get the following error and a "broken" fullscreen:                   TypeError: this.invalidateSize is not a function         this.invalidateSize();      Any help appreciated, thanks.


How to write a QGIS Action which opens a PDF from a server?

I need to open a PDF from an action in QGis. The PDF rests on a server, not local. So far I tried this (as Python):               from PyQt4.QtCore import QUrl;      from PyQt4.QtWebKit import QWebView;       myWV = QWebView(None);      myWV.load(QUrl(('https://myserver.com/[% "path" %]));      myWV.show()      This just opens an empty window. It works with a png. Can anybody tell me how to do that. Thanks!


Geoserver url is not working

I'm using GeoServer since couple of months and it were working fine. Today, after some gap, when I typed localhost:8080/geoserver; it is giving an error Object not found! The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again. If you think this is a server error, please contact the webmaster. Error 404 localhost 20/12/2013 5:51:07 PM Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8o PHP/5.3.4 mod_perl/2.0.4 Perl/v5.10.1


How to create polyline of varying distance from origin point using azimuth?

I am looking for a Python script that does the following:   1. Uses a point (from a point shapefile) as the origin.   2. Creates about 3 km line from point   3. Based on an azimuth provided in the original point shapefile.   4. Creates new entry in another shapefile with the new line I imagine this involves trig, but I can't decide the best way to go about it.


How to convert a .rik to .tif?

I have a quite large high-resolution map in a format called .rik from the Swedish land survey agency. I want that whole high resolution file in different format that can be used to print a map from a large area. When i choose "Save as picture" in the Archive menu now, it only exports the view seen on the screen. If I zoom-out to see the full extent of the map and then export it the resolution is poor. I want to export the whole file in the highest possible resolution. Is there a way to do this?


Where can I programmatically download SRTM_V4.1 data?

SRTM v4 is an effort by the folks at CIAT-CSI to scrub, polish, and remove gaps in the raw SRTM data released by NASA (SRTM 3). One userfriendly interface : http://dwtkns.com/srtm/ provides *srtm_xx_yy.zip* tiles of ~20Mo each. ![enter image description here](http://i.stack.imgur.com/YQxmC.png) The CIAT-CSI project provides 3 zipped tiles (W, NE, SE) of ~1Go each. These files are behind a public password (see page), on box.com, which block programmatic download. **Is there any mirror with these 3 big SRTM 4 files using a stable link ?** so I may use a `makefile` to let coworkers to programmatically download them via `curl` or alikes.


running tlb from bin -- interop.scripting.dll not found

I rebuilt a custom command in VS Express 2013, added from file to a custom toolbar in ArcMap 9.3.1. The form appears, but upon running I immediately get an error about a missing Interop.Scripting.dll file. I wonder if this is due to the fact that the reference to this dll points to the obj\Debug folder and not bin\Debug, where the tlb (type library) file resides. This is what VS automatically points to, however, and I don't think I'm supposed to change those references. I had the impression I could use custom commands without deploying an executable msi? To be clear, I am building this from source - there should be no need to use regasm or the sort to register the COM files. Here's a glance at some of my references. I think this is where the problem lies. ![Pic](http://i.stack.imgur.com/jP7aE.png) ![Pic](http://i.stack.imgur.com/iUlz9.png)


Run this module in GRASS 6.4.3 command line in Windows 7 or QGIS Grass Module

I have GRASS 6.4.3 running and working in windows. I would like to use this script (http://grasswiki.osgeo.org/wiki/AVHRR) Scroll down to Import to see the code. I have the correct EPSG set but still not luck even with the comment below.                   # Convert and import SST maps          for file in *pfv50-sst*.hdf ; do            map=`basename "$file" .hdf`            echo "map: $map"                 gdal_translate -a_srs "+init=epsg:4326" -a_nodata 0 \              -a_ullr -180 90 180 -90 -co "COMPRESS=PACKBITS" \              HDF4_SDS:UNKNOWN:"$file":0  ${map}_prep.tif            r.in.gdal in=${map}_prep.tif out="$map"          done      How do I implement it in Grass Command line in Windows? And where should I place all my .hdf files? I do have Cygwin running as well so conceptually can drag and drop a .sh file into Grass Command line. ![My grass start screen](http://i.stack.imgur.com/oZvxd.png)


dojo/parser::parse() error TypeError {stack: (...), message: "Cannot read property 'toString' of undefined"}

I'm trying to get the overview map example working from here: https://developers.arcgis.com/javascript/jssamples/widget_overviewmap.html in my site. I have two errors. Chrome gives the one above in the title and IE gives "dojo/parser::parse() errorTypeError: Unable to get property 'toString' of undefined or null reference". Also Chrome gives me the error: Uncaught TypeError: undefined is not a function when I have the OverviewMap variable in my function, IE says SCRIPT438: Object doesn't support property or method 'byId'. If I comment it out like this:               /*OverviewMap,*/ dom) {      and the reference to it below, I don't get those second two errors. looked at this one: ArcGIS API for JavaScript - error in Dojo parser.parse() but I don't have Lang=en anywhere...               @model Site.Models.LoginModel     @{         ViewBag.Title = "My Map";          }     @functions{         public string GetAntiForgeryToken()         {             string cookieToken, formToken;             AntiForgery.GetTokens(null, out cookieToken, out formToken);             return cookieToken + ":" + formToken;                         }     }                    @if (1==1)     {         @section toolbar {

Zoom In

Zoom Out

Full Extent

Prev Extent

Next Extent

Pan

Deactivate

                          }
             <input id="antiForgeryToken" type="hidden" value="@GetAntiForgeryToken()" />
Sidebar

     }     else     {

Log in
                 @Html.Partial("_Login")

Log in using another service
                 @Html.Action("ExternalLoginsList", "Account", new { ReturnUrl = ViewBag.ReturnUrl })

First time here? Sign up

Sign up
             @Html.Partial("_Register")
Already signed up? Log in

     }
          @if (1==1)     {                   @section styles {           @Styles.Render("~/bundles/bootstrap/map/css")             <link rel= "stylesheet" type="text/css" href="http://js.arcgis.com/3.9/js/dojo/dijit/themes/claro/claro.css" />           <link rel="stylesheet" type="text/css" href="http://js.arcgis.com/3.9/js/esri/css/esri.css"/>                          }              @section scripts {                                                                              }     }


Is my code for changing the resolution correct?

I have a raster files of daily minimum temperature (tmin) for the period 1962-2011 at a resolution of 1.125. I need to convert each single day raster file into 0.5 using inverse distance interpolation. The file is for the entire world and I need the file only for a selected county.               g.region vect=my_location  # setting g. region to my area of interest     i=1962                      #beginning of loop       while [ $i != 2011 ]     do         j=1         while [ $j != 366 ]         do                 g.region res=1.125                   #original resolution                 r.to.vect input=tmin$i.$j output=point_tmin$i_$j feature=point      #converts raster to point                  g.region res=0.5                # changes the resolution                 v.surf.idw input=point_tmin$i_$j output=idw_tmin$i.$j column=value npoints=4            #does the interpolation                 g.remove vec=point_tmin$i_$j                 j=`expr $j + 1`        done        i=`expr $i + 1`     done      I just need a confirmation from someone if this code will work fine and will do the desired work. I ran it only for a single file and then tried to make a shell script to run it for all the files. Thanks a lot


Attribute table where rows do not appear

I have an attribute table with 20000 rows but the rows don't appear in the attribute table, so I cannot do a selection that I want. Any idea what the reason could be? I have arcgis 10.2. Fyi, I have imported this table from an access database. ![enter image description here](http://i.stack.imgur.com/iN6ZP.png)


Polygon feature in PostGIS

I have uploaded a feature to the PostGIS db and visualize it by mapguide. Now I would like to know how can I update (add) features from database directly. Can I add a new row from the web form directly? Can the mapguide help to generate the new feature? Thanks.


Issue on Sliced SVG from Shapefile - ArcMap

Using ArcMap 10.2 I have a shapefile of Bc, Canada (polygon) in UTM zone 10. The shapefile is ok in ArcMap and I can change the it's style but when I export the map to SVG and I open it in Adobe Illustrator to create SVG Mapthe shape looks like: ![enter image description here](http://i.stack.imgur.com/JWizs.png) Can you please let me know why this is happening?


How do you convert SRTM HGT elevations from WGS84 into meters above sea level?

I am building a JavaScript script that reads binary HGT files - as generated by the SRTM - and converts the data into bitmaps viewable in your browser. You can try out the script and view the source code of a preliminary version on GitHub: https://github.com/jaanga/terrain-plus/tree/gh-pages/cookbook/read-hgt-files The app seems to be reading the elevation data correctly, but the numbers are huge ( over 20>). See the demo which shows the first 50 heights of the file. In this case, the demo shows the southern tip of Point Reyes near San Francisco CA. The SRTM 'Quickstart Guide' says: > Heights are in meters referenced to the WGS84/EGM96 geoid I cannot find a definition or explanation for what this exactly means. Nor have I found any JavaScript code that could be used to convert the 16 bit integer HGT data into something like meters of elevation above or below sea level. Any help or suggestions appreciated...


Developing QGIS plugin on Mac - GDAL

I'm developing a plugin for QGIS called DEMtools. It runs fine on my linux machine, but is causing me headaches when run on Mac OS X Mavericks (surprise, surprise). I keep getting segmentation faults that look like they are caused by GDAL accessing a GTiffDataset. Does anyone have any experience debugging these kinds of problems with qgis plugins in the Mac OS X environment? For starters I'd like to know where in my code this goes pear shaped, but as it crashes QGIS entirely, printing messages to the QGIS python console isn't an option. **UPDATE:** > I get the same error running in Safe Mode. **UPDATE 2:** > I've got Eclipse+PyDev up and running for better debugging. This post is > helpful with that. I've identified the problem, but I haven't found a fix > yet. > > As should have been clear initially from the first 6 lines of the backtrace, > the problem is the GDALClose. My code didn't explicitly close the dataset > and was relying on the gdal `__del__` method after it moved out of scope. > > However, even when I explicitly close the data set, `dataSet = None` the > same problem occurs **within QGIS.** > > When I open the python editor from the terminal I can use the gdal module to > open and close the same file all day without a problem. (and as stated > earlier, it works in linux) I am very close to being totally stumped. Any > thoughts? Also, I'd be really interested to know if any one can successfully run the plugin and/or duplicate this error in the Mac environment. Below is (part of) the crash log:               Process:         QGIS [511]     Path:            /Applications/QGIS.app/Contents/MacOS/QGIS     Identifier:      org.qgis.qgis2     Version:         2.0.1 (2.0.1 [f738351])     Code Type:       X86-64 (Native)     Parent Process:  launchd [262]     Responsible:     QGIS [511]     User ID:         501          Date/Time:       2014-05-26 12:58:19.517 +0200     OS Version:      Mac OS X 10.9.3 (13D65)     Report Version:  11               Crashed Thread:  0  Dispatch queue: com.apple.main-thread          Exception Type:  EXC_BAD_ACCESS (SIGSEGV)     Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000          VM Regions Near 0:     -->          __TEXT                 000000010a8fd000-000000010af86000 [ 6692K] r-x/rwx SM=COW  /Applications/QGIS.app/Contents/MacOS/QGIS          Thread 0 Crashed:: Dispatch queue: com.apple.main-thread     0   org.gdal.gdal                   0x000000010d45d2bb GDALMultiDomainMetadata::Clear() + 55     1   org.gdal.gdal                   0x000000010d2c0e40 GTiffRasterBand::~GTiffRasterBand() + 32     2   org.gdal.gdal                   0x000000011cce6fb9 GDALDataset::~GDALDataset() + 485     3   org.gdal.gdal                   0x000000011cb8855d GTiffDataset::~GTiffDataset() + 117     4   org.gdal.gdal                   0x000000011cce53bb GDALClose + 146     5   _gdal.so                        0x000000011ca896e7 _wrap_delete_Dataset + 279     6   org.python.python               0x000000011a8c3f72 PyObject_Call + 101     7   org.python.python               0x000000011a8c07d1 PyObject_CallFunctionObjArgs + 190     8   _gdal.so                        0x000000011ca69d43 SwigPyObject_dealloc + 94     9   org.python.python               0x000000011a8ee88f 0x11a8ba000 + 215183     10  org.python.python               0x000000011a90db4c 0x11a8ba000 + 342860     11  org.python.python               0x000000011a8dfe7c 0x11a8ba000 + 155260     12  org.python.python               0x000000011a94087c 0x11a8ba000 + 551036     13  org.python.python               0x000000011a93d4d4 PyEval_EvalFrameEx + 13079     14  org.python.python               0x000000011a93a093 PyEval_EvalCodeEx + 1641     15  org.python.python               0x000000011a8e1796 0x11a8ba000 + 161686     16  org.python.python               0x000000011a8c3f72 PyObject_Call + 101     17  org.python.python               0x000000011a8ce9a7 0x11a8ba000 + 84391     18  org.python.python               0x000000011a8c3f72 PyObject_Call + 101     19  org.python.python               0x000000011a94001f PyEval_CallObjectWithKeywords + 93     20  sip.so                          0x000000011ab46d38 sip_api_invoke_slot + 753     21  QtCore.so                       0x000000011ac6d597 PyQtProxy::invokeSlot(qpycore_slot const&, void**) + 179     22  QtCore.so                       0x000000011ac6d885 PyQtProxy::unislot(void**) + 117     23  QtCore.so                       0x000000011ac6d975 PyQtProxy::qt_metacall(QMetaObject::Call, int, void**) + 95     24  QtCore                          0x000000010f5bc2e2 QMetaObject::activate(QObject*, QMetaObject const*, int, void**) + 2146     25  QtGui                           0x000000010fee5ef1 QAbstractButton::clicked(bool) + 49


How to develop a Toolbox intended to be distributed in multiple version of ArcGIS?

I am currently developing a Toolbox for users who will use it in different versions of ArcGIS (10+ versions). Is there a recommended way to proceed in that situation? My main concerns about that are:   * Someone had to face that issue before me, how did they overcome the "one version per machine" limitation (ESRI FAQ) ? You can install another version on a virtual machine, but it makes the whole thing more laborious.   * How to deal with arcpy version differences in the code? Is there a clean way to handle multiple arcpy versions in the same application? All that I can think of is either split completely the tools for the different versions or design some sort of facade/strategy design pattern. I'm quite surprised I couldn't find more information on how people deal with that. Thanks NB for people passing by: the Toolbox must be saved in the oldest version (ArcGIS Help 10.1)


Minimum hardware requirements of server for host ArcGIS Server / QGIS / GeoServer?

I want to buy server on (Hetzner or other) for host the OpenLayers map on site. Well, I do not understand what the performance should be the server. I know that it depends on many factors (size, format, cache and etc), but how can I calculate it? For example.   * 20 GB data TIFF, cache 3GB png And what other factors should I consider? I think the use of a ArcGIS server, QGIS or other doesn't matter. Thanks


What is the best or recommended way to store a GeoJSON FeatureCollection in MongoDB?

The comments in this question: Shapefile to GeoJson conversion using C# raised another one: what is the best way to store a GeoJSON FeatureCollection in MongoDB? Is there any sort of convention when it comes to adding GeoJSON FeatureCollection to a MongoDB? When I create a GeoJSON output with ogr2ogr: `ogr2ogr -f GeoJSON outshp.json c:\temp\us_counties_.shp` I get a json file and load that into MongoDB collection. The result is collection with a single document of type FeatureCollection, which contains all of the features: ![enter image description here](http://i.stack.imgur.com/pO1JJ.png) It seems like a mongo collection and a featurecollection are redundant. Is there any sort of convention on how the Feature documents are stored? Are they typically left in their GeoJSON FeatureCollection? Or are they typically moved out of their GeoJSON FeatureCollection container once in a MongoDB? ![enter image description here](http://i.stack.imgur.com/ZVzls.png) Would there be any advantage in doing so? The scope of my questions is the group of features that would be analogous to a shapefile or featureclass, not for cases were you start nesting geometries or feature json inside other documents.


Splitting the job on Arcpy SearchCursor

I'm running a for loop with a cursor to disaggregate a large feature class into many smaller ones (of one polygon each). ArcMap crashes after about 1100 iterations, and I am trying to break the job down into more manageable snippets. I just can't get the code right. I have 4909 entries, and want to do it in five sets of 1000. Below is a copy of my original code, and recommendations on how to change it so that it runs for a selection of rows at a time are very much appreciated!               fc='C:\\Users\\xxxxx\\popcenters\\miyun_villages_poly.shp'     cursor=arcpy.SearchCursor(fc)     for row in cursor:         FID = str(row.getValue("FID"))         where = '"FID" =' + FID         out_fl='C:\\Users\\xxxx\\miyun_allvillages.gdb\\allvillages_miyun\\fl_{0}'.format(FID)         arcpy.MakeFeatureLayer_management(fc,out_fl,where)         SaveToLayerFile_management(out_fl, allvillagesfl)


How to encrypt/decrypt the Database password with FME 2011?

Is it possible to use the encryption MD5 or other for Database password with FME 2011 ? Link Thanks.


Parameters for python script: how to provide a user interface that lists a tool's available value options?

I have several scripts that I have working from inside PythonWin. I am now experimenting with running these from inside ArcMap 10.0 so I can have a user define the parameters of the script. An important part of designing this popup for the user is choosing a "data type" for each parameter. However, I find ESRI's information about data types for parameters of little use for figuring out which to choose to get different results for user interaction. For instance, say I have a script uses the dissolve tool in some way and I would like to have the user choose what type of "statistics_fields" they want in the final resulting shp file that the script returns (there are nine choises: FIRST, LAST...etc). Specifically, I would like to know how to choose the correct data type for this parameter so that the final user interface: _**a)** Provides a list of all nine choices available and allows the user to pick up to 9 variables that they would like to be included in the attribute table of the resulting shp file._ _**b)** Provides a list of all nine choices as a pull down menu and allows the user to only pick one that ends up in the attribute table of the resulting shp file._* How can I accomplish a) and b)? Perhaps I need to do more than just choosing the right data type?


How to efficiently find the closest point over the dateline?

I have a PostgreSQL 9.1 table with hundreds of thousands of PostGIS POINTs. For each of these I'd like to find the closest point in another table of POINTs. The points in the second table represent a grid over the whole world, so I know there is always going to be a match within 1 degree. This is the query I'm using so far, which makes use of GIST indexes, so it's reasonably fast (about 30 seconds total).               SELECT DISTINCT ON (p.id)         p.id, ST_AsText(p.pos)         , ST_AsText(first_value(g.location) OVER (PARTITION BY p.id ORDER BY ST_Distance(p.pos, g.location::geography)))     FROM point p     JOIN grid g ON ST_DWithin(p.pos::geometry, g.location, 1)      The only problem is the dateline. The grid points only have latitude 180, not -180. When using the geometry version of ST_Distance this does not return points on the other side of the dateline. Eg. if p.pos is `POINT(-179.88056 -16.68833)` the nearest grid point might be `POINT(180 -16.25)`, but the above query doesn't return it. What's the best way to fix this? I don't really want to have two coordinates for a single grid point (-180 and +180). I tried adding in my own function which checks for this specific case, but then the query doesn't return in 5 minutes, probably because it can no longer use the index. I also tried using the geography version of ST_DWithin and that query also didn't return after 5 minutes.


CartoDB.js SQL API editing geometry

Is there anyway you can allow users to edit the geometry of shapes (e.g. move an existing point) using the CartoDB.js or CartDB SQL API libraries. I realise you can do this directly in the CartoDB app but I don't want to give the client access to the CartoDB app and would rather them edit the data through a separate web app. The only thought I have had so far is to convert the features to GeoJSON and use available leaflet functions to move the data and then update the location via the SQL API.


Geoserver Link to External MS-Access Database

Is there a way that I can link a shape (as a polygon, with a LINK_ID = 12345) from Geoserver and have it open or link to the specific information (LINK_ID_DB = 12345) within an online Web Microsoft Access Database (on the same webserver) as a new tab to show addional information that is not in the GIS layer within Geoserver? This would enable me to update data externally for users that do not want to view the GIS data. Thanks.


How to reverse the drawing order of markers?

I saw this example which demonstrates how ordering can be controlled with markers added using styling options (graphicZIndex) applied to a vector layer. Due to the limitations in the combination of event listeners that I can apply using this method, I am forced to use the markers layer instead. There are 100 points with associated data that I need to present both on the map (as markers) and listed below it (as detailed data). The data is sorted with the most important data appearing first. It makes sense that the corresponding marker is also on top of the heap. But by looping through the array, and calling the `addMarkers` function while appending data to the bottom of the map, the most important marker would be buried under the heap. Is there a way to reverse the ordering of the markers without having to loop through the data twice?


How to draw a linear map programmatically?

I'm new to GIS programming and I'm using OpenLayers for my GIS project. I want to know how to draw a **linear map programmatically** between two locations from a real geographical map (may be OpenLayers). I think there should be a projected coordinate system for this. Is there any distance mapping algorithm to accomplish this task? I do not mean adding a vector layer to an existing map. I want create a separate line map looking at a real geo map (Obviously a path connecting two locations). **Original map** ![original map](http://i.stack.imgur.com/8f5qF.jpg) **Linear map** ![linear map](http://i.stack.imgur.com/V0Ggg.jpg)


Exporting to 2D (Arcview 3.0 compatible) shapefile in QGIS?

I need to run my shapefiles through a web mapping application which is incompatible with 3D shapefiles. At present I run them through the FME Universal Translator in Mapinfo, which enables you to specify shapefile type. I'm trying to find equivalent functionality in QGIS but haven't been able to so far. Anyone know if this is possible?


How to have PostGIS 2.1 and the Python osgeo library installed together without compiling from source?

My python application makes heavy use of the `osgeo` library. We're looking to upgrade from PostGIS 1.5 to PostGIS 2.1, and I'm having issues. I'm installing packages from the Ubuntu GIS PPA. Before, I would install the `python-gdal` Ubuntu package to install GDAL with a copy of the `osgeo` python library. I would also install `postgresql-9.1-postgis`. Now, installing `postgresql-9.3-postgis-2.1` uninstalls `python-gdal`, and vice versa. They are incompatible with one another, since one requires `libgdal1` and the other requires `libgdal1h`. I have found instructions to compile `libgdal` from source, specifying to include the `osgeo` python library, but I would prefer to use a package if possible. Does anyone know of a way to have PostGIS 2.1 and the Python `osgeo` library installed together without having to compile from source?


Display house numbers on the street corners

I have a street map (MuliLineString geom and house numbers min and max, left and right). I would like to show this numbers on the street corners. I use GeoServer. If I use the TextSymbolizer with LinePlacement the label is in the middle of the line.   If I use it with Geometry (startPoint and endPoint function) I can't move it in parallel. (All the labels are at the same point.) Have you any idea? Thanks


How to solve "Cannot create topology" in ArcCatalog?

I have a FileGeodatabase in ArcGIS 10.0 with a feature dataset and five feature classes (3 polygon shapes, 1 line shape, 1 point shape). I'm trying to create a topology to verify some vectors. Rightclicking `Feature Dataset > New... > Topology`. I'm getting the following error message in ArcCatalog: > ArcCatalog cannot create topology. The selected feature dataset does not > contain any feature classes which can participate in a topology. Browsing the internet for the error message, I found this tech article by ESRI. It tells the following: > There are several reasons for a feature class to be excluded from > participating in a topology: > >   * The feature class already participates in a topology or geometric > network. >   * The feature class is an annotation or dimension feature class. >   * The feature class is registered as versioned. > I'm not quite sure what that means. There is no other topology or geometric network as far as I can see. What is an annotation or dimension feature class? The classes are all X;Y-coordinates only (2D). What is a versioned or registerd feature class? I've tried checking all classes properties for something that sounds like that. This answer to a similar question suggests to unregister the feature classes. But how?


Best data for demonstrating world poverty on Mollweide projection

I am overwhelmingly failing at finding data about global poverty that is any more specific than at the country level. Because poverty has such a wide definition I am open to really anything that is an indicator, like high infant mortality or others. Any suggestions to point me in the right direction for data more specific than the country level would be great. Preferably it is not raster data but data I can manipulate on Arc 10.1. Any suggestions are welcome to get me out of this barrier!


pyspatialite, cannot update geometry

I'm trying to update geometry column with pyspatialite but it returns error: > spatialite.dbapi2.IntegrityError: mypoints.the_geom violates Geometry > constraint [geom-type or SRID not allowed] My code is:                cursor.execute(''' UPDATE mypoints SET  address = ?, the_geom = geomFromText('POINT(%f %f)', 2100)  WHERE PK_UID= ? ''' % (x_egsa, y_egsa),  (myaddress , myID))


How to Spatial Join centroids of parcels to point data and get the distance

I'm currently using ArcMap 10.1 (basic license). I have a LSOA shape file of Camden borough. From there I added 2 extra fields within the attribute table, X and Y. I then calculated the 2 extra fields to give me the centroid of each output area. I also have a point data shape file of the underground stations within Camden borough. three things I need to work out:   1. Get the **distance** for every LSOA to the closest underground stations in order to create a choropleth map   2. I need to create a polygon vector file containing the catchment areas of every underground station in Camden. If there are 19 stations then I assuming that there are 19 catchments areas   3. Get the centroid of the catchment areas and then get the distance to the closest underground stations and create a choropleth map I hope that makes sense


How to set up a layer control using Leaflet?

I have been working on a mapping application using Leaflet. I am using a WMS on Geoserver to get my layers, which are overlaid on a cloudmade basemap. I tried to use the layer control on my map by following the tutorial on the Leaflet website. The problem I am facing is that the layers in my map are not populated in the layer control. Instead, what I get is garbage data inside the layer control. This is what the control content looks like: ![content](http://i.stack.imgur.com/dz71I.png) This is my code:


Checking if a point is in a circle

I'm using shapely to check if a point is in a polygon, but I also need to check if a point is in a circle. Checking the docs, I don't see how do that... Maybe I could create a circle? `circle = (x,y).buffer(R)` But it doesn't seem to work using R in miles distance to set the ratio... Is it possible? Or is there another lib to get it?


How to use filter in GeoExt.FeatureStore?

I have a FeatureStore:                       var protocol=new OpenLayers.Protocol.HTTP({                 url: "/geoserver/ows?service=WFS&request=GetFeature&typeName=xxxx:lineview&srsName=EPSG:4326&outputFormat=GML2",         });         zoomStore_disp = new GeoExt.data.FeatureStore({             layer: myVecLayer_disp,             fields: [                 {name: 'id', type: 'int'},                 {name: 'name_dispatcher', type: 'String'},                 {name: 'voltage', type: 'String'},             ],             proxy: new GeoExt.data.ProtocolProxy({                 protocol: protocol,             }),             autoLoad: true,         });      But lineview layer contains too much features. So i must wait a lot of time before store is load. Its possible to load in store features by filter? i cant find any examples or documentations how to use it.


How to add items to the TOC without automatically displaying the items?

Is it possible to add items to the table of contents (ArcMap) without automatically displaying the items in the main window?


Spatial Analysis with Factors/Classifications

When doing analysis on spatial data with associated information that is numeric, it is possible to use techniques such as Kriging or Interpolation or Cluster Analysis to find out interesting relationships in your data. Then you can visualise using your choice of poison/GIS. Okay. Now, I want to do the same type of things with spatial data that has associated non-numeric data, i.e. a "Factor" in R or a "Classification". However I cannot find techniques that allow one to do this. Does anyone know of methods that can be used to perform this type of analysis? It would also be a bonus you know whether they can be performed in R or QGIS. * * * I would really love a model to do interpolation with a non-numeric attribute. The set I would use this interpolation on would be lithology or other geological data.


How to read/write a/from a file in javascript with prototype.js/jQuery.twFile support OR anyotherway

I want to write my data into a file from OpenLayers, I have gone through Prototype.js and jQuery.twFile.js or anyother way to write into a file.


Developing tools for ArcMap 9.x and 10.x

I've been asked to start developing something for ArcGIS 10.x, but here is the problem: in my computer I already have the SDK and ArcMap 9.3.1 installed. That means that I need to uninstall it before installing 10.x. My problem lies that I still work with customers that uses 9.3.1 and this is the first one with 10.x. What strategies are you guys using for targeting both platforms? My initial idea is to use virtual machines, but that is a PITA. Also, what if I throw some ArcEngine development? Do I still need separate boxes? Any other options?


Using QGis for an imaginary plane world

I created an own map for my p&p rpg group and now I want to transfer it into QGis. That's easy to make, but I'd like to have an own CRS for that map but don't know how to use the right proj.4 definitions. Maybe anyone here can help me with that? The map will be 30.000km from West to East and 21.000km from north to South. David


Importing MaxSea 3D Database to PostGIS

I am currently working on a project, where I combine several MaxSea 3D databases, which contain depth measurements made by the echosounder onboard on a ship. The idea is to combine these databases to create a detailed seafloor map around the Faroe Islands. I do not know if any of you have worked with this program before, and I am not able to find anything on this site related to MaxSea. The file format is proprietary, and the files generated are named 3DDB.PTZ. By inspecting the file, is see that it is a password protected Microsoft Jet database, but with some tools, I have been able to read from the file. The database contains a table named 3DTable which has the following structure:               ╔═══════╦══════════╦═══════════╦══════════════════╦═════════════════╦═════════════╦════════════╗     ║ Level ║   Lat    ║    Lon    ║ WeightDepth_CMap ║ ValueDepth_CMap ║ WeightDepth ║ ValueDepth ║     ╠═══════╬══════════╬═══════════╬══════════════════╬═════════════════╬═════════════╬════════════╣     ║     7 ║ 88021504 ║ 220475264 ║                  ║                 ║           1 ║ -48.64608  ║     ║     7 ║ 88021504 ║ 220475392 ║                  ║                 ║           1 ║ -48.64608  ║     ║     7 ║ 88021504 ║ 220508928 ║                  ║                 ║           3 ║ -19.2024   ║     ║     7 ║ 88021504 ║ 220509056 ║                  ║                 ║           2 ║ -13.35024  ║     ║     7 ║ 88021632 ║ 220474880 ║                  ║                 ║           1 ║ -48.64608  ║     ║     7 ║ 88021632 ║ 220475008 ║                  ║                 ║           1 ║ -48.64608  ║     ║     7 ║ 88021632 ║ 220475136 ║                  ║                 ║           1 ║ -48.64608  ║     ║     7 ║ 88021632 ║ 220509056 ║                  ║                 ║           3 ║ -21.0312   ║     ║     7 ║ 88021632 ║ 220509184 ║                  ║                 ║           3 ║ -21.9456   ║     ║     7 ║ 88021632 ║ 220509312 ║                  ║                 ║           1 ║ -7.3152    ║     ║     7 ║ 88021760 ║ 220461696 ║                  ║                 ║           1 ║ -70.77456  ║     ║     7 ║ 88021760 ║ 220474624 ║                  ║                 ║           1 ║ -51.75504  ║     ║     7 ║ 88021760 ║ 220474752 ║                  ║                 ║           1 ║ -51.75504  ║     ║     7 ║ 88021760 ║ 220509952 ║                  ║                 ║           2 ║ -14.6304   ║     ║     7 ║ 88021760 ║ 220510080 ║                  ║                 ║           5 ║ -33.8328   ║     ║     7 ║ 88021760 ║ 220510208 ║                  ║                 ║           2 ║ -13.53312  ║     ╚═══════╩══════════╩═══════════╩══════════════════╩═════════════════╩═════════════╩════════════╝      The column `Level` ranges from 5 to 21, in this particular dataset. However, I do not know how to process the data, as I do not know what format/projection the columns lat/lon is, and how to make sense of this. In the project (it is my Bachelors project in Software Engineering), I will focus on the data quality, and how I can combine different datasets from ships and trawlers to create a detailed map. I have reference data from a research ship belonging to the Faroese Marine Research Institute, taken with a calibrated echo sounder of a higher quality. To assist me in the process of combining the data, I intend to create a open source `ptz2pgsql` utility, similar to the `shp2pgsql` utility, and I would appreciate it, if someone of you could help me make sense of the data I have available at hand. I am able to send a sample of the data to you (a PTZ database). I have also contacted MaxSea to ask if it is legal to reverse engineer their proprietary file format.


Create a network topology for pgrouting with grade separation

I have built a network using Ordnance Survey's ITN data and I can solve routes across the network. What I need is to build in grade separation topology for overpasses and underpasses on the network so that my routing solutions do not drop off bridges onto roads underneath in an attempt to make the shortest path possible. Does anyone have any pointers as to where to start? I am using PostGIS 2.0.3, pgRouting 1.0.7dev and Postgresql 9.2 on Windows.


Help with trying to track ice and polar bears on a map. No idea where to begin

I was asked create a little google map showing the location of Polar bears. I've been given the location data in lat-long format. For each bear I've been given a file containing the following headings: Date Time Year Julianday Hour Minute Activity Temperature Latitude Longitude The intention was to show the migration of these bears over time - so I'd take the date, take the time, take the lat / long and animate a google map (straight ahead javascript + googlemaps api stuff - got it working... easy). However, I've now been asked to show the movement of arctic ice as well as bears.... Google maps doesn't have a North Pole... and while I've managed to overlay some ice, it just looks like a big white blob which didn't render out properly due to the lack of North Pole. I've been asked to use data found here http://nsidc.org/data/masie/. I need to find a way to take the nsidc data, and take the polar bear data and combine them to form a series of png files. Once I have the png files I can animate them.... vistor hits 'play' and all the files play back to show the bears and ice moving over time. The play stuff is easy... I just don't know how I am to create these files... To compound things, I've also been asked to include shipping data (also supplied in lat lon format) Normally I'd do lots and lots of reading to try and figure stuff out- however, I've been given 3 days to do this... I've tried a few things...downloaded "QGis" and pulling in the data - but nothing appears. I don't have a clue. How do I / where do I begin? Sorry - this is the worst, most vague question ever....


Rasterizing vector contour data: Python error message

would anyone know why qgis kicks up this error message (image attached) when using v.to.rast.attribute? the rasterise related to a contour set. i duplicated it twice to create 3 copies. the first rasterise worked perfectly! this is the attempt to rasterise the second file. ![enter image description here](http://i.stack.imgur.com/BbyNq.jpg)


How to recode bands in which max value occur?

I have 2 raster images; ras1 (an image with max value) and ras2 (an image with 5 bands). Basically. ras1 image extracted from ras2 images. I'd like to find bands from ras2 in which max value occur and recode them 1 to 5. For example, ras2 has band1, b2, b3, b4, b5. if max value of ras1 occur in band 3, 3 return to output, if max of ras1 occur in band 4, 4 return to output etc. Could you give me suggestion what tool in Arcgis has ability to do this? I used inlist tool, but it gave me the values (not the number 1-5) thanks a lot