Python program for "Comparing total number of pages of an mxd to total number of PDFs created from that mxd"!

I need some help on my program. I have the parameters set to ask user to pick an mxd and the folder where those data driven PDFs are located. I started with Search Cursor to create a list from the Sheet_ID field of an mxd. To get total number of pages of that mxd. Now I need to write in for the program, to compare the list created from the Sheet numbers to the number of PDFs created and tell me if there is a difference in the total count. For Example: If there are 1 out of 11 sheets for the mxd, then there should be 11 PDFs created and so on. MY code is below:               #Purpose: Compares SheeID field to the toal PDFs created from Data Driven Pages Program     Import arcpy, os, string, sys          #Make parameters for people to choose mxd and folder of PDFs to compare     mxdList = string.split(arcpy.GetParameterAsText(0), ";")     dir = arcpy.GetParameterAsText(1)          #Use Search Cursor to go through Attribuite Table to get Sheet number info     rows = arcpy.SearchCursor(mxdList, "Sheet_ID")          #Use list from Sheet_ID field to match the number of PDFs created to get difference


Changing Spatial Reference System (SRS) of existing GeoTiff file?

How do I change the Spatial Reference System (SRS) of an existing GeoTiff file? Or more fully, what can I use to convert the meta data for the file to a different SRS?


ArcGIS - Spatial ETL Tool - Checking fields in input shapefile

How to check if the input file fields have the expected name and type? Which transformer will be useful to validate names and types of attributes of reader. edit: I have a shapefile that transforms using ETL to gdb. But at first I want to check if the attributes of this shapefile is required by me names and types. For example: I want to check if the file road.shp, which is my "reader" has attributes: 'NAME' [type: char, width: 265], 'NUMBER' [type: integer]. How to control input shapefile when I will have a next file to be transformed. I'm using ArcGIS 10.2.2 with FME 2014


TinyOWS on IIS 7.5 as FastCGI does not see GET query string?

I'm trying to set up TinyOWS on IIS 7.5 as a FastCGI application. I've got the binary allowed in 'ISAPI and CGI restrictions', configured the handler for my virtual directory, set the TINYOWS_CONFIG_FILE env. variable for the TinyOWS FastCGI application. The problem is, if I send some basic HTTP GET request like               http://localhost/[path to my virtual dir]/tinyows.exe?SERVICE=wfs&REQUEST=GetCapabilities&version=1.0.0      The response is always an ows:ExceptionReport with:               <ows:ExceptionText>Service Unknown</ows:ExceptionText>      If I configure tinyows to log everything the logfile looks like this:               [Fri May 09 16:10:42 2014] [EVENT] == FCGI START ==     [Fri May 09 16:10:42 2014] [QUERY] (null)     [Fri May 09 16:10:42 2014] [ERROR] Service Unknown     [Fri May 09 16:10:44 2014] [QUERY] (null)     [Fri May 09 16:10:44 2014] [ERROR] Service Unknown      So it seems like the QUERY_STRING environment variable is not set properly for the FastCGI. Quick search in TinyOWS source on Github seems to confirm this: https://github.com/mapserver/tinyows/blob/38510100f539a80b26f707dcc0c458982050f9a6/src/ows/ows.c#L382 Most probably i just misconfigured IIS in some way... Does anybody have some idea?


How to create a matrix of points inside a polygon with QGIS?

I need to create a matrix of points (e.g. 3.5 x 0.5 meters), with a defined orientation, inside a polygon. Essentially, I have to plan the arrangement of plants in a grove in order to plan an irrigation system. I appreciate any hints Antonino


How to combine stacked polygons within a shapefile?

The image below shows my shp-file. Every polygon has the same transparent color. So a darker blue means, that several polygons are stacked! How do I cut every polygon with each other so no polygons are stacked anymore? ![enter image description here](http://i.stack.imgur.com/bdI2E.png)


Convert ArcGIS gdb with coded domains to Postgres / PostGIS

We have several file gdb's and would like to convert these to Postgres / PostGIS. We've used ogr2ogr to transfer these files; however, some of the fields are stored as coded domains and the fields are not decoded in the transfer. Would anybody know how to include these domains in the transfer from gdb to Postgres / PostGIS? We could convert to file gdb's to an ArcSDE database it this is easier; shapefiles however are not preferred due to column truncation.


Shapefile CRS damaged. How to bring it back?

I have two shapefiles with same location and extends (EPSG 4326). But one of the shapefiles CRS seems to be damaged after doing a lot wrong with reprojection... its not shown on the same position as the first, not damaged one. Both have just to be on the same "place". How can I do that? Damaged: ![damaged](http://i.stack.imgur.com/bPbXo.png) Good: ![good](http://i.stack.imgur.com/PnDfO.png)


why I can not select layer when calculate the shortest path in QGIS?

![enter image description here](http://i.stack.imgur.com/fzEvu.jpg) ![enter image description here](http://i.stack.imgur.com/fRGZi.jpg) the option Layer is grey, can not be selected. Does anyone know why?


Converting from GEOTIFF to JPEG2000

I need to convert raster from one format to another (geotiff-->jpeg2000). First I tried with very simple workspace, having input geotiff and direct to output jpeg2000, but I got error message: JPEG2000 writer: This format cannot support palettes. Consider removing or resolving palettes that are attached to the raster What should I do?


Combo Box selection to definition expression

Using ESRI JavaScript API I would like the pass the selection in a combo box to the setDefinitionExpression. I think this should be possible, but I am not sure of exactly what to do. The code that populates the Combobox is:                var dataItems = {                     identifier: 'name',                     label: 'scenario',                     items: values                 };                 var store = new ItemFileReadStore({ data: dataItems });                      dijit.byId("mySelect").set("store", store);             }      I then tried to set the definition expression on the feature layer using the code below.               LUeditor.setDefinitionExpression("Planname = 'store'");      Is it possible that I have done this correctly, but I just need to be able to "refresh" the page to visualize the results?


Start-up error message in QGIS: Unable to load the extension GoogleLayers causes an error when calling its method initGui ()

> **Possible Duplicate:**   >  Problems with Google layers plugins Impossible de charger l'extension GoogleLayers provoque une erreur lors de l'appel de sa méthode initGui()               Traceback (most recent call last):       File "C:/PROGRA~1/Quantum GIS Lisboa/apps/qgis/./python\qgis\utils.py", line 173, in startPlugin         plugins[packageName].initGui()       File "C:/Users/bruno.saphy/.qgis//python/plugins\GoogleLayers\GoogleLayers.py", line 33, in initGui         self.sessionid = gmaps.get_sessionid()       File "C:/Users/bruno.saphy/.qgis//python/plugins\GoogleLayers\gmaps.py", line 21, in get_sessionid         sessionid = t.strftime("%d%m%Y_%H%M%S%s")     ValueError: Invalid format string      Version de Python : 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] Version de QGIS : 1.8.0-Lisboa Lisboa, 6416f38 Chemin vers Python : [`'C:\\Users\\bruno.saphy\\.qgis\\python\\plugins\\GeoCoding', 'C:/PROGRA~1/Quantum GIS Lisboa/apps/qgis/./python', 'C:/Users/bruno.saphy/.qgis//python', 'C:/Users/bruno.saphy/.qgis//python/plugins', 'C:/PROGRA~1/Quantum GIS Lisboa/apps/qgis/./python/plugins', 'C:\\PROGRA~1\\Quantum GIS Lisboa\\bin\\python27.zip', 'C:\\PROGRA~1\\Quantum GIS Lisboa\\apps\\Python27\\DLLs', 'C:\\PROGRA~1\\Quantum GIS Lisboa\\apps\\Python27\\lib', 'C:\\PROGRA~1\\Quantum GIS Lisboa\\apps\\Python27\\lib\\plat-win', 'C:\\PROGRA~1\\Quantum GIS Lisboa\\apps\\Python27\\lib\\lib-tk', 'C:\\PROGRA~1\\Quantum GIS Lisboa\\apps\\qgis\\bin', 'C:\\PROGRA~1\\Quantum GIS Lisboa\\apps\\Python27', 'C:\\PROGRA~1\\Quantum GIS Lisboa\\apps\\Python27\\lib\\site-packages', 'C:\\PROGRA~1\\Quantum GIS Lisboa\\apps\\Python27\\lib\\site-packages\\PIL', 'C:\\PROGRA~1\\Quantum GIS Lisboa\\apps\\Python27\\lib\\site-packages\\win32', 'C:\\PROGRA~1\\Quantum GIS Lisboa\\apps\\Python27\\lib\\site- packages\\win32\\lib', 'C:\\PROGRA~1\\Quantum GIS Lisboa\\apps\\Python27\\lib\\site-packages\\Pythonwin', 'C:\\PROGRA~1\\Quantum GIS Lisboa\\apps\\Python27\\lib\\site-packages\\wx-2.8-msw-unicode']ag`


Where to find QGIS tutorials and web resources?

I wish to familiarize myself with the capabilities of QGIS. I have downloaded the program, but apart from basic loading of data, I am lost (even after reading the help file). Can you recommend me some good web resources and tutorials that would show me QGIS' capabilities? I am in particularly interested in developing applications using QGIS.


I am looking for a complete tutorial in QGIS (lisboa version)?

> **Possible Duplicate:**   >  QGIS tutorials and resources I am looking for a complete tutorial in QGIS (lisboa version) ?? Can you show me any website where I can download this tutorial? Thanks in advance


Where can I find "QGIS Training Manual" data?

I can't find data for this lesson in Quantum GIS: 9.4 Lesson: Supplementary Exercise. Can anybody help me?


Fill sinks error in arcHydro

I am working on a project that is modeling runoff at a county level. The DEM used is lidar derived and has a 5 ft resolution. The general workflow I am flowing is   1. Sink evaluation   2. Sink Selection (to give a minimum drainage area)   3. Fill sinks (using the deranged polygon from the sink evaluation and the 'Use IsSink field' option). When I run the fill sinks tool I receive the following error: > System.Runtime.InteropServices.COMException (0x80041098): ERROR 010429: > Error in GRID IO: MtVatBldNew: Value range for > c:\users\user\appdata\local\temp\arcc79c\ah2014~4\tmp2675 exceeds 100000 . > ERROR 010429: Error in GRID IO: and number of unique values exceeds 500 .. > ERROR 010236: Error in building VAT. ERROR 010067: Error in executing grid > expression. at > ESRI.ArcGIS.GeoAnalyst.RasterConversionOpClass.ToRasterDataset(IGeoDataset > dataset, String rasterFormat, IWorkspace pWorkspace, String name) at > ESRI.APWR.ApHydro.ArcHydroOp.FillSinks(ApLayers& aplayers, Boolean > useIsSink, Boolean fillAll, Double fillLimit, ITrackCancel trackCancel, > IGPMessage messages, String& exMessage) in > C:\Builds\HydroSolutions\10.1_ArcHydro\Sources\ArcHydroTools\src\ApHydro\ArcHydroOp.vb:line > 57592 Failed to execute (FillSinks). I thought this was telling me that the DEM was too large in size, so I tried running the tool again with several subsets by using a polygon to determine the processing extent. This results in the same error and I am not sure why. I have tried the usual fixes (deleting temp files, checking output locations, using the toolbox vs. the toolbar) and the error still occurs. In order to get the DEM to a smaller size, it was converted from float to integer so I thought the VAT error pertained to that. I reran the tools using the float based DEM and received the same error. I have also tried using small subsets of the raster to see if that is the problem, and I have the same error. Can anyone offer insight on this or help me figure out what I am doing wrong?


cannot check in related tables in arcpad 10

I'm using ArcPad Data Manager (ArcMap 10) to check in data in axf file. I can check in feature layers, but I can't check in related tables and the feature class parent of the related tables. I have tried changing the `[AXF_STATUS]` to 1 in the parent feature layer and in its child related table, but it doesn't work too. Any advice or suggestions will be welcome. Thanks in advance.


Geoserver 2.4.5 with Openlayers 2.13.1 overlay WMS layer

I'm using GeoServer with OpenLayers, happens that my WMS layers do not appear. Do I need to overlay a WMS layer in PostGIS that I have with google maps api and does not work appears in WMS layer switcher but does not appear on the map. Generated the wms link to the Earth and visualized layer is perfect. I then tested by creating a simple map in openlayers with those with a WMS layer that comes in geoserver and neither worked. What could be wrong? Debuguei the code in chrome, with a breakpoint in loading the WMS layer and does not give any errors. This is my code:               <!DOCTYPE html>     <html lang='en'>     <head>      <meta charset='utf-8' />      <title>My OpenLayers Map</title>      <script type='text/javascript' src='OpenLayers.js'></script>           <script src="http://maps.google.com/maps/api/js?sensor=false&v=3.2"></script>           <script type='text/javascript'>                var map;      var mercatorProjection = new OpenLayers.Projection('EPSG:900913');      var latLongProjection = new OpenLayers.Projection('EPSG:4326');      var bounds = new OpenLayers.Bounds(                     -51.2809219360352, -30.2445888519287,                     -51.0207977294922, -29.9661273956299                 );           function init() {            map = new OpenLayers.Map('map_element',{         maxExtent: bounds,         maxResolution:  0.0010877400636672,         units: 'm',         //allOverlays: true,         projection: mercatorProjection,         displayProjection: latLongProjection      });                var google_streets = new OpenLayers.Layer.Google(         "Ruas",         {numZoomLevels: 20}         );          var wms_layer = new OpenLayers.Layer.WMS(     'Linhas Ônibus',     'http://localhost:8080/geoserver/Teste/wms',     {layers: 'Teste:onibus', transparent: true},     {isBaseLayer: false,         opacity: 0.7}     );               //Adiciona as camadas ao mapa     map.addLayers([google_streets, wms_layer]);               var point = new OpenLayers.LonLat(-51.22,-30.08);      point.transform(new OpenLayers.Projection("EPSG:4326"),          map.getProjectionObject());      map.setCenter(point, 10);       //Camada de controle que vai mostrar as camadas no mapa      map.addControl(new OpenLayers.Control.LayerSwitcher({}));           //Verifica se o mapa tem um ponto central e o extende a sua extensão máxima      if(!map.getCenter()){      map.zoomToMaxExtent();           }      }           </script>     </head>          <body onload='init();'> <!-- Chama a função js init() -->           <!--Elemento HTML onde o mapa é exibido -->      <div id='map_element' style='width: 800px; height: 800px;'>      </div>          </body>     </html>


ArcGIS javascript API: A way to position Dynamic Service layer on top of Graphic Layer?

I have 3 layers:   1. Tiled based map   2. DynamicServiceLayer with ~1000 points   3. Graphics layer with ~20 polygons I really need the DynamicServiceLayer to be on top of the graphics layer (point must be on top of polygons), but I think it might not be possible - does the graphics layer always draw on top of all other layers? I tried to reorderLayers without success. Anyone drawn a dynamic service on top of a graphics layer?


Can Openlayers plugin be faster?

Can the Openlayer QGIS plugin be modified to have better map loading performance? I use only google satellite/maps. Thanks.


Automate SHP to JPG creation

Does anyone know of a way to batch convert shapefiles to jpegs or another common image format? edit: I should have clarified that I would like to apply a styling to each shapefile, and then export the shapefile with that styling to an image. For example, I have census tracts in a county, and I want an image of each individual tract highlighted while the other tracts are all the same color.


Export some specific pages from data driven pages to pdf file by python

I need to export pages 14, 13, 23 and 24 of 26 pages of data driven pages to pdf file by python and then add the pdf file to the final pdf file by arcpy (python), any help please?


How to fix ImportErrors when loading Python plugins in QGIS?

I have recently installed QGIS 1.8 in Windows 8. Although QGIS seems to be working fine, I cannot load plugins after their installation. Instead I keep getting this message:               Traceback (most recent call last):     File "C:/OSGeo4W/apps/qgis/./python\qgis\utils.py", line 143, in loadPlugin     __import__(packageName)     File "C:/OSGeo4W/apps/qgis/./python\qgis\utils.py", line 309, in _import     mod = _builtin_import(name, globals, locals, fromlist, level)     ImportError: No module named linear_ref      Any ideas?


Update Point using WFS Transaction with GeoServer

I am trying to update a `Point` inside my PostGIS database that is connected with GeoServer. I specify the new coordinates in the WFS-Transaction post message like this:               <gml:Point srsDimension="2" srsName="urn:x-ogc:def:crs:EPSG:4326">             <gml:coordinates decimal="." cs="," ts=" ">0,0</gml:coordinates>     </gml:Point>      This works just fine. However I am confused about the next step. The `Points` inside my PostGIS database are not in `EPSG:4326` but `EPSG:28992`. So I tried changing the `srsName` to `EPSG:28992` but this just makes GeoServer throw an exception. How am I supposed to update Points using the EPSG:28992 projection? If I update the points using `srsName="urn:x-ogc:def:crs:EPSG:4326"` GeoServer throws an PointOutsideEnvelopeException which is understandable. Am I missing something here? Can I only update points using `EPSG:4326`?


PyQGIS joining a dbf to a shapefile

I am trying to join a shp and dbf file using the PyQGIS API. The code I'll use is below:               from PyQt4.QtCore import *     vector1 = QgsVectorLayer("path to dbf file", "test1", "ogr")     id1 = vector1.id()     print id1     vector2 = QgsVectorLayer("path to shapefile", "test2", "ogr")     id2 = vector2.id()     print id2     QgsMapLayerRegistry.instance().addMapLayer(vector1)     QgsMapLayerRegistry.instance().addMapLayer(vector2)     info = QgsVectorJoinInfo()     info.joinFieldIndex = QgsMapLayerRegistry.instance().mapLayer(id1).fieldNameIndex("Id1Column0") # Returns 0 as expected     info.joinFieldName = QString(u"Id1Column0")     info.joinLayerId = QgsMapLayerRegistry.instance().mapLayer(id1).id()     info.targetFieldIndex = QgsMapLayerRegistry.instance().mapLayer(id2).fieldNameIndex("Id2Column0")  # Returns 0 as expected     info.targetFieldName = QString(u"Id2Column0")     info.memoryCache = True     print info.joinFieldIndex #All the following show the correct values     print info.joinFieldName     print info.joinLayerId     print info.targetFieldIndex     print info.targetFieldName     print info.memoryCache     QgsMapLayerRegistry.instance().mapLayer(id2).addJoin(info)      Querying for the respective field names using QgsVectorLayer.attributeDisplayName(0) yields the respective column names as expected. Yet when I look in the GUI properties, while the join layer is set correctly, the join field is something different and the target field is empty. Could anyone shed some light on what goes wrong?


procedurally alter dimensions of embedded Picture_Element

Theoretically, should it be possible using arcpy to alter Picture Element dimensions whose images are embedded? My attempts haven't worked. I thought to clone these as a possible workaround but those elements don't happen to have a clone method. Here's a snippet, page units are in inches -               for elm in arcpy.mapping.ListLayoutElements(mxd, "PICTURE_ELEMENT"):         if re.match("text", elm.name) or re.match("text", elm.name):             #tempelm = elm.clone("_clone")             elm.sourceImage = r"logo.jpg"             elm.elementPositionX=11.9688             elm.elementPositionY=0.6561             elm.elementHeight=0.4687             elm.elementWidth=1.6837     mxd.save()     arcpy.mapping.ExportToPDF(mxd, r"out.pdf")          del mxd      Changing the source works.


Conditional Labeling based on attributes in ArcGIS 10

I am trying to label a street centerline layer with a condition based on street width. I am using the Python parser and I can't figure out this simple logic. Neither of these questions address how to accomplish this within the "Label Expression" window of ArcGis using Python: Customizing label features using arcpy displaying combined data values in ArcMap My attempt at it looks like this:               def FindLabel ( [NAME] ):       if [WIDTH] > 30       return [NAME]      GIS returns me an error when I try this. Any help is much appreciated. Thanks in advance, mike


QGIS: Colour GPS track by speed

sorry íf I might ask this question the 101 time, but I didn't found anything with google or SE. I have a CSV file with WGS84 trackpoints and visualizing them with QGIS textplugin works fine. The log interval is 1sec and I like to get the current speed to get a visual feedback, how fast the vehicle was between two points (so distance/time). Any idea how I can realize this with a style?


How to Add/Remove Legend with Leaflet Layers Control?

I have two overlays http://02d0c8c.netsolhost.com/dev/lcb_census_layers3.html that can be turned on and off with a Layer Control. I’d like the legend for each layer to turn on/off along with the layers. New to js, new to Leaflet. Any suggestions greatly appreciated. Thanks, Ryan                   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">               <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />     <title>Lake Champlain Basin Census Data</title>     <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.4.5/leaflet.css" />


ST_Within from centroid of geometry

I am looking at doing a spatial query where I can find when the center of one feature falls within another. For example, when the center (centroid) of a building falls within a grid tile. I know I can do this if I create a centroid of the building polygon, but I would like to do this on the polygon layer. Is there a way to do this with ST_Within, or another function? Thanks... ![enter image description here](http://i.stack.imgur.com/isB0Y.jpg)


How to check if a GP service (async) has any jobs that are not completed yet?

I am trying to find out a way to tell if a GP service has any jobs that were submitted and are not completed yet. I have noticed that one can see the status of a specific service by using the ArcGIS Server Services Directory (by using a jobid value). However, I am not interested in a specific job; my concern is only to see if there are **any** jobs currently started by a GP service. I need to know if a service is busy working on any job because I need to make sure that there aren't any other jobs started when running a new one. This is because the GP service writes some data which results in some locks which I want to avoid. The current way I do that is by using Python to access the statistics page of the service: `http://server:6080/arcgis/admin/services/GPServiceName.GPServer/statistics`. I am using Python for server administration using the ArcGIS REST API. I have written a piece of code that uses this page to check if there are any busy instances (which means a service is busy working on a job). If this key's value is 0 then it means the service is not working on any job and it is safe to run another one. I consider this to be more of a workaround and looking to figure out if this information (if a GP service has any jobs running) is exposed via REST API. It seems as it doesn't, but wanted to ask others to make sure I haven't missed anything. Thank you.


Configuring spatialite database access for Python 2.6.6

I'm working on a GIS project, and I would like to implement and test some geo- spatial algorithms in Python. For this purpose, I will not only need sqlite, but also spatialite, in order to store and query the location data. Now I've tried to install the pyspatialite package, but no matter what Python version I tried (I tried all versions from 2.6 to 3.3), the pip keeps insisting, that none of the existing pyspatialite packages are compatible with my version of Python. If I try to do this using easy_install, I get a traceback and an error:               AttributeError: MSVCCompiler instance has no attribute 'compiler'      And that also occurs, if I try to install the package manually, by executing the setup.py file. From what I've already searched, some people suggest to connect to a spatialite database somehow using sqlite and loading extension, but frankly I have no idea how to do it, and couldn't understand any of these answers. I will be really grateful if someone here is able to propose a solution in a clear, step-by step way, as I'm not a very experienced Python programmer yet. Thanks in advance. UPDATE: Another attempt, this time with Python 3.3.5. The following code:               import sqlite3     conn = sqlite3.connect(":memory:")     conn.enable_load_extension(True)     conn.execute('SELECT load_extension("libspatialite-2.dll")')      yields:               Traceback (most recent call last):       File "<pyshell#10>", line 1, in <module>         conn.execute('SELECT load_extension("libspatialite-2.dll")')     sqlite3.OperationalError: %1 is not a valid Win32 application.      And again, I don't seem to resolve this on my own. I'm really stuck here, and slowly running out of ideas. If you can make it work on any Python version, I'd be REALLY relieved. # UPDATE #2 Sorry, the error above was due to something else, I reinstalled Python and pysqlite, and we are back with the old error. There are two options now: 1) I compile using from pysqlite2 import dbapi2 as sqlite3. In this case code is the following:               from pysqlite2 import dbapi2 as sqlite3     conn = sqlite3.connect(":memory:")     conn.enable_load_extension(True)     conn.execute('SELECT load_extension("DLLs\\libspatialite-4.dll")')     curs = conn.cursor()      In that case, the error is:               Traceback (most recent call last):       File "C:\Users\mszydlowski\Desktop\Project\sqlite.py", line 3, in <module>         conn.enable_load_extension(True)     AttributeError: 'pysqlite2.dbapi2.Connection' object has no attribute  'enable_load_extension'       2) I compile using import sqlite3. In this case code is the following:               import sqlite3     conn = sqlite3.connect(":memory:")     conn.enable_load_extension(True)     conn.execute('SELECT load_extension("DLLs\\libspatialite-4.dll")')     curs = conn.cursor()      And the error:               Traceback (most recent call last):       File "C:\Users\mszydlowski\Desktop\Project\sqlite.py", line 4, in <module>         conn.execute('SELECT load_extension("DLLs\\libspatialite-4.dll")')     OperationalError: The specified module could not be found.      even though the file is certainly in there, and I did use the double backslashes, like I was already advised. Any ideas?


Political world map texture?

What is correct name of texture and/or projection, which is suitable for 3D engines? I want to apply world map to 3D sphere, but a variety of images found by Google makes me thinks that some of them are incorrect. I imagine an image of size proportional to 360 x 180 (number of latitude and longitude degrees on the globe). What is the name of this projection? I don't see this projection here https://en.wikipedia.org/wiki/Map_projection because grid should be equi-quadri-lateral on it.


How to extract sublinestring from a linestring with overlapping segments

Problem statement: Given a bus route (defined as a linestring ln.the_geom), and a set of bus stop locations (pt1.the_geom,pt2.the_geom,...ptn.the_geom), divide the bus route into segments between bus stops. I am using two postgis functions                   ST_line_substring(ln.the_geom,ST_line_locate_point         ln.the_geom,pt1.the_geom),ST_line_locate_point(ln.the_geom,pt2.the_geom))      The above works well if the bus route has no overlapping sections. However, if there is overlapping sections, the ST_line_locate_point will snap a point to the other end of the linestring. As an example: Bus travels from A to B, make a loop, then travels from B to A. "A to B" and "B to A" are parallel routes with all points overlapped. In case of bus stops P1 and P2, P2 is mapped into point P2' instead (on the opposite direction). The segment is extracted wrongly in this case (where extra segments are included). How to solve problems like this? The overlapping bus routes can happen at any section of the route... ![EXAMPLE](http://i.stack.imgur.com/Gnh8q.jpg)


GeoServer v2.5.2, webadmin, missing WMS and styles menu

After installing GeoServer v2.5.2 we are missing the Styles and WMS menus. Does anybody seen this, have a clue whats wrong? (The WMS server is working, just the webadmin interface not working.) ![Simple image to show missing menu items WMS and Styles](http://i.stack.imgur.com/poo4K.jpg) * * * **EDIT** some more details about installation:   * MS Windows Server 2008 R2 Standard 64-bit SP1   * Java(TM) SE Runtime Environment (build 1.7.0_40-b43)      * GEOSERVER_HOME=C:\GeoServer\2.5.2     * XX:MaxPermSize=512m     * Initial Java Heap Size 512MB     * Maximum Java Heap Size 1024MB    * GeoServer is installed from zip-archive   * Extensions: mysql, gdal, dxf-core   * Only 1 small tweak to: OpenLayersMapTemplate.ftl   * Installed as Service with Wrapper v3.5.19   * Same type of installation as with previous versions (se directories below, all worked fine, only 2 or 3 versions live) ![Geoserver directories](http://i.stack.imgur.com/ZY422.jpg)


access point layer representation in qgis with pyqgis

I am exporting the style of a categorized point layer with qgis: ![layer table with common sizes and different representation in the map](http://i.stack.imgur.com/27QIO.png) unfortunately my code only extract the size of the symbol in the definition of the properties of the layer but not the representation in the map... here is a working code:               canvas = qgis.utils.iface.mapCanvas()     allLayers = canvas.layers()     i = allLayers[0]     iter = i.getFeatures()     provider = i.dataProvider()     attrvalindex = provider.fieldNameIndex(i.rendererV2().classAttribute())     categories = i.rendererV2().categories()     color_str = []     radius_str = []     transp_str2 = []     transp_str = str(1 - ( float(i.layerTransparency()) / 100 ) )     for feat in iter:         fid = feat.id()         attribute_map = feat.attributes()         catindex = i.rendererV2().categoryIndexForValue(str(attribute_map[attrvalindex]))         if catindex != -1:              color_str.append(str(categories[catindex].symbol().color().name()))             radius_str.append(str(categories[catindex].symbol().size() * 2))             transp_str2.append(str(categories[catindex].symbol().alpha()))         else:              color_str.append('#FF00FF')             radius_str.append('4')             transp_str2.append('1')


What is the best hack for importing large datasets into PostGIS?

I have to import large Shapefiles (> 1 million records) into PostGIS, and I have been wondering about the best way to do it. ![enter image description here](http://i.stack.imgur.com/XsImb.png) In my question I used the word "hack", instead of tool, on purpose because I think this is not so much a matter of which tool, but which set of steps, or configuration settings to use. So far, I have tried the SPIT plugin (QGIS), the shp2pgsql Postgis tool and the GDAL ogr2ogr tool. You can view my full review on this post. So far, I find all of them really unresponsive, when dealing with a large dataset. I was wondering if someone experienced a similar issue, and if you could share something about the approach. Thanks in advance for your time and look forward to hear your opions.


I have compared some distance calculations between `geopy` and PostGIS `ST_Distance_Sphere`, and it seems that PostGIS `ST_Distance` uses a calculation that is similar to the great circle distance rather than Vincenty. ### Geopy Vincenty (Most accurate) using `geopy`               >>> from geopy.distance import great_circle, vincenty     >>> p1=(32.083659,34.806480)     >>> p2=(32.0843373,34.8065365)     >>> vincenty_distance = vincenty(p1, p2).meters     >>> print vincenty_distance     75.4044140365      ### Great Circle (less accurate) using `geopy`               >>> great_circle_distance = great_circle(p1, p2).meters     >>> print great_circle_distance     75.6324224394      ### PostGIS `ST_Distance_Sphere`, Unknown Algorithm:               => SELECT ST_Distance_Sphere(               ST_SetSRID(ST_MakePoint(34.806480, 32.083659), 4326),               ST_SetSRID(ST_MakePoint(34.8065365, 32.0843373), 4326));      st_distance_sphere     --------------------            75.611223453     (1 row)      **Does PostGIS have a Vincenty Distance calculation?**


How to begin creating a linear referenced gdb with NHD

Our legacy fish distribution data contains data by reaches. Reaches are arbitrary locations on streams, eg. reach 1, 2, 3. Each reach's from-to are known, but not by x,y coords. An example is 'brown trout are found in this stream reaches 1 and 2, not 3". Our data has many fish species with such data. I want to create a linear referenced fish distribution database that can dynamically segment this data. It seems I should create a route layer from the NHD for our reaches first, then create event layers for each spp. My question: "Is creating a route layer for reaches necessary? or can I digitize directly from the NHD? I am new to LRS.


How to automatically populate fields instantly?

I am looking to create an attribute table where the first field is a drop-down menu (I have achieved this by using the 'value map' edit widget), but I'm struggling to find a method for the next part; After the value has been selected from the drop-down menu, I would like the adjacent cell (in the next field) to be automatically populated according to the value in the drop-down menu. So for example; if drop-down value = A, then adjacent field = 1. Or if drop-down value = B, then adjacent field value = 3, etc. I realise that by using field calculator, it is possible to auto-populate fields as part of a separate process, but I would like to have the fields populated at the same time as the drop-down value is selected if possible. I am using windows 7 and QGIS version 1.8. Many thanks.


How to export Std Dev from Raster Dataset of DEM to classify current extent and execute Contour Tool with Python?

I want to create Countour Lines for a DEM which are based on a "STD dev" classificaion. My problem is that the "Std dev" is exported in an unknown type instead of a String. So the classifacation for the Contour Tool can not be executed. Do you have any ideas how i could convert it in a String? **STD**               elevstd=arcpy.GetRasterProperties_management("rectExtract","STD")      **Define Variables**               Intervall=0       Automatisch=0      **If Statements**               if Intervall==Automatisch and elevstd>"0" and elevstd<="5":   # Class1           Contour("rectExtract", "C:/fakepath/Class1.shp", 1,0)       if Intervall==Automatisch and elevstd>"5" and elevstd<="10":  # Class2           Contour("rectExtract", "C:/fakepath/Class2.shp", 5,0)        Thanks for your help,


How to display arrows on pipes from upstream to downstream using QGIS?

I am trying to display arrows on pipes of a sewer network so their direction is from upstream to downstream edges of the pipes. I have managed to display those arrows on a polyline layer (which is the pipes) from the properties menu, but their direction seems to always be from Northeast to Southwest, regardless of the upstream and downstream edges. How do i connect the arrow direction to those edges? For example in the picture, the pipe between Nodes D11122 and D115 should have the arrow directed the opposite way. Each pipe has an upstream and a downstream edge. Each edge is connected with a node and their properties are shown in the attribute table. ![enter image description here](http://i.stack.imgur.com/NIzqv.jpg)


Error while rendering a layer from postgresql in mapserver

I got a point layer into QGIS from postgresql database. After this I used a plugin to export it to a map file.After exporting the following is the starting of the map file.                NAME "QGIS-MAP"      # Map image size      EXTENT 59.396660 7.316000 105.983338 35.204001      Imagecolor 255 255 255      SIZE 100 100      UNITS meters      Imagetype jpeg           FONTSET 'C:\ms4w\Apache\htdocs\fontset.txt'          PROJECTION     'proj=longlat'     'datum=WGS84'     'no_defs'      Now when I change the size parameter to 600 400 and the units to dd. It gives me the following error while rendering the layer. **msDrawMap(): Image handling error. Failed to draw layer named 'growth_1'. msPostGISLayerWhichShapes(): Query error. Error executing query: ERROR: column "%growth_1_id%" does not exist LINE 1: ...ary(ST_Force_2D("the_geom"),'NDR'),'hex') as geom,"%growth_1... ^** First of all I am not sure why is it taking units as meter.But if I dont change it to dd , the legends come up but the layer is not rendered. Also the extent which i get is in the range of 100's and not the one which I have defined. Could someone tell me where is this thing going wrong. ![enter image description here](http://i.stack.imgur.com/k4bQN.png)


Why are Bounding Coordinates not as expected?

I have a shapefile in GCS_WGS_1984 projection, but the bounding coordinates/Feature extent shows the wrong coordinates in the screenshot below. ![Feature of extent of shape file](http://i.stack.imgur.com/ulefs.jpg). I tried to change the projection, by deleting the *.prj file and defining a new projection but it still did not get a good result. Can anyone explain what I may be doing wrong?


Getting started with development for ArcGIS Server

I'm currently working on upgrading a C# web service I wrote a couple of years ago built against ArcGIS Server to ArcGIS Server 10. The application in question does some basic spatial queries and exports several PDFs, so no addtional extensions are required however it cannot be hosted directly on the ArcGIS Server. My problem is that I'm unsure of exactly which ESRI components I'll need and where they need to be installed. Is what I've drawn up below reasonable? ## Developer PC   * Visual Studio 2010   * ArcEngine 10 Runtime   * ArcObjects 10 SDK ## Application Server   * ArcEngine 10 Runtime ## ArcGIS Server   * ArcGIS Server 10   * ArcGIS GIS Services


How to read Binary overlay (*.ovl files) data programmatically

Currenlty, Im dealing with binary Overlay files (*.ovl files) and I needed to read them byte by byte and display the content in a possible way. I came to know that there can be ASCII and Binary format of Overlay content (*.ovl files) and there are few tools which can read ASCII Ovl files. But, could not get anything on Binary Overlay files. Could you please anyone point me to possible way of displaying the binary overlay content either by any tool or by programatically (Final aim to program it).


What does Overlay files (*.ovl files) contain about GIS data and how to read them?

Recently, I started dealing with Overlay files (*.ovl files) and my focus is to read the data from OVL files and display them. Could you please anyone guide me what are these files and what is the best way to read the content both via product and via programmings (pointers to any knowledge base is very appreciated). Please let me know if further information is needed.


Field Calculator, Conditional

I am trying to assign Value from one field of my Attribute table to a new field based on the 3d field.... The Code Block I am thinking about as follows:               *def conditional (!FarmCateg!):        if (FarmCateg=='4'):         return (and overhere I want to return values from "Percent Area" Field (float)):        elif( ): return "0"*       Expression: conditional(!FarmCateg!) Thank you so much in advance!!!


How to create an SQL Persisted Computed Column which values are derived from spatial column

Our GDB is using the SQL native GEOMETRY data storage type (SQL 2012 Standard) and the spatial reference for this uses a unit of square feet. I want to create a (persisted) computed column which will populate another column as acres. Using the following query I'm able to produce the results I want:               Select shape.STArea()/43560 as Area from DATAOWNER.CTF_STANDS      In setting up the computed column I used the following: ![Computed Text](http://i.stack.imgur.com/asl2P.jpg) Editing on the front end GIS application (ArcGIS), the Shape.STArea() field updates during edits, but updates to my computed column fail to happen. I think that Shape.STArea is actually a function and appears to be enforced/maintained by the SDE/GDB Schema itself, so working with spatial column appears to be the best way forward. I don't want to convert the Geometry column itself to another unit, but rather use it to populate another column via a formula which converts square feet to acres. How do I create a computed column which will derive acres from the geometry column who's current values are in square feet? This other SE post's answer is very similar.


Finding the area of a polygon feature in a shapefile

Excuse the very simple question. How do i find the area of a selected polygon feature in a shapefile?


How do I obtain the envelope of a data frame in Layout?

This is to expand on this question. How can i programatically obtain the corner coordinates (in page units) or the envelope of the data frame in layout view? I don't seem to be able to do this with iActiveView:Extent as it is returning the extent of the data view in page units. The below screen capture shows what I would like to get. The coordinates are roughly; upper left 0.9,10 and lower right 8, 0.9. Even in page layout iActive:extent returns: upper left -3.4, 12 and lower right 14,-3 which is the extent of the entire application window not the data frame as it appears in layout. Here is what i need: ![enter image description here](http://i.stack.imgur.com/f0YmN.jpg)


Geoserver SLD for OSM valdation errors

I'm trying to build a Geoserver (V2.0.2) style file for OSM data using https://github.com/FlorentDotMe/OSM-Styles-for-GeoServer as a starting point but they produce a number of validation errors Can some one suggest where I'm going wrong or where I can get a valid style file for OSM data (Points, Lines and Polygons) This is what i've done to date. According to this blog you can ignore these http://guanxiaoyu.blogspot.co.uk/2010/06/florentdotmes-osm-sld-for- geoserver.html and previewing the separate layers works however grouping the layers together Lines on top of polygons & then attempt to preview the group doesn't work the file save to dialogue box is shown indicating an error I'm assuming is related to the validation errors following the instructions in this comment http://blog.geoserver.org/2009/01/30/geoserver-and- openstreetmap/#comment-76354 I've attempted to fix the style_osm_line but I'm still getting loads of errors so I've created a smaller manageable sub file to work out how it works, I'm aware it is very incomplete. I get the following errors. Thanx for you help Holly Errors               org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'Filter'. One of '{"http://www.opengis.net/sld":Name, "http://www.opengis.net/sld":Title, "http://www.opengis.net/sld":Abstract, "http://www.opengis.net/sld":LegendGraphic, "http://www.opengis.net/ogc":Filter, "http://www.opengis.net/sld":ElseFilter, "http://www.opengis.net/sld":MinScaleDenominator, "http://www.opengis.net/sld":MaxScaleDenominator, "http://www.opengis.net/sld":Symbolizer}' is expected.     org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'Filter'. One of '{"http://www.opengis.net/sld":Name, "http://www.opengis.net/sld":Title, "http://www.opengis.net/sld":Abstract, "http://www.opengis.net/sld":LegendGraphic, "http://www.opengis.net/ogc":Filter, "http://www.opengis.net/sld":ElseFilter, "http://www.opengis.net/sld":MinScaleDenominator, "http://www.opengis.net/sld":MaxScaleDenominator, "http://www.opengis.net/sld":Symbolizer}' is expected.     org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'Filter'. One of '{"http://www.opengis.net/sld":Name, "http://www.opengis.net/sld":Title, "http://www.opengis.net/sld":Abstract, "http://www.opengis.net/sld":LegendGraphic, "http://www.opengis.net/ogc":Filter, "http://www.opengis.net/sld":ElseFilter, "http://www.opengis.net/sld":MinScaleDenominator, "http://www.opengis.net/sld":MaxScaleDenominator, "http://www.opengis.net/sld":Symbolizer}' is expected.     org.xml.sax.SAXParseException: cvc-complex-type.2.4.b: The content of element 'ogc:Or' is not complete. One of '{"http://www.opengis.net/ogc":comparisonOps, "http://www.opengis.net/ogc":spatialOps, "http://www.opengis.net/ogc":logicOps}' is expected.      SLD File               <?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>style_osm_line</Name>         <UserStyle>         <Title>'Line'</Title>         <!--TAG-->         <FeatureTypeStyle>         <Rule>         <Filter>           <ogc:Or>             <ogc:PropertyIsEqualTo>               <ogc:PropertyName>highway</ogc:PropertyName>               <ogc:Literal>footway</ogc:Literal>             </ogc:PropertyIsEqualTo>             <ogc:PropertyIsEqualTo>               <ogc:PropertyName>highway</ogc:PropertyName>               <ogc:Literal>pedestrian</ogc:Literal>             </ogc:PropertyIsEqualTo>             <ogc:PropertyIsEqualTo>               <ogc:PropertyName>highway</ogc:PropertyName>               <ogc:Literal>path</ogc:Literal>             </ogc:PropertyIsEqualTo>             <ogc:PropertyIsEqualTo>               <ogc:PropertyName>highway</ogc:PropertyName>               <ogc:Literal>steps</ogc:Literal>             </ogc:PropertyIsEqualTo>           </ogc:Or>         </Filter>              <MinScaleDenominator>1000</MinScaleDenominator>         <MaxScaleDenominator>12500</MaxScaleDenominator>         <LineSymbolizer>           <Stroke>             <CssParameter name="stroke">#A20808</CssParameter>             <CssParameter name="stroke-width">2</CssParameter>             <CssParameter name="stroke-dasharray">1 3</CssParameter>             <CssParameter name="stroke-linejoin">round</CssParameter>             <CssParameter name="stroke-linecap">round</CssParameter>             <CssParameter name="stroke-opacity">0.5</CssParameter>             </Stroke>         </LineSymbolizer>         </Rule>         </FeatureTypeStyle>        <FeatureTypeStyle>         <Rule>         <Filter>         <ogc:Or>           <ogc:PropertyIsEqualTo>             <ogc:PropertyName>highway</ogc:PropertyName>             <ogc:Literal>unclassified</ogc:Literal>           </ogc:PropertyIsEqualTo>           <ogc:PropertyIsEqualTo>             <ogc:PropertyName>highway</ogc:PropertyName>             <ogc:Literal>road</ogc:Literal>           </ogc:PropertyIsEqualTo>           <ogc:PropertyIsEqualTo>             <ogc:PropertyName>highway</ogc:PropertyName>             <ogc:Literal>residential</ogc:Literal>           </ogc:PropertyIsEqualTo>           <ogc:PropertyIsEqualTo>             <ogc:PropertyName>highway</ogc:PropertyName>             <ogc:Literal>unsurfaced</ogc:Literal>           </ogc:PropertyIsEqualTo>           <ogc:PropertyIsEqualTo>             <ogc:PropertyName>highway</ogc:PropertyName>             <ogc:Literal>living_street</ogc:Literal>           </ogc:PropertyIsEqualTo>         </ogc:Or>         </Filter>         <MinScaleDenominator>1000</MinScaleDenominator>         <MaxScaleDenominator>12500</MaxScaleDenominator>         <TextSymbolizer>           <Label>             <ogc:PropertyName>name</ogc:PropertyName>           </Label>           <Font>             <CssParameter name="font-family">Lucida Sans</CssParameter>             <CssParameter name="font-size">10</CssParameter>             <CssParameter name="font-style">normal</CssParameter>             <CssParameter name="font-weight">normal</CssParameter>           </Font>           <LabelPlacement>           <LinePlacement />           </LabelPlacement>           <Halo>             <Radius>1</Radius>             <Fill>               <CssParameter name="fill">#ffffff</CssParameter>             </Fill>           </Halo>           <Fill>             <CssParameter name="fill">#000000</CssParameter>             <CssParameter name="fill-opacity">1.0</CssParameter>           </Fill>           <VendorOption name="followLine">true</VendorOption>           <VendorOption name="group">yes</VendorOption>           <VendorOption name="spaceAround">0</VendorOption>           <VendorOption name="maxDisplacement">300</VendorOption>           <VendorOption name="repeat">750</VendorOption>         </TextSymbolizer>         </Rule>         </FeatureTypeStyle>         <FeatureTypeStyle>           <Rule>           <Filter>           <ogc:Or><ogc:PropertyIsEqualTo><ogc:PropertyName>highway</ogc:PropertyName><ogc:Literal>tertiary</ogc:Literal></ogc:PropertyIsEqualTo></ogc:Or>           </Filter>           <MinScaleDenominator>1000</MinScaleDenominator>           <MaxScaleDenominator>12500</MaxScaleDenominator>           <LineSymbolizer>             <Stroke>             <CssParameter name="stroke">#bbbbba</CssParameter>             <CssParameter name="stroke-width">10</CssParameter>             <CssParameter name="stroke-linejoin">round</CssParameter>             <CssParameter name="stroke-linecap">round</CssParameter>             </Stroke>           </LineSymbolizer>           </Rule>         </FeatureTypeStyle>              </UserStyle>       </NamedLayer>     </StyledLayerDescriptor>


Change SQL Query of an Annotation Class in an existing Annotation Feature Class

I have an annotation feature class containing several annotation classes. There are SQL queries set on the annotation classes. They act as a definition query, determining which features are part of a certain annotation class. An example would be `OBJTYP = '3A' OR OBJTYP = '3B' OR OBJTYP = '3C'`. The queries originate from the label settings on the layer which was used to create the annotation feature class. I now want to change the SQL queries. Is there a way to do this?


What proportion of the 240m area sensed by MODIS must be forest before it is defined as forest?

MOD12 is a MODIS product at 240m resolution. Landsat produces 30m resolution products, which I resampled to 240m resulting in a raster of proportion forest cover in each 240m pixel (based on the mean of the 8x30m cells it covers). The MOD12 raster has been reclassed to binary forest/non-forest. My question is: what proportion of the 240m area sensed by MODIS must be forest before it is defined as forest? Is it majority (50%+) or something more complex? My reason for wanting to know this is to reclass the Landsat proportional raster to a binary raster that mirrors the MOD12 data.


ArcGIS Mobile 10 Routing Solution

Does anyone know of an example of routing within ArcGIS Mobile 10 that uses GPS location to route to a destination? Thanks, Seth


Get google maps small portion for offline application

Can some body help me in downloading some portion of hybrid maps of google as I want to store them in my server and display them on web application using openlayers so that the user will only have access to only that particular area, not the whole map


Digitizing map into three dimension?

Can somebody help me in making 3-dimensional map from 2-dimensional??some software reference or some tool which can do this. I know the height of the building and other aspects....


Extrude in FME for lines

I tried to extrude walls in FME from chopped lines (2 vertices). I am using ground height to extrude. The middle portion of the lines for the building slope roof is not extruding correctly. Please anyone help me in this. ![enter image description here](http://i.stack.imgur.com/DytQp.png)


Cluster strategy, problem with labels on uncluster features - undefined

I have vector layer - WFS from GeoServer (Postgis). In the Postgis table there are some attributes e.g.: the_geom (of course), adr_adm, ... So I would like display label: adr_adm on features when they are unclustered. I'm looking for replay in: Cluster Strategy different Labeling at Different Level http://www.gistutor.com/openlayers/12-intermediate-openlayers- tutorials/40-styling-and-labeling-vector-layers-in-openlayers.html http://openflights.org/blog/2009/10/21/customized-openlayers-cluster- strategies/ and many others I wrote something like that but it still doesn't work. Label for unclustered features still undefined. When I remove cluster strategy features have properly labels. (I can't get an attribute from an array of features clustered) Please help me to improve my code. Thanks for any reply. I greet. ## My code:                   var map;         var refresh = new OpenLayers.Strategy.Refresh({force: true, active: true});         var extent = new OpenLayers.Bounds(                     2568598.39063282, 7000794.41264775,                     2586376.89361486, 7012360.91662176);          OpenLayers.IMAGE_RELOAD_ATTEMPTS = 5;         var colors = {     low: "#93b772",      middle: "#f1d046",     high: "#fd9c73",      s_low: "#465736",      s_middle: "#9b862d",      s_high: "#ac6a4e"         };         var singleRule = new OpenLayers.Rule({      filter: new OpenLayers.Filter.Comparison({     type: OpenLayers.Filter.Comparison.EQUAL_TO,     property: "count",     value: 1         }),              symbolizer: {         fillColor: colors.low,         fillOpacity: 0.9,          strokeColor: colors.s_low,         strokeOpacity: 0.2,         strokeWidth: 9,         pointRadius: 8,         label: "${text}",         context:{             text: function(feature){ return feature.attributes.adr_adm; }                 },          labelAlign: "cc",         labelXOffset: 4,         labelOutlineWidth: 0.5,         fontColor: "#00376d",         fontOpacity: 1,         fontSize: "10px"     }         });         var lowRule = new OpenLayers.Rule({     filter: new OpenLayers.Filter.Comparison({         type: OpenLayers.Filter.Comparison.BETWEEN,         property: "count",         lowerBoundary: 2,         upperBoundary: 5     }),     symbolizer: {         fillColor: colors.low,         fillOpacity: 0.9,          strokeColor: colors.s_low,         strokeOpacity: 0.2,         strokeWidth: 11,         pointRadius: 10,         label: "${count}",         labelOutlineWidth: 0.5,         fontColor: "#00376d",         fontOpacity: 1,         fontSize: "10px"     }         });         var middleRule = new OpenLayers.Rule({     filter: new OpenLayers.Filter.Comparison({         type: OpenLayers.Filter.Comparison.BETWEEN,         property: "count",         lowerBoundary: 5,         upperBoundary: 15     }),     symbolizer: {         fillColor: colors.middle,         fillOpacity: 0.9,          strokeColor: colors.s_middle,         strokeOpacity: 0.2,         strokeWidth: 13,         pointRadius: 12,         label: "${count}",         labelOutlineWidth: 0.5,         fontColor: "#00376d",         fontOpacity: 1,         fontSize: "10px"     }         });         var highRule = new OpenLayers.Rule({     filter: new OpenLayers.Filter.Comparison({         type: OpenLayers.Filter.Comparison.GREATER_THAN,         property: "count",         value: 15     }),     symbolizer: {         fillColor: colors.high,         fillOpacity: 0.9,          strokeColor: colors.s_high,         strokeOpacity: 0.2,         strokeWidth: 15,         pointRadius: 14,         label: "${count}",         labelOutlineWidth: 0.5,         fontColor: "#00376d",         fontOpacity: 1,         fontSize: "10px"     }         });         // Create a Style that uses the three previous rules         var style = new OpenLayers.Style(null, {     rules: [singleRule, lowRule, middleRule, highRule]         });              function init() {          map = new OpenLayers.Map({         div: "map",         layers: [             new OpenLayers.Layer.OSM("OpenStreetMapa")             ],         controls: [             new OpenLayers.Control.Navigation(),             new OpenLayers.Control.PanZoomBar(),             new OpenLayers.Control.OverviewMap(),             new OpenLayers.Control.LayerSwitcher({ascending: false}),             new OpenLayers.Control.KeyboardDefaults(),             new OpenLayers.Control.ScaleLine(),             new OpenLayers.Control.Attribution()           ],         projection: "EPSG:3857",         restrictedExtent: extent,         }     );          var wc_layer = new OpenLayers.Layer.Vector("WC parametry", {         strategies: [ new OpenLayers.Strategy.Fixed(),                       new OpenLayers.Strategy.Cluster({distance: 40}),                        refresh],                     protocol: new OpenLayers.Protocol.WFS({                     url: "http://localhost/wfs_ant",                       featureType: "v_wezly_param",                        featureNS: "http://mapy.telemetria/"                       })                     ,styleMap: new OpenLayers.StyleMap(style)                     ,attribution: '   © BB'                     ,extractAttributes: true     });     map.addLayer(wc_layer);          setInterval(function () { refresh.refresh(); },20000);          if(!map.getCenter()){             map.zoomToExtent(extent);           }              }


qgis + show queries in log

Basically using qgis 2 I would like to see/check the queries syntax to the OWS service. (I didn't find a way to show the queries in a log). If I do a getfeature, I would like to see: http://giswebservices.massgis.state.ma.us/geoserver/wfs?request=getfeature&version=1.1.0&service=wfs&typename=massgis:GISDATA.EOTROADS_ARC&propertyname=STREET_NAME& _*_ * Or WMS query http://www2.demis.nl/worldmap/wms.asp?Service=WMS&Version=1.1.0&Request=GetMap& BBox=-20,-40,60,40&SRS=EPSG:4326&Width=400&Height=400&Layers=Countries,Borders,Coastlines&Format=image/gif Thanks, D


Corpscon6 reliability

I've been blindly using Corpscon to convert from NGVD29 to NAVD88. Have any of you kind folks found issues with your outputs?


How would I draw and visualize custom maps based on OSM data?

I would like to be able to use openstreetmap data for a specific region as a source and "draw" from that the map of infrastructure improvements - mostly roads. I want it to be self-hosted (not spoiling any data on the real OSM servers), want to have quite big flexibility and detail level in the editing process and it would be nice to render it in a pretty way. I'm not familiar with lots of GIS software. Actually it's not that important to have OSM data as the source, it could be a satellite image as well. The important things - flexible drawing bound to real coordinates and visualization of the map. Where could I start? Hope this question makes sense here :)


an arcgisscripting method for sanitizing a filename?

Is there an **_arcgisscripting_** method for sanitizing a filename to get rid of characters which Arcgis barfs on, the meek hyphen `-` for example?


What is a good formula for calculating if a LatLong is within a radius (in miles) of a second LatLong?

If I have two LatLongs, what is the best way to determine if the first one is within a 10 mile radius of the second?


How do I load mapinfo mid/mif into geopandas?

I suspect this is a trivial question to answer but how do I load mapinfo mid/mif files into geopandas? While it's trivial to load and manipulate .shp files, I can't work out what code to use: Here's a few examples of the data I'm trying to play with: http://www.stoke.gov.uk/ccm/content/business/general/open-geospatial- consortium-data-catalogue.en               cylpaths = geopandas.GeoDataFrame.from_file(path)        I tried to test the geometry, which shows:               cylpaths.crs           Out[15]:     {u'ellps': u'airy',      u'k': 0.9996012717,     u'lat_0': 49,     u'lon_0': -2,     u'no_defs': True,     u'proj': u'tmerc',     u'towgs84': u'375,-111,431,-0,-0,-0,0',     u'units': u'm',     u'x_0': 400000,     u'y_0': -100000}      But when I try to preview the data, I get an empty dataframe:               cylpaths          Out[16]:     Int64Index([], dtype='int64')   Empty GeoDataFrame      I'm a bit lost in working out what I need to do next.


Misalignement of the Corine data set after reprojection with gdalwarp, nodata not working either

I want to reproject the original corine data set with a resolution of 100x100m. I am using gdalwarp:               $ gdalwarp -overwrite -s_srs EPSG:3035 -t_srs EPSG:32632 -tr 100 100 -tap -wo "SAMPLE_GRID=YES" -dstnodata '-9999' g100_06.tif corine_utm32.tif      When I load another reprojected file (that was done with ArcGIS by a colleague) and the new file to QGIS, the new file is shifted a couple of metres. Comparing the new file to the original data, some pixels have different values after the transformation. Moreover when I cut out a region with QGIS Clipper and transform it into Arc/Info ASCII grid, the nodata value is zero, even though I define the nodata value in every transformation step with -9999. Now I am not sure whether QGIS or ArcGIS is producing a wrong result. Am I missing an important gdalwarp-flag? Is it possible to create the same GeoTIFF as the original but with another projection?


PostGIS reports invalid Curve GML

PostGIS version `POSTGIS="1.5.3" GEOS="3.3.1-CAPI-1.7.1" PROJ="Rel. 4.7.1, 23 September 2009" LIBXML="2.7.3" USE_STATS` Postgresql version `PostgreSQL 9.1.2` I'm having issues inserting Curves into a PostGIS database using `st_geomfromgml()`. Basically I'm hitting up Geoserver WFS services and storing returned geometries. Here is an example of failing GML;                   <gml:Curve xmlns:gml="http://www.opengis.net/gml" srsName="urn:x-ogc:def:crs:EPSG:4326" srsDimension="2">           <gml:segments>             <gml:LineStringSegment interpolation="linear">               <gml:posList>-61.5681 -179.687 -61.52288589853826 -180.0</gml:posList>             </gml:LineStringSegment>             <gml:LineStringSegment interpolation="linear">               <gml:posList>-61.52288589853826 -178.0 -61.5177 -179.9641</gml:posList>             </gml:LineStringSegment>           </gml:segments>         </gml:Curve>      Yet if I split this up into multiple inserts like;                   <gml:Curve xmlns:gml="http://www.opengis.net/gml" srsName="urn:x-ogc:def:crs:EPSG:4326" srsDimension="2">           <gml:segments>             <gml:LineStringSegment interpolation="linear">               <gml:posList>-61.5681 -179.687 -61.52288589853826 -180.0</gml:posList>             </gml:LineStringSegment>           </gml:segments>         </gml:Curve>              <gml:Curve xmlns:gml="http://www.opengis.net/gml" srsName="urn:x-ogc:def:crs:EPSG:4326" srsDimension="2">           <gml:segments>             <gml:LineStringSegment interpolation="linear">               <gml:posList>-61.52288589853826 -178.0 -61.5177 -179.9641</gml:posList>             </gml:LineStringSegment>           </gml:segments>         </gml:Curve>      It works fine. What is incorrect with the original GML?


Best way to get Convex Hull/Boundary of millions of points

I've been trying to do some point analysis on some xyz data, I'm at the _point_ where I've decided it is best to produce a boundary of my xyz files and put this with the metadata for each survey. Now the part im stuck on is I've got over 15,000 surveys to compute the boundary of, tried convex hull and concave hull with varying results. I can be fairly confident of the regular interval in my points for each survey, so I was thinking of a buffer merge op of point interval + 25%... Works great for smaller amounts of data. however it doesn't seem the most efficient way on the larger xyz data (still waiting on one to complete processing 15 minutes in ... 500,000 points.). My thought process was `Point -> buffer 0.75 -> Polygon -> Merge to existing polygons -> Multi Polygon -> buffer -0.75 -> Extents of Survey Multi Polygon.` I've been using NetTopologySuite c# for processing, perhaps some others have a routine they would like to share? **Update: logic using NetTopologySuite** I think mpl = mpl.Union(p) as Geometry; is the bottleneck ...               Geometry mpl = null;     While(Loop all pnts logic)     {     NetTopologySuite.Geometries.Point pnt = new NetTopologySuite.Geometries.Point(             ((float)eastL / 100),             ((float)northL / 100),             ((float)depth / 100)           );           float pntSpace = spacing + (spacing * 0.25);           //produce a polygon for buffer.           Polygon p = pnt.Buffer(pntSpace , 2, GeoAPI.Operations.Buffer.EndCapStyle.Square) as Polygon;           if (mpl == null)             mpl = p;           else             mpl = mpl.Union(p) as Geometry;     }


How to remove black box around georeferenced grayscale image in QGIS?

i'am trying to georeference a grayscale image (*.tif) in QGIS 2.2.0 Valmeria. It is working but QGIS draws a black box around the georeferenced raster image. If i use the option set 0 transparent, not only the black box is transparent but also the black pixels in my gray scale image. But setting black or white transparent isn't an option for me, because it is a gray scale image. Thanks a lot for you help!   * Rob


insertVertex giving false in pyQGIS

I have this code from my plugin which work in Qgis 1.8 and I am trying to make it work in 2.0. I want to insert a coordinate x and y into a polyline after the last entry.               points = geom.asPolyline()     points = [(574081,6.26395e+06), (575817,6.26287e+06), (577807,6.26276e+06), (579111,6.26147e+06), (579059,6.26034e+06)]     vl = QgsVectorLayer("MultiLineString", layerName, "memory")     vl.startEditing()     vl.addAttribute(QgsField("id", QVariant.Int))     fet = QgsFeature()     fields = vl.pendingFields()     fet.setFields( fields, True )          i = 1     fid = 1     disp = 90     dist = 100          coor = points[i+1]     x1 = coor[0]     y1 = coor[1]     x1 = x1 + dist * math.cos(math.radians(disp))     y1 = y1 + dist * math.sin(math.radians(disp))     geom = fet.geometry()     geom.insertVertex(x1,y1,len(geom.asPolyline()))     fet.setGeometry(geom)     fet["id"] = fid     vl.addFeatures( [ fet ] )      The problem is that I get a _false_ at the               geom.insertVertex(x1,y1,len(geom.asPolyline()))      It works in Qgis 1.8, so I can not see where the problem is.


Unable to execute pgsql2shp in php

I am able to execute the command using the command line. But when i use it in the php script, I am not able to ececute it. Could you please help me out on thi Using command line               pgsql2shp -f p2 -h localhost -u postgres -p 5432 test "select geom from pipeline where gid=1"      Using php script               <?php     $ret = shell_exec ('pgsql2shp -f p2 -h localhost -u postgres -p 5432 test "select geom from pipeline where gid=1" ');     echo $ret;     ?>


Geomedia Objects Customization

I have created a form using VB.net based on Geomedia 2013. IN this form i have created a DATAGRID view in which i m able to see all the assets that are present in connected database with a click of a button. Now i want to use "zoom to" Functionality i.e when i click on specific records in DATA grid view form, I am zoomed to specified faeture on MAP Please help if someone has any idea on how to go about it.


Select all features close to clicked

I have an openlayers map with more then 20000 features not in wms, only in vector layer. I have a control to select features, but sometimes it's really hard to select, specially the lines, and also the other feature because they are too close. So instead the regular select tool I want to be able to click on the map, and get all the close features then chose what to select. How I wanted to do it it's like this: when I click it's create a little circle and I check all the features that in the circle (even little part from the feature) I didn't really find a function to do it in the api, it's possible to do it? Or someone have other solution? Thanks


Estimation of hydraulic head

I am trying to estimate hydraulic head using SRTM DEM. My objective is to calculate hydropower potential using the hydraulic head and inflow among others. The problem is I do have estimate of head. How can I do this? I am using ArcGIS 10.


How to export .mdb file to shapefile?

I have received some GIS files, in .mdb format. Is it possible to project this .mdb file onto my map; say by converting it into shapefile etc? In Mapinfo Professional, i could open this .mdb file but i don't know if i could translate it to another format. Kindly advise & thank you in advance. Best- Anna.


ESRI State Plane Coordinates as EPSG

I am working with some State Plane projections from Colorado. I have looked them up on spatialreference.org and they are the following:               ESRI:102254: NAD 1983 HARN StatePlane Colorado Central FIPS 0502     ESRI:102654: NAD 1983 StatePlane Colorado Central FIPS 0502 Feet      I am wondering how I reference this coordinate in QGIS or FWTools using an EPSG code. When I load this data it comes up as a User 10000 value. Any help would be great. Thanks...


How to flip X and Y coordinates of a grid by GDAL

I have a grid, which has flipped X and Y coordinates (X is represented by Y values and Y is represented by X values). This results in grid being positioned in completely wrong place. How can I flip the coordinates without loss of quality and doing by GDAL. Is it possible? If not, is there any other Linux library, that can achieve that? Thank you, Matej


GeoTIFF: How to remove Internal Overview without recompression

"gdaladdo -clean" does not remove the internal overview from the file see http://trac.osgeo.org/gdal/ticket/4940 How do I remove GeoTIFF overview(s) without having to re-compress the main image.


How can I more efficiently select related records?

Below is the code I'm using to replicate the "related tables" button in ArcMap. In ArcMap that button selects features in one feature class or table based on the selection of features in another related feature class or table. In ArcMap I can use that button to "push" my selection to the related table in a matter of seconds. I was unable to find anything built in to arcpy that replicates the button so I used some nested loops to do the same task. The code below loops through a table of "treatments". For each treatment, it loops through a list of "trees". When a match is found between the ID fields of treatment and trees, a selection occurs in the tree layer. Once a match is found for a treatment, the code does not continue to search the tree layer for additional matches. It goes back to the treatment table, selects the next treatment and again searches through the tree feature class. The code itself works fine, but it is agonizingly slow. The "treatment table" in this case has 16,000 records. The "tree" feature class has 60,000 records. Is there another more efficient way to recreate what ESRI is doing when it pushes the selection from one table to another? Should I be creating an index for the tables? NOTE: This data is stored in an SDE.                # Create search cursor to loop through the treatments     treatments = arcpy.SearchCursor(treatment_tv)     treatment_field = "Facility_ID"          for treatment in treatments:              #Get ID of treatment         treatment_ID = treatment.getValue(treatment_field)              # Create search cursor for looping through the trees         trees = arcpy.SearchCursor(tree_fl)         tree_field = "FACILITYID"              for tree in trees:                  # Get FID of tree             tree_FID = tree.getValue(tree_field)                  if tree_FID == treatment_FID:                 query = "FACILITYID = " + str(tree_FID)                 arcpy.SelectLayerByAttribute_management(tree_fl, "REMOVE_FROM_SELECTION", query)                 break


Combining UK OS Historic Digimap Tiles

I'm assisting a retired user in combining a large number of raster tiles downloaded from Historic Digimap http://edina.ac.uk/digimap/description/historic_overview.shtml into one project in qgis. I'd like if possible to combine these into one layer, - I'm aware that these can likely be stitched together using an external tool, but am unsure exactly how to go about doing so (or whether this is in fact possible in qgis itself) in a way that the resulting layer is still usable on a standard desktop pc (~4GB ram) or whether this is in fact not possible. Many thanks in advance


Wrong order to the path

I have a query which i use to find a route between two points . Even though the route is displayed good on the map the order i get from pgrouting is wrong the query is this one               SELECT rt.gid, ST_AsGeoJSON(rt.the_geom) AS geojson,                         length(ST_transform(rt.the_geom,3785))as meters,x1,x2,y1,y2,name, ways.gid                      FROM ways,                          (SELECT gid, the_geom                              FROM dijkstra_sp_delta(                                 'ways',                                 714,                                 4807,                                 0.1)                        ) as rt                    WHERE ways.gid=rt.gid;      do you know any way to take the segments of the route in right order ? Thanks in advance


In Geoserver, Using as a Data Store the Web Feature Server option, but I have a serious problem

I’m using as a Data Store the Web Feature Server option, but I have a serious problem, because Geoserver needs to know what Coordinate Reference System of my data. This information is used for computing the latitude/longitude bounding box and reprojecting the data. In my case, I’m using Native SRS and Declared SRS as EPSG:4326, but if I choose SRS Handling as force declared or maintain native, distorts my layers; because in Bounding Boxes computes the coordinates wrong. Please check


Relating Tables in CartoDB

Is there a way to relate tables in CartoDB? More specifically, is there a way to have a single row in one table associated with multiple rows in another table without having to actually join them?


Can I load a country-size OSM file in QGIS?

I've tried several ways to display OSM data in QGIS, but none of them really worked well for me. For example, I've tried WMS layer, but when I try to print high resolution, it won't give me enough data. I've tried to load into Postgis DB, but only got thousands of nodes displayed. Did not really look like a map ... Is there any way to load some big file, for example for one country, and display it in Mapnik style in different zoom levels?


Why can't I add the the qgis.org repository public key to Ubuntu 12.04

I'm tryng to intall QGis in Ubuntu 12.04 but I can't import the public key:               mferreira@cibiows1:~$ gpg --recv-key 997D3880     gpg: requesting key 997D3880 from hkp server keys.gnupg.net     gpg: keyserver timed out     gpg: keyserver receive failed: keyserver error      Even if I try sudo it it gives an error message:               mferreira@cibiows1:~$ sudo gpg --recv-key 47765B75     [sudo] password for mferreira:      gpg: WARNING: unsafe ownership on configuration file `/home/mferreira/.gnupg/gpg.conf'     gpg: external program calls are disabled due to unsafe options file permissions     gpg: keyserver communications error: general error     gpg: keyserver receive failed: general error      Does anyone I have any idea how to work around this? Many thanks.


What technology is used behind arcpy cursors?

I'm using ArcGIS Server 10.0. I have a geoprocessing using arcpy search, update and insert cursors. I'd like to know more about the technology behind these cursors. Does it use any driver or pool to connect to the database (I'm using Oracle 11g)? Does it open a connexion to the DB once at the creation of the cursor and close it when the cursor is deleted? What about transactions? Does the cursor open a new connexion and transaction to the DB each time a row is updated or inserted?


How to convert picture to annotation in ArcGIS 10.1?

I have been tasked to display analytical data tables (currently in MS Excel) in an ArcGIS (v 10.1) map document (.mxd) and would also like to convert them to map document annotation, if possible. Ideally, I would like the embedded excel tables to stay the same size and in the same place when I am moving and zooming around the map document. Each analytical table is linked to a specific monitoring well. If I simply cut-and-paste the individual tables (e.g. below) into my map, they will appear as "pictures". I know that pictures are neither graphics (point, line, polygon, text) nor a feature. And when I right-click on the pasted table, I am not allowed to "Convert to Graphics" (as it is greyed out). How can I solve this problem? Is there a work-around? **Example table I want to add to my map document (which appears as a picture in ArcGIS):** ![enter image description here](http://i.stack.imgur.com/4jVY6.png)


start gdalbuildvrt from c++ plugin

I want to create a vrt from my plugin via gdal-tool. From OSGEO4W-Shell the command works. In my code i tried this:               QString program = "gdalbuildvrt";                         QStringList arguments;                         arguments.append("C:\\Temp\\output.vrt");                         arguments.append("P:\\Daten\\Rasterdatenkatalog\\Raster1\\kat_1\\teil1\\4331ein.tif");                         arguments.append("P:\\Daten\\Rasterdatenkatalog\\Raster1\\kat_1\\teil1\\4332ein.tif");                         arguments.append("P:\\Daten\\Rasterdatenkatalog\\Raster1\\kat_1\\teil1\\4333ein.tif");                              QProcess p;                         p.start(program, arguments);                         if (p.waitForStarted())                         {                             p.waitForFinished();                             qDebug() << p.readAllStandardOutput();                         }                         else                             qDebug() << "Failed to start";      I get no errormessage but the file will not be created. Do I need the full path to gdalbuildvrt? I thought in qgis the path is even set. Thanks for any idea.


Identifying the cause of NOT ST_IsValid()

I have a table of raw GeoJSON in a Postgres database, with PostGIS installed. Some of this GeoJSON is unfortunately invalid, for varying reasons.               SELECT         id, name, geometry     FROM shapes     WHERE         NOT ST_IsValid(ST_GeomFromGeoJSON(geometry));      Sample log output:               NOTICE:  Self-intersection at or near point -98.12763909659509 40.524842899558408     NOTICE:  Ring Self-intersection at or near point -89.500197172165002 45.280231548720003     NOTICE:  Nested shells at or near point -80.15264234 34.224868579999999     NOTICE:  Duplicate Rings at or near point -80.155240000000006 34.217115999999997     NOTICE:  IllegalArgumentException: Invalid number of points in LinearRing found 3 - must be 0 or >= 4     NOTICE:  IllegalArgumentException: point array must contain 0 or >1 elements      Self-intersection is by far the most common error. I'd like to edit out the self-intersection completely, such as via `ST_SimplifyPreserveTopology`. However, when I attempt to do so:               SELECT         id,         name,         geometry,         ST_AsGeoJSON(ST_SimplifyPreserveTopology(ST_GeomFromGeoJSON(geometry), .00000001)) as new_geometry     FROM shapes     WHERE         NOT ST_IsValid(ST_GeomFromGeoJSON(geometry));      Those `IllegalArgumentExceptions` kill the query:               ERROR:  First argument geometry could not be converted to GEOS: IllegalArgumentException: Invalid number of points in LinearRing found 3 - must be 0 or >= 4      I tried using `ST_IsSimple` to filter those geometries out, but that function also triggers an `IllegalArgumentException`. How can I more accurately identify which validity error a GeoJSON string suffers from so that I can filter out those nastier geometries?


How can I render latitude-longitude coordinates on a map with D3?

I am trying to overlay dots of arbitrary sets of longitude-latitude coordinates on top of a United States map. So far I have found the D3 cartography example, but when I try to place dots on X,Y pixel coordinates they appear way off the canvas. I did find workshot lecture notes which include coordinate systems in d3, but I'm still unsure of how get lat/long coords to show up on the map. This is what I have so far (pretty much only a map of the USA) Advice on how to make this work would be greatly appreciated!


Is it possible to increase/reduce features proportionally?

Is it possible with QGIS to increase or reduce features (polygons or lines already drawn) proportionally? Preventing me to redraw several times new polygons :) ![enter image description here](http://i.stack.imgur.com/AvaPB.png) See picture above: Making it possible to resize for example the green polygon to the size of the red polygon (the polygons are build by the plugin "Rectangles ovals digitizing"). In ArcGIS, this can be accomplished by using the Scale tool to resize an individual feature. I haven't found a solution in the QGIS-Guide.


Show "layer name" as text in arcgis layout view (map)

I am trying to show the layer names of all visible layers in ArcGis 10.1 when creating a map in layout view. First I tried to use "insert legend" and show there only the layername, but I can't disable the decription/symbology display. That did not work, so I think it is better to use "insert dynamic text" instead. That is easy for the Document name `Document Name: <dyn type="document" property="name"/>` but I don't know, what to insert when I want the layernames. What is the correct type and property? Thank you!


Changing projection for field calculator

I've just succeeded in getting the area of a polygon using field calculator. The polygon was drawn on a Google hybrid aerial photo. There are no units given in the calculation and I assume the area figure is based on latitude / longitude. How do I go about changing the projection in order to get an area figure in hectares?


Is there a simple way to sort layers alphabetically in QGIS?

I am working on a big GIS project and not being able to sort the items in the Layers panel is giving me hard time. I can have up to 250 layers in the Layers panel. I have a special naming scheme for all the TIFF raster files I import and geo- reference in QGIS. But when I import them I can't import them one by one in alphabetical order, because my co-workers are working on some of the files and I am working on others. So the items in the Layers panel are all over the place. The program is not intelligent enough to sort them in alphabetical order. Instead it sorts them in the order I import them. Here, take a look at this screenshot. ![a](http://i.stack.imgur.com/94Nxz.png) Is there no built-in option in QGIS that would allow me to sort these items? If not, is there a plugin I can install that would allow me to do this? **Edit:** I found this and the first few lines of code seem to do the trick.               from PyQt4.QtCore import *     from PyQt4.QtGui import *     from qgis.utils import iface          mw = iface.mainWindow()     lgd = mw.findChild(QTreeWidget, "theMapLegend")  # get ref to object by type/objectName     lgd.sortItems(0, Qt.AscendingOrder)  # sort first column (Qt.DescendingOrder to reverse)      But I'm not a fluent C++ or a Python programmer. Seriously?... Do I have to pick up a programming cook book to sort the layers in QGIS? Could it be any more difficult?... ![b](http://i.stack.imgur.com/xmOrI.png) Is there no plugin that can do the same job? I'm afraid to use code that I don't understand on an important project.


How to merge/cluster smaller contiguous polygons to form larger ones?

Any help you can give an inexperienced college GIS user would be greatly appreciated. I am using both ArcGIS ArcMap 9.3 and 10 on desktop (i.e. not online), and the only info I can find on License Type on college computers is 'ArcInfo'. I have a set of forestry data that maps forestry type (species/age class etc) for a small country. With this data I am attempting to evaluate suitable habitat by identifying woodlands over a certain size (>200ha) with particular make up of tree species (mostly coniferous/broadleaf). The problem I am having is that the shapefile has polygons made according to individual tree species. Is there a way to cluster the individual tree species, so I can attain one larger polygon for the entire woodland, and thereby have an area value for the woodland as a whole, instead of the individual parts (both due to seperate species, or division due to a fence, for example). There are thousands of polygons in the dataset, so it is not feasible to get the sum individual ones, with the time I have available to me.


PCS and GCS Transformation

Trying to trasnform GCS_Bessel_1841 PCS_Trasnverse Mercator (central meridian 18) to WGS1984 using "Project tool" in ArcGIS 9.3. I tried to do it in several different ways, every time from the beginning. In project dialog box under Output coordinate system I choose a) Select predefined PCS. I choose WGS PDC. Nothing happens. b) Select predefined GCS. I choose World/WGS_1984. Nothing happens. c) Import from an existing dataset. Nothing happens. d) I go to Layers, Transformations, select "Convert from GCS_Bessel_1841 to World/WGS_1984 (from the drop down menu). I select "using New Geographic Transformation" and choose position vector with seven variables which I got from here http://georepository.com/transformation_3964/MGI-1901-to-WGS-84-4.html. Nothing happens. The polygons remain the same, and the PCS is always the TM I started with. Please help. Obvious ideas are welcome. As are a few short sentences behind the rationale of the system. I know what a PCS and GCS and datums are :) The country is Croatia.


Digitizing from OpenLayers Plugin in QGIS, or create raster?

Is there an easy method for digitizing from a layer added from the OpenLayers pluggin. As i cannot snap to it or use it as raster so the entire map does not load? two separate issues there.


Remove Duplicate items in legend

I working on several layers that share similar symbology in the arcview. I'm trying to remove duplicate Symbology from the legend. Manually I can do it by click "properties -> symbology" and then start to choose wha't to remove (see jpg2), but it will take a lot of time. I work with arcview 10.2.2 & python 2.7.5. ![data view of the map](http://i.stack.imgur.com/pRoeI.jpg) ![layer properties](http://i.stack.imgur.com/rDqU2.jpg) In jpg3+4 i added attribute table of the 2 layers ![attribute table- landuse1](http://i.stack.imgur.com/9BMB1.jpg) ![attribute table- landuse2](http://i.stack.imgur.com/0am3n.jpg) Here i build the legend, but as you can see there duplicate symbology and i want to remove it. Now, in the real map i have 32 layers with a lot of duplicate symbology. ![LEGEND](http://i.stack.imgur.com/c9y4B.jpg) I hope someone can describe an easy way to accomplish what I'm after with manually way and also with python script?


How to reproject WSF layer created from GeoJSON?

I have a WFS layer:               myVecLayer_disp= new OpenLayers.Layer.Vector("Редактируемый участок",{projection: new OpenLayers.Projection("EPSG:900913")});      And i have feature store:                       var protocol=new OpenLayers.Protocol.HTTP({                 url: url_servlet+"fullSearch.jsp",                 format: new OpenLayers.Format.GeoJSON({internalProjection: new OpenLayers.Projection("EPSG:4326"),externalProjection:new OpenLayers.Projection("EPSG:900913")})         });         searchStore = new GeoExt.data.FeatureStore({             layer: myVecLayer_disp,             fields: [                 {name: 'id', type: 'String'},                 {name: 'name_dispatcher', type: 'String'},                 {name: 'voltage', type: 'String'},             ],             proxy: new GeoExt.data.ProtocolProxy({                 protocol: protocol,             }),             autoLoad: true,             layerOptions: function() {                 return {                     strategies: [new OpenLayers.Strategy.BBOX()],                     //projection:"EPSG:4326"                 };             }         });      As you see i use GeoJSON. In this geojson i have features in wgs84. And reproject it in mercator in protocol. Now i show this layer:                   app.mapPanel.map.addLayers(myVecLayer_disp);     myVecLayer_disp.visibility=true;      And see features near Africa but expect to see it within Russia. So Nothig reproject i think. But when i see layes's features:                   LINESTRING(0.00055807640304122 0.00050642147755534,0.00055807616948463      0.00050641930362077,0.00055807588202664 0.00050641664462617,0.00055807423809849      0.00050641332981391,0.00055807306129967 0.00050640979946183,0.00055807191147579      0.00050640644872202,0.00055807052802261 0.00050640231648177,0.00055806910873212      0.00050639813934481,0.00055806841697321 0.00050639609116937,0.00055806763547558      0.00050639388128181)      Ant this is same feature in geojson:               {"type":"LineString","coordinates":[[62.124781001642077,56.374581001212391],     [62.124755002241727,56.374338999945053],[62.124723002564679,56.374043002482722],     [62.124540001320156,56.373673997157425],[62.12440900067503,56.373281000617851],     [62.124281002866155,56.37290799870533],[62.124126997563053,56.372447999975407],     [62.123969002867341,56.371983002813522],[62.123891996618511,56.371755002191776],     [62.123805000700372,56.371508997142655]]}      What i doing wrong?


how can i use openlayers to use my locally rendered tiles

I've been stuck on how to use my local tiles which i rendered with mapnik's generate_tiles.py and all the data is on postgresql. I'm kinda confused on what i should do to "feed" the tiles to openlayers. The map would be used in django btw. hoping you could help me with this.


plugin list not appear

I use QGis 2.4 over linux ubuntu 12.04 (a very standard situation :D) Why does the list of installed plugins not appear in the program? ![enter image description here](http://i.stack.imgur.com/d8xht.jpg)


Create polylines from point array Python

I am working on building polylines from an array of points I have created from a csv file and am completely lost in building the lines. My code works as follows: I have the point array working, I need help in creating the polylines from the point array. Please note I am also wanting to add the name into the new polyline feature.               # Reads a csv file to create points of locations     import arcpy     print "==============RESTART===================="          # Set up variables     spreadsheet = "C:\\Users\\Desktop\\RhinoObservations2.csv"    # input file with coordinates     ouputFC = Rhino_Path          # defines the name of the ouput feature class          # Open the CSV file and read the header line. "r" is read the file     observationsFile = open (spreadsheet, "r")     print observationsFile          headerLine = observationsFile.readline()  # reads all lines in CSV??     print headerLine          # Determine the indicies of the columns "X","Y","Rhino"     fieldList = headerLine.split(",")     print fieldList          xIndex = fieldList.index("X")     print xIndex          yIndex = fieldList.index("Y")     print yIndex          rhinoIndex = fieldList.index("Rhino")     print rhinoIndex          # Set up new dictionary where the Rhino information is stored     rhinoDictionary = {}          # Loop through the remaining line of the input file; for each line....     for line in observationsFile.readlines():        print line              # Determine the rhino name, X,Y coordintes from that line         segmentedLine = line.split(",")              rhino = segmentedLine[rhinoIndex]              x = segmentedLine[xIndex]              y = segmentedLine[yIndex]                   # Create an object of the the class Point (defined in the arcpy module) for the X Y coordinate         coords = arcpy.Point(x,y)              # If this rhino is not already in the dictionary         if not rhino in rhinoDictionary:                  # Create a new object of class Array, add the object point, and then put array into dictionary             # under the name of the Rhino             coordArray = arcpy.Array()  #setting up an empty list to store points             coordArray.add(coords)      #list that contains one point             rhinoDictionary[rhino] = coordArray              # Else         else:                  # Get the array object from the dictionary for this Rhino and add the point to the array.             coordArray = rhinoDictionary[rhino]             coordArray.add(coords)               # Print out the information in the dictionary     for key in rhinoDictionary:         print key         print "This is the point array: " + str(rhinoDictionary[key])         for p in rhinoDictionary[key]:             print "(" + str(p.X) + ", " + str(p.Y) + ")"              # Take the array and create polylines from it.              print "========"     # Create polylines and add them to the feature class


Visualization of 3D GIS daten with 3D glasses

A colleague of mine wants to inspect 3D aerial photos in 3D with 3d glasses. He thinks he just needs the right 3d Graphics card and monitor with more Ghz - something along the lines of nvidia 3d Gaming cards I imagine. The 3d Visualisation could then be produced automagically without any need for extentions in ArcGIS. Has anyone any experience with this kind of hardware? what works, what doesn´t what should be avoided at all cost etc?


Calculate distance between point and linestring, save the distance as table and represent that on QGIS?

I have loaded my data with osm2pgrouting and I have my network with ways (Linestring) and nodes (Point). The problem is : I have a database of doctors addresses (point) and I should calculate the distance between these points and my ways (Linestring). Yellow points are Doctors : !(http://i.imgur.com/XmqVTCt.png) I am using the following query :               SELECT ST_Distance (      ST_GeomFromText('POINT(55.4504545699355 -20.8752577759738)',4326),     ST_GeomFromText('LINESTRING(55.4748349 -27.1342723, 55.4747091   21.1338699)',4326) )     As ST_DISTANCE;      But I don't think that works. I need to calculate the distance from all the doctors points and represent that in QGIS as a linestring. I want to add this lines to my network (table : ways) to calculate the driving_distance or the shortest_path from this points with PgRouting. Any help or advice?


ESRI Geoprocessing Script : Runs Fine in Desktop - Crashes as Geoprocessing Service

I have a small and simple geoprocessing script that I am trying to expose as a geoprocessing service in ArcGIS Server 10 SP4. The script is below. Pardon the hard-coding... With the hard-coded variables, this script runs perfectly fine in desktop. However, once published as gp service, it crashes in a bad way, like I can't even trap the error. The exact message in the GIS Server log - "Container process 6436 has crashed on machine westchamp24-pc." A couple of potential causes I can eliminate right off the bat:   1. Permissions: The entire D: drive is wide open to the 'Everyone' user   2. Licensing: ArcGIS Server is licensed at Enterprise level              # Check out the ArcGIS Spatial Analyst extension license     arcpy.CheckOutExtension("Spatial")          # Execute CostDistance     outCostDistance = CostDistance("origin",SOURCE,"#","D:/RasterStuff/backlinkRaster.tif")          # Execute CostPath     outCostPath = CostPath("destination", outCostDistance,"D:/RasterStuff/backlinkRaster.tif")          # Convert Result to Polyline     arcpy.RasterToPolyline_conversion(outCostPath, "D:/RasterStuff/costPath.shp")     featSet = arcpy.FeatureSet()     featSet.load("in_memory/costPath")          arcpy.SetParameter(0,featSet)      except: # do stuff with error print finally: print


Running QGis from flash drive

How can I setup a portable QGis to run from a flash drive / USB-Stick? In the userguide for QGis 1.7 Wroclaw there is only mentioned the option of "-- configpath". But to me it is not clear how to deal with this information. I would be very thankful if someone could post a step-by-step explanation! NEW EDIT: Will the answers still be valid for QGIS 2.0?


Google/OSM style map layer labels

I am currently using the OpenLayers plugin to import google maps as the base layer for a heat map. The map is of population by census tract. The more populous census tracts are red and less populous green. This is working well but the openlayer is completely flat and 0% transparent. This means I have to have my coloured census tracts over the top which obscures the features of the map. In products like MapPoint you are able to have the background of the map at the very back, then the coloured data and then the labels (cities, highways etc) at the top. Does anyone know how I can do that? Another option would be a transparent map layer which I could then put over the top of my coloured census tracts. Any help would be much appreciated.


Is it possible to put EPSG:3035 wms layer over google maps or OSM? I managed to do this, but my wms layer is placed differently then google maps or osm. I assume, google maps/osm uses different projection. I was wondering is it possible to show my EPSG:3035 wms layer over "map" (without transforming my wms data)? P.S. I managed to put my wms layer in correct position, but then wms layer "gets" curved and openlayer fills rest of the square black - which is bad.


How to use wget inside Msys - OSGEW4W?

I open MSYS from the OSGEO4W and type wget and I get 'command not found'. I'm using Windows 7. ![enter image description here](http://i.stack.imgur.com/qN5s4.png) Does anyone know how to solve this? Thank you!


FME-pass the parameter to the reprojector transformer

Let me describe the scenario. I have to make a statistical maps for a bunch of countries. The FME workbench is going to use ESRI reprojector to reproject the shape of given country to lambert azimuthal equal area and after generate regular grid. Is there any way FME can pick up automatically the values of central meridian, latitute of origin for the country that the map is going to be created ? Could the information about the country center be passed to the reprojector automatically ? I would like to avoid situation where I have to manually pass the parameters each time the new country is going to be processed. Thank you in advance Gregory