Trouble getting lat/lons from point layer

I am following this post about how to get lat/lon information from a point file, but without success. Does this metadata posted below provide information that changes the prescribed method for getting lat/lon for each point?               In layer spatial reference system units : xMin,yMin 1091130.77,1813891.89 : xMax,yMax 1205198.85,1951669.02     Layer Spatial Reference System:     +proj=tmerc +lat_0=36.66666666666666 +lon_0=-88.33333333333333 +k=0.9999749999999999 +x_0=300000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs      I have taken the following steps:   1. Loaded a ESRI shapefile into QGIS with one polygon layer.   2. Extracted nodes to create a point layer. Vector -> Geometry Tools -> Add/Extract Nodes. I clicked the option to create new shapfile, then clicked the option to add shapefile to the current project.   3. Right clicked on new point layer, selected 'Save As', and specified target CRS as ESPG4326, and added GEOMETRY=AS_XY in the layer OGR Creation options. This created point layer 2.    4. Clicked on point layer 2, then ran Vector -> Geometry Tools -> Export/Add Geometry Columns.  I ran this entire process 4 times, once with no layer OGR creation options, and once with the Geometry=AS_XY in the layer OGR creation option. I also varied step 4: once with target CRS 'layer' in step 4, once with CRS 'project' in step 4. I also added a step 5, Right click on point layer 2, then save as CSV file. When complete, I right click on point layer 2, click 'Open Attribute Table', and see new XY columns with numbers that are definitely not lat/lons. Also no lat/lons in the csv file.


How to highlight routes using a plugin like ATLAS/EASY PRINT

First I'm new to GIS and this forum. Secondly sorry my bad English. I use Atlas to auto generate my maps. Eevery "route" has a coverage. At times the "routes" are too close, so the lines cross and it is impossible to make out a specific "route". I really need some advice on this please. Atlas already jumps from "route" to "route" take the .jpeg images for me. I tried to use EASY PRINT but was unsuccessful. ![example](http://i.stack.imgur.com/zbeEk.jpg) The black is what I get by default. The red is what I would like to show for that "route" with the highlighted "route" name (red added with paint). So, in short words, **when that map gets generated for that "route" it should be highlighted and the rest of the "routes" must stay black.** This needs to be done automatically: I have too many maps to do this manually. I'm sorry if this topic has been covered but I did search and can't find help (probably due to lack of correct search, and poor English). I hope you guys understand and can help me as soon as possible. Thank you !


API to build GoogleStreet-like photo maps

do you know if Google offers a public API to display pictures in a map as they do with Panoranio? just to be clear, I don't want to use Google Street, or publish my pictures anywhere in the Internet, but just have blue dots as you can see in this map if you drag and drop the orange little guy.


How to calculate the scale of map tiles accurately?

In web maps, there are two coordinate: wgs84 geographic coordinate and web mercator project coordinate. The displayed scale of a world map is the value at equator, and one 256*256 pic can contain the map in web mercator level 0. So we can calculate the scale like this, 1:(2*pi*6378137)/(256/96*0.0254)= **1:591658710.909131**. But in the similar Esri provided service is **1:591657527.591555**(Esri Ocean Map). So, what's the affect in map display with the tiny difference? And how Esri calculate his scale? ps: I was also confused with the same problem in wgs84.


Blank map with a single layer while using map server

I am just tying to render a map with single layer using map server and I get a blank output. Below is how the map file looks like MAP               IMAGETYPE   PNG     SIZE    900 900     EXTENT  37.078266 6.747135 68.172030 97.403297     SHAPEPATH   "E:/GIS Data/INDIA/2001_State.shp"     IMAGECOLOR  255 255 255              LAYER             NAME    '2001_STATE'             DATA    '2001_STATE'             STATUS  OFF             TYPE    POLYGON               CLASS             NAME "2001_STATE"             STYLE               COLOR 232 232 232               OUTLINECOLOR  32 32 32             END          END             END      END I have saved this map file as prac1.map The following is the URL I am trying to hit for the above map file http://localhost/cgi- bin/mapserv.exe?map=/ms4w/apps/tutorial/htdocs/prac1.map&mode=map&layer=2001_State&mode=map Any help would be appreciated. Thank You. Senthil


Can I drop my own templates into the OTB ExportWebMap Tool?

At ArcGIS for Server 10.1, there is a print task installed by default. Looking at the web-help, it states: > The PrintingTools service included with ArcGIS for Server references a > preconfigured folder with 8 map layouts. These include basic designs in the > 8.5 by 11 inches, 11 by 17 inches, A3, and A4 paper sizes in both portrait > and landscape orientations. **If you want to use your own layouts, you can > publish your own service** for printing web maps Despite this advice, I want to confirm if it is possible to include additional templates to this Out The Box service, as opposed to having to publish a separate service. Looking at the Service in REST, I can see these templates.   I also found the corresponding templates under:   `C:\Program Files\ArcGIS\Server\Templates\ExportWebMapTemplates` If I drop a new 10.1 MXD into that folder, and restart the PrintingTools service (which now automatically clears the REST cache at 10.1), it will not pick up this new template. ![enter image description here](http://i.stack.imgur.com/R0t0S.png) **Is there any way to configure the underlying GP service behind Export Web Map to accept new MXDs?** I did notice that if I edit one of these existing templates (e.g. add a North arrow) then these changes flow through.


arcsde huge size file upload into Oracle spatial

I have 35million records (tomtom multinet) of file gdb file in my desktop machine. I need to upload this file into Oracle spatial as SDO_geometry file. I already tested the connection with small size file gdb file and it is success. Is there any best practice here to upload this huge file (from a desktop machine -windows 7 to oracle ? my env: arcgis desktop 9.3.1 (sp2) and arcsde (arccatalog and arsde are in same machine), oracle 10g (db is in different location). Or, whether i have to upload it as splittted files (5m rows each) into oracle spatial, then doing append in a file through arccatalog. I have default dbtune.sde file, commit interval 1000. Pls. share your experience in this.


Labeling stacked polygons with different records

I work in Oil and Gas and trying to label leases is a huge pain. In most cases there are multiple polygons of the exact same size and shape stacked on each other with records that represent different lessees. The number of lessees per section is unlimited. How can i label these polys so that they look like the annotation in the picture below. Optimally the labels would be sorted on the date field as well. This label is also an expression containing the Net Acres and the Expiration Date. ![enter image description here](http://i.stack.imgur.com/ftgna.png)


How to add FP_WGS_84_IBCAO_Polar_Stereographic projection to QGIS?

I have a GeoTiff image that is projected (see below) I would like to add this projection to the list of CRS in QGIS. Can someone help me do this? Thank you very much in advance!!! Francis               PROJCS["FP_WGS_84_IBCAO_Polar_Stereographic",        GEOGCS["FG_WGS_84",           DATUM["FD_WGS_1984",              SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],           PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],           UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],        UNIT["meter",1,AUTHORITY["EPSG","9001"]],        PROJECTION["Polar_Stereographic"],        PARAMETER["latitude_of_origin",75],        PARAMETER["central_meridian",0],        PARAMETER["scale_factor",1],        PARAMETER["false_easting",0],        PARAMETER["false_northing",0],        AUTHORITY["EPSG","3996"],        AXIS["X",           UNKNOWN],        AXIS["Y",           UNKNOWN]]


Two questions about mapnik

I newbie have two newbie questions about Mapnik.   1. Does Mapnik allow generation tiles with float zoom level?   2. I have osm file for my region. I want generate images. Where i can download full xml file for it?


Problems building QGIS 1.8.0

I am very new to QGIS (and the entire Linux thing). I am trying to build QGIS 1.8 on ubuntu 12.04LTS. I specifically need to use the 1.8 version of QGIS. When running the "make" command, I see the following:               e@pe-ThinkPad-Edge-E320:~/dev/cpp/Quantum-GIS1.8/build-master$ make     -- Quantum GIS version: 1.8.0 Lisboa (10800)     -- Found GRASS: /usr/lib/grass64 (6.4.1)     -- Touch support disabled     -- Found Proj: /usr/lib/libproj.so     -- Found GEOS: /usr/lib/libgeos_c.so     -- Found GDAL: /usr/lib/libgdal1.7.0.so (1.7.3)     -- Found Expat: /usr/lib/i386-linux-gnu/libexpat.so     -- Found Spatialindex: /usr/lib/libspatialindex.so     -- Found Qwt: /usr/local/qwt-5.2.3/lib/libqwt.so (5.2.3)     -- Found Sqlite3: /usr/lib/i386-linux-gnu/libsqlite3.so     -- Found PostgreSQL: /usr/lib/libpq.so     -- Found SpatiaLite: /usr/lib/libspatialite.so     -- Pedantic compiler settings enabled     -- Found Python executable: /usr/local/bin/python     -- Found Python version: 2.7.2     -- Found Python library: /usr/local/lib/libpython2.7.so     -- Found SIP version: 4.15.5     -- Found PyQt4 version: 4.9.1     -- Found GSL: -L/usr/lib -lgsl -lgslcblas -lm     -- Ctest Binary Directory  set to: /home/pe/dev/cpp/Quantum-GIS1.8/build-master/output/bin     -- Configuring done     -- Generating done     -- Build files have been written to: /home/pe/dev/cpp/Quantum-GIS1.8/build-master     [ 89%] Built target version     Scanning dependencies of target qgis_core     [ 89%] Building CXX object src/core/CMakeFiles/qgis_core.dir/qgis.cpp.o     Linking CXX shared library ../../output/lib/libqgis_core.so     [ 89%] Built target qgis_core     Linking CXX shared library ../../output/lib/libqgis_analysis.so     [ 89%] Built target qgis_analysis     Linking CXX shared library ../../../output/lib/libqgis_networkanalysis.so     [ 89%] Built target qgis_networkanalysis     [ 89%] Built target ui     Linking CXX shared library ../../output/lib/libqgis_gui.so     [ 89%] Built target qgis_gui     Linking CXX shared module ../../../output/lib/qgis/plugins/libmemoryprovider.so     [ 89%] Built target memoryprovider     Linking CXX shared module ../../../output/lib/qgis/plugins/libogrprovider.so     [ 89%] Built target ogrprovider     Linking CXX shared module ../../../output/lib/qgis/plugins/libwmsprovider.so     [ 89%] Built target wmsprovider     Linking CXX shared module ../../../output/lib/qgis/plugins/libdelimitedtextprovider.so     [ 89%] Built target delimitedtextprovider     Linking CXX shared module ../../../output/lib/qgis/plugins/libosmprovider.so     [ 89%] Built target osmprovider     Linking CXX shared library ../../../../output/lib/qgis/plugins/libqgissqlanyconnection.so     [ 89%] Built target qgissqlanyconnection     Linking CXX shared module ../../../output/lib/qgis/plugins/libsqlanywhereprovider.so     [ 89%] Built target sqlanywhereprovider     Linking CXX shared module ../../../output/lib/qgis/plugins/libgdalprovider.so     [ 89%] Built target gdalprovider     Linking CXX shared module ../../../output/lib/qgis/plugins/libmssqlprovider.so     [ 89%] Built target mssqlprovider     Linking CXX shared module ../../../output/lib/qgis/plugins/libpostgresprovider.so     [ 89%] Built target postgresprovider     Linking CXX shared module ../../../output/lib/qgis/plugins/libspatialiteprovider.so     [ 89%] Built target spatialiteprovider     Linking CXX shared module ../../../output/lib/qgis/plugins/libgpxprovider.so     [ 89%] Built target gpxprovider     Linking CXX shared module ../../../output/lib/qgis/plugins/libwfsprovider.so     [ 89%] Built target wfsprovider     Linking CXX shared library ../../../output/lib/qgis/plugins/libqgisgrass.so     [ 89%] Built target qgisgrass     Linking CXX shared module ../../../output/lib/qgis/plugins/libgrassprovider.so     [ 89%] Built target grassprovider     Linking CXX shared module ../../../output/lib/qgis/plugins/libgrassrasterprovider.so     [ 89%] Built target grassrasterprovider     [ 89%] Built target qgis.d.rast     [ 89%] Built target qgis.g.info     Linking CXX executable ../../output/bin/crssync     [ 89%] Built target crssync     Scanning dependencies of target qgis     [ 89%] Building CXX object src/app/CMakeFiles/qgis.dir/main.cpp.o     Linking CXX executable ../../output/bin/qgis     [ 89%] Built target qgis     Linking CXX executable ../../output/lib/qgis/qgis_help     [ 89%] Built target qgis_help     Linking CXX executable ../../output/bin/qbrowser     [ 89%] Built target qbrowser     Linking CXX shared module ../../../output/lib/qgis/plugins/libdelimitedtextplugin.so     [ 89%] Built target delimitedtextplugin     Linking CXX shared module ../../../output/lib/qgis/plugins/libdiagramoverlay.so     [ 89%] Built target diagramoverlay     Linking CXX shared module ../../../output/lib/qgis/plugins/libinterpolationplugin.so     [ 89%] Built target interpolationplugin     Linking CXX shared module ../../../output/lib/qgis/plugins/liboracleplugin.so     [ 89%] Built target oracleplugin     Linking CXX shared module ../../../output/lib/qgis/plugins/librasterterrainplugin.so     [ 89%] Built target rasterterrainplugin     Linking CXX shared module ../../../output/lib/qgis/plugins/libcoordinatecaptureplugin.so     [ 89%] Built target coordinatecaptureplugin     Linking CXX shared module ../../../output/lib/qgis/plugins/libdxf2shpconverterplugin.so     [ 89%] Built target dxf2shpconverterplugin     Linking CXX shared module ../../../output/lib/qgis/plugins/libevis.so     [ 89%] Built target evis     Linking CXX shared module ../../../output/lib/qgis/plugins/libspatialqueryplugin.so     [ 89%] Built target spatialqueryplugin     Linking CXX shared module ../../../output/lib/qgis/plugins/libsqlanywhereplugin.so     [ 89%] Built target sqlanywhereplugin     Linking CXX shared module ../../../output/lib/qgis/plugins/libroadgraphplugin.so     [ 89%] Built target roadgraphplugin     Linking CXX shared module ../../../output/lib/qgis/plugins/libzonalstatisticsplugin.so     [ 89%] Built target zonalstatisticsplugin     Linking CXX shared module ../../../output/lib/qgis/plugins/libgeorefplugin.so     [ 89%] Built target georefplugin     Linking CXX shared module ../../../output/lib/qgis/plugins/libofflineeditingplugin.so     [ 89%] Built target offlineeditingplugin     Linking CXX shared module ../../../output/lib/qgis/plugins/libspitplugin.so     [ 89%] Built target spitplugin     Linking CXX shared module ../../../output/lib/qgis/plugins/libgrassplugin.so     [ 89%] Built target grassplugin     [ 89%] Built target qgis.g.browser     Linking CXX shared module ../../../output/lib/qgis/plugins/libgpsimporterplugin.so     [ 89%] Built target gpsimporterplugin     Linking CXX shared module ../../../output/lib/qgis/plugins/libheatmapplugin.so     [ 89%] Built target heatmapplugin     Linking CXX shared library ../../output/lib/libqgispython.so     [ 89%] Built target qgispython     [ 89%] Built target t2tdoc     [ 89%] Built target translations     [ 89%] Built target compile_python_files     Linking CXX shared library ../output/python/qgis/analysis.so     [ 89%] Built target python_module_qgis_analysis     Linking CXX shared library ../output/python/qgis/core.so     [ 89%] Built target python_module_qgis_core     [ 89%] Building CXX object python/CMakeFiles/python_module_qgis_gui.dir/gui/sipguipart2.cpp.o     /home/pe/dev/cpp/Quantum-GIS1.8/python/../src/gui/qgsmapcanvas.h: In member function ‘virtual void sipQgsMapCanvas::connectNotify(const char*)’:     /home/pe/dev/cpp/Quantum-GIS1.8/python/../src/gui/qgsmapcanvas.h:461:10: error: ‘virtual void QgsMapCanvas::connectNotify(const char*)’ is private     /home/pe/dev/cpp/Quantum-GIS1.8/build-master/python/gui/sipguipart2.cpp:9597:39: error: within this context     make[2]: *** [python/CMakeFiles/python_module_qgis_gui.dir/gui/sipguipart2.cpp.o] Error 1     make[1]: *** [python/CMakeFiles/python_module_qgis_gui.dir/all] Error 2     make: *** [all] Error 2      So there seems to be a problem with the QgsMapCanvas, but I really don't know how to solve this. Please see the versions of SIP, PyQt4, Python etc. at the beginning of the quote segment. Any help would be appreciated. Thank you!


Vector Layer editing in OpenLayers

I can draw a polygon in `OpenLayers` by this code.                       var points = [];                  var point = new OpenLayers.Geometry.Point(0, 0);             point.transform('EPSG:4326', 'EPSG:900913');             points.push(point);                  var point = new OpenLayers.Geometry.Point(0, 30);             point.transform('EPSG:4326', 'EPSG:900913');             points.push(point);                  var point = new OpenLayers.Geometry.Point(30, 30);             point.transform('EPSG:4326', 'EPSG:900913');             points.push(point);                  var point = new OpenLayers.Geometry.Point(30, 0);             point.transform('EPSG:4326', 'EPSG:900913');             points.push(point);                  var ring = new OpenLayers.Geometry.LinearRing(points);             var polygon = new OpenLayers.Geometry.Polygon([ring]);                  // create some attributes for the feature             var attributes = { name: "my name", bar: "foo" };                  var feature = new OpenLayers.Feature.Vector(polygon, attributes);             select.addFeatures([feature]);                  map.addLayer(select);      My map can show this polygon perfectly. Here i did `point.transform` because of matching my map's projection system. Now I want to edit this polygon like `'DragFeature', 'SelectFeature', 'Separator', 'DrawHole', 'ModifyFeature' etc` by `OpenLayers`. How can i do that.


Postal codes in shapefile overlapping

I downloaded some shapefiles from the Australian Bureau of Statistics (ABS). Its basically showing a bunch of suburbs when I view the shapefile through a GIS tool. The GIS tool that I am using at present is the GRASS 6.4.2 tool. When I extract the polygons of each postal out of the shapefile I noticed that some postal codes overlap with one another. I assume this should not be the case, and the correct display is to make sure the overlapping postal codes exclude on another in areas that they overlap. Is there some tool I can use to make sure that no postal codes overlap one another? Thanks


MS SQL Server 2012 to Postgresql

How to use MS SQL Server 2012 spatial database in postgresql using foreign data wrapper?


QGIS: Line to polygon conversion

Currently we are working in a geological project..in which all the Contacts, Linear & some other geological features have to be captured. The thing is most of the features have to be Captured as "Line" and then it has to be converted to "Polygon". So that we don't have to repeat the digitization for features like Contact.... 1) Juz wanna know, is it not at all possible in Qgis to Snap a line with the same line ? like that of in AutoCAD, Mapinfo..?? (Image 1) 2) I've captured a polygon as two separate lines...and when i use "Line to Polygon" (Enclose in the case of Mapinfo)....it actually creates two polygons instead of one single entity. Is it a bug ? (Image 2) I am trying to convince some of colleagues (and the management as well) to switch over to QGIS..atleast in few systems...So i am trying to figure out the available functionalities in QGIS as that of MapInfo. So any sort of feedback will be of great help. ![enter image description here](http://i.stack.imgur.com/SVBES.jpg) ![enter image description here](http://i.stack.imgur.com/jTbgz.jpg) Update: Polygonize command does the trick of converting the two separate lines into one single polygon feature...(Image 2).


Why do objects disappear when I zoom on a dynamic map service?

I have a dynamic web map service that contains some point objects. When I zoom in and out, some of the point object disappear and reappear randomly. The map service is dynamic, no cache has been created for it. Do you have any hint on what is going on?


Generate a pyramid of tiles by 1/2 scaling a higher zoom level

Given a set of tiles covering a large area at a particular zoom level (These are online on someone's tile server and will need scraping, but let's assume these are on disk if it's easier. With TMS google style filenames) ... **what is the easiest way to generate, by straightforward scaling down, a pyramid of tiles for lower zoom levels?** No need for reprojecting just 1/2 scaling. I could write my own script to do this. Just stitch together four tiles and scale down the resulting image by half, to give you a single tile at the next zoom level. And repeat. It's almost easy enough for me to go ahead an do this, but I'm guessing it's been done before! What are the best existing tools and established approaches for doing this? It looks like I could use gdal2tiles given a single image file. I could create such a file by tile stitching e.g. with BigMap, but is there a tool (or params) which lets me skip that step? Just to pique your interest in the question, let me tell you the fun thing I'm actually thinking of doing: The TIGER Edited Map is a really neat tool for OpenStreetMap contributors in the U.S., letting them see areas where the data has never been edited since the TIGER import (areas where more contributors are needed) but it's only generated by MapQuest from zoom level 8 and above. ![TIGER edited map at the lowest zoom generated zoom level 8](http://i.stack.imgur.com/Yri3o.png) It would be great (and quite easy hopefully) to generate a more zoomed out overview at zooms 7,6,5,4. We'll be scaling the text of place names too which is a shame, but not really a big worry.


Publish relationalship data from arcsde

I have feature classes and tables having relationship shored in them.(Feature classes has id as which is primary key in other table ). I want to publish the Feature class as a service on arcgis server 10.1. I want to show the value in place of the id's.what is the best way to do it.


ArcGIS 10 Field Calculator doesn't notice selection/Attribute Table problem?

I just have an annoying problem with the Field Calculator in ArcGIS 10. I selected specific points of a Shapefile I want to calculate, but FC is always calculating all fields. Unfortunately there is no checkbox in ArcGIS 10 anymore to tell FC to only calculate selected fields. I discovered that it seems to be a problem with the Attribute Table since values can only be changed manually while being in the "Show selected records" mode. Otherwise my edits won't be even recognized (even acutal typed in ones). I tried both activated Editor and not activated Editor for FC. Just a few minutes ago everything worked out fine, now all Shapefiles can't be calculated according to the selection anymore. :/ Anyone an idea what went wrong? I'm not aware of having changed any settings. Restart of ArcMap also doesn't do it.


Is there a way to use "Select by Attribute" in QGIS using a python command?

is there a way to use the function "Select by Attribute" in QGIS using a python command? In my plugin the user should enter a value via a GUI and this value should be used in a function which selects all features which have this attribute. The column name is fixed in the code, the function should only search for the correct value. In my current solution the function connects QGIS to a postgresql database and runs an SQL statement. This creates a table from the result and the table is visualised as shapefile in QGIS. In principal it would be enought to highlight the features and not to create a new shapefile of the selection. Using the "Select by Attribute" function would also skip the unnecessary database connection. Is there a way to use the function "Select by Attribute" in python so that the features are highlighted? Using the function in QGIS all features that doesn´t match the query are temporary blanked-out that would be ok too. Regards from Hamburg,


QGIS Desktop 2.2.0 - program does not start

I just installed QGIS 2.2 (I download QGIS Standalone InstalleVersion 2.2 (32 bit)).Installation was successful without any errors. Then I try lunch QGIS Desktop 2.2.0 but the program does not start. ### **Update** In postinstall.log I not found any bugs. I also install Microsoft Visual C++ 2008 Redistributable Package (x86) and clear path (Why is QGIS not launching?)


Find max and min values from a table based on two fields

I have a geodatabase table with the following fields: County_Name, State_Name, Date_Time, Customers Example               Alameda, CA, 8/1/2014 12AM, 6       Alameda, CA, 8/1/2014 1AM, 1       Alameda, CA, 8/1/2014 2AM, 3       ....      Data for all US counties is in the table. I just want to create a new table that contains the   * county, state, max customers for the day (24 hour period), time of the max customers   * county, state, min customers for the day (24 hour period), time of the min customers Many states have the same county names as other states. Do I need to create a cursor to obtain a list of the unique county and state names first? This will give me a list of the county names but I also need the state names. Thank you!               with arcpy.da.SearchCursor(tablesMerged, ["county_nam"]) as cursor:             print sorted({row[0] for rows in cursor})


Make a polygon from intersecting lines in QGIS, using Polygonize or similar?

In QGIS, I want to make polygons from a set of intersecting lines. Looking at the screenshot here, I want chop the purple line (it's a closed line, not a polygon) where it crosses the green and blue lines. The result hopefully would be a polygon where I have hatched in red. I have quite a few to do. ![Polygonize problem](http://i.stack.imgur.com/lk7YI.jpg) I have tried the QGIS tool previously called Polygonizer (see An Introduction to the Polygonizer Plug-in), but now called **Polygonize**. This is a tool that, given a layer containing a set of crossing lines arranged essentially like a # symbol, should create a polygon from the enclosed space in the middle. (In QGIS 2.01, Polygonize is in the top menu bar: go to Processing -> Commander, then type "Polygonize" on the command line, select "Processing algorithm: Polygonize" from the list that appears, and press Enter.) At the momemt Polygonize doesn't work properly. Is there another way to do what I want to do? For example, wouldn't it be great if the QGIS 'Split Feature' command was able to work like MapInfo's 'Polyline Split', where you select the polygons to split, then select an already-drawn polyline to split by, and voila. But Split Feature seems not to work that way. * * * UPDATE: Detail of problems with running Polygonize. I have 64-bit QGIS 2.01 installed to Windows 7 from the installer package, QGIS-OSGeo4W-2.0.1-3-Setup-x86_64.exe. The routine processed an output from my shapefile, but did not create a polygon from the region enclosed by intersections between the blue, green and purple lines. (Note: in the actual input file, all these lines are on the same layer; the screenshot just colours them differently for illustrative purposes). What I got instead was a simple conversion of the purple outline to a polygon, as though the program completely ignored the blue and green lines. When I node-edited the closed purple line, to open it so that I had a set of open crossing lines like in the # symbol, and then ran Polygonize again, nothing happened. No crash, but no visible polygon in the output file. When I used Nick Hopton's own Laxton.kml data, I got a crash; see screenshot: ![Laxton data crash](http://i.stack.imgur.com/jppmF.jpg)


How to find a nearest line to a point

I have a table with many points that need to be associated with street segments to calculate an average value. should I do a relationship for all points to a street segment that is closest. I have dealt with several queries but most is for a specific point with coordinates, I do take care for the whole set of points (61000), similar to the "spatial join" for proximity of ArcGIS **Attributes of the streets** id integer NOT NULL DEFAULT nextval ('calles_osm_gid_seq' :: regclass), objectid integer, osm_id numeric, name character varying (48), Inventory character varying (16), type character varying (16), oneway smallint, bridge smallint, maxspeed smallint, shape_leng numeric, maxvel integer, MinSpd smallint, azimuth numeric, geom geometry (MultiLineString, 4326), **Point attributes** "Latitude"numeric (50,10), "Longitude" numeric (50,10), "Azimuth" integer, "Speed" integer, "Date" timestamp without time zone, "Geometry" geometry (Point, 4326), id_calles integer Any idea?


Option to auto refresh map every [n] seconds in CartoDB?

Is it possible to make a CartoDB map auto-refresh using the latest data every [n] seconds using the web interface? I am using the SQL API to update with new positions and would like to see them reflected on the map automatically. **Disclaimer:** I am aware of the CartoDB.js library, specifically the refreshTime option for createLayer(). I have successfully created an HTML file following the tutorial to implement the auto-refresh layer. Just wondering if there is an easier way to do this via CartoDB website directly.


Populating fields in a Matrix format

I am trying to develop an accuracy assessment tool using ArcObjects. As an output I would like to show a matrix with the fields such as road ,land,water etc. I just want to know how can I fetch unique values from the raster value attribute table into a matrix format. ![enter image description here](http://i.stack.imgur.com/XdWgN.jpg) Thank You.


How to trigger a second drop-down list when selecting a coded value in ArcGIS?

I am making a drop down list inside an attribute table of car makes, but want to have a list of models from the respective maker populate when I select a make. Example: I select Ford in my CAR_MAKE field My CAR_MODEL field would populate with models that Ford makes.


Make EPANET model with GHydraulics

I´m working with water supplies, and modeling the water system and great part of the data in QGIS. I've found GHydraulics can work with EPANET. But I can't get rid of an error: "202 - Illegal numeric value in function call" when I import the .inp file into EPANET, or when I try to run the system with GHydraulics. It seems the only way to work, is change that "NULL" value to "0.000" in the Minorloss column. But I want that EPANET give me the Minor loss value after running the system. Anyone can help me with this?


Metadata and GeoJSON?

My agency currently maintains and distributes shapefiles with FGDC XML metadata. We have now converted a lot of shapes to GeoJSON but are concerned that if our developers forget where they got the data, then they will not know who to blame when their node apps break. Is there a GeoJSON metadata specification?


Line to Polygon via Polygonizer in QGIS

My question is in the same vein as this one. I'm attempting to convert precipitation lines (Precipitación Media Anual) to a polygon for Mexico in `QGIS` using the `Polygonizer` plugin. After running the `Polygonizer` using the `New Method`, it returns the polygon but with a table full of NULL values after clicking `Copy table field from line layer`, the same as this problem. The `Old Method` crashes at around 19% completion. Here's a few related questions to this problem: Is clipping the lines to smaller sizes the easiest option?   _extracting each line class, polygonize, and then union_   Though I'm unfamiliar with GRASS, is there a way to easily do this? **EDIT:** I'm going to see if GRASS or PostGIS will do the trick I'm open to any other ways to do this. Thanks again for all the help!


Is there workaround for very slow ArcSDE 10.1 data display

I'm suffering from very slow viewing data of and ArcSDE database from an Arcgis engine application, the SDE database is in localhost so there's no network issues. but i still don't know the reasons neither how to solve this problem. i'm working on 64 bit machine with 2 CPU's Xeon 3.4 GHz and 2 Gb of RAM. the database contains 20 feature class, but with the max number of features do not exceed 100 000 in some feature classes, if i wait to view the data i should wait 10 minutes. i tried to compress and rebuild indexes in the database but there's no improvements at all. i tried to view data from ArcMap, i have founded the same problem. Using the performance monitor i remarked some bottlenecks in CPU and network sides. **SDEINTERCEPT details:** i have tried **@travis** advice, so i opened mxd referencing data in sde with Arcmap, then i remarked this part take 7 minutes:               [W 10:34:37.710] Command:      QueryWithInfo     [R 10:34:37.710] Long:         1     [R 10:34:37.710] Query Info:          Num Columns:   1         Columns:       "shape"         SQL_Construct: [1]         Tables:        "gebase.sde.point"         WhereClause:   "type_point_id<3"         Query Type:    4         Num Hints:     0         Num Parameter markers: 0         Logfile:       <null>     [W 10:34:37.718] Long:         0     [W 10:34:37.718] Col_Defines:  [1]         Name                                 Type    Width nDec  NULL?   RowID         -------------------------------- ----------- ----- ---- -------- -----         shape                            SE_SHAPE        0   0      NULL               -------------------------------- ----------- ----- ---- -------- -----     [W 10:34:37.718] Long:         71303299     [W 10:34:37.718] Long:         0     [W 10:34:37.718] CoordRef:         XY False Origin:       -37644800,, -28128500,         XY System Units:       10000,         XY Half SysUnit:       0,00005         XY Round:              0,0001         XY Cluster Tolerance:  0,001         Z  Offset:             -100000,000000         Z  Units:              10000,000000         Z  Half SysUnit:       0,000050000         Z  Round:              0,000100000         Z  Cluster Tolerance:  0,001         Measure Offset:        -100000,000000         Measure Units:         10000,000000         Measure Half SysUnit:  0,000050000         Measure Round:         0,000100000         Measure Cluster Tol:   0,001         Coordinate System ID:  0         Coordinate System:     "PROJCS["Nord_Maroc_Degree",GEOGCS["GCS_Merchich_Degree",DATUM["D_Merchich",SPHEROID["Clarke_1880_IGN",6378249.2,293.46602]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",300000.0],PARAMETER["Central_Meridian",-5.4],PARAMETER["Standard_Parallel_1",33.3],PARAMETER["Scale_Factor",0.999625769],PARAMETER["Latitude_Of_Origin",33.3],UNIT["Meter",1.0]]"         Spatial Reference ID:  102191         Precision              High [64]     ========================================     [W 10:34:37.719] Command:      SetSpatialConstraints     [R 10:34:37.719] Long:         1     [R 10:34:37.719] Short:        2     [R 10:34:37.719] Long:         0     [R 10:34:37.720] Filter Array: [1]         Table:        gebase.sde.point         Column:       shape         SearchMethod: SM_ENVP         Truth:        Must Pass         FilterType:   SE_SHAPE_FILTER               FilterShape:               XY False Origin:       -37644800,, -28128500,               XY System Units:       10000,               XY Half SysUnit:       0,00005               XY Round:              0,0001               XY Cluster Tolerance:  0,001               Z  Offset:             -100000,000000               Z  Units:              10000,000000               Z  Half SysUnit:       0,000050000               Z  Round:              0,000100000               Z  Cluster Tolerance:  0,001               Measure Offset:        -100000,000000               Measure Units:         10000,000000               Measure Half SysUnit:  0,000050000               Measure Round:         0,000100000               Measure Cluster Tol:   0,001               Coordinate System ID:  0               Coordinate System:     "PROJCS["Nord_Maroc_Degree",GEOGCS["GCS_Merchich_Degree",DATUM["D_Merchich",SPHEROID["Clarke_1880_IGN",6378249.2,293.46602]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",300000.0],PARAMETER["Central_Meridian",-5.4],PARAMETER["Standard_Parallel_1",33.3],PARAMETER["Scale_Factor",0.999625769],PARAMETER["Latitude_Of_Origin",33.3],UNIT["Meter",1.0]]"               Spatial Reference ID:  102191               Precision              High [64]               Feature Number:        0               Feature Entity Type:   Area                       Number of Points:      5               Feature Envelope:                 MinX:    328133,48150, MaxX:    384094,63650                 MinY:    133834,78230, MaxY:    159869,12210               Polygon Perimeter:        163990,98960               Polygon Area:          1456911724,87047     ---------------------------------------------------------------     Point          X                Y               2D Distance      ---------------------------------------------------------------         1     328133,48150     133834,78230         2     384094,63650     133834,78230        55961,155         3     384094,63650     159869,12210        26034,340         4     328133,48150     159869,12210        55961,155         5     328133,48150     133834,78230        26034,340          [W 10:34:37.721] Long:         0     ========================================     [W 10:34:37.721] Command:      ExecuteSpatialQuery     [R 10:34:37.721] Long:         1     [W 10:34:37.727] Long:         0     ========================================     [W 10:41:17.554] Command:      NextBuffer     [R 10:41:17.554] Long:         1     [W 10:41:17.554] Long:         0     [R 10:41:17.554] Long:         16416     [W 10:41:17.554] Long:         456     [W 10:41:17.554] Short:        -1     [W 10:41:17.554] Long:         0     [W 10:41:17.554] Long:         0     [W 10:41:17.554] Block:         BufferInfo: [25/16416]  Address@0x26fb0000          BufferInHex:    "02008A850100010000000100140000000C0000000100000082..."      **what could make`ExecuteSpatialQuery` so slow to take 7 minutes ?** I'm available for explanations of the problem. Any help please.


How to transfer the attributes of features based on their spatial relationship?

I'd like to check if a point feature class is placed on a line feature using python in ArcGIS 10.0. I have created a set of point features and placed them directly on a group of line features at predetermined points using the snap tool. I want to iterate through each point feature, checking if the point feature is coincident with any of the line features. If a result is found then i'd like to extract a field value from the line feature and insert into a field in the attribute table of the corresponding point feature that the line feature is coincident with. Basically i am trying to establish a primary key, foreign key relationship between 2 feature classes but i have so many records in the attribute tables that it would be impossible to do this one by one. I just need some pointers to get going with the python script, the part that i am struggling to conceptualize the most is how to check for spatial coincidence between a point and line feature.


Sort a feature table by geographic location

Here's in interesting challenge: I need to embed a table in a map layout so that the records in the table are sorted according to their geographic position on the ground. For example, in a north-to-top map, the northern-most feature (points in this case) should be first record, and the southern-most the last. The map composition is in ArcGIS, but I'm willing to use gdal/ogr, qgis, etc. for the table sorting if need be. To expand this question beyond my immediate use case and thereby make it more useful to the community, a robust solution would allow choosing other geographic sorts, such as _west to east_ or _inner to outer_. ![illustration](http://i.stack.imgur.com/kWyui.png)


How to convert coordinates in a .csv into another CRS in QGIS

How can I convert coordinates which are stored in a csv and in a certain format in a different CRS, i. e. I want to convert GK 3 (EPSG:31467) into WGS 84 (EPSG:4326). I am using QGIS and already tried different methods such as saving a shapefile into another with a different CRS but this did not work out! I hope you can help me! Thanks!


Dynamic Map Service with Zoom Slider in arcgis by API for javascript

I have ArcGISDynamicMapServiceLayer and I want to show Zoom Slider by API 3.2 for javascript


Calculate tree cover over certain area from raster data

Last year Hansen et al. published Global Forest Change map as set of raster data available in TIFF format. Basically those are 30-meters resolution satellite images with pixel values ranging from 0 (no forest) to 100 (full forest). I would like to programmatically calculate tree cover area over certain country that has its boundaries described by a shapefile. Since I just started with GIS, would you be so kind and advise me where should I begin? What are the available libraries that could help me? I guess my problem is not new at all, but with my limited knowledge I was unable to find proper resources (or recognise them as such). My preference would be C++ or Python, given that the latter has some high-performance libraries. For starter, I have found this post that describes how to handle it in ArcGIS. However, since I want to process lot of shapefiles (500MB) and raster data is huge in size, using such an approach is not an option.


How do you construct a definition query to return only those features in the current month without hard coding the date?

I have a feature class containing a date field within a 9.3.1 File Geodatabase. There are "duplicate" features contained within this layer, one feature for each month over the past few months. However, the final dataset may contain dates for the last few **years**.               | Feature 1 | '2012-05-01' |     | Feature 1 | '2012-04-13' |     | Feature 1 | '2012-03-23' |     | Feature 1 | '2011-03-23' |     | Feature 2 | '2012-05-12' |     | Feature 2 | '2012-04-14' |     | Feature 2 | '2012-03-30' |     | Feature 2 | '2011-03-30' |     ... and so on      I want to apply a definition query such that the map will only display features for the current month and year and I do not want to update the definition query each month. I have attempted to use a combination of `date`, `CURRENT_DATE`, `EXTRACT`, and `CONCAT` but without much success. Ultimately I think I need a definition query that looks something like this but with the hard-coded dates removed.               DateField >= date '2012-05-01' AND DateField <= date '2012-05-31'      `CURRENT_DATE` returns the current date and can replace the second component to give:               DateField >= date '2012-05-01' AND DateField <= CURRENT_DATE      However I cannot seem to format the first component such that it always starts at the beginning of the current month. I attempted to format the date string via the `CONCAT` but I am unable to form valid SQL and I am not sure what the error is. Ignoring the `CURRENT_DATE` and `EXTRACT` methods for now gives me this invalid SQL:               DateField >= date CONCAT(CONCAT(CONCAT('2012', '-'), CONCAT('05', '-')), '01')      Ultimately the year and month would be replace by the current year and month using `EXTRACT` and `CURRENT_DATE`. However the "simplified" SQL above fails with a generic "An invalid SQL statement was used." error. I know I am doing something wrong but I am not sure what it is. So, how do you construct a definition query to return only those features in the current month without hard coding the date in ArcMap 9.3.1 in a 9.3.1 File Geodatabase?


Adding VBA into a Python script generated by ModelBuilder

I have created a model that does a calculate field and have used VBA in the code block. But when I export it to Python, it doesn't work. Here is the VBA code:               new_value = [HDATA_N_LAREF_ACTIVITY_TEXT]      if len(new_value) > 100 then         desc = Left(new_value,100)         desc = Left( desc, InStrRev( desc, " ") - 1) & " " & "..."     end if      When i exported it it came out as this....               # Process: Calculate Field...     gp.CalculateField_management(DWWEB_FINAL, "DESCRIPTION", "desc", "VB", "new_value = [HDATA_N_LAREF_ACTIVITY_TEXT]      if len(new_value) > 100 then         desc = Left(new_value,100)         desc = Left( desc, InStrRev( desc, \" \") - 1) & \" \" & \"...\"     end if     ")      **EXTRA INFO:** I have had a look at a previous script that was created (before I started this role), where within the Python script the VBA code is all on one line and contains "\n", where there is a new line within the code, so it should end up like this:               gp.CalculateField_management(myTempWorkspace + os.sep + "DWWEB_Joined", "DESCRIPTION", "desc","VB","new_value = [HDATA_N_LAREF_ACTIVITY_TEXT]\\nIf len(new_value) > 100 then \\ndesc = Left(new_value,100)\\ndesc = Left( desc, InStrRev( desc, " ") - 1) & " " & ""...""\\nend if\\n\\n\\n")      but in PythonWin it gives me the following error:               >>> Unhandled exception while debugging...     Traceback (most recent call last):       File "D:\ScheduledTasks\Scripts\DES_HYMS_Streetworks_v1.py", line 255, in ?         gp.CalculateField_management(myTempWorkspace + os.sep + "DWWEB_Joined", "DESCRIPTION", "desc","VB","new_value = [HDATA_N_LAREF_ACTIVITY_TEXT]\\nIf len(new_value) > 100 then \\ndesc = Left(new_value,100)\\ndesc = Left( desc, InStrRev( desc, " ") - 1) & " " & ""...""\\nend if\\n\\n\\n")     RuntimeError:      (Microsoft VBScript compilation error) Syntax error     Failed to execute (CalculateField).      But that doesn't run, so what do i have to do to get the code block to work? Thanks


Move .SHP from .MXD to gdb

> **Possible Duplicate:**   >  How to move SHP to gdb with ArcView license? Let's cut it short, I have numerous mxd with layer coming from .SHP and various servers WMS that I need to move to a gdb. What I want is to open the mxd and run a script that select all .SHP layers in the TOC create a gdb, export the .SHP, and create a new MXD with the new path pointing to gdb. Following is the code I wrote, but I can't have it to select only the .SHP, I tried with describe dataType but they all come out as "FeatureLayer"...need help!               # Import system modules      import arcpy, datetime, os, traceback      from arcpy import env           # Load required toolboxes...      arcpy.AddToolbox("C:\\Program Files (x86)\\ArcGIS\\Desktop10.0\\ArcToolbox\\Toolboxes\\Data Management Tools.tbx")               # Get the active map document      import arcpy.mapping      mxd = arcpy.mapping.MapDocument ("CURRENT")           # List broken links      # arcpy.mapping.ListBrokenDataSources(mxd)           # Set environment settings      ws = "C:\\PARK"      arcpy.env.workspace = ws      print("env.workspace completed successfully")      installdir = arcpy.GetInstallInfo("desktop")           #check GDB exist      gdb_nam = "test.gdb"      gdb_full_path = os.path.join(ws,gdb_nam)      if os.path.exists(gdb_full_path):          arcpy.Delete_management(gdb_full_path)      print("GDB checked")           # Execute CreateFileGDB      arcpy.CreateFileGDB_management(ws, gdb_nam)      print("CreateFileGDB completed successfully")      outWorkspace = gdb_full_path           # Iterate           list = []           for df in arcpy.mapping.ListDataFrames (mxd):          for fc in arcpy.mapping.ListLayers (mxd, "", df):             if (fc.datasetName.endswith(".shp")):                         list.append(fc)      for fc in fclist:          arcpy.FeatureClassToGeodatabase_conversion(fc, gdb_full_path)


QGIS 2.2 curved labels - 'maximum angle between curved characters' makes label invisible

When labeling a curved line in QGIS 2.2, and setting Placement to 'Curved', the behavior of 'maximum angle between curved characters' is not intuitive, and I haven't been able to find documentation on it. The line I'm trying to label is pretty jagged (it's a hiking trail). If I leave the 'maximum angle' settings both at 20 (default), no label is drawn. If I crank the values up to 45, the label is drawn but it is very jagged just like the trail, and illegible. If I crank the values down to 30, the label disappears again. So, it seems like these values are being interpreted like so: "If any generated character would be more than x degrees rotated from the previous character, then do not draw the label." Whereas I was hoping the values would be used as a sort of filter / smoothing algorithm: "Rotate the characters as needed such that each character's rotation is within x degrees of the adjacent characters' rotations." Can anyone provide a more clear interpretation?


Probability of iOS/Android device location accuracy

I'm working with Android and iOS apps that report location. Both iOS and Android can derive location from a combination of cell tower triangulation, visible wifi access points, and assisted GPS. The location APIs return a lat/long and an "accuracy" number in meters. In the case of Android the API also tells us whether GPS was used, but iOS does not report the source. What I have not been able to figure out from the Android/iOS documentation is how to read the accuracy number in terms of probability. Some GPS devices return the CEP, which means that there's about 50% probability that the device was within that radius. There are other ways of describing accuracy (e.g. 2DRMS) that provide up to 98% probability. Is there any standard for reporting these accuracy numbers in Android and iOS? Or would the probability of the device being within the accuracy circle vary from one reading to the next?


Clip depth contour with spatial polygon

I need to somehow combine my Spatialpolygons with my depth contour, but not sure how do to so. Maybe create a SpatialPolygonsDataframe? This is what I've done so far:               > class(subarea0) #This is my area of interest (Eastern Canadian Arctic Sea)     [1] "SpatialPolygons"     attr(,"package")     [1] "sp"          > extent(subarea0)     class       : Extent      xmin        : -82.21997      xmax        : -57.21667      ymin        : 60.2      ymax        : 78.16666          library(marelac)     data("Bathymetry")#World bathymetric data in library (marelac)     names(Bathymetry);class(Bathymetry);str(Bathymetry)     [1] "x" "y" "z"     [1] "list"     List of 3      $ x: num [1:359] -180 -179 -178 -177 -176 ...      $ y: num [1:180] -89.5 -88.5 -87.5 -86.5 -85.5 ...      $ z: num [1:359, 1:180] 2853 2873 2873 2873 2873 ...            raster_bath<-raster(Bathymetry)#Transformed into a raster layer (not sure if this is the best way to achieve what I want)         extent(raster_bath) <- extent(subarea0)#Transform the extend of my raster to the extend of my SpatialPolygons     v <- extract(raster_bath, subarea0)#Extract data from my Raster Layer for the locations of my SpatialPolygons      v is a list with depth and I am not quiet sure how/under what form to rebind this info with my spatial polygon... Ideas? Other suggestions? **EDITS** I apologize in advance, looks like I've been having a hard time to explain clearly what I was hoping to get. I don't want to summarize my depth info for each of my polygon but rather provide a detailed bathymetry within my area of interest. I am definitely not sure if what I did up to now is the way to go, but ultimately what I would like to achieve is to end-up with a plot of my polygon with my depth information. Something like this ![enter image description here](http://i.stack.imgur.com/Xu1iI.jpg) (thanks to Simbamangu), but without the depth info outside of my polygon. Basically, I just want the bathymetry info comprise in my overall area at the finest scale possible. Should I first transform my SpatialPolygons into one and then into some grid format to then be able to clip with my raster layer? Thank you!


How do I select all outermost features

Is there anyway in QGIS that I can select all the outermost features on a map? On an island that would be all that have a coastline. edit: This is what I'm trying to select: ![enter image description here](http://i.stack.imgur.com/Hknii.png)


how to do simple self join and touches function in postgis?

I am having trouble with this query and neighbor calculation in PostGis. I want to find out which are the neighbors of Sweden in the table COUNTRIES which has column 'the_geom' for geometry and 'cntry_name' for countries. This is what I tried to do but with little success. Can someone help me out and explain me what am I missing? Thanks a lot everyone!!!               SELECT s1.cntry_name     FROM countries AS s1, countries AS s2      WHERE s1.cntry_name = ‘Sweden’ AND     touches(s1.the_geom, s2.the_geom);      After editing the query this got me two results, Finland and Norway!               SELECT s1.cntry_name as sweden_neighbors     FROM countries AS s1, countries AS s2      WHERE touches(s1.the_geom, s2.the_geom) = 'True'      AND s2.cntry_name = 'Sweden';      thanks everyone!!


Uncaught TypeError during proj4 transformation

I get: Uncaught TypeError: Cannot read property 'x' of undefined at proj4js- combined.js:2720 While executing this code (transforming polygon from one system to another):               Proj4js.defs['EPSG:3765'] = '+proj=tmerc +lat_0=0 +lon_0=16.5 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs';          var source = new Proj4js.Proj('EPSG:3765');     var wgs84 = new Proj4js.Proj('EPSG:4326');          var polygon = Proj4js.transform(source, wgs84, features[0].geometry.Polygon);                 gmlLayer.addFeatures(polygon);     map.addLayer(gmlLayer);


How can I find the difference between two times (hh:mm) in QGIS?

I have a shapefile of crime reports that includes the time a call was received and the time officers arrived on scene. I want to create response times from the difference in these two values. I know QGIS has support for the difference between dates, but I need the difference between two times in hh:mm format. Is there a way to do this in QGIS specifically? I am running QGIS 2.0 standalone version.


Trying to label graphic using feature attribute (ArcGIS Javascript 3.7 API)

I have a Dialog DIV containing an HTML list of buttons with a value for each school district. I want the user to be able to click on a button and have a polygon graphic of the district placed on the map, zoom to its location, and label the graphic with the district name. Using A HREF (javascript:findSchoolDist('district_name')) I call the function and zoom to the extent of the returned graphic. To my understanding, when using FindTask, all attributes are returned along with the graphic. The FindTask successfully finds the feature, returns the graphic, and zooms to its extent. The problem is I cannot get the label to appear. While I am using the Javascript 3.7 API, I am not using the AMD format so the code I am using is borrowed from a 3.5 API sample as they are coded using the legacy format. For finding the center of the polygon so the app knows where to place the label, the require "esri.tasks.geometry" is included and I have included the Geometry Service URL under the layers as "var geometryService = new esri.tasks.GeometryService("http://gis.abag.ca.gov/arcgis/rest/services/Geometry/GeometryServer");" The two functions that make up the tool are as follows:               function findSchoolDist(searchText) {        map.infoWindow.hide();        map.graphics.clear();             //Create find task        var schoolFindTask = new esri.tasks.FindTask("http://gis.abag.ca.gov/arcgis/rest/services/admin/abag_District_School/MapServer");             //Build school district filter        var schParams = new esri.tasks.FindParameters();            schParams.returnGeometry = true;            schParams.outSpatialReference = map.spatialReference;            schParams.layerIds = [0];            schParams.searchFields = ["name"];             //Set search text and find school district        schParams.searchText = searchText;        schoolFindTask.execute(schParams, schShowResults);     }          function schShowResults(results) {        var schoolSymbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_DIAGONAL_CROSS, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,255,0]), 4), new dojo.Color([0,0,255,0.25]));             map.graphics.clear();             dojo.forEach(results, function (result) {           var schGraphic = result.feature;           var schAttrib = schGraphic.attributes.name;           schGraphic.setSymbol(schoolSymbol);           map.graphics.add(schGraphic);        });             var poly = dojo.filter(results, function(r) {           return r.feature.geometry.type === "polygon";        });        if ( poly.length > 0 ) {           map.setExtent(poly[0].feature.geometry.getExtent().expand(1.5));        } else {           alert("No polygon results...");        }   //WORKS UP TO THIS POINT, FAILS AFTER             //Add district name to map        var schFont = new esri.symbol.Font("14pt", esri.symbol.Font.STYLE_NORMAL, esri.symbol.Font.VARIANT_NORMAL, esri.symbol.Font.WEIGHT_BOLD, "Arial");             var schTextSymbol = new esri.symbol.TextSymbol(schAttrib);           schTextSymbol.setColor(new dojo.Color([255,0,0]));           schTextSymbol.setAlign(esri.symbol.TextSymbol.ALIGN_MIDDLE);           schTextSymbol.setFont(schFont);             var pt;           pt = schGraphic.getExtent().getCenter();        var gra = new esri.Graphic(pt, schTextSymbol);             map.graphics.add(gra);     }      I am hoping that someone is still using the legacy format who has experience labeling graphics.


Calculate Slope Between Pixels Through Time: A Time Series Trend Analysis

I have a 9 year weekly time series (~500 raster grids of equal cell size and extent). I'm interested in obtaining the regression line slope between pixels (Imagine stacking all 500 grids on top of one another and running a linear regression between each individual pixel). Essentially, this would measure the net change between pixels through my time series. My main question is about the coefficients defined in the first answer here. Is the coefficient defined as 12 due to the temporal scale of the original question being at the monthly level? And if so, should my code's coefficient be set to 7 due to the weekly temporal scale between grids? I have been referencing these posts that are similar: Representing trends over time and make linear regression across multiple layers. I wrote this python code after reading the links referenced above:               from __future__ import division     import arcpy     import os     from arcpy import env     from arcpy.sa import*               # define workspace     arcpy.env.workspace=r"C:\Users\mbs7038\Documents\Remove_Gauge_Outliers\test\forSlope.gdb"          # enable overwriting     arcpy.env.overwriteOutput=True          # check spatial analyst extension     arcpy.CheckOutExtension('Spatial')          # define output paths     slopePath=r"C:\Users\mbs7038\Documents\Remove_Gauge_Outliers\SpatialTrends\SlopeTEST.gdb"          # list all rasters in the workspace     rasters=arcpy.ListRasters('*')     # sort rasters numerically     rasters.sort()          # get the number of rasters     n=len(rasters)     print n          # setup index     i=1          # define division     seed=(n*n*n)-n     print 'the global seed is {0}'.format(seed)          for raster in rasters:         print i         coef=(12*(i)-((6*n)+(6*1)))/seed              print 'Raster {0} is {1}:'.format(i,raster)         print 'the coef for raster {0} is {1}'.format(i,coef)              # Multiple raster by coefficient         if i==1:             outSlope=(Raster(raster)*coef)             i+=1  # same as saying i=i+1         else:             print 'adding {0} to outSlope'.format(raster)             outSlope=outSlope+(Raster(raster)*coef)             i+=1         if i==6:             break          # Save final slope grid     print 'saving final slope grid'     outSlope.save(slopePath + "/" + "floodChange_py")          print 'script is complete'      I created this code as a test which appeared to work on a 5 week subset of my data. If what I have referenced above is correct then this code will work on a time series (of equal cell size and extent) of any length. Although there were no bugs in the code, I have a feeling I may have made a mistake someplace and would appreciate extra eyes on my code. Any advice or recommendations? On a side note I'm using PyScripter, hence the "from **future** import division" in the first line. This disables the automatic floor function which rounds floating point numbers to the nearest integer away from zero.


ArcGIS 10.1 Geocoding problems - Creature Feature Class/Error processing the table

I am trying to geocode a list of addresses to location in a particular shapefile which has roads. I'm using ArcGIS 10.1, and trying to geocode using the address locator 10.0 north america geocode service (in table of contents, right click on the file -> geocode address). The spreadsheet that I am trying to geocode is in .xls format. The geocoding MATCHED ~640 cases, before it gave this error: > Creature Feature Class/Error processing the table There are no unusual characters in the field names - all of them either have a letter or a number, and nothing else. Scanning over the spreadsheet, there do not appear to be any null values, and the addresses do not seem to contain any periods, or characters that would otherwise be unacceptable to an address locator (my thoughts on the matter obviously). I've looked over other problems of a similar nature that have been posted in various forums, and most of the answers seem to be that the problem lies in the data, or in the format of the data. So my questions are:   1. Is there a specific problem with the data that I should look for?   2. Why would the address location terminate after ~640 successful matches?   3. Is there a better way to place point representation on a map, rather than geocoding a list of addresses via address location to a shapefile?   4. Could the problem be with the shapefile, and some of the shapefiles attributes?


How do I set nodata with custom color for gdal_translate and gdal2tilespy?

I start with a bunch of 1-bit geotiff files that I had to convert to 8-bit RGB tiff files to use with GDAL. Then I tried to set borders to red (content is in black and white so I can't use those) and do               gdal_translate -a_nodata '200 0 0' -of vrt red.tiff nodata.vrt          gdalbuildvrt -srcnodata '200 0 0' -vrtnodata '200 0 0' -hidenodata -addalpha nodata.vrt trans.vrt          gdal2tiles.py -a "200,0,0" trans.vrt ...      But I am only able to hide nodata if it is in grayscale(ex. rgb(200,200,200)) I think the color information is just lost in the gdal_translate process. Is there any way to verify what happened and make gdal work with nodata that has custom colors?


How to horizontally align irregularly shaped point symbol to vector layer in QGIS?

Fairly new to QGIS and searching a method to graphically align my point symbols in the direction of the vector. The symbol represents a water valve in an irregular shape in close proximity to a vector water network--is there a way to align each symbol adjacent/ horizontal to a water network vector layer?


QGIS 2.2 - Oracle Spatial Layer - Offline editing - Not synchronizing

I am sarting with QGIS 2.2.0 (windows, 64b). For my project I imported some layers Oracle Spatial layers (Layer>add Oracle Spatial Layer). Then I convert the project offline as I can't always be connected and edit the layers (mostly splitting features and adding others). My problem is that after synchronizing, the layers are back to their initial states and the changes are apparently not uploaded in my online Oracle database. Is there anything that can be done? Thank you for your help!


How do I set options for individual layers within an ESRI Mapservice?

I've been working on an internet mapping site to include ESRI basemap layers, and in-house mapservices broken out by layer.. I have gotten that far.. I am also still fairly new to javascript..so, this might be a javascript question.. Here is the code for the mapservice and the layers I am accessing..               var patLayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://gis.co.frederick.va.us/ArcGIS/rest/services/Planning/Planning_PAT/MapServer",{id:'PAT',opacity:.6});         patLayer.setVisibleLayers([7,6,1,2,3,4]);         legendLayers.push({layer:patLayer,title:'Planning Layers'});      What I am not sure of is how to set the options only for specific layers and not just the entire mapservice.. such as opacity.. Any help is greatly appreciated..


How can I import layer symbology from another layer programmaticaly with ArcObjects & VBA?

I would like to be able to develop a procedure that runs through all layers in the TOC and if the layer (name) exists in a specific folder where I am storing layer files with complex symbology I would like to import the procedure to import the symbology from the layer files. I have a similar procedure for importing stored Label schema so combining the two into a more dynamic solution would save me a lot of time. Thanks


why is my findTask Not working correctly? can someone please look at my code and see if I have missed something?

My findTask is from the SAMPLE on ERSI's website http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples/find_map_datagrid.html I have incorporated into the project I am working on. I've looked over the code again and again and can't seem to figure out why this is not working. ADDED - here is a link to the map.. http://www.co.frederick.va.us/planning/newmap1copy2.html UPDATED - Link..


Creating a list in Python and emailing the list

I am literally BRAND NEW to python and in my current role it is not a hardcore requirement, but knowing my way around a script will make life much easier. I am working in an ArcGIS Server environment, for context. I am gutting old scripts and piecing them together to do what I want. Right now, my script writes a text file compiling a list of services and their average draw times, and sends me an email every single time it detects an average draw time of more than 0 seconds for a service. (Ultimately this will be moved to 2 seconds but I'm using 0 to ensure it is workign correctly first). What I really want it to do is send one email with the listing of the draw times instead of x amount of individual emails. I will attach below the part that I think is relevant.... Thank you in advance for any help!!! Regards, S # Open text file and write header line summaryFile = open(filePath, "w") header = "Now,Service,Number of hits,Average seconds per draw\n" summaryFile.write(header)               # Read through dictionary and write totals into file     for key in hitDict:              #print hitDict              # Calculate average elapsed time         totalDraws = hitDict[key][0]         totalElapsed = hitDict[key][1]         avgElapsed = 0              if totalDraws > 0:             avgElapsed = (1.0 * (totalElapsed / totalDraws)) #Elapsed time divided by hits                    #Send email when invalid password is found in logs.                                            #NEW         if avgElapsed > 0:                     #Define Email Parameters                     #counter = 1 + counter                     #if counter > 5:                         EmailBody = "High avg draw time noted, check services."                         EmailSubject = "High avg draw times observed in " + item["source"]                              for address in Receivers:                             EmailAttachments(address, From, EmailSubject, EmailBody)                              print "High Average Draw Time Observed"#.format(timeStamp, machine)                   # Construct and write the comma-separated line         line = timeStamp +"," + key + "," + str(totalDraws) + "," + str(avgElapsed) + "\n"              fields = ["TIME", "SERVICE", "HITS", "AVGSECPERDRAW"]         insCur.insertRow(( timeStamp, key, str(totalDraws), str(avgElapsed)))              #serverName = item["machine"]         #print serverName              summaryFile.write(line)          summaryFile.close()     return


PostGIS retrieve polygons within a rectangle

I am building a system to bring in shapefile data from a PostGIS database and render it on top of OpenStreetMap tiles using the Leaflet.js library. My table (sierra_county_parcels) has a polygon geometry field (geom) in SRID 4326, and a field called "upc" that contains the parcel ID. There are about 16,000 rows in sierra_county_parcels. What I need to do is retrieve all of the upc values for rows where the geom polygon is within the currently visible part of the Leaflet map control. I have already written the code to send the northwest and southeast lat/lon pairs and generate an SQL query, which looks like this:               SELECT upc AS pt_parcel_key     FROM  sierra_county_parcels     WHERE  ST_Within(geom, ST_Envelope(ST_GeomFromText('MULTIPOINT(33.167444534375925 -107.14931488037108, 33.08909661229697 -107.35513687133788)')))      The MULTIPOINT WKT is what I'm currently using to specify the corners (nw_latitude, nw_longitude, se_latitude, se_longitude). The problem is that the query always returns 0 results. For this query, the map was zoomed out to show most of the region where the geometries should be. Any ideas? Thanks in advance, John W.


QgsFeatureList features as QStrings

I am catching the selectionChanged signal and passing the selected layer to the registered method. Once here, I want to know the features that were selected. I do this with a call to layer.selectedFeatures(). The return type from this call is a QgsFeatureList. As a test, I'm trying to print the values of the features in the QgsFeatureList that was selected, or just display them in a simple way. I find that neither QgsFeatureList nor QgsFeature has any functions returning a QString. How can I print the values of the features that were selected?


How to set the path to shapely?

I am using QGIS 1.8.0 on Mac OS 10.8.3 with python 2.7. Thanks to other threads in the forum, I have successfully installed shapely here: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site- packages/Shapely-1.2.16-py2.7.egg However, when I try to use the polygonizer-Plugin in QGIS it tells me that it cannot find shapely.ops. This clearly seems to be a path-problem, but I have no other versions of python installed. I have tried to append the above path to .bash-profile, but to no avail. Any help is appreciated. Nils


ArcGIS mobile to use external GPS device

Im currently tasked to create an app that would sketch a GPS Device's movement and plot it on the ArcGIS map. By default, the ArcGIS locationDisplay class calls the IOS class CLLocation to retrieve the GPS data in which it only uses the internal GPS of the iPhone. My question is: Is there any way to force the iPhone to use the GPS of an external device? Or can we configure the ArcGIS to use the data from the external device?


Using R to subtract the polygon area of one shp file from another

I'm looking to produce a map from two separate maps in R. My Maps files are as follows: ftp://ftp.cpc.ncep.noaa.gov/GIS/us_tempprcpfcst/610prcp_20140822.zip #Map1 ftp://ftp.cpc.ncep.noaa.gov/GIS/us_tempprcpfcst/610prcp_20140812.zip #Map2 These are 6-10 day weather Precip maps from NOAA. I would like to create a map with the area showing, being only the difference of the two maps. So `Map1 - Map2 = Map3`. Also, I would like it to show the relative strength of the change for the above or below normal moisture. Which can be seen in the "Prob,N,13,11" & "Cat,C,254" files of the dbf file. Without success I have tried: converting to PolySet and then using `joinPolys` with the Operation="DIFF". Also: using `readOGR`, checking for gIsValid, and then trying to use `gDifference`. When I run the second one I get this error: > Error in RGEOSBinTopoFunc(spgeom1, spgeom2, byid, id, drop_not_poly, > "rgeos_difference"): TopologyException: no outgoing dirEdge found at > -168.86604844949545 63.300706978948405 I am sorry if it seems like such a simple question of taking the difference between two maps but I have been stuck on this question for a number of days now. I would even appreciate being sent down the correct path because I feel like I'm going down the very wrong paths.


(.NET) Get DTED Data (Elevation) Between Two Points

I want to get DTED data (elevation) between two points (on a line). Is there any built-in function for this purpose or I should implement it on my own? What I want is similar to Linear Line of Sight (LLOS), but it should be on a direct line. I want to check if there is collision between two points or not. Thank you Sincerely


I want to make a table that displays shapefile information

I have a parcel I'm working with that has multiple layers laid over it. I'd like to make a table that displays various attributes of those different layers. For example, within that shapefile, I'd like to have a table display the watershed, school district, utilities, etc. and if that parcel changes, I'd like the table information to change too. I've experimented with data driven pages, but I'm not sure that's quite what I'm looking for. Any suggestions?


get map tiles for a polygon

Based on this tutorial, I can easily find out a tile for a point. But is there an algorithm to find all tiles that are covered by a rectangle or lineString or by any other feature? I would greatly appreciate any help!


Looking for "big names" that use open source WMS (like geoserver / ms4w / qgis server) for presentation

I'm looking for famous companies / "big names" (like army , goverments , city halls) that chose to use open source map servers and not paid solution like ESRI and such for presentation I'm doing (go Open Source :) ) Thx.


Can i change the color/font of map tool tip through arc objects for desktop application?

I want to have custom format of tooltip of features on axmapcontrol.


Add an individual layer from ArcGISDynamicMapServiceLayer to the map

I have a ArcGISDynamicMapServiceLayer containing many layers. I'd need to add only individual layers to the map, like layers 2,5 and 10. The following code would add all the layers to the map:               url = "http://...MapServer";     mapServiceLayer = new ArcGISDynamicMapServiceLayer(url, {          className: layer,          opacity: opacity     });     map.addLayer(mapServiceLayer);      How can I add only i.e. layer 5 to the map? (.../MapServer/5) There is a similar question here but answers seem not to be helpful for the front end solution.


Consuming gml generated by sql server As.GML()

Sql server has a method As.GML to produce GML file from geography/geometric type. Is there a good example to utilize this GML on other mapping platform such as QGIS? I have ask a related question here, but QGIS reports its format is not valid. Thanks.


How to create a feature class from a DEFeatureClass output parameter

I'm writing a geoprocessing tool with ArcObjects for Java. My tool takes in parameters one feature class (from a layer, a shapefile or a GDB) and others parameters. The parameter in output is a DEFeatureClass. I want to create from the DEFeatureClass a feature class of the same structure of my input feature class. I can get the full path of my output:               IGPParameter parameter3 = (IGPParameter)paramValues.getElement(2);     IGPValue gpValue3 = gpUtilities.unpackGPValue(parameter3);     String outputFeatureClassStr = gpValue3.getAsText();      And my input feature class like this:                   IGPParameter parameter1 = (IGPParameter)paramValues.getElement(0);         IGPValue gpValue1 = gpUtilities.unpackGPValue(parameter1);         IFeatureClass inputFeatureClass = gpUtilities.openFeatureClassFromString(gpValue1.getAsText());      But I can't found a method to create a new feature class from my outputFeatureClassStr string and my inputFeatureClass. Do you know how to do it? I tried to write a function getting the path and creating the feature class depending of the type of location (dataset or workspace):               private IFeatureClass getOutputFeatureClassFromGPValue(IGPValue gpValue, IFields fields, int featureType) throws AutomationException, IOException {         IDataElement dataElement = (IDataElement)gpValue;         String featureClassCatalogPath = dataElement.getCatalogPath();              IName fcName = gpUtilities.createFeatureClassName(featureClassCatalogPath);         String fcNameString = fcName.getNameString();         IFeatureClassName featureClassName = (IFeatureClassName)fcName;              IFeatureClassDescription featureClassDescription = new FeatureClassDescription();         IObjectClassDescription ocd = (IObjectClassDescription)featureClassDescription;              IFeatureClass featureClass = null;         if(featureClassName.getFeatureDatasetName() != null) {             IName datasetName = (IName)featureClassName.getFeatureDatasetName();             IFeatureDataset featureDataset = (IFeatureDataset)datasetName.open();             featureClass = featureDataset.createFeatureClass(featureClassCatalogPath, fields, ocd.getInstanceCLSID(), ocd.getClassExtensionCLSID(), featureType, featureClassDescription.getShapeFieldName(), null);         } else {             IDatasetName datasetName = (IDatasetName)featureClassName;             IWorkspaceName workspaceName = datasetName.getWorkspaceName();             IName name = (IName)workspaceName;             String nameString = name.getNameString();             //IFeatureWorkspace featureWorkspace = (IFeatureWorkspace)name.open();                  ShapefileWorkspaceFactory shapefileWorkspaceFactory = new ShapefileWorkspaceFactory();             Workspace workspace = (Workspace)shapefileWorkspaceFactory.openFromFile(nameString, 0);             featureClass = workspace.createFeatureClass(featureClassCatalogPath, fields, ocd.getInstanceCLSID(), ocd.getClassExtensionCLSID(), featureType, featureClassDescription.getShapeFieldName(), null);         }              return featureClass;     }         The way I call my function:               IFeatureClass outputFeatureClass = getOutputFeatureClassFromGPValue(gpValue3, inputFeatureClass.getFields(), inputFeatureClass.getFeatureType());      But it doesn't work. If the output is in a GDB, I get the fcNameString = "", and if the output is a shapefile, I get a ClassNotFoundException for the class com.esri.arcgis.datasourcesfile.ShapefileWorkspace. Does anyone see what's wrong in this or know another method ? Thanks a lot.


ArcGIS Labeling Expression when truncation needed to fit in some polygons?

What would be the expression coding for if the address is 14802. But if the whole address cannot fit inside the building dimessions, then it should be truncated to the last two digits - 02. I am trying to do this ... ![enter image description here](http://i.stack.imgur.com/vHIDM.jpg) As seen in my map, I am trying to take down the congestion of the map with the numbers and trying to still be able to label each building for a firedepartment map. Any ideas?


Is it a bad idea to convert a File Geodatabase table to a dictionary?

## First, what am I trying to do? I am building a Python script that should be called from an ArcMap 10.0 toolbox. This scripts uses (among other inputs) data contained in huge gdb tables. It processes the data in many different ways (hence, there are many inevitable iterations on the table). ## Why would I want to convert the data? The reason why I am converting the tables to ditionaries is that it is extremely slow to iterate through the table using SearchCursor. I have many operations that I want to do on my data and it is much simpler and faster to use existing data structures. ## How am I doing it? The usual way to use gdb tables in Python (and the one to which I have compared my method) is something along the lines of:               # Create a search cursor     rows = arcpy.SearchCursor(table)     for row in rows:         (...)      What I'm doing instead, is that I am converting the table to dbf using TableToTable_conversion (throwing away some useless columns/rows on the way). Then I convert this DBF table to a dictionary (I was inspired by some code written by Tyrtamos, if you google "Lecture d'un fichier dbase III" you should find it). In the end, I have a dictionary containing lists of data indexed with the column names. And I'm very happy because I can do many things with it relatively quickly. ## Finally,... This method seems to be much faster. However, I am new to that game and I'm afraid to be missing something because I don't understand everything that's going on. Is it a bad idea to do that? Are there reasons not to do it other than potential memory overflow? Please tell me if something is unclear. Thanks! **EDIT** After seeing your answers, I realize that there was one _very_ important information missing: I'm using Arcmap 10.0. I have run performance tests using nmpeterson's solution, modifying a few lines to make the code compatible with ArcGIS 10.0               cursor = arcpy.SearchCursor(fc, cursor_fields)     for row in cursor:         rowList = []         for field in cursor_fields:             rowList.append(row.getValue(field))         attr_dict[rowList[0]] = dict(zip(cursor_fields, rowList))      On a small table containing ~15000 rows, I measured an average elapsed time and got               make_attribute_dict -- 10.7378981873     gdb_to_dbf_to_dict-- 2.56576526461


R - Crop a pixel image produced by spatstat with a boundary shape

i am using the very good spatial statistic package **spatstat** to produce probability maps of spatial point patterns. Here is a simple working result from the examples to try out.                 require(spatstat)       data(lansing)       z <- relrisk(lansing)       plot(z, main="Lansing Woods")      My question is rather simple (or maybe not). I produced a similar map as shown above and i want to crop it in **R** with a boundary shapefile. The spatstat package uses its own system (of windows and pixel images) so i am rather clueless. I know that i can format my shapefile to a so called mask with this command `as.mask(as.owin(shapefile))`, but i didn't get beyond this point.   Anyone knows how i can crop the produced image with this mask? * * * EDIT: Ahh, sry. I already found a solution around it, which works for me. I simply have to make a subset out of the spatial points before converting it to a ppp object.               library(rgdal)     st <- readOGR("GIS-Data","boundary_shape")      wp <- spp[-which(is.na(over(spp,st)[,1])),] # spp is my spatial point shape     rm(st)     #Then use this command from the maptools package     library(maptools)     plp <- as.ppp.SpatialPointsDataFrame(wp)      Nevertheless it would still be nice to know if it is possible to crop a spatstat pixel image.


How do "join field" and "target field" work?

New user. This should be simple, but I can't figure out how to perform this basic join in QGIS. (It works in Cartographica.) My shapefile (IL_BNDY_County_Py) has two fields/columns in its attribute table: COUNTY_NAM and CO_FIPS. My source DBF file (IL_BNDY_County_Py-species-dbf4.dbf) has three fields/columns: COUNTY_NAM, CO_FIPS and SPECIES. (The file is a literal clone of the shapefile table, with the addition of "SPECIES".) Both are available as layers in my project. I want to add the SPECIES field to the shapefile. Either COUNTY_NAM or CO_FIPS could serve as "key" field (to use terminology I'm familiar with from other software). When I try to create a join, the **Add vector join** dialog shows the following options: **Join layer** : IL_BNDY_County_Py-species-dbf4.dbf **Join field** : (three menu options): COUNTY_NAM, CO_FIPS or SPECIES **Target field** (two menu options): COUNTY_NAM or CO_FIPS Is this what I should be seeing? I can't figure out how to use this dialog to get the SPECIES field added to the shapefile. Part of the problem is that QGIS doesn't use the the term "key," so it's impossible for me to know which field QGIS wants to use to ensure the relationship. Given the options displayed, neither the "target" nor "join" field seems appropriate to serve as "key." How do I denote the "key" field? If I choose SPECIES as the Join field, and CO_FIPS as the Target field, the results are duplicate columns for COUNTY_NAM and CO_FIPS with random mix of integer values and NULL values. SPECIES values are ignored and not copied over. I even tried creating a placeholder "species" column in the shapefile attribute table but still couldn't figure out how to get SPECIES copied over to species. What is the proper procedure for doing this? Is there another problem that I should be considering?


Setting coordinate systems in gvSIG: Is the workflow similar to QGIS?

I am still learning how to use coordinate systems and projections, but I hope this basic question will be easy to answer. My goal is to be able to use either QGIS or gvSIG to create a simple county map of Illinois using the base data shapefiles available from the Illinois Natural Resources Geospatial Data Clearinghouse. I believe I need to use a state plane coordinate system such as NAD83/Illinois (East) or NAD83/Illinois (West) so that the state will look like this: ![Illinois](http://i.stack.imgur.com/npHUC.jpg) ... but not this: ![Illinois wide](http://i.stack.imgur.com/KgsT4.jpg) In QGIS, I assume that best way to get the desired look is by _first_ setting the application's CRS Preferences and the Project Properties CRS to NAD83/Illinois (West) [EPSG code 26972], with "On the Fly" selected, then adding the shapefile. Leaving the "On the fly" option unselected causes problems. Changing the Preferences or Project CRS _after_ adding the shape layer also causes problems. Are my basic steps and assumptions correct? If those basic steps are correct, why do the same steps _not_ work in gvSIG? (The Illinois shape is displayed as the undesired "wide" version no matter what I do.) _Added later to illustrate comment on gvSIG:_ Here are the dialogs I see after adding the layer: ![enter image description here](http://i.stack.imgur.com/BUGEA.png) In case this is relevant, here's the empty Transformations list in gvSIG: ![Transformation dialog](http://i.stack.imgur.com/uF8vu.png)


tile cache error : Lower left corner is outside layer bounds

i have made a wms layers in openlayers consuming cached tiles generatred by tile cache , in the generation step i have used this configuration : [vmap0] type=WMS url=http://localhost/cgi-bin/mapserv?map=maps/poimanager/nav 2tiles.map layers=nav_map bbox=-855822.40976158,3975513.7271299,-847686.6435646,3976531.2950689 levels=20 concerning the map in openlayers i have defined the resolutions in map instance options:                     var options = {         maxExtent: new OpenLayers.Bounds(-2015494, 2445884, 48919, 4383204),         projection: "EPSG:900913",         displayProjection: new OpenLayers.Projection("EPSG:4326"),         units: 'm',         numZoomLevels: 20,     resolutions :[3.9725420883691527, 1.9862710441845763, 0.99313552209228817, 0.49656776104614408, 0.24828388052307204, 0.12414194026153602, 0.062070970130768011, 0.031035485065384005, 0.015517742532692003, 0.0077588712663460013, 0.0038794356331730007, 0.0019397178165865003, 0.00096985890829325017, 0.00048492945414662508, 0.00024246472707331254, 0.00012123236353665627, 6.0616181768328135e-05, 3.0308090884164068e-05, 1.5154045442082034e-05, 7.5770227210410169e-06]                 };                      var map = new OpenLayers.Map('map', options);      but i still get nothing just when i try to view the images using firebug it gimme this error : "An error occurred: Lower left corner (-851825.191138, 3976933.501194) is outside layer bounds [-855822.40976158006, 3975513.7271298999, -847686.64356460003, 3976531.2950689001]. To remove this condition, set extent_type=loose in your configuration." can you help me resolve this error :) thanks in advance :)


Join Text File with lat/long in a shape file without a field in commom with QGIS 1.8

I'm using QGIS 1.8. I have 3 files: a shape file from a state, a csv file with a commom field with this shape file and a third file (csv, with long/lat colums). In this third file. I have a column 'id_customer'. The shape file is a map of a state. And the file with a commom column with the shape file, has the income for vrious neighborhoods. I want to link the customer file with the shape, and after link the customer to the income field. Can anyone help me?


Reprojecting Natural Earth "Admin 0 – Countries" shapefile to Web Mercator

I haven't received a reply posting this same question on the Natural Earth forums, so I figured I'd give it a try here. I’m trying to reproject the 1:10m "Admin 0 – Countries" shapefile into a Web Mercator projection (EPSG:3857) using QGIS. However, the reprojection fails with the following message:               Export to vector file failed. Error: Failed to transform a point while     drawing a feature of type ‘ne_10m_admin_0_countries’. Writing stopped.     (Exception: forward transform of (3.141593, -1.570796) PROJ.4:     +proj=longlat +datum=WGS84 +no_defs +to +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs      Error: tolerance condition error)      I receive this error for both "ne_10m_admin_0_countries" and "ne_10m_admin_0_countries_lakes". A post here on gis.stackexchange.com indicates that it might be a problem with points in Antarctica going to infinity during reprojection, but I’m not sure how to fix it if that is indeed the problem. The 1:50m "Admin 0 – Countries" shapefiles are able to be reprojected successfully using QGIS, which leads me to believe that the root of the problem may lie in the 1:10m shapefiles. I'm hoping that someone can expand on the answer offered in the linked post and provide answers for the following questions:   * Is there an error in the 1:10m shapefile? (Since the 1:50m shapefile reprojects without issue) Or is this sort of reprojection error just to be expected under certain circumstances?    * **Exactly what steps may I take to fix the shapefile so that it can be successfully reprojected?** The linked post says to "delete the objects around the south pole" but I'd prefer not to delete Antarctica. I tried editing the Antarctica feature to chop off the southernmost portion, but it didn't seem resolve the reprojection error. Please assume I'm a GIS newbie. Thanks!    **RESOLUTION & NEW SHAPEFILES** Second try was the charm for me, and I was able to trim off the bottom of Antarctica using the "Reshape Feature" tool in QGIS. There's a decent description of how to use it here: http://gis.stackexchange.com/a/21651/1770. After removing the southernmost portion of Antarctica, I was able to successfully reproject the map. To save everyone some time, I've posted the files. These are the "_lakes" files that do NOT include boundary lakes:   * Original file in WGS 84 (EPSG:4326), but with the bottom 0.4 degrees of Antarctica trimmed off. You should be able to reproject this file without issue: https://github.com/dmillz/misc/raw/master/shapefiles/ne_10m_admin_0_countries_lakes-trimmed_antarctica.zip   * Same file, but reprojected into Web Mercator (EPSG:3857): https://github.com/dmillz/misc/raw/master/shapefiles/ne_10m_admin_0_countries_lakes-EPSG_3857.zip


How can I enable PostGIS Shapefile and DBF Loader 2.0 plugin in PgAdmin III?

I am on Windows and I want to download/enable the plugin "PostGIS Shapefile and DBF Loader 2.0". I installed PostGIS 2.0 using StackBuilder of PostgreSQL installer.


XYTools truncating decimals on export to excel

Is there some sort of setting to prevent XYTools from truncate decimals when exporting a shapefile to excel? I live in Sweden hand we normally use comma as decimal point. Even if I change the setting both on system level as in Excel - XYTools still truncate decimals. Thx /Jan


ArcObjects VB.Net - Looping through Layers from TOC and ListBox

Greetings, I'm creating a tool in ArcMap 10 using a windows form... its been a struggle (maybe some of you recognize the same themes in my questions) because this is the first time I've really messed with ArcObjects and VB.Net... either way I'm almost there!! (Largely thanks to a very helpful GIS community.) The main chunk of the code works (grabs an attribute from one layer and assigns it to the "target" layers), and now I'm in the process of linking up the user parameters. ![enter image description here](http://i.stack.imgur.com/5hszo.jpg) As it stands, the "NHD Reach Layer" combo box (cmbNHD) requires the source layer be in the table of contents (TOC). The target layers, on the other hand, can either be in the TOC (through the "Target Layers" combo box (cmbTarget), or accessible through the GxDialog. Either way, the selections are placed in the list box (boxTarget).                   ...              Dim pLayer As IFeatureLayer         Dim pGxDataset As IGxDataset = pGxObjects.Next         Do Until pGxDataset Is Nothing             pLayer = New FeatureLayer             pLayer.FeatureClass = pGxDataset.Dataset             pLayer.Name = pLayer.FeatureClass.AliasName             If Not boxTarget.Items.Contains(pLayer.Name) Then boxTarget.Items.Add(pLayer.Name)             pGxDataset = pGxObjects.Next         Loop     End Sub      OK, so what I can't figure out, is how to form some "loopable" list from the items in the list box. The original code worked only with the items in the table of contents, and so it could loop through them all using this type of loop...                   For i = 0 To pMap.LayerCount - 1             Dim pLayer = pMap.Layer(i)      ...and just skipping the index number of the source layer ("NHD Reach Layer"). AND SO, I'm pretty sure I just need to create an enumeration of the layers in the list box, but I've only been able to dig up the IEnumLayers interface, and it seems as if that only works with the layers in the current map. Any thoughts/ideas? Also, I'm not sure if this is the place (though, I can't think of a better one), but when this is all finished, I was wondering if I could post the final code (the reason I ask is because it wouldn't really be a question). I've spent a good amount of energy trolling through forums and developer help files to find relatively simple answers in the form of examples, but usually they are snippets, which, when viewed out of context, can be confusing. It's my belief that this code would be really helpful to anybody just getting started, because it offers few frills, and combines a lot of basic methods with some intermediates thrown in here and there. Just trying to help. Thanks so much!! DR


Relabel Vector Points in OpenLayers

I have created two labeled vector points on an open layers map. I'm trying to change the label text dynamically. I tried changing the values where the stylemap gets the values from and calling layer.refresh() but it does not do anything. Any ideas? Here is my code in its entirety. All you have to do is change the open layers JS reference to your local file and it will work in your browser.                                 <title>OpenLayers Labeled Features Example</title>          <link rel="stylesheet" href="../js/OpenLayers/theme/default/style.css" type="text/css" />          <link rel="stylesheet" href="style.css" type="text/css" />
OpenLayers Refresh Labeled features example

              <input type="button" value="Switch Labels" onclick="Javascript: switchLabels();" />


RuntimeError while executing python

After downloading Matplotlib to use the Statist Pugin An error has occured while executing Python code: RuntimeError: module compiled against API version 9 but this version of numpy is 6 Python version: 2.7.5 (default, Mar 9 2014, 22:15:05) [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] QGIS version: 2.2.0-Valmiera Valmiera, Later on the message is that statist is also not able to run. How to solve this problem?


Convert feature class to raster based on attribute field values

As part of a tool, I’m trying to convert a feature class to a raster based on attribute field values. I have accomplished this conversion using IRasterConvertHelper, but this is done without specifying an attribute field. So I then was able to do the conversion using the IGeoProcessor to execute ConversionTools.FeatureToRaster , but was only able to use numeric fields (i.e., tool didn’t work when a text field was selected). Going another route, I tried dissolving the feature class based on a selected attribute field using IBasicGeoprocessor and Dissolve, but this fails with: {System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component. (thanks ESRI, lots of help!) Does anyone have any idea on how to accomplish the same thing as the ArcToolbox Conversion Tools Feature to Raster tool and convert a feature class into a raster based on an attribute field?


Getting started with ArcGIS

I am 100% new to ArcGIS and I am feeling more than lost. I have found quite some tutorials on the web but they do not really help me - they explain nicely how to analyse perfectly prepared data and maps. But the dirty work to me seems completely uncovered. What I would like to do is the following   * For my country I have a Stata dataset on individuals and postcodes   * My second Stata dataset contains measurements and their coordinates   * For each individual I would like to know inverse weighted average distances to the x closest measurements I guess ArcGIS is well suited for this. I managed to load a proper basemap and a layer containing postcodes. Now I face the following questions and I do not really know where to begin. How do I have to format my Stata-files? In which format (dbase, personal geodatabase...) do those data have to be? I´m very willing to work my way through, but I just have no idea where to start. Do you have some reference to a tutorial or so where such topics are covered - and not just how to change a color? Thanks a lot!