Code works on python console in QGIS but same doesn't work in stand alone script

I'm trying map rendering with stand alone script, so I have small script which works fine in python console provided QGIS, however when I run same code in stand-alone script it executes without error, but output is not produced. Here is my standalone script:               from qgis.core import *     from qgis.gui import *     from qgis.utils import *     from PyQt4.QtCore import *     from PyQt4.QtGui import *     from PyQt4.QtXml import *          QgsApplication.setPrefixPathddd("C:\Program Files (x86)\QGIS Valmiera", True)          QgsApplication.initQgis()          mapinstance = QgsMapLayerRegistry.instance()     mapinstance.removeAllMapLayers()          layer = QgsVectorLayer("F:\scripts\map\wb.shp", "test", "ogr")          if layer.isValid():         print "shplayer succesfully loaded - adding to mapinstance"         mapinstance.addMapLayer(layer)     else:         print "shplayer failed to load!"          print mapinstance.mapLayers()          # create image     img = QImage(QSize(800,600), QImage.Format_ARGB32_Premultiplied)     # set image background color     color = QColor(255,255,255)     img.fill(color.rgb())     # create painter     p = QPainter()     p.begin(img)     p.setRenderHint(QPainter.Antialiasing)     render = QgsMapRenderer()     # set layer set     lst = [ layer.id() ] # add ID of every layer     render.setLayerSet(lst)     # set extent     rect = QgsRectangle(render.fullExtent())     #rect.scale(1.39800703)     rect.scale(1.1)     render.setExtent(rect)     # set output size     render.setOutputSize(img.size(), img.logicalDpiX())     # do the rendering     render.render(p)     p.end()          # save image     img.save('F:\scripts\out.png',"png")              QgsApplication.exitQgis()


Are there PhD programs that specifically focus on GIS, and if so, what is the typical outcome?

I know of the University of Pittsburgh where you can get a PhD in information science that focuses on Geoinformatics, which seems kind of cool. I've been looking around but it seems that most PhD programs in Geography focus on either human or physical and don't really get into studying methods of GIS, which is what interests me. I'm sure there are some that I'm missing though.


File representing extents of coordinates systems and their wkid

I'm looking for a file that represents the major coordinate systems throughout the world, and the extent that they cover. Ideally they'll also have the wkid as an attribute. Something like the shapefile found here of UTM zones, but with wkid's http://earth-info.nga.mil/GandG/coordsys/grids/universal_grid_system.html Cheers!


ArcObjects Workspaces with spaces

I am programming with ArcObjects and trying to output a raster to a folder path that contains spaces. Before creating the raster I am trying to validate that the destination path is valid. The following call to IsWorkspace() returns false when the path has spaces. Is this by design or a problem? How should one test that a folder is a valid file-based raster workspace?               Dim aType As Type = Type.GetTypeFromProgID("esriDataSourcesRaster.RasterWorkspaceFactory")     Dim obj As System.Object = Activator.CreateInstance(aType)     Dim pWSF As ESRI.ArcGIS.Geodatabase.IWorkspaceFactory = obj     return pWSF.IsWorkspace("C:\MyGISData\My Output Folder")


Hiding Map Elements Outside of Neatline in ArcMap

I have a map layout in ArcMap 10.1 that incorporates a neatline that is offset from the edges of the layout by about an inch on the inside. Certain elements of my map extend beyond the neatline and layout view. Does anyone know of a way to clip or hide the elements that extend between the neatline and edge of the layout when exporting the map? Thanks!


Help me to understand how i.fusion.brovey works in Grass 6.4.3

I'm using Grass 6.4.3 in Linuxmint 16. I don't have a very big problem but I'm trying to understand what is Grass doing, if I'm applying the process correctly and if there is something wrong with my image files. I'm trying to pansharpen a SPOT image. I have two files, one the panchromatic band and the other is the multiband file. I import them to grass as, for example, 'spotimage.pan' (panchromatic) and the other file is automatic named by grass as 'spotimage.1', 'spotimage.2', 'spotimage.3' and 'spotimage.4'. I think that in the original file, the bands order is inverted, I mean that the first band is NIR, the second one is Red and the third one is Green. This is because original image composite was done in order to obtain a false color image when is displayed as R,G,B = B1, B2, B3 So, if I do               d.rgb -o red=spotimage.1 green=spotimage.2 blue=spotimage.3      I obtain a false color view of the image. Then, to pansharpen the image I use               i.fusion.brovey -s ms1=spotimage.3 ms2=spotimage.2 ms3=spotimage.1 pan=spotimage.pan outputprefix=spotimage.pansh      I inverted the order, where I should use the SPOT Band 1, I'm using the band 3 of my image and where I should use the SPOT Band 3, I'm using the band 2 of my image. This because, in the dialog box of `i.fusion.brovey`, where it says _"Name of input raster map (green: tm2 | qbird_green | spot1)"_ I suppose I have to use the name of the SPOT Band 1 and, where it says _Name of input raster map (MIR; tm5 | qbird_red | spot3)"_ I suppose I have to use the name of the SPOT Band 3. Is it correct? The output are three raster files: _pansh.red, pansh.green_ and _pansh.blue_. But I cannot manage to obtain again a false color view with any combination of these pansharpened bands. What am I doing wrong? Are pansh.red the "pansharpened version" of spotimage.2, pansh.green the pansharpened version of spotimage.3 and pansh.blue the pansharpened version of spotimage.1? Remember thar the bands order is inverted. Should I use `i.landsat.rgb`? Can I use it with a SPOT image? Any help? Thanks!


QGIS - Calling interpolation extension from python console

I would like to call the QGIS interpolation extension function (TIN method) (Raster->Interpolate) from python console. I can't find the corresponding function within QGIS API or within the processing algorithm list. I found the SAGA Triangulation algorithm, wich work fine but is 5-10 x slower and speed is important in my case. Any idea how to execute it? thank you Vincent


Geometry type invalid occurs while trying to view data from oracle to arcmap connection

I have been trying to connect oracle databse in to arcmap 10.1. It got connected but while trying to add feature type ( route network file) to the map it says "Coodinate system identifier is invalid". The tables which are not associated with any geometry are displayed but the geometry related files are not showing up. I would really appreciate on any comment and thoughts.


Insert geometric data to a column from coordinate values in double precision

Screenshot of database http://wp.me/aIW9p-i0 For table “households”, I want to create two new columns: 1) “Geom”, data type – geometry; 2) “WKT”, data type ‐ text; I am intending to do the following tasks: 1. For each household, I have the location, indicated by x_coord and y_coord, respectively in the table. Then I have to create a geometric object – point, based on the x_coord and y_coord for each household. Insert these geometric data to the column “Geom” accordingly.   1. Now, after the first step, I have a geometric object for each household. Translate the geometric point data to the well‐known‐text,showing the longitude and latitude of the location of each house. Insert these values to the second column “WKT”, accordingly For the Step 1 I wrote the following function but I am getting the error: **Query returned successfully with no result in 54 ms.** CREATE OR REPLACE FUNCTION my_geom() RETURNS SETOF clean.households AS $BODY$ DECLARE x clean.households%ROWTYPE; pst geometry; BEGIN FOR x IN SELECT * FROM clean.households LOOP pst := ST_GeomFromText('POINT(' || x_coord || ' ' || y_coord || ')'); UPDATE clean.households set geom = pst; RETURN NEXT x; END LOOP; RETURN; END $BODY$ LANGUAGE 'plpgsql' ;


Need spatial data for very specific administrative boundaries in Ontario

I was wondering if anyone might know where I can download the rectangular administrative boundaries shown in the image below. I have highlighted one of them in red. On the image, you can see that the naming convention consists of some sort of numeric administrative identifier, as well as a name for each area (which seems to correlate roughly to the nearest city or town of any significance). I require the spatial file in order to provide a quote for a large project and I haven't been able to find anything. The only information the client has is in paper format. The title on the overview map shown below is **Provincial Series and Crown Land Use Atlas Index - 1:100,000**. I have searched the Provincial data available from LIO, the Federal data available at GeoGratis, and I've tried numerous Google searches with no luck. Any assistance would be greatly appreciated as I'd like to avoid digitizing if possible. Thanks in advance, and here's the image: ![enter image description here](http://i.stack.imgur.com/FwPuz.jpg)


Is there an interface that provides access to a property/method that shows whether a Layer is visible?

Repost--I deleted this yesterday when I discovered the answer and remembered this on meta. Had second thoughts this morning, since this might be useful to someone in the future. I'll let this go for a week and provide my own answer if it's unanswered. * * * I came across some hack code that I wrote from a few years back that I need rewrite in c#. At the time, I couldn't find property/method that would tell me if a layer was actually visible on the map. As opposed to the ILayer.Visible property which is the potential for a layer to be visible. IMapLayers.IsLayerVisible looked promising but it didn't return the expected values. My ESRI incident didn't have a related bug and the resolution to that incident was my own hack that I provided. How are others obtaining this information about a layer's true visibility within a map? **Update**   When I said true visibility, I meant that if a layer was visible and it's parent/grandparent/etc are visible too. 'True visibility' was a poor choice of words on my part, because it could be interpreted as a visible layer that has features within the current extent (which is not what I need).


How do I set the timezone in GeoServer w/ Jetty on Windows?

GeoServer is set to the local server timezone, but I need to have it use UTC. I believe that to make this happen I need to set the Java's user.timezone variable. My understanding is that if user.timezone is not set, Java (and so GeoServer) will use the server's local timezone. I'm running it with Jetty on Windows, talking to SQL Server 2008. We have a field Following these instructions, I tried creating a start.ini and putting               --exec     -Duser.timezone="GMT"      in it, but that file doesn't seem to be used. I next tried adding               wrapper.java.additional.4=-Duser.timezone=GMT      to the GeoServer 2.2.4\wrapper\wrapper.conf file, but that didn't seem to work either. I'm not sure what to try next and my searches are coming up empty.


How can I get the set of points (cloud) that are a given distance in SpatiaLite?

I have a set of points and need to get the groups of points that are within a distance x. Ie, determining the point clouds that are up to the distance x from each other. Any help would be appreciated. Thanks. Additional information: Example of a table with coordinates (in EPSG:4674) ![Table with points EPSG:4674](http://i.stack.imgur.com/V8LOq.jpg) The extension of the data is variable. Will be implemented in several counties, separately. I need anything like this: ![clustering buffer](http://i.stack.imgur.com/FZJLG.jpg) And I need make this in SQL from SpatiaLite. I can make this using buffer and union but I get just one polygon because I don´t have a "group by" attribute, and I need polygons separately for each group. I´ve been trying this:               CREATE TABLE "T_bufEndR" AS            SELECT "PK_UID" as "ID_end",                  ST_BUFFER(geom_ce, 0.00025) AS "geom_bu"             FROM "T_CoordEnd"            WHERE "situacao" IN (4, 5, 6, 7, 8)      and               CREATE TABLE "T_unbufEndR" AS           SELECT ST_UNION(b.geom_bu, a.geom_bu) AS "geom_bu"             FROM "T_bufEndR" AS "b", "T_bufEndR" AS "a"            WHERE ST_OVERLAPS(b.geom_bu, a.geom_bu) = 1 AND                  "b"."ROWID" IN (SELECT rowid from SpatialIndex                                    WHERE f_table_name = "t_bufendr" and                                         search_frame = "a"."geom_bu")      Is that!


OpenLayers with Yandex layer position issue

I am kind of new for openlayers and I am working on a project that have many different layers. one of this layer is Yandex, I added this layer few days ago and it seems to work fine, untill QA :) discovered that when you switch from this layer to another it not position the same as the other layer, I added this layer base on the following article (couldn't find anything else that show how to add the Yandex) http://xbb.uz/openlayers/i-Yandex.Maps when I have lines layer on the map and change the base layer from google, bing or any other layer to yandex the lines or the yandex layer are not positioned right. YANDEX layer ![enter image description here](http://i.stack.imgur.com/eEq5I.png) OPEN STREET MAP LAYER ![enter image description here](http://i.stack.imgur.com/7nVSQ.png)


Using Quickbird to discriminate vegetation response and spectral signatures - which season?

I have a study area in N. Florida loblolly pine plantation with 3 treatments (drought, fertilization, drought+fertilization, control) and 4 replicate plots. All plots will be in the same scene. These treatments are expected to alter the growth and response of pine trees. The only available existing imagery at the initial time of treatment installation is from quickbird (one in March and one in December) - this will be the baseline image. Ideally, it would be nice to acquire imagery every year and season, it's not feasible due to budget constraints. So, I will probably purchase one, maybe two more images over the next 1-2 years. They should be the same season as the "baseline" scene. **My Question:** Which season, if any, is best to discriminate spectral signatures between treatments/plots to really tease out differences in growth due to treatments and estimate NDVI, LAI, and other vegetation indices? I would suspect winter, when everything is not as lush and green and somewhat stressed (relative to summer). What is your expert opinion? Thanks in advance.


Labelling a multipoygon scattered in different areas

I am using **mapnik** and **tilecache** to generate tiles and **openlayers** to view map in the browser. In one of my **shapefiles(multipolygon)** with administrative boundaries, I found that more than one records have their **polygons displayed in two areas in the map**. In the map, **label is placed in center position** of the two polygons. When I opened the shapefile in **Qgis** , I found that label is displayed for each of the two polygons correctly. How will this type of labelling be done in mapnik. Thanks in advance.


Is it necessary to use a third party service for serving this case?

I have been assigned a task to help build a mobile app, which only shows terrain view of map with a fixed (min/max) zoom level based on mobile phone position and moveable markers which are provided by our server in json format (vector with speed, directions, etc) . Now.. since i haven't a big experience dealing with GIS data, how could i serve the tiled images to client without having to query a 3rd party service? I only need the static images plus a custom json to client, should i build a server or use a 3rd party service(gmap,etc). Given the amount of expected load and the restrictions set by 3rd party services on limitation of storing or even caching data on local machines is what i try to avoid. Contribution to the 3rd party such as a Google map is something i personally dislike, OpenStreet map though is better from my point of view. **Example** I have the London Territory which it isn't required to maximize Zoom, need to serve its Terrain point of view, based on OSM data for highways/rivers etc, a special json is generated from server-side which both tiles+custom json are supposed to be delivered to client, in order to sync and present a response to clients action. Since it rather unlikely for the terrain view (tile) to change for like the next year, and i can't cache from 3rd parties, how can i serve this? * * * > **Conclusion** _just for the record_ Well after a review and research we decided to go with Leaflet at client side since it looks mature, build our tilesets with TileMill and serve PNGs. The application will use own tiles for rendering terrain view of major cities, with availability for zoom (at fixed levels) , if any user wants to view other cities the application will try to connect to server and start caching tiles that it receives, but in favor of NOT consuming all of phone memory or ram, it will limit its caching on <100MB (guess that is enough).


Opening specific area only

I have a Shp file loaded of a County boundary, but i would like to open another shp file but only show the lines etc within that area and automatically delete anything outside. Thank-you


Are there any good libraries for visually creating simple Google Maps?

I'm working on a simple webapp that lets the journalists I work with easily construct styled Google maps. In short, I need an interface that lets users place markers, set zoomlevel and choose a center lat/long — all without writing any JavaScript. I know Google Maps has a "My Maps" functionality that provides this already, but I'm needing that kind of functionality as a way of adding data to my app. ![Something like this...](http://i.stack.imgur.com/LxGrS.jpg) _Something like this..._ Anyone know of such a library? I'm currently using a series of text fields using LocationPicker for the markers, but I still need to be able to set center and zoom — and I can't shake the feeling there's probably already something out there that does this... Thanks! **Edit:** This seems close, if a little clunky... http://www.birdtheme.org/useful/v3tool.html


Calculating raster values from center to edges to represent normal distribution

Edit for simplification/clarification: What I want to do is take a raster and calculate cell values from center to edges such that the center has an arbitrarily determined high value which decreases down to near zero as you get closer to the edges. The values of said raster would have a Gaussian distribution, peaking in the center and tapering down near the edges. Any suggestions are welcome, conceptual or technical. I am most comfortable with ESRI products, but not an absolute requirement.


What type of remote sensing methodology is commonly used to locate and track the movement of woodland caribou herds?

I am most curious whether it is possible to use Landsat or other freely available imagery (but info on any other method would great as well) to locate and track the movement of woodland caribou herds over time. I only have some experience doing this type of work with forest depletions and vegetation analysis but am curious whether similar techniques exist for locating and tracking animal herds.


Automated attribute update geometric network

I have a Network Dataset of a storm water system containing two feature classes of points and lines. (All data is topologically sound with pits and pipes snapped and linework captured in direction of flow.) The point feature class contains an attribute "ASSET TYPE", the line feature class has two attribute fields which hold this value as well (ASSET_US and ASSET_DS) referring to the attached asset of the upstream and downstream pits. My question is, could anyone suggest a way to automate updates (through ESRI's ModelBuilder or Python or FME) to the ASSET_US and ASSET_DS fields in the pipe layer when the ASSET TYPE field has been changed in the pit layer?


How do I convert a CSV of latitude/longitude coordinates with timestamps to a GPX tracklog?

Converting from a GPX track to CSV is easy, but I'm looking to go the other way. I have a table of point locations logged with a handheld GPS, with timestamps. I need to convert them to a GPX file with a tracklog containing those points so they can be used with some other software to geotag some photos. I can convert them to GPX waypoints easily enough, but not to a GPX tracklog. Here's the header of my CSV:               Lon,Lat,Altitude,NewTrack,TimeStamp,Datum,InternalTime


ArcGIS API using maps from ArcGIS Online

I am new to the ArcGIS API for JavaScript but I would like to create an application which uses an existing map of ArcGIS Online. Creating an application where just a map is shown works fine. But now I would like to add the posibility to toggle the different layers. I researched about that but I am not sure how to implement that without having layers as map services. I have a free ArcGIS online account where I can upload shapefiles to the map. Can I access those layers from the API?


Qgis Server, show Oracle Georaster dynamically

I have an Oracle Spatial database and I use rasters (SDO_GEORASTER). I can render some rasters on a web page with Qgis Server : when I render the maps on the webpage, it come from a qgis project (*.qgs) 2-3 new rasters are automatically added in the database each day. I want to create a web page to render the rasters dynamically : the user choose the raster he wants to show in a combobox. Is it possible to connect Qgis server directly to the Oracle spatial database ? Sorry for my english Thanks


How to combine Boolean and Fuzzy logic?

So I have a set of 5 Fuzzy Memberships and a polygon feature class, to which I already added a yes/no field. For the final map, I need to combine/overlay all Fuzzy Memberships and the rasterized polygon feature class in order to map suitability, and don't know how to combine it. Any advice?


How to disperse clusters of proportional markers or polygons?

I am mapping a set of points in ArcMap that are symbolized using proportional marker symbols based on a numeric field value. The scale of the map has lead to alot of the point markers overlapping. ![current cluster](http://i.stack.imgur.com/U5HYF.png) I would like to disperse the markers so that they are not overlapping. A random dispersement would be fine, preferably with control over the spacing between the dispersed markers. It seems that proportional symbols can't be converted to representations (else I could have used the Cartographic Refinement - Disperse Markers tool). I could buffer the points by the numeric field to create polygons instead of using point markers to get around the representation issue, but is there a way to disperse polygons away from each other so they are not overlapping (similar to the functionality of the Disperse Markers tool for points)? I'm using ArcMap with an Advanced License. Thanks


Why can´t Geowebcache communicate with geoserver?

I have installed geoserver 2.5 with integrated GWC on a windows server 2008 R2 in tomcat6. I am not able to create map caches with GWC. GWC gives me "404: cannot communicate with server. I have a reverse proxy set up and a url rewrite in IIS to provide internet access. What do I have to do to establish communication again between Geoserver and GWC?


Cause of MODIS Reprojection Tool errors?

I have installed the **MODIS Reprojection Tool** (mrt) and it says the installation completed successfully but it does not mosaic my images properly. However, there seems to be some projection errors. I want to open the file in ArcGIS for Desktop. Does anyone know the cause of the MODIS Reprojection Tool errors below? ![enter image description here](http://i.stack.imgur.com/B1Zeq.png)


Running x64 bit geoprocessing Python in Python IDLE 2.7.6 x64 error

I am trying to set the Python IDLE 2.7.6 x64 to run the arcpy module from ArcGIS x64 bit geoprocessing (10.2.2). I copied the file DTBGGP64.pth from C:\Python27\ArcGISx6410.2\Lib\site-packages to C:\Python27\Lib\site-packages that is written as:               C:\Program Files (x86)\ArcGIS\Desktop10.2\bin64     C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy     C:\Program Files (x86)\ArcGIS\Desktop10.2\ArcToolbox\Scripts      when I then open the python 2.7.6 x64 IDLE and run the following command : import Arcpy, I get this error               Traceback (most recent call last):       File "<pyshell#0>", line 1, in <module>         import arcpy       File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\__init__.py", line 24,     in <module>         from arcpy.toolbox import *       File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\toolbox.py", line 356,     in <module>         from management import Graph, GraphTemplate       File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\management.py", line 22,     in <module>         import _management       File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\_management.py", line 14,     in <module>         import _graph       File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\_graph.py", line 27, in     <module>         import numpy      ImportError: No module named numpy      it seems to me that the 10.2.2 x64 bit python is pointing to the 32 bit python library. I have tried substituting the code from: http://resources.arcgis.com/en/help/...00000008000000               c:\Program Files\ArcGIS\Desktop10.2.2\arcpy     c:\Program Files\ArcGIS\Desktop10.2.2\bin     c:\Program Files\ArcGIS\Desktop10.2.2\ArcToolbox\Scripts      I get the error that it cannot even find the arcpy module. My ultimate goal is to get the arcpy module to run in spss 22 which is built on the Python 2.7.1 x64 framework. However even when I put the DTBGGP64.pth file in the site- packages folder of that module, I get the same exact traceback error that it cannot find Numpy Any thought on how to solve this? Thanks in advance!


How to access the datasource from a REST service

I have a ArcGIS REST service, is it possible to access the data source of the layer that is within the rest service. For example I have a layer called "Conservation Area" within the service, that references the dataset "PLANNING.CONSERVATION_AREAS". It is "PLANNING.CONSERVATION_AREAS" that i want to retrieve back. Is this possible **EDIT** I want to get access to the actual feature class name which is held within the database (oracle in my case). I have read about the Data Source object REST Data Source Object which does suggest it is possible ? (but not sure how). Thanks


How wrap GRIB data in Mapserver 6.4

I'm trying to draw a combination of layers with Mapserver. One of the layer takes a shapefile as input and the other one is based on GRIB data. The issue is that the GRIB layer (in green) is drawn from 0 deg to 360 deg. The shapelayers draws from -180 to 180. And indeed, when I examine the GRIB file in Panoply, the meta data of sample shows, among other things, this:               netcdf file:/D:/gribs/sample.grb {       dimensions:         lon = 360;         lat = 181;         isobaric = 4;         time = 3;       variables:         float lat(lat=181);           :units = "degrees_north";              float lon(lon=360);           :units = "degrees_east";            ...       other variables       ...       }      Which leads me to conclude that the coordinate system runs from 0 to 360 degrees in the east ward direction and from 0 to 180 in the north direction. So Mapserver is correct when it draws this image: ![incorrect drawn grib layer](http://i.stack.imgur.com/Omxkw.png) **So my question is how can I wrap the GRIB image so that the right half is placed over the left half of the earth?** The url with parameters i use: http://mapserver-dev.de.meteogroup.net/cgi- bin/mapserv?map=/var/www/mapserver/routeguard/poc_test.map&mode=map&layer=grib_sample&layer=world_outline_red My mapfile:                   MAP         EXTENT      -180 -90 360 90 #max x should be only 180, but then only half of the grib layer is drawn         CONFIG      "CPL_DEBUG" "ON"         CONFIG      "MS_ERRORFILE" "/var/www/mapserver/routeguard/poc.log"         SYMBOLSET   "symbols.sym"         FONTSET     "../fonts/fonts.txt"         IMAGETYPE   PNG8         IMAGECOLOR  255 255 255         SIZE        1600 900          # ------------------------------------------------------------------------------     # the Map Projection     # ------------------------------------------------------------------------------         PROJECTION             #which to use????             "init=epsg:4326" #54004 #4326             "units=m"         END          # ------------------------------------------------------------------------------     # the Web object     # ------------------------------------------------------------------------------              WEB             IMAGEURL    '/mapserver/routeguard/' #do not include the the var/www             TEMPLATE    'poc_template.html'         END          #--------------------------------------------------------------------------------     # the country mask     #--------------------------------------------------------------------------------         #red world, defined in shp file         LAYER             NAME "world_outline_red"             TYPE POLYGON             DATA "/var/www/mapserver/data/routeguard/static/world_outline.shp"             CLASS                 COLOR 255 0 0             END                  PROJECTION                 "init=epsg:4326"             END         END          #----------------------------------------------------------------------------     #grib example     #----------------------------------------------------------------------------         LAYER             NAME "grib_sample"             TYPE LINE             CONNECTIONTYPE CONTOUR             DATA "/var/www/mapserver/data/grib/routeguard/sample.grb"                  PROCESSING "BANDS=2"             CLASS                 STYLE                     WIDTH 1                     COLOR 0 100 0                 END             END                  PROJECTION                 "init=epsg:4326"             END             METADATA                 #"wms_srs"       "epsg:54004"             END              END               END #end map file


What does this error mean- 'Underlying Connection was closed'

I am receiving this error message on one of our server while publishing a mobile project in mobile project center to ArcGIS server (10.1). ![enter image description here](http://i.stack.imgur.com/qurHj.png) Please advise - what connection is this one referring and how to resolve this? Thanks


How to check that a point is outside of a route?

I am newbie in PostGIS and also GIS particularly. I need to check that a vehicle is outside of a route. This route has been defined in advance, and of course it stores in a table: RROUTEDETAIL. This table contains: ROUTE_ID, LONGITUDE and LATITUDE. So, when vehicle leaves the route they should be on, the system will give a warning message and then record it into other table. I imagine to check the point I get with every point store in the RROUTEDETAIL, one by one with ST_DWITHIN. If all check get FALSE value, then the system give a warning message. Is this the best approach or is there a better idea ? Thank you very much. Best regards, Dion. * * * thank you. For example, this is the point where vehicle leaves: -7.539079, 109.322891 with value tolerance: 0.5. Then I write:                   select st_dwithin((select st_makeline(ST_Point(-7.539079, 109.322891))),             (select st_makeline(ST_Point(foo."TRACKERDATA_LATITUDE",foo."TRACKERDATA_LONGITUDE"))                 from (select ht."TRACKERDATA_LATITUDE",                              ht."TRACKERDATA_LONGITUDE"                             from "HTRACKERDATA" ht                             left join "RVEHICLE" rv on ht."VEHICLE_ID" = rv."VEHICLE_ID"                             where ht."VEHICLE_ID" = 106 and                              ht."TRACKERDATA_GPSTIME" BETWEEN '2012-01-01 08:00'                             AND '2012-01-01 17:00'                             order by ht."TRACKERDATA_GPSTIME", ht."TRACKERDATA_REPORTTIME") as foo),              0.5);      It always return FALSE. Then I check again with ST_DISTANCE, it gives 99999999999.9 (double precision). How to fix that ? Thank you.


How do I use polygon centroids within a GeoQuerySet?

I have two models: neighbourhoods and boroughs, each containing a polygon field. I am trying to construct a QuerySet that will give me the neighbourhoods within a given borough. I expected to use _within_ or _contained_ : `neighbourhoods_in_borough = Neighbourhood.objects.filter(poly__within=Borough.poly)` However, it is not always the case that a neighbourhood lies cleanly within a borough. Neighbourhood polygons roughly align with a Borough, but may weave in and out slightly. As such, filters like within or intersects either leave out neighbourhoods or include too many surrounding a Borough which happen to slightly overlap. Because I only want the Neighbourhoods which are predominantly inside of a given Borough, I thought I would test to find Neighbourhoods whose centroids are within a given Borough: `neighbourhoods_in_borough = Neighbourhood.objects.filter(centroid__within=Borough.poly)` However, you can spot the issue here: centroid is not a field on the model, and so the above does not work. I did think adding a preceding query (e.g. Neighbourhood.objects.centroid() ) would make the centroid available to be used in some form, but it fails for the same reason as the example above. Is it possible to filter based on a polygon's centroid rather than the polygon's shape?


How to print pie charts in QGIS?

I added pie charts via text-file to my map. When printing the map they get lost. Does anyone know how to print them?   QGIS also seems to delet some charts, when there are to many at one place. Does anyone have a solution for that?


How can I use polygon grid to export raster

I have a polygon grid which consists of 100 square polygons. For each square I need to export the raster overlay. I have ArcGIS 10.0, FME 2014, Saga-GIS. Is there a suitable tool for this or do I need to script something with Python or Model builder?


Idiots guide to expressions for QGIS

I have no formal training in GIS and have learned on the fly with ArcGIS 9.3 at work and have been dabbling with QGIS on my own time for my business. Is there any resource recommendations ingeneral for getting past the basics of GIS and going into the deep dark secrets? Specifically in relation to experession coding for labeling, queries, etc.


Calculating area of MultiPolygons within 250m buffer of points

I am using using PostgreSQL 9.2 and PostGIS 2.0. I have two tables: 1) a geocoded table of home addresses (address_list) and 2) a table containing data on tree density in the same geographical area. I have included examples of the relevant columns in each table below. address_list:               house_id (serial) |  geom(Point, 4283)     ------------------+-----------------------             1         |              2         |      tree_density:                 gid (serial)  |  tree_dens |  geom(MultiPolygon, 4283)         ------------+------------+----------------------------               1     |  scattered |               2     |  medium    |               3     |  dense     |      What I would like to do is compute the area of forest (m2) by tree_density categories within 250m of each home address for my whole address table (approx 6,000 entries). (E.g for house_id = 1: area_scattered_within250m = 50m2, area_med_within250m = 0m2, area_dense_within250m = 20m2) Can this be done easily? Even if in 3 or more seperate queries? Does anyone have a moment to assist me with the syntax? I guess I need to combine ST_Area, ST_Buffer and perhaps ST_Contains or St_Within, but I'm new to PostGIS and although I've been ok with other (simpler) spatial joins, I'm lost here and haven't found any similar examples. For the area of my study I transform to SRID 3112 (meters) for measurements. Many thanks Mike


QGIS connection to PostGIS showing wrong TYPE

I've got a user that it trying to edit his polygon layer but gets a message `PostGIS error while adding features: ERROR: Geometry type (Polygon) does not match column type (MultiPolygon)` When you have a look at his PostGIS connection details, the TYPE reads as polygon but if I log as an administrator into PostGIS via QGIS and edit the same layer i dont get an error message but see the TYPE as multipolygon. I'm not sure where the error lies, in PostGIS or with QGIS not updating itself!


Installing pandas with Esri's python?

Trying to get pandas to import, but I'm getting what looks like an error caused by a failed dependency of the version of my Esri-provided numpy's compile, based on this stackoverflow posting. Here's what I get.               >>> import pandas     numpy.dtype has the wrong size, try recompiling     Traceback (most recent call last):       File "<interactive input>", line 1, in <module>       File "C:\Python27\ArcGIS10.2\lib\site-packages\pandas\__init__.py", line 6, in <module>         from . import hashtable, tslib, lib       File "numpy.pxd", line 157, in init pandas.hashtable (pandas\hashtable.c:22315)     ValueError: numpy.dtype has the wrong size, try recompiling      I check my numpy version:               >>> import numpy     >>> numpy.version.full_version     '1.6.1'      Based on this, I believe that this is the right version of numpy for the version of pandas I'm using (tried 13.1, 14.0, and 14.1). I'm running the standard ESRI-shipped python for ArcGIS 10.2 (Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win32).               >>> import arcpy     >>> arcpy.__file__     'C:\\Program Files (x86)\\ArcGIS\\Desktop10.2\\arcpy\\arcpy\\__init__.py'      Has anyone succeeded in getting pandas going this way or have ideas on what's wrong with my environment? Should I update my numpy, which is supposed to be backwards compatible (according to user333700's text at the bottom of the stackoverflow posting), or is that likely to break my ArcGIS functionality? Thanks for any info!


How to populate the geometry_columns table

I have a SQL Server table of vector data (containing latitude, longitude, UComp and VComp columns), that I am trying to add as a layer to QGIS. Here is a sample of the data in the SQL Server data table: ![enter image description here](http://i.stack.imgur.com/28a8o.jpg) And the table design: ![enter image description here](http://i.stack.imgur.com/rAjEb.jpg) I have successfully connected to my database from QGIS and also created the geometry columns table. What data should I be adding to the [f_geometry_column], [coord_dimension] and [geometry_type] columns in the geometry_columns table?


Where to execute sdetable command in Windows?

I am trying to fire some Sde Command in Arcgis Desktop 10.1 but I am not aware where to execute the command in windows operating system.Thank you in advance.


Why Do Colors Look Darker When Printed on Paper?

I made a map with a terrain-colored relief-shading in the background. I then exported them as PDF from Print Composer in QGIS. But **when I print the PDF onto paper:**   * the shaded-relief color in the **background appeared _way_ darker** than it supposed to.   * the colors of roads, symbols and labels in the **foreground looked all right** , though..  All of the colors in the PDF itself appeared correct. **Is there a way to ensure my print colors look right on paper?** Appreciate any tips/documents/links that can help me get my prints right, thanks!


Is there a "Select by Attributes" plugin/widget for ArcGIS Server JS API?

I'm hoping to find some existing code which emulates the "Select by Attributes" dialog in ArcMap, within the ArcGIS Server JavaScript API. Writing a hard-coded QueryTask is easy - I'm looking for some code which will automatically handle any layer on the map, forming a Query on-the-fly using any attributes, ideally returning the results into a datagrid. Clever people have written Table of Contents and Identify widgets which handle any layers in the map. Has anyone written something similar for "select by attributes"? Thanks


GeoWebCache tiles with specific scales

Is it possible to generate some tiles by GeoWebCache with specific scales eg. 1 000 000 , 500 000 etc. By default they are eg. 611.4962261962891, 305.74811309814453, 152.87405654907226, 76.43702827453613 what is very confusing for me actually ;/ Thanks for any help Alex


What's a term for Sea Level Distance which is usable by novice users?

I've been using the term Sea Level Distance to describe the total length of a line string where I ignore the elevation and just calculate the distance from point to point along the ellipsoid and sum the total. Sea Level Distance has always seemed to be an artificial term for this. Slope Distance seems to naturally describe the distance when elevation is included. Is there a term for Sea Level Distance that is more natural and usable for novice users.


VBA Convert decimal degree to Meters button

I have 2 data frames one which has WGS data in it and the other OSGB1936. I am trying to create a button where the user can input decimal degrees (WGS) and it will zoom them to that location in British National GRid (OSGB1936) I have done the code but when it zooms to OSGB data frame it does not convert the decimal degree to meters. It returns incorrect values for Northing and Eastings in meters. The code does work only if i have done it as a ToolControl_MouseDown but that uses pMxDoc.CurrentLocation.x, pMxDoc.CurrentLocation.y. which i dont want to do because i want the user to enter the value from a text box. Any ideas please?               Private Sub CommandButton2_Click()               Dim pSREnv As ISpatialReferenceFactory2     Set pSREnv = New SpatialReferenceEnvironment     Set m_PCS = pSREnv.CreateProjectedCoordinateSystem(esriSRProjCS_BritishNationalGrid)          Dim pMxDoc As IMxDocument     Set pMxDoc = ThisDocument          Dim x As Double     Dim y As Double           y = CDbl(Texty.Text)      x = CDbl(Textx.Text)          Dim pEnvelope As IEnvelope     Dim pMap As IMap     'Set pMap = pMxDox.FocusMap          Dim strName As String         strName = "Layers"          Set pMap = GetMap(strName)      If Not pMap Is Nothing Then         If pMxDoc.ActiveView Is pMxDoc.PageLayout Then             Set pMxDoc.ActiveView.FocusMap = pMap         Else             Set pMxDoc.ActiveView = pMap         End If              End If              Dim pPoint As IPoint         Set pPoint = New Point                   pPoint.PutCoords x, y     'pMxDoc.CurrentLocation.x, pMxDoc.CurrentLocation.y              Dim pGeom As IGeometry         Set pGeom = pPoint         Set pGeom.SpatialReference = pMxDoc.FocusMap.SpatialReference         pGeom.Project m_PCS                   Set pEnvelope = pMxDoc.ActiveView.Extent         pEnvelope.CenterAt pPoint         pMxDoc.ActiveView.Extent = pEnvelope         pMap.mapScale = 5000         pMxDoc.ActiveView.Refresh                       Application.StatusBar.Message(0) = "meters east: " & pPoint.x & ", meters north:" &     pPoint.y          End Sub      * * * The below code is the updated but still does not do what it should. When i enter the decimal degrees 53.47574, -2.22553 it returns a value of -512464, -2174656 which is in the incorrect position. So somewhere in the conversion between WSG and OSGB it is going very wrong.               `Private Sub CommandButton2_Click()               Dim pMxDoc As IMxDocument     Set pMxDoc = ThisDocument          Dim pEnvelope As IEnvelope     Dim pMap As IMap          Dim pSREnv As ISpatialReferenceFactory2     Set pSREnv = New SpatialReferenceEnvironment          Dim pProjCoordSystem As ISpatialReference      Dim pProjCoordSystem2 As ISpatialReference     Dim pGeoTrans_A As IGeoTransformation     'Dim pGeoTrans_B As IGeoTransformation               Set pProjCoordSystem2 =   pSREnv.CreateProjectedCoordinateSystem(esriSRProjCS_BritishNationalGrid)     Set pProjCoordSystem = pSREnv.CreateProjectedCoordinateSystem(esriSRProjCS_WGS1984UTM_14N)                    Set pGeoTrans_A = _     pSREnv.CreateGeoTransformation(esriSRGeoTransformationType.esriSRGeoTransformation_OSGB1936_To_WGS1984_1)                Dim strName As String         strName = "Layers"           Set pMap = GetMap(strName)      If Not pMap Is Nothing Then         If pMxDoc.ActiveView Is pMxDoc.PageLayout Then             Set pMxDoc.ActiveView.FocusMap = pMap         Else             Set pMxDoc.ActiveView = pMap         End If              End If               Dim x As Double     Dim y As Double                y = CDbl(Texty.Text)      x = CDbl(Textx.Text)                  Dim pPoint As IPoint         Set pPoint = New Point         'Set pPoint = New esriGeometry.Point         Set pPoint.SpatialReference = pProjCoordSystem2                   pPoint.PutCoords x, y     'pMxDoc.CurrentLocation.x, pMxDoc.CurrentLocation.y             Dim pGeom As IGeometry2         Set pGeom = pPoint         Set pGeom.SpatialReference = pProjCoordSystem2         pGeom.ProjectEx pProjCoordSystem2, esriTransformForward, pGeoTrans_A, 0, 0, 0                   Set pEnvelope = pMxDoc.ActiveView.Extent         pEnvelope.CenterAt pPoint         pMxDoc.ActiveView.Extent = pEnvelope         pMap.mapScale = 5000         pMxDoc.ActiveView.Refresh                   Application.StatusBar.Message(0) = "meters east: " & pPoint.x & ", meters north:" & pPoint.y             End Sub'


How to import a non-spatial Table into QGIS?

Can I import tabular data in Qgis, without any information about X and Y only the table? I need to join them after importing them.


How can I apply "natural breaks" classification to a raster symbology in QGIS?

Anyone knows how can I apply "natural breaks" to a raster symbology in QGIS? Cause I only see the "Equal interval" option.. ![enter image description here](http://i.stack.imgur.com/v49Jr.png) I'm using QGIS 1.9


How to perform SQL query using .STContains in MS SQL Server

I have a table that stores polygons and a table that stores points with a value field. Both sets of data are stored using the Geometry type in MS SQL Server. I have a simple requirement - I need to retrieve the records of points that are contained within the polygons and then sum the result based on a value field in the points table. So, the end result of the query is two columns: - polygon names - sum of the value field in the point table               DECLARE @area GEOMETRY  = (SELECT Shape FROM GREENFIELDAREAS WHERE AREANAME = 'Aerodrome')     SELECT NETDWELLINGS, Shape FROM ORA_NETDWELLINGCOMPLETIONS WHERE @area.STIntersects(Shape) = 1      The above query returns point geometries but only for 1 polygon (Aerodrome). What I need is to sum NETDWELLINGS and return that value for all the polygons.


how to easily serve vector layer with extra attributes for openlayers

On a website I'd like to show an openstreetmap with buildings colored by a certain feature (tag). So far I was able to extract the buildings for a bounding box, save them as an osm file and load it via an openlayers vector layer. Next I'd like to load the buildings dynamically and based on the current bounding box. I could probably achieve that using overpass api and data from openstreetmap.org etc. However in the future I'd like to add a custom tag - e.g. sshpa (sunshine hours per year) - to each building and conditionally style the buildings according to the tag. I could probably write my own server returning vector data to openlayers upon ajax calls based on the bounding box, but I wonder if there already exists a solution, that does this for me. After all this is probably a standard problem for osm users. I am looking for an application that serves vector data to openlayers.js and where I can easily manipulate the data of the layers, e.g. by extending them with tags.


REtrieve field info from web map services in ArcMap

I am trying to work out what fields are associated with a map service in ArcMap. The service is very slow in drawing and I wondered if it was possible to retrieve attributes associated with a layer another way?


Broken PostGIS support GDAL

I'm having some problems with Postgres/PostGIS after rebuilding my GDAL library:( I wanted to add MrSID support in GDAL so rebuilt it with the MrSID SDK. Everything compiled ok and I am now able to open Raster .sid files within QGIS. BUT I seem to have screwed my Postgres 9.3 install as now I have no PostGIS support. If I try and open previously functioning postgis databases in QGIS I get a ton of error messages indicating that my database has no working PostGIS support. When I look at my databases in PGADMIN3 I get the following error:` ERROR: could not load library "/usr/lib/postgresql/9.3/lib/postgis-2.1.so": /usr/lib/postgresql/9.3/lib/postgis-2.1.so: undefined symbol: GEOSHausdorffDistance` The postgis-2.1.so library is definitely present on my system and was working fie before I recompiled GDAL. I'm running Ubuntu 13.10, Postgres 9.3, PostGIS 2.1, and GDAL 1.10. This is how I compiled GDAL 1.10:               ./configure --with-geos=yes --with-sqlite3 --with-python --with-spatialite --with-fgdb=/usr/local/FileGDB_API --with-postgres --with-odbc --with-curl=yes --with-mrsid=/usr/local/MrSID_DSDK/Raster_DSDK --with-mrsid_lidar=/usr/local/MrSID_DSDK/Lidar_DSDK --with-poppler=yes --with-jasper=yes --with-opencl=no --with-ogdi=no      Anyone have any idea how to fix this? Do I need to recompile Postgis against Gdal?! Really appreciate any help with this for as usual I urgently need to use my postgis data! Thanks Marty _**EDIT_** Looking at libraries for postgis-2.1.so gives:               $ldd /usr/lib/postgresql/9.3/lib/postgis-2.1.so     linux-vdso.so.1 =>  (0x00007fffcb1fe000)     libgeos_c.so.1 => /usr/local/MrSID_DSDK/Raster_DSDK/lib/libgeos_c.so.1 (0x00007f84d821e000)     libproj.so.0 => /usr/lib/libproj.so.0 (0x00007f84d7fcc000)     libjson-c.so.2 => /lib/x86_64-linux-gnu/libjson-c.so.2 (0x00007f84d7dc1000)     libxml2.so.2 => /usr/lib/x86_64-linux-gnu/libxml2.so.2 (0x00007f84d7a5b000)     libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f84d7693000)     libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f84d7475000)     libgeos.so.2 => /usr/local/MrSID_DSDK/Raster_DSDK/lib/libgeos.so.2 (0x00007f84d717d000)     libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f84d6e79000)     libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f84d6b74000)     libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f84d695e000)     libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f84d675a000)     libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f84d6540000)     liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f84d631e000)     /lib64/ld-linux-x86-64.so.2 (0x00007f84d86f0000)


Model Builder - import arcinfo licence when required by tool

Is it possible to check licences in/out as needed within modelbuilder? or will the following work -write a script to turn arcinfo licence on when the tool requires it and off once it's done? I need to run a complex model on 100+ segments of data on multiple machines concurrently and we have only one arcinfo licence which is required only by the eliminate tool. Each segment takes about an hour which is approx 100hrs of processing time. We don't have this much time so need to split the process into 6 machines running the arcview licence...the blocker is one-step needing arcinfo. As the machines will need the licence for only 10mins or so at differeing times, I want to get the model to run in arcview upto the eliminate, check-out arcinfo (or if unavailable keep checking every 5 mins), finish the tool and then check-in the info licence so another machine can take it and continue. Thanks guys,


CORS Printing Issue with ArcGIS Javascript

I'm developing an application using the ArcGIS Javascript API and everything has been working fine until I've tried to incorporate the print widget using printtask. When only the base layers are accessed in the code, the map is printed just fine. But when I include any layer running on my local instance of ArcGIS Server 10.2 (dynamic or feature layers) the print operation fails. I assume this is because I need a "proxy" file although I thought I read it's possible to utilize CORS. I'm using the latest FireFox browser, ArcGIS Server 10.2 and I have configured my code to include:   esri.config.defaults.io.corsEnabledServers.push("10.111.123.234:6080"); esri.config.defaults.io.corsEnabledServers.push("sampleserver1a.arcgisonline.com"); esri.config.defaults.io.corsEnabledServers.push("sampleserver6.arcgisonline.com"); esri.config.defaults.io.corsEnabledServers.push("tasks.arcgisonline.com"); esri.config.defaults.io.corsEnabledServers.push("server.arcgisonline.com"); The IP address above is my local PC pointing to the ArcGIS Server port of my services. I have tried just localhost:6080 as well. Either way, the printing functionality still fails so I'm not sure if CORS is valid for this operation and that I have to use a proxy file anyway? Or perhaps I'm doing something wrong? Any thoughts or suggestions would be appreciated.


Merging parcels but keeping Geometry seperate

I am working on updating a parcel layer we received for a project, and I have duplicate parcelID's for parcels and I have been merging these to create 1 parcel as to not have duplicate ID's. My question is, when i look at the town online viewer some parcels have the same Parcel ID but they still maintain a separate geometry for these adjacent parcels. The information that is pertinent to my project is the same for each parcel, so I would like to merge them but maintain the separate property boundaries. This is an SDE Polygon feature class. P.S. I found a post that is pretty much the same question entitled How to Create Touching Multi-Part Polygons? How to Create Touching Multi-Part Polygons? Have there been any updates on this in the last year? Thank you.


Convert 800 .hdf4 files to Tiff using GRASS/QGIS/SAGA/GDAL/R

I've have MODIS ndvi data (MODIS_Grid_16 days NDVI) from the iberian peninsula, from February of 2000 to August of 2012 (really big data). How do I batch convert about 800 .hdf MODIS files to .tif ? I can use QGIS/GRASS/SAGA/GDAL/R but I have no experience with bash scripts.


Calculate polygon area in ArcMap

Please please please help me figure out what the deal is with my area units!!When calculate geometry for census tracts in km^2, I am given back some absurd, meaningless number such as 0.000696186


PostGIS - certain MultiPolygons cause “BOOM! Could not generate outside point!”

I've just posted this at StackOverflow and someone suggested I try here. Original: http://stackoverflow.com/q/5863859/246265 I'm trying to represent a rectangular area which crosses 180 degrees longitude. For more background see http://stackoverflow.com/q/5737506/246265 Here's my test case:               from django.contrib.gis.geos import Polygon, MultiPolygon     from my_project.my_app.models import Photo          a = Polygon.from_bbox((30, -80, 180, 80))  # the part to the east of 180     b = Polygon.from_bbox((-180, -80, -160, 80))  # a part to the west of 180     c = Polygon.from_bbox((-180, -80, -100, 80))  # a larger part to the west of 180          ok   = MultiPolygon(a,b)     ok2  = MultiPolygon(c)     boom = MultiPolygon(a,c)          # This works     Photo.objects.filter(location__coveredby=ok)[:1]     # This also works so c is ok     Photo.objects.filter(location__coveredby=ok2)[:1]     # This gives "BOOM! Could not generate outside point!"     Photo.objects.filter(location__coveredby=boom)[:1]          # splitting c doesn't help     c1 = Polygon.from_bbox((-180, -80, -140, 80))     c2 = Polygon.from_bbox((-140, -80, -100, 80))     test = MultiPolygon(a,c1,c2)     Photo.objects.filter(location__coveredby=test)[:1]     # BOOM! Could not generate outside point!      By changing the numbers I can make this error come and go. (-180, -80, x, 80) works where x <= -140 for example. For every number there is a threshold like this but I can't find a pattern. For boxes with the same area, some will work and others not. For boxes with the same width some will work and others not. I can look at the SQL being generated but the areas are represented in binary (EWKB) and I'm not sure how to read it. Can anyone explain this?


How to normalize choropleth maps of census information?

I'm trying to improve on the census-based maps on this site, which shows census values at 5 scales from Collection Districts through to State. Currently the maps show whole numbers (eg total population per polygon) which is not optimal. How should they be normalized? **Option 1: % of Total** I was advised to normalize by % of the total. This results in legend ranges such as "0.0004% to 0.0006% of the Total Population" which (IMO) make the legend hard to decipher - it's not an intuitive fraction, and is hard to put into perspective. **Option 2: Population Density** Another option could be to normalize based on area. Since the datasets are stored in meters, this also results in values like "0.000000019 to 0.000000035 persons per square meter". I could flip this to show "area / person" - but this wouldn't make sense for datasets such as housing. And would it be offensive when applied to datasets such as religion (1km2 per X person)? Is there a standard methodology to convert either of these values into something more meaningful? What do other people do on their census maps? Thanks, Steve


Shp's will NOT line up  (coordsys) - shps made using GPSeismic sotftware (client made shp's)

OK, I asked this previously but solved it on my own last time. Same project, but differant shp files. I recieved from a client shp files that were made in GPSeismic 2011. Upon recieving the shp files from client, he sent the 5 files (dbf, shp, shx, txt and sp1) as you can see in the screen shot. The POREC did not have the prj (coordinates) so I put in the correct coordinates that are being used. I've tried the coords that we are currently using, "undefined" coords, even did the same with the surface shp file prj, switched that to 'undefined'. Nothing seems to work. The postplot keeps falling into the same place, just to the East even with differant coords. What is going on with this, I make the coordinate changes in ArcCatalog as I have ArcView 9.3. I have two projects as this is the 2d one, the first one I had no problem with the coords as the client sent the shp files made with the GPSeismic software program. My Proj Manager could not get this to line up on her computer either. Waht could be the problem AND SOLUTION? Could the SP1 file be the problem? ![enter image description here](http://i.stack.imgur.com/RtA6b.png) * * * ## sp1 file below (partial) ![enter image description here](http://i.stack.imgur.com/hLHeJ.png)


How to add super/sub script on a QGIS text annotation?

How do I add super/sub script on a QGIS text annotation? For example, 44.95 mi^2 ![example image with superscript 2](http://i.stack.imgur.com/q1Fr5.png)


Natural Earth: How to get the position of all provinces that belong to a state

This question is about Natural earth 1:10 states and provinces.shp file. I'm using ogr2ogr and want to know the name of the id i need to pass . In purpose of pulling out the right states regions. I've use couple of properties name that didn't work (`-where "adm0_a3 IN ('MLI')" \` , `-where "iso_a2 = 'ML'" \` ). Can anyone help me i'm running out of places to find the answer.


Why don't libgrass.so.1.8.0 and libqgissqlantconnection.so.1.8.0 load?

I have compiled Qgis 1.8 at Ubuntu 12.10, but some phyton plugins does'nt work, like sextante. Trying to solve this problem, some files don't have been load. They are: libgrass.so.1.8.0 and libqgissqlantconnection.so.1.8.0. Any ideia about this?


Conversion from 3 dimension geometry to 2 dimension

I have a Point table in which the geometry column contains both 3 dimension and 2 dimension values.I want to convert this 3 dimensional geometry to 2 dimension.Is there any function in PostGIS? Please help me to solve this problem. Regards Sreesha.T.A


POI Datasets for North America

I use foursquare because it contains a lot of POIs. Which database do you use when you need a point of interest in North America?


Call ArcGIS Server Buffer command without using SOM

All, I wanted to see what the best way was of calling the geometry service to carry out a Buffer operation on ArcGIS Server 10, without using the SOM. Ideally I want to consume the REST API, using a wrapper so that it was easy to call from c#. Is the GISClient the way forward? From what I can determine, it looks like you only get stateless (and thus low footprint) access to the Mapserver and Geocode services. I know that I could construct a call using a URL, but I wondered if there was C# API that wrapped the REST API for you. Cheers, Matt


features supported by WCS in geoserver?

i have implemented a geotiff image layer using WCS service in geoserver 2.2.4. I have searched on net for operations supported by WCS...it tells me about 3 operations: GetCapabilities, DescribeCoverage and GetCoverage I have used these operations using http request and all are working perfectly. My questions are:   * is there any other way to use these operations other than http request (if yes, please explain with some example)   * is wcs support any other feature/facility/operation other than the above mentioned operations. Is it possible to apply stretch operations(standard deviation/histogram etc) and other operations on geotiff image in geoserver using WCS?


how to add GML files in geoserver 2.2.2

How can I add GML files to a GeoServer 2.2.2 instance? How can edit them "on the fly" and save the results back to the server using OpenLayers? I would appreciate examples if possible. sir i m adding a vector layer. in which we want to use gml. we want to add feature like point ,line etc. to gml. when we do editing on line that features will be saved on this layer. i want to insert that feature using openlayers on line like in wfs layer we do using transanction. similar type i want to do using gml .... please provide some solution..


.NET And ArcGIS 10x - Where have all the wrappers gone?

With prior versions (to ArcGIS 10x) of ArcGIS, the .NET wrappers used to be placed in a dotnet directory. Where are they located with 10x? With prior versions, I used the absence or presence of this directory to tell whether or not the .net framework was installed in the proper order with installation of ArcGIS. How can I tell if the .net framework was installed in the correct order with respect to ArcGIS???


ArcGIS 10.1 Network Analysis- How do I get appropriate network dataset?

I have acquired London road dataset from the Open Street Map however after creating and building the network dataset in ArcCatalogue the solve tool could not return the routes because of errors no valid stops. That after I had enter the addresses as stops, No result was returned. Olawumi


How to create a webmap showing point density?

I am trying to develop hotspot map showing point density in our gis based web application. After searching for an option I have decided to use v.kernel command. I have a table containing some point data ie crime data. I need to display the hotspot of crime for a particular area. In v.kernel vector file containing points and polygon are used for displaying hotspots/heatmaps. In qgis there is an option for selecting some rows and exporting it to shape file. Is there any option for running this command from a python file or is there any better option for displaying hotspot/heatmaps? I have tried openlayers heatmap, python's heatmap and django-heat app but nothing seems to work for me. I am using openlayers tms(Openlayers-2.12) for displaying maps generated through mapnik and tilecache. Thanks in advance.


Finding outliers with wrong Z values in LIDAR data

I have more than 2000 XYZ (only ground points) .txt files and I have to do Quality Control (QC). Let's say I have file, which I converted to multipoint (or even singlepart feature). I have mean Z value for a file, but if most of the points are 20-40 metres, and two, three points per file are 70-80 metres (wrong Z values). How to catch these points and remove? On another hand, it could be that in another file 70-80 metres is common Z value and some points wrong Z value 120 metres. In another file 120 metres is common and correct. How to find and remove points with wrong Z values in LIDAR data? Standard deviation? Raster cells?


Plotting two shapefiles using R?

I'm not familiar with using R for GIS. I was wondering if you can help me figure out how to plot different shapefiles at the same time. I'm using the "map" function to generate a map in order to get the boarders of the country I'm working on. Then I would like to add on top of it 20 shape files representing each a state in a way that they look adjacent to each other and fit the country's borders.


How to draw graphics in a child window?

I am adding some graphics to the map in a parent window, and I would like to show the same graphics in a child window. I am using the ArcGIS Javascript API (version 3.1). I have written code as below: Complete code in parent window:               <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test1.aspx.cs" Inherits="ePermit.Test.Test1" %>          <!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" />         <meta http-equiv="X-UA-Compatible" content="IE=7" />                  <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no" />         <title>GIS Search </title>         <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.1/js/dojo/dijit/themes/claro/claro.css">         <%--<link href="Styles/claro.css" rel="stylesheet" type="text/css" />--%>                                                                     <form id="form1" runat="server">

                         Content for the second tab                          Layer List :

                         Content for the third tab

                 <%--

--%>

                                                             <%-- <button onclick="map.panUpperLeft();"></button>--%>                                                             	                  <%--<button onclick="map.panUp();"></button>--%>                                                              	                 <%--<button onclick="map.panUpperRight();"> </button>--%>

                                                              <%--<button onclick="map.panLeft();"></button>--%>

                             	                                                  <%--<button onclick="map.panRight();"></button>--%>

                                                              <%--<button onclick="map.panLowerLeft();"> </button>--%>                                                              	                 <%--<button onclick="map.panDown();"></button>--%>                                                              	                 <%--<button onclick="map.panLowerRight();"></button>--%>

                 This is the results section
               <asp:HiddenField ID="hfxmin" runat="server" />          <asp:HiddenField ID="hfxmax" runat="server" />          <asp:HiddenField ID="hfymin" runat="server" />          <asp:HiddenField ID="hfymax" runat="server" />              </form>                     Complete code in Child window:               <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm3.aspx.cs" Inherits="ePermit.WebForm3" %>          <!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" />         <meta http-equiv="X-UA-Compatible" content="IE=7" />                  <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no" />         <title>GIS Search </title>         <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.1/js/dojo/dijit/themes/claro/claro.css">         <%--<link href="Styles/claro.css" rel="stylesheet" type="text/css" />--%>                                                                    <form id="form1" runat="server">

            <asp:HiddenField ID="hfxmin" runat="server" />          <asp:HiddenField ID="hfxmax" runat="server" />          <asp:HiddenField ID="hfymin" runat="server" />          <asp:HiddenField ID="hfymax" runat="server" />          </form>                       When user click on print button child widow should open with the same graphics as in parent window. Thanks, Uday


How to center a map in Print Composer to the same center as in map window?

I can't figure out how can I **center the map in Print Composer to layer/object/map center** in the same way as in map window in **QGIS 1.8**. Let's say I have layer which I want have in the center of the map. In map window it is pretty easy - I just click on " **Zoom to layer extent** ". Unfortunately when I create map frame in Map composer, the layer is centered on width (good) but not centered on height (I guess it is aligned to bottom). If I use button _Set to map canvas extent_ in _Print Composer / Item Properties / Extents_ it is again centered on width but this time aligned to top. I think in both cases it would be much better to have it centered. **Is there any way to have map centered in Print Composer to the same center as map in map window?**


Batch Export feature attribute to ascii

I have around 160 feature classes that I need to convert into ascii files. Spatial statistics tool ---> Utilities ---> Export feature attribute to ascii only allows converting one file at a time. Is there any way to export all my features to ascii in one go? Any script written? Thanks


How to create Sequential Animation of Polylines in ArcGIS10?

I have a data set consisting of sets of polylines which reflect movement of individual organisms in my sample within their habitat each day. I am trying to create an animation which cycles through the days, displaying only the movement for one day at a time. When I try to do this in ArcGIS10, it adds the lines from each day onto a map containing the lines from all previous days. How can I get the previous days' lines to disappear when the time slider moves to the next day?


How to run two versions of QGIS simultaneously

I really enjoy seeing the new features and icons of QGIS 1.9 nightly versions. It's looking fantastic, and some features are already very useful for my work. However, it is inherently less stable than QGIS 1.8 as it's a development version. To deal with this, I generally keep QGIS 1.9 installed and updated on my system, and use it until something I need does not work (this happens every fortnight or so - most commonly with plugins such as ftools and openlayers). At this point, I uninstall v1.9, remove the ubuntugis repository, and proceed to install v1.8. This solution works fine, but I was just wondering if there's a better way? How would I go about running 2 versions of QGIS simultaneously (with updates), one for stability, the other for features, fun and bug-checking? And is it worth doing? One solution I tried a while back was to clone the github version into a new folder on my machine and run that binary when I wanted the latest version...


Create Polygon Overlay Handling Holes

How can I create a polygon overlay that correctly handles holes? This answer provides a method of creating a polygon overlay that does not handle holes. Can it be modified to correctly handle holes? Software Versions:   * PostgreSQL 9.2.1   * PostGIS 2.0.1 r9979   * Windows Server 2008 R2


How to create a point cloud from DEM?

Please forgive my ignorance if I am asking a totally irrelevant question, I am still a GIS newbie. I looked in Google and found a lot of links as of how to convert point clouds to DEMs. I am trying to achieve exactly an opposite: to create a point cloud from a DEM of the specific location and then to create a 3D model of this location from this point cloud. I didn't find one single link about it. So is all my thinking wrong? Is there other way to achieve what I am trying to achieve?


How to create shapefile from OS MasterMap data using ArcGIS Desktop 10?

How do I create a shapefile from **OS MasterMap** data in Arcgis 10? I have tiles from the Ordnance Survey Site and would like to create a topomap from the existing tiles. These tiles contains the data I require for the creation of the shapefiles. I will be grateful if someone could help me out with this. Thanks


Is it possible to have a dynamic table in a data driven page environment?

I am creating a map series that has many polygons per sheet. There is annotation for the polygons however some polygons are very small with no annotation for them (annotation would completely hide a polygon). Thus, I have an attribute table where lables are stored for those specific polygons. How can I have that table displayed on the map, with only the attribute values per sheet, rather than all 2000+ values? I am looking for a simple, dynamic solution.


Export polygon to points (vertices)

This is the first time that I have worked with geospatial data and QGIS, so please be kind. I was given a shape file that contains house districts for the state of FL. This link provides instructions (for ArcMap users) to import the house districts into Tableau, which is my goal. I was able to generate a file that contains the district, and coordinates, but I need the order column, and am not sure how to do this using QGIS (assumedly using an add-in).               "shapeid","x","y"     "0","-87.634896","30.866261"     "0","-87.634871","30.866344"     "0","-87.634851","30.866536"      The format that I am looking for is ...               "shapeid","x","y","order"     "0","-87.634896","30.866261","1"     "0","-87.634871","30.866344","2"     "0","-87.634851","30.866536","3"


How to change selection tolerance for WMS/WFS in QGIS?

Does anyone know if there is any equal function to the selection tolerance (ArcMap) in QGIS. I have a problem activating points in my WMS/WFS. The "selection tolerance" function solves the problem in ArcMap (If I raise the pixel numbers there it works), but I would like to find a similar function in QGIS. Does any one know?


How to integrate .NET application in QGIS using Python?

In our company we have developed a .NET application that's now integrated with 3 different GIS platforms. Now we would like to make it work with QGIS but we need some help on getting started. I've been thinking of using callbacks and I've looked at this **posting** on NathanW's blog but I can't make it work in QGIS. Any ideas?


Anything similar to TMS or WMTS for WFS?

I've been working with OpenLayers for a while, but problem got a question with WFS. Not sure if it's supported by WFS, or OpenLayers, I want to achieve something like this, mostly for cache purpose: As user pans/zooms the map, OpenLayers keeps sending out WFS requests with BBOX. I want to make coordinates in such requests keep only 3 decimal digits, in a sense, aligning to 0.001 degrees. Do I have to tinkle with OpenLayers, or is it built-in? **EDIT** I'm thinking about tiling for WFS, like TMS and WMTS do. Just we don't render image here, instead we "render" XML files.


Integer rasters referring to the same scale

I'm using ArcMap 10. I want to display the area of simulated avalanches. I want this area to be divided in different colors depending on the thickness of the deposit. I managed to do that. But I want all the simulated avalanches to refer to the same scale and same legend of thickness. This means that for every simulation a certain range of values of thickness (e.g. from 2m to 4m) falls within the same color. The problem is I need to transform my raster into polygons (for future calculations of area ratios) and to do this it must be integer. So I guess I have two choices: "raster calculator" or "reclassify". With "raster calculator" I see I obtain my integer raster with the number of classes of thickness I want but the areas are changed a bit (I don't know why). With "Reclassify" I obtain an integer raster where my areas are essentially the same as before, but it can have a number of classes not higher than the value of thickness it reaches. In other words using the "reclassify" tool I would have each simulated avalanche with its own scale of thickness and not a common thickness for all my simulations. Is there a way to accomplish what I'm looking for? I hope I explained it clear enough (It's a bit hard to explain this even in my own language). Thank you, Michele


Need to give same color for Points and its label

![like this I have to give](http://i.stack.imgur.com/tZF4L.jpg)I have 10000 points, using Graduate Color I have given different color for each points in 10000. I want to give a same color for each label according to each points colors using ArcGIS. is it possible, How to do it. the above image is model for my work


Query Postgis Table with PHP

Would you be so kind as to help me with the following in OpenLayers. I need to be able to use the coordinates from a user click in a postgis query. To catch the coordinates of a click I built a click handler to use the function `map.getLonLatFromViewPort(ext.xy)`, which delivers me the coordinates of my click in the following format: lon = 568417.33622114, lat = 681985.1902844. These are sent to a php-script using a GET request. I then want to query my postgis db using `ST_GeometryFromText`, which requires that I put my coordinates in the following syntax `((568417.33622114 681985.1902844))`. Any help on how to get my coordinates in the correct format would be appreciated!


How do I change geotiff "no data" color to white/transparent rather than black?

I am preparing data for inclusion into a geonetwork node, where the maps are displayed via geoserver. The problem is that cells that have"no data" are displaying as black in the geotiff and I am would like the color to be set to white or transparent. I am using ArcView and do not have access to either Spatial Analyst or 3D analyst. I would prefer not to have to assign a new sld file and am presently using "Use colormap" when exporting from Arc. Any help with this would be greatly appreciated. Thanks


Can Geoserver return the raster value of a lat/lon point

I have a GeoTIFF published by Geoserver 2.2 and being used by Leaflet via WMS. How can I get Geoserver to return the raster value at a lat/long point? I'm guessing it has to do with using WCS, but no examples seem to exist for doing this! This will be similar to querying PostGIS with `ST_Value(raster, ST_SetSRID(ST_Point(lon,lat),4326))`. I dont really want to import the same raster into PostGIS just to find the raster value at a point. Or is this the recommended solution?


Opening GeoServer Admin returns HTTP ERROR: 503?

I try to open Geoserver Admin and returns the following error. > HTTP ERROR: 503 > > Problem accessing /geoserver/web/. Reason: > > Service Unavailable What is causing this?


How can I convert a set of ShapeFiles to an OSM file?


Arcgis JS api WMS layer on top of basemap

I'm trying to place WMSlayer on top of basemap "streets", but have ran into problems. Code:               // mapHandler.mapextent = new esri.geometry.Extent(350000,6370000,750000,6630000,new esri.SpatialReference({"wkid":3301}));          mapHandler.map = new esri.Map('map', {     // extent: mapHandler.mapextent,     center: [25.88270117, 58.70311058],     basemap: 'streets',     spatialReference: new esri.SpatialReference(4326),     zoom: mapHandler.defaultZoom     });     mapHandler.wms1layer1info = new esri.layers.WMSLayerInfo({title:"Maa-ameti fotokaart"});     mapHandler.wms1resourceinfo = {extent: new esri.geometry.Extent(300000,6300000,800000,6700000,{wkid:3301}),layerInfos:[mapHandler.wms1layer1info],version:["1.1.1"]};     mapHandler.wms1layer1 = new esri.layers.WMSLayer("http://kaart.maaamet.ee/wms/fotokaart?",{resourceInfo:mapHandler.wms1resourceinfo,visibleLayers:["MA-FOTOKAART"]});     mapHandler.wms1layer1.setImageFormat("jpg");     // mapHandler.wms1layer1.setVisibleLayers(["0", "1", "2"]);     mapHandler.wms1layer1.setImageTransparency(false);     mapHandler.map.addLayers([mapHandler.wms1layer1]);      With the above code only the basemap is displaying. I'm getting the following warning in console:               Resource interpreted as Image but transferred with MIME type application/vnd.ogc.se_xml: "http://kaart.maaamet.ee/wms/fotokaart?SERVICE=WMS&REQUEST=GetMap&FORMAT=ima…=2445863.801486572,7992358.782554072,3272606.6994188153,8240626.2504242575".       If I comment out:               basemap: 'streets',      Will result in WMSlayer displaying correctly and also prints the following the console:               Map: Geometry (wkid: 4326) cannot be converted to spatial reference of the map (wkid: 3301)       Any help would be appreciated.


Calculate Field using Esri Python Addin

I am trying to select a polygon then it must automatically change (calculate) the status to "C". The tool seems to work in the background but nothing actually happens (the status is not updated). I have used the code from this post but nothing actually gets selected. If I have a feature in the layer selected already it does deselect it though. Below is the code that i am using. Is there something that I have gotten wrong? Thanks for any help.               import arcpy     import pythonaddins          def getSearchDistanceInches(scale, selection_tolerance=3):         """Returns the map distance in inches that corresponds to the input selection         tolerance in pixels (default 3) at the specified map scale."""         return scale * selection_tolerance / 96.0 # DPI used by ArcMap when reporting scale          class tlStatToC(object):         """Implementation for PythonAddin_addin.tlMapCoods (Tool)"""         def __init__(self):             self.enabled = True             self.shape = "NONE" # Can set to "Line", "Circle" or "Rectangle" for interactive shape drawing and to activate the onLine/Polygon/Circle event sinks.         def onMouseDownMap(self, x, y, button, shift):             mxd = arcpy.mapping.MapDocument("CURRENT")             pointGeom = arcpy.PointGeometry(arcpy.Point(x, y), mxd.activeDataFrame.spatialReference)             searchdistance = getSearchDistanceInches(mxd.activeDataFrame.scale)             lyr = arcpy.mapping.ListLayers(mxd)[0] # assumes you want to select features from 1st layer in TOC             arcpy.SelectLayerByLocation_management(lyr, "INTERSECT", pointGeom)             arcpy.RefreshActiveView()             arcpy.CalculateField_management(lyr,"STATUS","C")


How to get a message when the map is moved in QGIS?

I want to get a message when every time I move the map. I had:               def info(self):         QMessageBox.information( self, self.tr( "Info" ), self.tr("info") )      I suppose that used to be something like that...               iface.mapCanvas().???.connect(self.info)


Retaining original thematic colors in a USA source shapefile

> **Possible Duplicate:**   >  Adding Layerfiles (.lyr) to Qgis New to QGIS and need a lot of help! I am using QGIS with MAC - I have downloaded a USA thematic map but when I open it in my system it changes the colours. I need the original colours! There are over 30 categories and they are very difficult to match, so manually changing them is not an option. How can I retain the original colours? The downloaded zip file includes a .shp, .dbf, .sbn, .prj, .sbx, .lyr, .xml as well as a .kml file. Thank you any help you can provide


Getting MapInfo instance from C# code

Please sorry for my bad english :( Here is the situation: I have a .Net DLL written on C#, witch contains windows form. MapInfo calls function from this DLL witch opens form. Is there any way to get instance of MapInfo, that called this function? (Not just first opened instance, because i can have multiple opened)


QGis 1.7.4 on Ubuntu 12.04

Will there be available stable version of Qgis 1.7.4 in Ubuntu 12.04? Version 1.9 is working fine at the moment, but as it is unstable yet, dont want to risk with my work. Thanks.


How do you change the prime meridian of a map?

I am working with the Natural Earth world map as a SHP file, but when I try to change the prime meridian (`PRIMEM`) of the coordinate system > > GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]] I get this: ![enter image description here](http://i.stack.imgur.com/vGGVi.png) Projections seem to give the same results. What is happening here?


QGIS: WMS misalignment

I am experiencing a small screen space offset when using a WMS layer (origin is GeoServer 2.1.4): ![Alignment visualisation](http://i.stack.imgur.com/lj6ZQ.png) The image shows a red square which is the top left pixel of a tile (GeoTIFF). An exact copy of the same tile is among the tiles in the background provided by my GeoServer. The four images represents the same view (the red square is the same pixel in all four images) just panned a bit inside my QGIS window. The yellow line outlines the corresponding pixel in my WMS layer - added to illustrate the misalignment. I would expect the red square to always align to the yellow line. **Can anyone provide me with some knowledge to why I'm having this misalignment depending on the extent shown on my screen?** _I have posted a similar questionhere proposing that the misalignment could be from a difference in the aspect ratio between the width/height and the bbox in the WMS request. But I'm not sure this is the reason and thus the reason for posting two different questions on the same topic._


Summary statistics on attribute table

I've got a polygon feature class with attributes fields `y2010`, `y2011`, `y2012`, `y2013`, `y2014`, `country` The 'year' fields contain counts of an event occurrence, which can be 0 or > 0. The 'country' field' is an identifier for country A or B, so the table looks like this:               y2010 | y2011 | y2012 | y2013 | y2014 | country             0  |  10    |   1   |   0   |   5   |   A        1  |   0    |   3   |   0   |   5   |   A        0  |   1    |   1   |  45   |  20   |   B      I'd like to reformat this table to show _per year_ the _number of features_ that fit certain criteria. The criteria are:   1. More than zero event occurrences for countries A+B;   2. More than 1 event occurrences for countries A+B;   3. More than zero event occurrences for country A. so that the final table using the example above would looks like:               criterium | 2010 | 2011 | 2012 | 2013 | 2014 |        1           1      2      3      1     3        2           0      1      1      1     3        3           1      1      2      0     2         and the table content of columns 2:6 would be the number of features of the original table, that meet the criterium _for that specific year_. I've been toying around with the Statistics toolset, but so far without success. Any tips are welcome. Edit: Opted for Q&D solution by exporting the attribute table to R and wrote a script to calculate the cell values.


Creating a new raster based on pixel value of original raster using raster calculator but new layer is not evident

I am trying to create a new raster based on a current raster (w001001 - NVIS) which has one paletted band, with palette values ranging from 1 to 29, with each palette/value representing a vegetation type (e.g. 1 = rain forests). I want to create a new raster (actually, preferably a vector, but I cross that bridge later) for the palette of value 3 (this one:) ![enter image description here](http://i.stack.imgur.com/XIcWR.jpg) I have followed the answers to the questions posted in this forum, and have used the Raster Calculator to do this: ![enter image description here](http://i.stack.imgur.com/4JXm0.jpg) It all seems to process fine, and the new layer appears in my layer list. However, I can't see the layer at all and when I use the ![enter image description here](http://i.stack.imgur.com/NCMam.jpg) nothing comes up. When I open properties for the layer, metadata tells me this: ![enter image description here](http://i.stack.imgur.com/hnu8W.jpg) Is there something obvious that I am missing? This is my first post and I am a fairly new user of QGIS so apologies if anything is unclear or nonsensical. Thanks in advance.


Which is the best way to store roads for the shortest path finding application?

I would like my application which is simply a shortest path finder in a city to meet the following requirements:   * the city roads network should be stored persistently on disk and loaded into memory on demand (to execute the shortest path finding algorithm);   * I would like to use something like OpenLayers to view the results that have been yielded by the shortest path algorithm;   * the 'OpenLayers view' should contain not only the results, but the map (uninteractive) of the city itself. As for now I am thinking of the following architecture:   * PostGIS enabled database to store roads ('roads' table);   * PostGIS enabled database to store the actual map data to render it in OpenLayers;   * a table for the results of shortest path algorithm in the PostGIS enabled database (I would like to view a couple of shortest paths simultaneously);   * a web app with OpenLayers which shows the map from the 'map' table, shows the roads layer from the 'road' table and the shortest path from the 'shortest path' table. Does this sound correct or should I change anything?


QGIS Relation Manager

I have a PostgreSQL database with a one-to-many relationship. Here is a reduced example:               CREATE TABLE buildings.building     (       objectid serial NOT NULL,       building_no character varying(40) NOT NULL,       geometry geometry(Polygon,32638),       CONSTRAINT building_pkey PRIMARY KEY (objectid)     )          CREATE TABLE buildings.flat     (       objectid serial NOT NULL,       fk_property_group integer,       fk_building integer NOT NULL,       CONSTRAINT flat_pkey PRIMARY KEY (objectid),       CONSTRAINT flat_fk_building_fkey FOREIGN KEY (fk_building)       REFERENCES buildings.building (objectid) MATCH SIMPLE      )      I defined a relationship in the QGIS (2.2 and 2.4) Project Properties and it looks good in the forms. But when I enter a new building I will have the value `nextval('real_estate.property_group_objectid_seq'::regclass)` for the objectid of the building and the flats that I want to add won't have the correct foreign key. Its actually NULL. Is there any workaround/solution for this issue?


How to create a 9.3 file geodatabase with ArcObjects SDK for ArcGIS 10?

In ArcGIS 10 I could use the Create File GDB geoprocessing tool to create a 9.3 file geodatabase or the Create Personal GDB geoprocessing tool to create a 9.3 personal geodatabase. But I cant't find a similar method in the ArcObjects SDK for ArcGIS 10. The _IWorkspaceFactory2.Create_ method seems only to create geodatabases compatible with ArcGIS 10. Possible workarounds are:   * using the geoprocessing interface   * centrally storing one empty 9.3 geodatabase and using that as template geodatabase But is there really no possibility to create a 9.3 Geodatabase with the ArcObjects SDK for ArcGIS 10?


Resume Tilemill MBTiles export after crash

Is there a way to resume a Tilemill export (MBTiles) after it has crashed? Today I just got the following crash:                FATAL ERROR: Evacuation Allocation failed - process out of memory      This was just a little sample export, but I will need to make a pretty huge export (size of Europe with Zoom Level from 0 - 18) and if that would happen inbetween this export I'd like to know that I don't loose everything, but just a little part and that Tilemill will continue afterwards... Is there a button for resuming that I am missing? Or what would be the most reliable solution for this process? Thanks


How to change shape file's extent in QGIS

I have created a network from 3 shapefiles using GRASS. While haveing problem to perform a network analysis with it, I've been told that the extent of the network shouldn't exceed that of the original shape file. Since the extent of each original shape is smaller than that of the network, I am looking for a way to modify the extent of the original shape files in Qgis. Can someone help me with it? Many thanks, Dor


spatialpolygons heatmap in R - NAs in grey?

I have a spatial polygon data-frame and I am trying to plot a heatmap via spplot. It's a map of Europe and the values for the heatmap are in a column of the data-frame. Plotting it works fine but I have some NAs in the column used for the colors and these countries are just not colored, so they are white. I'd really like them to be grey, however.. I have no idea how I can do this in spplot.. can anyone help?


add attributes to newly created shapefile from existing shapefile using arcpy

I have created a new shapefile and want to add shape attribute from another existing shapefile. It will be a recursive process with update of shape attributes of new shapefile (ofc) more than 2 times. Any help is appreciative. Following is what I am trying to make work:               Import arcpy     ofc = "C:/outFC.shp"     ifc = "C:/inFC.shp"     fields = arcpy.ListFields(ifc,"*","ALL")     for f in fields:         shape = f.Shape         query = '"Shape" = \'' + str(shape) + '\''         cur = arcpy.UpdateCursor(ofc,query)          del f, fields      Diagram: I want to get FID (0) from first table and add it to second table of new shapefile and only need FID, Shape, and id fields in second table. ![enter image description here](http://i.stack.imgur.com/jSjTv.png) ![enter image description here](http://i.stack.imgur.com/qPsVt.png)


Determining Pixel-by-pixel Catchments in ArcHydro

I used ArcHYDRO to prepare HydroDEM (5m) without sinks, Flow direction (FDR) raster, flow accumulation raster (FAC). As I understand FAC, value of pixel shows number of pixels that contribute to this pixel. Now, let say I derive drainage line from FAC (in raster form), I would like to link somehow all pixels that contribute to particular pixel in my drainage line, in way that I have separate contributing areas for each pixel in that drainage with clear relation to this pixel. How do I do that? The main goal is to derive height difference between pixel in the drainge and any pixel that contribute to it and only to it.


Conditional field calculator expression

I need to calculate the PIPEID field to equal the G_KEY_COMP field if PIPEID is null or PIPEID and G_KEY_COMP do not match. I think the first condition of the PIPEID being null is covered by the second condition of the fields not matching? I'm a novice on this topic and can't get the syntax I have to work. Here's what I've piecemealed together: Pre-Logic Script Code:               def update(PIPEID,G_KEY_COMP):      if PIPEID != G_KEY_COMP       return G_KEY_COMP     else:      return PIPEID      PIPEID = update(!PIPEID!, !G_KEY_COMP!) I'm posting a screenshot of the field calculator window since I'm not able to get the indentation right in the codeblock. ![enter image description here](http://i.stack.imgur.com/4rY91.jpg)


Mysterious Invalid Syntax in Field Calculation

I'm trying to calculate a field in Model Builder using the Calculate Field tool. I'm using the following code block and expression in the calculation, but am getting an "invalid syntax (, line 1)" error.               # Code Block:     def get_block(block_id):         block_only = str(block_id)[1:]         if block_only[-1].isalpha():             return block_only.zfill(3)         else:             return block_only.zfill(2)          # Expression:     get_block(%block_id%)      **%block_id%** is an in-line substitution that points to a string variable I create as the output of a custom Python script tool. Any ideas what the error is?