Bringing GIS data into Minecraft

_A **little** off the beaten path...:_ Denmark has built a 1m:1block Minecraft World using real GIS data. Here's the home page, in Danish: http://gst.dk/emner/frie-data/minecraft/, and an ArsTechnica overview. How did they do it, and how might others do the same for their home- land/country/province/county/city/backyard? ![Screenshot](http://i.stack.imgur.com/Tr20Q.png)


How to hide map to print only the legend on a PageLayout?

If I'm printing a Pagelayout, is there any API for hiding the MapFrame or stop it from getting draw on the printout? I would like to only print the Legend on the paper.


Unrestricted codec for creating raster files with interior pyramids files

I'm looking for a tool that will allow me to mosaic a collection of images into a file format with performance similar to MrSID or ECW, but without the licensing restrictions that those formats come with. (I believe the .sid limit is 50 mb with the ECW limit is 500 mb). Unfortunately, the tool that I am working with doesn't recognize external pyramid files (.rrd) or .tif with internal pyramids. Does that leave me any good options?


How to create a pop-up box if a condition is true in a table? (ArcMap 10)

I'm creating a script that will grab layout data from a table for the current Building Number of the current building my map series is on. It works fine, but I need it to pop up a window if multiple entries exist in the table for that same Building Number. In this window I would need to be able to choose one of the entries identified by their BLDNAME attribute. Is this possible with arcpy or ArcObjects?


Find out if a point exists in an irregular shaped ILayer

Assuming I have an layer from a shape file which is not shaped like a rectangle how would I determine if a point lies within this layer?


GxFilterWorkspace allows a folder that is not a IWorkspace or IGxDatabase

I am trying to open a ArcGIS file browser. And For this, I used IGxDialog interface's DoModalOpen method. To specify what the user can select using a GxDialog browser is based on the filters (GxObjectFilter) held by the object. To browse workspace, I set ObjectFilter to GxFilterWorkspaces. But it allows folders that contains layers/feature classes/raster datasets that is not IGxDatabase or IWorkspace.                       IGxObjectFilter gxObjectFilter = new GxFilterWorkspaces();             IGxDialog gxDialog = new GxDialog();             gxDialog.AllowMultiSelect = false;             gxDialog.Title = title;             gxDialog.ObjectFilter = gxObjectFilter;             gxDialog.ButtonCaption = "Open";             gxDialog.RememberLocation = true;                  IEnumGxObject enumGxObject;             gxDialog.DoModalOpen(0, out enumGxObject);             while ((gxObject = enumGxObject.Next()) != null)             {                 if ((gxObject as IGxDatabase2) != null)                 {                     return gxObject.FullName;                 }             }      **Question:** What should I do to select only workspace through this browser? Or is there any other option to browse GIS dataset?


MSSQL spatial layer import error

I am currently working on a project in which spatial data are stored in a Microsoft SQL Server 2008 database. The tables which hold the spatial table contain 3 rows and are:               RoomId - BIGINT,      Description - VARCHAR(40),      Geometry - geometry.      I use QuantimGIS 1.8.0 for Windows and I use the tool for adding an MSSQL Spatial Layer. I succeed in connecting to the Server and I get a list of the tables which is as follows:               Schema: dbo     Table: tbl_lv1     Type: Polygon     Column: Geometry     SRID: 0     Primary key column: (empty)     Select at id: checked     Sql: (empty)      And when I click add, I get the following error:               dbname='gis' host='CAPDEV' user='qgisuser' password='*********' srid=0 type=POLYGON table="dbo"."tbl_lv1"(Geometry) sql= is an invalid layer and cannot be loaded      Why is this happening? Am I missing something? Thank you **Solved:** The solution was to add an auto-increment identifier to use as a primary key, because QuantumGIS needs a primary key attribute in order to import data.


QGIS field-calculator replace function

I've got a Shapefile containing contourlines which I would like to style differently according to their value. For that reason I created a field named "100s" where I would like to give values from 0=25m-lines, 1=100m-lines and 2=500m-lines. For doing that I tried the "replace" function with this syntax:               NAME="4600" OR NAME="4700" OR NAME="4800"  replace('NULL','NULL','1')      but QGIS gives the following error: " _syntax error, unexpected FUNCTION, expecting $end_ ". When I then set "$end, the error message is the same. Any suggestions how to resolve that? Thanks in advance, Ralf


Problems moving POSTGIS database from postgresql 8.3 to 9.3 using Navicat

I am using Navicat 11 to move a POSTGIS database from 8.3 to 9.3 on Mac OS X 10.9. I have installed PostgreSQL 9.3 and PostGIS with homebrew (brew install postgresql postgis) and everything looks ok. I then create the db locally with template "postgis_template". Then with Navicat I connect to the remote 8.3 PGSQL, choose the remote db and choose "Data Transfer", choose the remote db, schema public and the local db, schema public. When the transfer starts I get this error:               [Msg] [Dtf] Drop table: "geometry_columns"     [Err] [Dtf] Transfer Data [DROP TABLE IF EXISTS "geometry_columns";]:     ERROR:  "geometry_columns" is not a table     HINT:  Use DROP VIEW to remove a view.     [Err] [Dtf] Terminated      In PGSQL 8.3 there is a table "geometry_columns" while in 9.3 there is a VIEW with the same name. If I try to delete the VIEW in my new db I get an error that it is need by POSTGIS. Also after several tries I was able to delete the view but now I get this error and wonder if everything is transfered and if I have to do something:               [Msg] [Dtf] End transaction on target server     [Err] [Dtf] Transfer Data [ALTER TABLE "kulturminner" ADD CONSTRAINT "enforce_dims_punkt_geom" CHECK ((ndims(punkt_geom) = 2)) NOT DEFERRABLE INITIALLY IMMEDIATE;]:     ERROR:  function ndims(geometry) does not exist     HINT:  No function matches the given name and argument types. You might need to add explicit type casts.     [Err] [Dtf] Terminated      Any idea how to fix this?


gdalwarp from within python script misbehaving

I'm trying to run gdalwarp from within a python script                   start = "gdalwarp -overwrite -ts 22 20 -r average -srcnodata 99 "         input_file = filename[12:]         output_file = "temp1.tif"         print start + input_file + ' ' +output_file         subprocess.call([r'%s %s output.tif' % (start, input_file)],  shell=True )      Where `filename` changes iteratively (i'm batch processing and this is the first step). However when i run the script i get for example:               ERROR 4: `200301.h11v09.tif' not recognised as a supported file format.      But when i run the code on `200301.h11v09.tif` in terminal it works perfectly. I feel like it's something to do with python string substitution but don't know enough to figure out myself now. Any ideas?


Converting ArcGIS topology rules file (*.rul) to *.txt, *.csv or *.xls for reviewing?

Has anyone converted ESRI's topology rules file (.rul) into another format? I built a complex topology rules set and would like to QC it in something easier to read and work with than ArcCatalog. A text file and spreadsheet format would work great.


Free ServerContext has failed because the Wait Timeout Interval has elapsed

All, ESRI ArcGIS Server 10 SP4 logs below entry in log file. We have a single map service with 100+ layers which has Maximum time client can use a service is 600 seconds (10 min). I am really surpised when some of requests failed with below message. I could not understand (or believe) which request to map server is taking more than 10 min. Can some one throw some light on this. I read all ESRI documentation and forums , please help me with your experience or knowledge. Thanks a bunch. A request to obtain a free ServerContext has failed because the Wait Timeout Interval has elapsed.


How to request ArcGis geometries for specific bus routes including terminal numbers?

My app currently loads geometry data for all sub-routes under a route number. Here is the request: ` http://arcgis.metc.state.mn.us/ArcGIS/rest/services/transit/TIM_BusRoutes/MapServer/find?searchText=4&contains=true&searchFields=ROUTENUM&sr=4326&outSR=4326&layers=0&layerdefs=&returnGeometry=true&maxAllowableOffset=&f=pjson ` Route 4 has several sub-routes denoted by letters. For instance, this lists routes 4P and 4L: Bus Schedule Link In the API responses for departure times, the sub-route letters are denoted as "Terminal". How can I make a request that loads geometry for one of the lettered subroutes specifically? For instance, how could I request the geometry for route 4P ?


Problems in viewing ArcGIS webservice from MS Windows

We setup web GIS service using the combination of ArcGIS Server and Oracle. We put the spatial data in Oracle and use ArcGIS Server to publish the service. Currently we have a problem in viewing the web GIS from computer using MS Windows, but can view it using Ubuntu Linux and Mac OS X. If we view the service using MS Windows, sometimes all of the function works but most of times they fail. I would like to ask you if some of you had this kind of problem? If so, please kindly hint me to a solution. Thank you. Best regards, Firman Hadi. www.integrasiautama.com


ArcMap tables - copying multiple horizontal cells between rows

I would like to be able to select a contiguous set of horizontal cells in a row, take a copy, then paste the values into another row at the same position in the same table. I do not want to copy all the attributes, only a subset, but they are at least contiguous. At the moment I am doing a simple copy-paste cell-by-cell, and it is very time consuming, not to mention frought with error. If it were in a spreadsheet, it would be as simple as highlighting the group of horizontal cells, taking a copy, move the cell cursor down one cell, and then doing a paste. Is this possible without going through an export/edit/import process. Thoughts greatly appreciated. Barrie


MODIS image reprojection/ change coordinate system in ArcGIS 9.3

I have downloaded Utah state shapefile in `NAD_1983_UTM_Zone_12N` projection and also downloaded the MODIS image of the area (MOD09Q1) in .hdf format which has `sinusoidal projection`. the .hdf format was converted to .img using ERDAS imagine 2011. Upon adding these two layers in ArcGIS 9.3, the boundary shapefile does not fall on the image rather lies far away. I have also tried projecting the image to NAD_1983_UTM_Zone_12N...its still not working. Any suggestion on what to do...or wether i did the right thing??


How do you solve the map publishing problem with Geoserver 2.1.1 on Windows 7 x64?

Well, my problem is that i have geoserver installed over a windows 7 x64 system with both java (JRE 6u29) x32 and x64 installed and i can't proyect my layers on the website. The preview on geoserver works fine, but it doesn't work on my site ( it's a localhost server, a testing server) I have Apache + Openlayer + geoserver. I have tried Tomcat + Openlayer + geoserver (war) with similar results. The server status shows Jai libraries marked as false. I say this because i think the problem may be on the jai library. I searched about and found that JAI works only on x32 systems so i don't know how to solve this. I need to work with x64 architectures. I tried to install Jai over the x32 version of java but my server stop working after that. My local call to geoserver trough OpenLayer Instance is this:                <script type="text/javascript">          var mapa, capa;              function init(){             mapa = new OpenLayers.Map('mapwms');              capa = new OpenLayers.Layer.WMS(                 "Catastro",                 "http://localhost:8080/geoserver/Catastro/wms",                 {layers: 'Catastro:Predios'}             );                  map.addLayers([capa]);             map.zoomToMaxExtent();             map.addControl(new OpenLayers.Control.LayerSwitcher());         }          </script>      So i need to figure out why the geoserver preview is working and not my code. I'm new on this kind of softwares so i need some help I put "http://localhost:8080/geoserver/Catastro/wms" because that is how appear on the preview source code. I'll really appreciate your help please ;) NOTE: i've changed the question title to a more clearg one ;) * * * SOLVED: Thanks all for your help. I follow your advice and my server is now working.


Geoserver - tiles/grid offset

I would like to host an Openstreetmap server using Geoserver (Geoserver/GeoWebCache/postgis). However, I encounter a problem regarding the tiles and gridsets. TMS urls (myserv/z/x/y.png) are different than urls from openstreetmap.org or MapQuest. Furthermore, there is an offset on the y axis. The following url shows an area from my own server. The other url shows the same area from Mapquest. http://devmobicite.dnsroute.fr:8080/geoserver/gwc/service/tms/1.0.0/mapServer:mapOSM/14/16280/12392.png http://mtile01.mqcdn.com/tiles/1.0.0/vy/map/15/16280/11637.png The offset seems to be caused by the zoom level (here 14~=15) and by the y value (12392->11637). I hope my issue is understandable and that someone can help me. (Sorry for my english) Thanks Raphaël


How to create a MultiLineString feature with a postgis layer in QGIS

I have troubles handling with MultiLineStrings in QGIS. I added the table where I defined a column as geometry(MultiLineString, 31468) as a postgis layer in QGIS. Now I want to create features with multiple linestrings. When I finish to create the feature (with right click), then I have to insert an id (which is a value for another column in the table). So I have to create the next linestring feature and to assign the same id, to have a kind of a multiple linestring.               id  |  geom     1   |  "linestring1"     1   |  "linestring2"       I think this is not a proper way to work with multilinestrings!? I want to have this:                 id  |  geom       1   |  "linestring1" and "linestring2"      How can I create a MultiLineString in QGIS/postgis like this? ![enter image description here](http://i.stack.imgur.com/54mCY.png)


How to digitize a raster automatically

I have a raster (.sid extension) file. I want to digitize roads automatically in ArcMap, QGIS..etc. Digitizing by hand would be too time consuming. How can i do this ? Thanks ![I want to digitize roads automaticly](http://i.stack.imgur.com/IDGvx.jpg)


How to drape a simple jpeg image over dem of some area?

How can we drape a simple jpeg image which doesnot have any geo referencing information over the digital elevation model in order to visualize it in 3D in QGIS?


Dan Patterson's bounding containers

I used a toolbox by Dan Patterson () and the problem is that the new shapefile does not contain any field from my original shapefile and this is a problem because I can't join the two layers based on the unique id of my polygons.   Is there any way that I can do this in Python where the script is written in? I also post in ESRIS forum but I don't know how fast i can get an answer. Thanks


create table with IDs for all arcs downstream of all others

I need to summarize downstream information associated with each arc in an NHD dataset. I have a table with the downstream ID for stream segment but am not sure how to get all of the downstream IDs. Any ideas?


Extraction of raster cell values based on 'rgeos' and 'raster' buffering approaches in R

I am trying to extract cell values from a raster that lie within a certain distance from a given location (i.e. buffering). Evaluating different approaches, I found out that applying `gBuffer(..., width = 20000)` from package `rgeos` generally includes fewer cells than `extract(..., buffer = 2000)` from package `raster` for one and the same buffer width. Does anybody know what's the difference between these two approaches? Here's a reproducible example that comes close to my piece of code:               # Required packages     library(dismo)     library(raster)     library(rgeos)          # Sample raster data (and perform reclassification for clarity purposes)     germany <- gmap("Germany")     germany <- reclassify(germany, matrix(c(0, 200, 0,                                              200, 255, 1), ncol = 3, byrow = TRUE))          # Sample point shape data     nuremberg <- data.frame("lat" = 49.452778, "lon" = 11.077778, "city" = "Nuremberg")     # Set current CRS and reproject to raster CRS     coordinates(nuremberg) <- c("lon", "lat")     projection(nuremberg) <- CRS("+proj=lonlat +ellps=WGS84")     nuremberg <- spTransform(nuremberg, CRS(projection(germany)))          # Extract cell values using extract() only     nbg.val <- unlist(extract(germany, nuremberg, buffer = 20000))          # Extract cell values using gBuffer() and extract()     nbg.bff <- gBuffer(nuremberg, width = 20000)     nbg.val2 <- unlist(extract(germany, nbg.bff))      So far, so good. Now let's compare the results.               # extract() only     table(nbg.val)     nbg.val       0   1      118  91          # gBuffer() and extract()     table(nbg.val2)     nbg.val2       0   1      116  90      Of course, these are minor differences. However, using larger buffers and/or higher resoluted raster images, these discrepancies become larger and larger. Cheers,   Florian


How to calculate land cover inside the buffer zones?

In one Shape file I have created 1200 buffer zones Around coordinates. I created a field and calculated the buffer zones area in hectares. Then I clipped different landcover layers to the buffer zones. Now I want to calculate How many hectares of eg. Forest there are in Each buffer zone And afterwords the amount of felds, And so on. The calculations shall be done in model builder.. Can anybody help me please...?


How to create cost surface for least cost water transport analysis?

I am working on a project to derive least cost pathways between sites by dug out canoe travel. Has anyone worked on a similar project or found a function like the Tobler hiking function that can be used for water transportation? I am hoping to use ArcGIS 10.1 but I would be open to shifting to GRASS if that increases my options or coding with python.


Syncing Google Earth My Places data in OS X

Since Google hasn't implemented a sync service for Google Earth's _My Places_ data, I'm trying to make this work manually between my home and work computers, one OS X the other Windows. Windows side works fine - I've just redesignated the KML path in registry (`HKEY_CURRENT_USER\Software\Google\Google Earth Plus\KMLPath`) to a Dropbox. The problem's on the Mac side. I've tried replacing the myplaces.kml with a symlink, but this failed as the new object is somehow automatically overwritten by a backup (even when the backup in the same folder (`/Users/username/Library/Application Support/Google Earth/`) has been manually deleted). So I'm trying by adding a 'Network Link' folder to My Places, linking to the dropbox kml. This half works - edits from Windows side load up in Mac side, but edits/additions in Mac side placed in the networked folder are not saved upon exit. Does anyone know the reason for this failure to sync, or of an alternative method that works on OS X? Thanks in advance.


Flagging when point feature(s) covered by tables (made as graphics) using ArcPy?

I've set up data driven pages to create a series of maps, but I'm running into a problem which seems like it would be quite common! I've made some tables (as graphics) using ArcPy and the technique described an Answer to another Question: How to add Table to Layout View using ArcPy?. However, with a series of maps, sometimes these graphics will cover my points layer. Does anybody know how to (at least) flag when a point is hidden by my tables?


How to Georeference a tiff with correct coordinate system

I am having difficulty in georeferencing an existing tiff (already has georeference information - but is out of alignment). Using the georeference plug-in I can create the map's GCP in the 4 corners and run the transformation (using WGS84). However, even trying other transformations I get a map that is not georeferenced to the Lat & Long. The Lat / Long of the original map shows 26.00, -25.00 (top left corner), the georeference after transformation is 974, -747. How can I get the transformation to reflect Lat / Long as per the original georeference as all I am trying to achive is a re-aligned map?


Trilateration using two or three points

We have a positioning system where we can measure our range without 0.1m from multiple beacons. The placement of the beacons is about on a 1-2km box. So we could get anywhere from 2-4 ranges from the beacons. The beacons are surveyed in place to an accuracy of about 1m. We found the PHP code for the range case: Trilateration using 3 latitude and longitude points, and 3 distances and we're testing this in our "C" program w/ double precision math. Questions: We're looking to get the most accurate position projection in LAT,LONG over a short area say max range up to 2km. What's the best aproach to get the least errors in the solution math? How big will the position errors be in meters? Is there a code example of finding the two solutions in lat,long is we only have 2 ranges?


How to calculate a new bounding box that is 80% of the actual bounding box returned by google map?

I need to show a marker for each user that falls within the visible portion of google map. To do so, I get the bounding box from google map, and send it down to the database and I receive a list of users that fall within the box. Then loop through the list of users and place a marker on the map for each user. All works well, however, if the lat/lng falls just bellow the top border, then only the bottom of the marker is visible. If the lat/lng falls next to the side borders, then only 1/2 of the marker is visible. One way to tackle this problem is to send a reduced version of the bounding box to the database. This way, you'd have a bounding box with margins, but you don't show anything within the margins. Now, what is the best way of shrinking down the bounding box before sending it down to the database? Is there any better way of doing this? Check the image, 1/2 of the marker is hidden. (top) ![enter image description here](http://i.stack.imgur.com/QpWiP.png)


What to do about Geoserver WPS Warning "Could not get a ServiceInfo"?

This is the warning i am getting when i try to use this WPS service from QGIS, and the processing take a long time, but doesn't terminate, what might be the problem?               17 Oct 12:33:25 INFO [geoserver.wps] -     Request: getCapabilities            service = WPS            baseUrl = http:// localhost:8080/geoserver/        17 Oct 12:33:31 WARN [geoserver.ows] - Could not get a ServiceInfo for service wps                                            thus could not check if the service is enabled        17 Oct 12:33:31 INFO [geoserver.wps] -     Request: describeProcess            service = WPS            version = 1.0.0            baseUrl = http:// localhost:8080/geoserver/            identifier[0]:               value = gt:VectorToRaster


How to export objects from wikimapia to openstreetmap?

How to export objects (buildings, houses) from wikimapia to openstreetmap? What is the way?


Adding Geometry column in Postgis

while i'm adding a geometry column in postgis by using **AddGeometryColumn** then the error is > no function matches the given name and argument types. you might need to add > explicit type casts Please Explain clearly Thanks in advance.


Where can I get information on QGIS beta versions?

While searching for information on some qgis functionality on the web, i noticed several times, people using version 1.9, however this version is probably some beta (or so i thought) but i cant seem to find a download/site of it anywhere. Then, on some other site someone wrote thats a development version of 1.7.4. Wiki site lists only official versions, but i want to know, is there a site where some beta previews are available? google search yields nothing useful under 'qgis beta', 'qgis 1.9' Thanks


Proper use of Modulus "%" operator in ArcMap

# Objective: Gather pour points to define a specific-sized watershed. In this case, 1000 pixels. (for this thought exercise, watershed is to mean any point that flows through a pour point, regardless of size, not the NHD definition) # Layers: DEM, flow direction, flow accumulation, the like. Flow accumulation symbolized with 1/2 standard deviations on top of the DEM:![flow accumulation map](http://i.stack.imgur.com/Dg92o.png)   My mathematician brother suggested the use of the modulus operator, which returns the remainder of a division problem, thus allowing something like `Con(("flow_accum" % 1000) < 10, 1, 0) in the Raster Calculator.   Theoretically, this should return a blip in the stream every thousand pixels of flow accumulation, but it doesn't.   What just the modulus ( just "flow_accum" % 1000) returns is this:   ![modulus map](http://i.stack.imgur.com/nSwFq.png)   I do not know how to interpret this. It should have low values for all pixels that are not near a X,000 but it appears to have just done some sort of rescaling to 1000 or something.   I did a manual selection of the first 12 watersheds with:               Con(("flow_accum" == 1000), 1, Con(("flow_accum" == 2000),2, Con(("flow_accum" == 3000)     ,3,Con(("flow_accum" == 4000),4,Con(("flow_accum" == 5000),5,Con(("flow_accum" == 6000)     ,6,Con(("flow_accum" == 7000),7,Con(("flow_accum" == 8000),8,Con(("flow_accum" == 9000)     ,9,Con(("flow_accum" == 10000),10,Con(("flow_accum" == 11000),11,Con(("flow_accum" == 12000)     ,12,Con(("flow_accum" == 13000),13,Con(("flow_accum" == 14000),14,0))))))))))))))      Which after running the watershed tool, returned this:   ![manual watershed delineation](http://i.stack.imgur.com/xxsMU.png) # What I need help with is making sense of the output of the modulus function, and defining arbitrarily-sized watersheds.


Regarding property setMinScale(scale) and setMaxScale(scale) in ArcGIS Java script API

I am new to programming in JSAPI. I have two dynamic layers and I want to set the property setMinScale(scale) and setMaxScale(scale) to layers so how do I Set ? ex. I tried using layer.setMinScale(0) but its not working any help would be appreciated.. thanks in advance : )


Hashing functions for GIS data

I would like to take geometries from a vector dataset and reduce them to a hash. This hash would then be used to verify the integrity of that data and also identify identical geometries. Do any appropriate algorithms exist that could be used? What pitfalls could I encounter?


Clipping Buffers

I have buffered a line shapefile where many lines are intersecting but not broken at intersections. I am trying to select each record in the buffer file and clip all intersecting polygons in the same layer. Hoping this can be done in Python, but I am a real beginner.


Picture fill symbol fails with a polygon graphic

The following code snippet successfully draws a graphic polygon and fills it with the specified picture fill symbol. When the x values for all of the points are made negative and a repeat call to the snippet is made, the polygon is symbolized but it is not visible. However, when you grab one of the resizing grips of the polygon graphic and stretch it a little the symbolization becomes visible. Can anyone vouch for this behavior? Is this a bug with ArcGIS maybe? I'm completely baffled etc.               Dim pGC As IGraphicsContainer     pGC = pMap          Dim oPoint As IPoint          Dim pPolygon As IPointCollection     pPolygon = New Polygon          oPoint.PutCoords(150, 120)     pPolygon.AddPoint(oPoint)          oPoint = New ESRI.ArcGIS.Geometry.Point     oPoint.PutCoords(160, 120)     pPolygon.AddPoint(oPoint)          oPoint = New ESRI.ArcGIS.Geometry.Point     oPoint.PutCoords(160, 115)     pPolygon.AddPoint(oPoint)          oPoint = New ESRI.ArcGIS.Geometry.Point     oPoint.PutCoords(150, 115)     pPolygon.AddPoint(oPoint)          oPoint = New ESRI.ArcGIS.Geometry.Point     oPoint.PutCoords(150, 120)     pPolygon.AddPoint(oPoint)          Dim pElement As IElement     pElement = New PolygonElement     pElement.Geometry = pPolygon          Dim pFillShapeElement As IFillShapeElement     pFillShapeElement = pElement          Dim pPictureFillSymbol As IPictureFillSymbol     pPictureFillSymbol = New PictureFillSymbol     pPictureFillSymbol.CreateFillSymbolFromFile(esriIPictureType.esriIPictureBitmap, clsAppHelper.GetArcGISInstallDir & "styles\pictures\smallwave.bmp")          pFillShapeElement.Symbol = pPictureFillSymbol     pGC.AddElement(pElement, 0)     pMxDoc.ActiveView.Refresh()


How to install the Python module shapely for QGIS use?

I'm using QGIS 1.8.0 on a Mac with OSX 10.6.8 (Snow Leopard). I've installed QGIS including GDAL, GSL, UNIXImageIO, Freetype, and Matplotlib all from www.kyngchaos.com. When installing the plugin Contour I get the error that the Python module `Shapely.geometry` isn't present at my system. So I have to conclude that this module isn't a part of QGIS nor of Matplotlib and also not of the plugin Contour. Where do I find this module and how do I install this on a Mac? I'm new to a Mac. In Windows this isn't a problem, everything works correct, also the Contour plugin.


traversing KML files with ogr python

i'm new to OGR processing and KML format so be gentle: i've got a series of KML files all containing multiple regions partitioning a larger area in each. i also have a series of geocoded points for which i want to ask `WITHIN/CONTAINS` queries with respect to the regions. two questions:   * i don't know how to ENUMERATE all the regions/placemarks contained in the file. [UPDATE:] thanks to this hint i guess i can get what i want via a JSON encoding:              drv = ogr.GetDriverByName('KML')     inf = 'path/file.kml'     ds_in = drv.Open(inf)     featureTbl = {}     for kml_lyr in ds_in:         for feat in kml_lyr:             ftbl = eval(feat.ExportToJson())             fname = ftbl['properties']['Name']             geom = ftbl['geometry']             featureTbl[fname] = geom      but there must be a better/XML-parse-like way to get "child" placemark elements?   * since i know the point will only be in one of the regions, i wonder if it is worth the effort of first computing region centroids and asking the `WITHIN/CONTAINS` query of the regions in order of their proximity to the point, rather than just dumbly enumerating all the regions and asking until i get a hit?


How to convert geometry to WKT using ArcPy?

I would like to be able to convert a single feature (or potentially many features) in an ArcGIS layer into Well Known Text (WKT) format during a geoprocessing operation using Python and ArcPy (no non-ArcPy modules). The purpose is to then pass the WKT on to SQL Server Spatial and do additional processing outside of the ArcGIS GP toolset. Is there a method for converting a ArcGIS geometry features to WKT via ArcPy? I have already read the following, without finding what I am after:   * Shapefiles to Text (references a tool in the deprecated "Samples" toolbox)   * Convert between ESRI Geometry and WKT (uses ArcObjects or non-ArcPy modules)   * How to convert a shapefile to WKT? (Uses QGIS and OGR) There apparently used to be a tool called "Write Features To Text File" (which appears to be a Python script) that was in the Samples toolbox, but that toolbox was deprecated at version 10 and I cannot find a copy of the Samples Toolbox (I have v10.0) on my machine. If there are no current solutions, if someone could just point me to a copy of the sample, I would be totally fine with using that tool, too.


Convert KMZ image to UTM projection jpg file

I have some KMZ files that are basically aerial imagery that has been referenced to Lat/Long. I would like to convert them to a projected UTM coordinates such as NAD 83 in a geo-jpg format. I was hoping to use QGIS or some low cost method. I can't seem to get these KMZ files into QGIS to start with. If I change the file extension of KMZ to a zip, I see both the KML file and then a folder with the unprojected jpg file. QGIS just says it doesn't support or it's not valid format both the KMZ as raster format or the KML (with attached jpg) as a vector format. Any ideas what I could do here?


1-band raster colour table workaround in QGIS

Does anyone know what the workarounds are for the 1-band raster colour table plugin in QGIS? Currently I find it will run once, then crash on the second iteration. The workaround I use is to delete the two files which the plugin creates in the directory of the raster - *.aux.xml and *.bccPAL1. After this I find I can run the tool again. Both Wroclaw and trunk. But is there something I am overlooking, a simpler workaround? cheers


Classify trajectory compression algorithm

I'm tryng to classify each compression algorithm based upon their features, i've thinked:   * Compression algorithm      * Lossless algorithm        * Batched algorithm          * Rinex     * Lossy algorithm        * Batched algorithm          * Uniform sampling         * Douglas-Peucker         * Bellman       * Online algorithm          * Opening window       * Hybrid algorithm          * Threshold algorithm Do you agree with me? How can I improve this chart? The main division is among lossless and lossy or batched and online? Exist an online lossless algorithm? Best regard


How to Edit Popup using Openlayers Text Layer?

I am creating a map with about 1000+ points using Openlayers. Currently when I click on one point's icon, the description for the point shows up in a popup, and to exit the popup I need to click on the same point's icon again. Is there a way to modify the code for this so that I can press a close button or I can click anywhere on the map so that this popup will close again? I know there is a way if I am just using a regular popup but I am using an Openlayers.layer.text layer.               var pois = new OpenLayers.Layer.Text( "Frequencies",                 { location:"./frequencyrange.txt",                   projection: map.displayProjection                 });         map.addLayer(pois);      I use this code to add the text layer. Within the text file would be the following columns: lon lat title description icon iconSize iconOffset. Is there another column that I should add for the popup? I have tried a column that was supposed to modify the size of the popup but it did not work for me. So, so far I have not been able to modify the popup except for what is in it.


Identity tool FID column name gets cut off

After my ArcMap extension executes the Identity tool, the resulting identity shapefile has FID columns for the "input features" FeatureClass and the "identity features" FeatureClass but the column names get cut off. I need to access these columns when looping through the identity shapefile later. I thought I could find the field by name to get the column index but I never know what they are going to be called. It is "FID_" plus some part of the input's name but the column name string is too short to just compare the strings. The inputs might have similar names. If I do this manually in ArcMap, it does not cut off the names. The column name will be 'FID_" plus the full name of the input feature FeatureClass name. Is there a way to set what the FID column names will be?


Commit Feature WPS Split process

I develop a WebGIS application with GeoServer (2.1.1) and GeoExt (with the last version of OL). Data (polygons features) are stored in a postgis DB. I've implemented editing tools that allow users to add/delete and modify features and their attributes directly on-line. It's work fine. Now, I add a new control for splitting polygons in two (or more) parts. It's possible with the GeoServer's split polygon WPS process (gs:SplitPolygon). I've followed the tuto here (http://blog.opengeo.org/2012/07/24/splitpolygon- wps-process-p2/) and implemented the tools on my appl. For information, this is the code I've used:               function handleSplitDraw(event) {     var splitter = event.feature;     var features = map.layers[2].features;     var candidates = OpenLayers.Array.filter(map.layers[2].features, function(feature) {     var hit = false;         if (feature.geometry.intersects(splitter.geometry)) {             hit = true;         }         return hit;         });     var candidate;     for (var i=0, ii=candidates.length; i<ii; ++i) {         candidate = candidates[i];         if (candidate.geometry.intersects(splitter.geometry)) {             map.layers[2].removeFeatures([candidate]);             executeSplit(candidate, splitter);         }     }     return false;}     var wktFormat = new OpenLayers.Format.WKT();     var wpsFormat = new OpenLayers.Format.WPSExecute();     function executeSplit(poly, line) {           var doc = this.wpsFormat.write({         identifier: "gs:SplitPolygon",         dataInputs: [{             identifier: "polygon",             data: {                 complexData: {                     mimeType: "application/wkt",                     value: wktFormat.write(poly)                 }             }         }, {             identifier: "line",             data: {                 complexData: {                     mimeType: "application/wkt",                     value: wktFormat.write(line)                 }             }         }],         responseForm: {             rawDataOutput: {                 mimeType: "application/wkt",                 identifier: "result"             }         }     });         OpenLayers.Request.POST({         url: "http://localhost:8080/geoserver/wps",         data: doc,         success: function(response) {             handleSuccess(response, poly);         }     });}     function handleSuccess(response, poly) {     var features = wktFormat.read(response.responseText);     if (features && features.length > 0) {         map.layers[2].addFeatures(features);     } else {        // map.layers[1].addFeatures([poly]);     }}      Control:               var drawLine = new OpenLayers.Control.DrawFeature(map.layers[2], OpenLayers.Handler.Path);       mapPanel.map.addControls(drawLine]);      WFS definition:               saveStrategy = new OpenLayers.Strategy.Save();     wfs_layer =     new OpenLayers.Layer.Vector(             "Editable plot Layer",              {             styleMap: WFSStyle,                 eventListeners: {                     sketchcomplete: function(event) {                             var proceed = true;                             if (event.feature.geometry instanceof OpenLayers.Geometry.LineString) {                                 handleSplitDraw(event);                                 proceed = false;                             }                             return proceed;                         }                     },                     visibility: false,                     strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],                         projection: new OpenLayers.Projection("EPSG:4326"),                         protocol: new OpenLayers.Protocol.WFS({                             version: "1.1.0",                             url: "note_url",                             featureNS :  "FNS",                             featureType: "fname",                             geometryName: "the_geom",                             extractAttributes: true,                             schema: "myschema"                         })                     }             ),      The process work very fine. I can split polygons by line and splitted features are added on my map. In FB consol, I receive a correct response (Geom Collection). Now, I would like to save back these changes (splitted polygons) to GeoServer. How can I do this? Can I use the WKT response and save the Geometry on a GeoJSON File (for example) for update the database? Do you have any idea of this step? Thanks very much Geoffroy


Save longitude and latitude in Django

I had plotted a Javascript gMap.Using the marker,the values of latitude and longitude are displayed.I need to get that values and save it to database.What is the best way to do this and ,How to accomplish this. In model,i created both field as CharField.I want to know how Python get the values from HTML and save.


Label callouts in QGIS

Has anyone been using callout labelling with QGIS, either trunk or stable? Used for clustered points. That means the point stays where it is, the label maybe moved if required and a leader (plain or pointed) shows the linkage between the label and the point. How could I do it (you know what I mean, no coding....)?


Simple WebMapping application with postgis Database

am very new to web-mapping, so this question may be a little misguided. I want to develop a simple web mapping application using OpenLayers which can display Cadastral information that are currently in PostGIS(2 tables: property and boundaries). I want this to be as simple (and as low maintainence) as possible: -Use java for developping -The user can search a parcel by 4 fields (name, indice complement and nature) existing in table : "titre" -and then the user can generate the an A4 sheet for print that contains the title/property plan and also a table containing the name, X and Y of boundaries of title/property from the second table : "Boundaries" -Styling of the vector layers is of minimal importance. PS: i tried to use the library geotools with applets but i have a problem with versions, because the tuto that i used is old 2004, and i couldn't find the old version 2.1 on the net, i only have 2.7


Need help with the creation of add-ins for arc map

How to find the coordinates x and y of the point when you click on the map? I'm creating a new add-in to the arc map. When you create the add button and I chose dockable window. In dockable window I have a green button when it is clicked, and then the map should I get x and y coordinates on the map? ![enter image description here](http://i.stack.imgur.com/bJTh6.png)


Data format for checking a land survey deed

A commercial property is in the closing phase of sale and the only hold up is that the deed description is one that's been lifted from prior deeds dating back to the 1950's and is obviously erroneous. A 1992 survey does appear to properly depict what the Seller's have to convey and both Buyers and Seller agree that the aforementioned survey be the basis of description in the new deed and title policy if ...it plots out in reasonable fashion in Copan. But, after spending six hours trying to get a result (closure error, or an additional call necessary to close) and a graph, I have been unsuccessful. format I've used is:               Map Traverse     1 degrees distance tab tab tab     2 degrees distance tab tab tab     3 degrees distance tab tab tab     1 degrees distance tab tab tab      That produced a bizarre graph, so I tried making the first call               Map Traverse     1 0.0 0.0 tab tab tab      Then I get an error message saying in effect "insufficent tabs" and use cut and paste to provide missing tabs. * * * My data:               1                        2   354.0847    129.65               3    84.4149    117.82               4   352.2410     69.78               5   309.4352     82              6    37.1300     55              7   307.4700     61              1   276.5342     95.62                * * * The original survey plat: ![enter image description here](http://i.stack.imgur.com/aUqRq.png)


Show categories in QGIS

I have a .csv file pointing at coordinates. It is a large file that is edited often. In it, I have three groups of data (say A, B, and C). Within each group there are a number of Names, and each name has ten sets of coordinates. I would like to keep all of this data in one spreadsheet. How can I set the categorization in QGIS to show each Name with it's own colour from only Group A? I hope to create three layers, one for each group, all pointing to the same .csv file. I think I need to do this in the Expression dialog box but can't seem to work it out! Any help appreciated. For example: `NAME,GROUP,Easting,Northing Orange,A,, Orange,A,, Orange,A,, Orange,A,, Orange,A,, Orange,A,, Red,B,, Red,B,, Red,B,, Red,B,, Blue,C,, Blue,C,, Blue,C,, Blue,C,, Blue,C,, Blue,C,, Blue,C,, Blue,C,, Green,B,, Green,B,, Green,B,, Green,B,, Green,B,, Green,B,, Violet,C,, Violet,C,, Violet,C,, Violet,C,, Violet,C,, Violet,C,, Violet,C,, Violet,C,, Violet,C,, `


Issue with vertex level editing in ArcScene

I have a 3D data set of some buildings in ESRI Shapefile MultiPatch format. The buildings appear in 3D in ArcScene (10.2.1 on Windows 8.1 64bit) and I am able to move, rotate and scale buildings. However when I select a building in an editing session and I go to vertex editing, if I try to edit any of the vertices of my building I am presented with a 'Select a single editable feature to modify' prompt. I am unable to work out why I can't edit at vertex level for this set of buildings. ![A depiction of the error that I'm getting](http://i.stack.imgur.com/xkZ7o.png) In addition clicking on the building appears to make it disappears until I select another building and the original building reappears. Anyone have any thoughts about this issue?


Wich is the way to create serial field following alphabetical order with QGIS?

I have a field with names, a string field, and I want to create another one with serial content following the alphabetical order. I have this:               --------     |Field1|     --------     |  B   |         --------     |  C   |     --------     |  A   |     --------     |  D   |     --------      And I want to reach this:               -----------------     |Field1| Field2 |     -----------------     |  A   |    1   |     -----------------     |  B   |    2   |     -----------------     |  C   |    3   |     -----------------     |  D   |    4   |     -----------------      How can I reach it using the fiel calculator of QGIS? Any idea??? Thank you!!!


How to change 0,360 WKT string to -180,180?

I'm reading POLYGON WKT strings using OpenLayers.Format.WKT().read(). The polygons use 0,360 longitudes but my map is -180,180. When I display the polygons on the map they are displayed outside of the map. How can I display them on their correct location? I tried OpenLayers transforms and Proj4js transforms (plus defining the 0,360 CRS using +lon_wrap=180) but nothing seems to work! Help would be appreciated ;-)


Use arcpy.da.searchcursor to select rows to dissolve

I'm quite new to ArcGIS and hope someone can help me. I have one table that lists which polygons are contiguous with each other called BLPUsCavPlaceContigBLPUs that looks like this:               OBJECTID   blpuid  contigid  shape-length         1         1        7          38         2         1        16         42         3         2        8          14      I then have a table of all the polygons called BLPUsCavPlace where the objectID is the blpuid and contigid:               OBJECTID   SHAPE   SHAPE_length  SHAPE_area         1     polygon    126.846       986.093      Therefore I know which can merge with which, such as 1 and 7. I want to iterate through the first table, and for each row the cursor will take the blpuid and contigid and select these rows (OBJECTIDs) in BLPUsCavPlace, then it will dissolve them and add them to BLPUsCavPlaceDissolved. So it would look at BLPUsCavPlaceContigBLPUs and select 1 and 7 in BLPUsCavPlace, then it would do the next row etc The end result is that I have a polygon layer that contains all the possible dissolved polygons for each polygon within BLPUsCavPlace i.e. 1 + 7, 1 + 16, 2 + 8 I've been looking at arcpy.da.searchcursor which could retrieve the field values, but how would I then use the blpuid and contigid to select the rows in BLPUsCavPlace? Any help is greatly appreciated!! so i can run this:               fc = "BLPUsCavPlaceContigBLPUs"     fields = ["blpuid", "contigid"]          with arcpy.da.SearchCursor(fc, fields) as cursor:         for row in cursor:             print("{0}, {1}".format(row[0], row[1]))      to get the field values, i then want to take the two values and use both as objectid in the other table and run dissolve on them


Code in python for arcgis to select multilines (path) and vertexes

I am learning to write a python code for ArcGis 10.2. Need help!   1. I have some shp poly lines file, need to learn how to write multiple selection of those lines, even if a cursor of mouse pressed not exactly on line but near of it.   2. By selecting one vertex, on the cross place of lines should be selected all the vertexes. Will be thankful for all ideas of algorithms and methods, or reading materials, since I am not good familiar with programming algorithms, but I know the Python. Thanks in advance!


Adding UTM Zone Number to Coordinates

The computer program that I'm working with requires an 8 digit UTM Easting for the coordinates of shapefiles (i.e., the UTM zone number must be included with each coordinate within a shapefile). The program was designed in Europe and considers all of my shapefiles to be extremely far away, due to the two "missing" digits. I'm using ArcMap 10.1 and also downloaded Quantum GIS, as the individual I'm working with overseas suggested that QGIS could add the UTM zone number to the coordinates. I haven't found any way to do so, so if anyone has any ideas, I'd be very grateful. Thanks in advance!


Network segment gaps, when offset

I'm having an issue when offsetting a line shapefile. For some reason when the lines are offset, ArcGIS isn't drawing some segments although the segments are there confirmed via “identify”. Has someone come across a similar problem? why is this happening and how does it get resolved? Thanks for the help


Quantum GIS returns "Invalid Layer" message when trying to add Postgis view

I'm new to Postgis and Quantum GIS. I created a view defined as               CREATE OR REPLACE VIEW pupr.vstudentmuni AS       SELECT m.id AS munid, m.name AS muname, m.geom, s.code,          (s.name::text || ' '::text) || s.lastname::text AS fullname        FROM pupr.municipio m, pupr.student_location l, pupr.student s       WHERE st_within(l.geom, m.geom) AND s.code = l.code;      in PostgreSQL. Trying to add this view to QGIS returns the following error...               "Invalid layer"..."sql= is an invalid layer and cannot be loaded."      Not sure what the problem is. The table is mentioned in the `geommetry_columns` table in PostGIS, but I can see a message entry in QGIS that says "No key field for given view". I'm using PostgreSQL 9.2 and Quantum GIS 1.8.0.


OpenLayers Protocol specification

Is there a specification for the protocol OpenLayers uses to communicate with the server? I'm trying to reverse engineer what happens on GET, POST, PUT and DELETE, but I don't like to do it this way. Example:               var vectorLayer = new OpenLayers.Layer.Vector("Vector Layer", {         protocol: new OpenLayers.Protocol.HTTP({             url: '...',             format: new OpenLayers.Format.GeoJSON({})         }),     });


No Postgis after installing opengeo suite

After the installation of the opengeo suite; everything seems to work fine, except for the postgis extension of postgresql. In the dashboard all the postgis options are greyed out. The system is running Ubuntu 12.04 (Precise) LTS Bare OS. Is there a way to install postgis afterwards with the templates from opengeo?


arcpy calculate zero number instead of negative number

I want to develop a model using python.When i want to calulate negative numbers using the model,my script get zero number. Whats wrong in my script ? How can i solve the problem ? Thanks for advance               import arcpy     from arcpy import env     env.overwriteOutput = True     env.workspace= r"D:\ppa_test\test.dbf"     arcpy.AddField_management(r"D:\ppa_test\test.dbf",'cf',"Float")     updatecursor = arcpy.UpdateCursor(r"D:\ppa_test\test.dbf",["ppa","pps",'cf'])          for update in updatecursor:         if update.ppa < update.pps:             update.cf = (update.ppa - update.pps) / (update.ppa * (1-update.pps))         elif update.ppa>update.pps:             update.cf = (update.ppa- update.pps) / (update.pps * (1-update.ppa))             updatecursor.updateRow(update)     del update     del updatecursor      ![enter image description here](http://i.stack.imgur.com/lqbTI.png)


Create buffer-lines in QGIS alongside Vector lines

I am currently doing a map of a farm, to see which roads needs to be repaired. Those roads are either one sided fenced, on both sides fenced or not fenced at all. I want to make buffer lines around the already mapped roads (vector lines), which have fences. Something like this: I hope this is possible to understand. Of course I can draw additional lines alonside those paths... but this is a hellofa work. I work with QGIS :) Thanks for your help in advance! Lukas


summing up over an area based on a distance related function

Through a field study, we learned that the density of a bird species in the forest was related to the distance to forest edge: `ln(density) = 1.89*(distance to edge) + 0.34` Now, for any forest polygon, how can we estimate the number of birds in it based on above equation? I thought of using raster approach, dividing the forest into many grids, calculating, and summing up. But as the forest polygons are highly irregular in shape, there are many "incomplete" polygons. The size of the grid cell and the origin of the grid system influence the output as well. I wonder if there is any approach to this problem using polygons directly? Many thanks for any discussion!


Every time I use the Distance Matrix my program stops responding

I get to the point of having all of my information in QGIS, and am attempting to save a .csv file in the Distance Matrix. I browse to an output distance matrix, click ok, the bar fills up to 100% and then stops responding. Any suggestions?!


How can I generate a fishnet grid and a matrix of percentage of overlapping in R?

I'm trying use R for create a fishnet grid like in arcGIS with many cells of same size. In the arcGIS 9.3 we have the option of create a polygon with many small square polygons (eg. 1 x 1 degree of lat and long) in the extent of our study area using the tool 'create fishnet' (http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Create_Fishnet_(Data_Management)) and after aply the tool 'Feature to Polygon' to transform the polygon lines in square polygons. Other option is use the “Hawth’s Tools” extension and acess the “Sampling Tools” -> “Create Vector Grid (line/polygon) but the extension only work properly until arcGIS 9.2. Then I want create the fishnet grid (polygon with many regular squares) and after calculate many percentage of overlap of some polygons to each cell of the fishnet and create a matrix with each cell in lines and each polygon in the columns, like this matrix. Any idea? Thanks!


r.series command in QGIS - timeseries

I am using r.series command in qgis. The command is performing correctly, but when I import input raster files, it creates a list in a random order. Sometimes the order of input rasters is essential to the outcome. Is there a way to control the list of input rasters? the order of raster is random thanks


Synchronizing Changes From File Geodatabase to SDE Geodatabase

I have an SDE geodatabase that has a one way replication to a file geodatabase, where I will make edits to the feature classes offline somewhere. I know that this scenario doesn't support one-way or two-way replication, so is there anyway I can push the updates I made in the file geodatabase back to the SDE geodatabase?


Is there a way to access the GeoProcessing tools in QGIS, in code? I want to find the Difference between two layers and make a new shapefile with the result.It can be manually done by selecting vector->GeoProcessing Tools->Difference. But how to do it in my code? (I use python) Please help me to find a solution to this problem


Gdal_translate and transparent rasters in PDF

I am trying to make an application that creates geospatial pdf's from my website, but i am encountering problems with Gdal_translate and transparency of rasters. The setup that i am working up against is based on Mapserver, creating wms services. These services are created with image/png properties, and a predefined transparency. I would like to be able to combine these wms serices on top of a basemap in a geospatial PDF, but when i combine the layers with Gdal_translate, the transparency on the individual layers are lost. When i call the layers individually with Gdal i am quite sure the transparency is present, so i assume that the problem occurs in the process of making the overlays in Gdal. Have anybody experimented with this usage of gdal_translate against Mapserver - and have succeded in creating transparent overlays from rasters ?? Thanks in advance


GIS and Public Health

I am starting to research on the topic related to use of GIS in Public Health. I have started with Wikipedia articel http://en.wikipedia.org/wiki/GIS_and_public_health   I would like to apart from epidemic spread of disease, what are the other application areas? Currently active research groups/universities working on these topics? WHO projects? Resources that would help students researching in this area?


Convert list of coordinates to OGRGeometry or WKT

I am using a Visvalingam-Whyatt simplification script and the output is a list of coordinates such:               [[[[-10885205.10690245   3525662.26531131]        [-10885369.01690829   3525374.0741439 ]        [-10885424.08206484   3525269.35422813]        [-10885439.88685361   3525278.66051977]        [-10885600.07792469   3525092.02164548]        [-10885623.88512575   3525100.58301066]        [-10885627.28152936   3525101.52167386]        [-10885630.67801411   3525102.45679679]]]]      I would like to create OGRGeometry object from that list. Is there any function that can do that? Edit: A simple WKT would be correct.


How to represent bimodal attribute value distributions on a map

I'm looking for a visualisation method that enables me to represent bimodal or even multimodal attribute value distributions on line features. A bimodal distribution has two different modes that appear as distinct peaks in the probability density function (image #1). Mean, median and standard deviation values are of little use to describe such data. _#1 Example of a bimodal distribution:_ ![Example of bimodal distribution](http://upload.wikimedia.org/wikipedia/en/thumb/f/f2/BimodalAnts.png/800px- BimodalAnts.png) My use case is the following: For all road links in a network, I have associated speed measurements (many hundreds per link) in bimodal - sometimes multimodal (three modes) - distributions. Now, I'm looking for a way to visualize this data on a map. Besides attaching a bar diagram to each link, I haven't found any way to achieve my goal using a GIS. The visualisation results should be printable so animations won't do. _#2 Example visualisation using diagrams:_ ![Example road segments with bar diagrams](http://underdark.files.wordpress.com/2010/08/qgis_bimodal_bars.png) All ideas welcome!


How to export Select By Location result to Excel using Python and ArcPy?

I have been using ArcGIS for a few years now but have only started using Python scripting for ArcGIS for a month or so. I am trying to create a script and I am having a hard time trying to get it to work (Error after Error). In ArcGIS, I have used SELECT BY LOCATION and exported the selected records as a dBASE table into my file. I have been able to create the Python script to help me do this and also to convert it into an Excel file.               import arcpy          fc = 'Z:\\GIS TEST\\Codes\\Codes\\K.Dun\\Export_Output_2.dbf'     CSVFile = 'Z:\\Excel.csv'          fields = [f.name for f in arcpy.ListFields(fc)]          for i,f in enumerate(fields):         if f == 'Shape' or f == 'Shape_Length' or f == 'OBJECTID':             del fields[i]          with open(CSVFile, 'w') as f:         f.write(','.join(fields)+'\n') #csv headers         with arcpy.da.SearchCursor(fc, fields) as cursor:             for row in cursor:                 f.write(','.join([str(r) for r in row])+'\n')      This is fine but it requires me to manually use SELECT BY LOCATION and export the dBASE (.dbf) file before I run the script. Is there any script I can write that will allow to SEARCH BY LOCATION then export the selected records into an Excel file all in one go. I created a SEARCH BY LOCATION script but don't know how i would join them.               import arcpy     arcpy.env.workspace = "Z:\GIS TEST\Select_by_Location"          arcpy.MakeFeatureLayer_management('Bld_Locations.shp', 'Bld_Locations_lyr')      arcpy.SelectLayerByLocation_management('Bld_Locations_lyr', "WITHIN_A_DISTANCE",                                            'Breakout_Location.shp', "2000 Meters", "NEW_SELECTION")      Anyone have any ideas? Please remember my Python knowledge is very limited.


"add feature" tool QGIS 2.0 - polygon fill blocks view of what I want to digitize

How can I change the settings on the vector "add feature" tool so the tool fill doesn't block my view of what I want to digitize? This problem popped up after I upgraded to QGIS 2.0 !["add feature" polygon fill](http://i.stack.imgur.com/NQ4sG.png) QGIS 2.0 Macbook Pro OS 10.9


How to correctly use multipolyline with leaflet

I'm trying to represent one polyline with leaflet, then copy it in a multi polyline, empty the polyline, and fill it again with new data. I currently use something like:               l = polyline.setLatLngs(polyline.getLatLngs().push(line));


Opengeosuite 4 unable to open psql

When I try and open psql from the postgis menu in opengeosuite 4 on the Mac I get the following error message. “psql” can’t be opened because PostGIS is not allowed to open documents in Terminal. Anyone know how to cure this error.


postgis: no module named psycopg2

> **Possible Duplicate:**   >  psycopg2 error with QGIS 1.5 When I open DB Manager in QGIS I get what appears to be an error message at the bottom of the window:- postgis: no module named psycopg2 Can somebody help me with what is going on please and what I do next?


Where is the ArcGIS ServicePackFinder 9.3 utility found? I know it's for download, but no amount of trawling can find it.


TMS tile layer in ESRI ArcGIS iOS API

Great that this forum exists now. I hope it will thrive. Let me start by saying I did ask this particular question on the official iPhone SDK forum as well. I have seen a working example of a `TiledMapServiceLayer` subclass that overrides the `GetTileUrl(int level, int row, int col)` method to point to a TMS-compliant service. This is in the .NET API. I tried implementing               -(NSString *)tileURL:(NSInteger)level row:(NSInteger)row column:(NSInteger)column       and various variations but to no avail. Is there a workaround for this or does the ArcGIS iOS SDK just not support TMS?


OpenLayers, Get clustered point's val

I'm working on a map with WMS overlays and a lot of markers, my problem is when I try to calculate the average of points clustered, I've found how to differentiate the behaviour and the label text depending on the number of clustered elements, but I don't know how to reach the "val" value of every clustered point to calculate their average and show in the clustered point. I think values are into features.cluster array (if I look into it with .toString() I get different numbers of [object][object],[object][object] etc), but I can't understand how to reach those values. This is the context code:               context: {         val: function(feature) {             if(feature.attributes.count>1) {                [here I should show the average]            } else return feature.attributes.val;          },     [...]      And this is just some from the OpenLayers.Style code:               var pointStyle = new OpenLayers.Style({         strokeWidth: "${strokeFunction}",         fillColor: "${fillFunction}",         label: "${val}",         [...]      Don't think it's needed, but this is the point code where I set the val variable:               [...]     var pointFeature = new OpenLayers.Feature.Vector(point);          pointFeature.attributes = {              val: mks[i].m,              align: "cm"          };      (mks[i].m is the value I get from a JSON array, it's a number with decimals) I really appreciate any help you can provide, Alberto


why I can not run hibernate-spatial (in eclipse)

I have a problem with Hibernate Spatial.   I followed the tutorial 4.x, and I created my project using maven. after correcting some minor errors in pom.xml and in persistence.xml, executing the project (via mave) works perfectly. my **pom.xml** :               <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"              xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">         <modelVersion>4.0.0</modelVersion>         <groupId>org.hibernatespatial.tutorials</groupId>         <artifactId>event-tutorial</artifactId>         <packaging>jar</packaging>         <version>1.0-SNAPSHOT</version>         <name>event-tutorial</name>         <url>http://maven.apache.org</url>              <properties>             <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>             <hibernate.version>4.0.0.Final</hibernate.version>         </properties>              <build>              <!-- we dont want the version to be part of the generated war file name -->              <finalName>${artifactId}</finalName>              <plugins>                    <plugin>                         <artifactId>maven-compiler-plugin</artifactId>                         <configuration>                             <source>1.6</source>                             <target>1.6</target>                             <encoding>UTF-8</encoding>                         </configuration>                     </plugin>                  <plugin>             <groupId>org.apache.maven.plugins</groupId>             <artifactId>maven-dependency-plugin</artifactId>             <version>2.5.1</version>             <executions>               <execution>                 <id>copy-dependencies</id>                 <phase>package</phase>                 <goals>                     <goal>copy-dependencies</goal>                 </goals>                 <configuration>                     <includeGroupIds>org.hibernate</includeGroupIds>                     <outputDirectory>${project.build.directory}/dependency-jars/</outputDirectory>                          <includeGroupIds>org.postgis</includeGroupIds>                     <outputDirectory>${project.build.directory}/dependency-jars/</outputDirectory>                          <includeGroupIds>postgresql</includeGroupIds>                     <outputDirectory>${project.build.directory}/dependency-jars/</outputDirectory>                          <includeGroupIds>org.slf4j</includeGroupIds>                     <outputDirectory>${project.build.directory}/dependency-jars/</outputDirectory>                 </configuration>               </execution>              </executions>             </plugin>              </plugins>         </build>                   <dependencies>                  <!-- Hibernate Spatial for postgis. This will include Hibernate Spatial Core and JTS -->             <!--<dependency>                 <groupId>org.hibernatespatial</groupId>                 <artifactId>hibernate-spatial-postgis</artifactId>                 <version>1.1</version>             </dependency>         -->               <dependency>                 <groupId>org.hibernate</groupId>                 <artifactId>hibernate-spatial</artifactId>                 <version>4.0-M1</version>             </dependency>          <dependency>                 <groupId>org.hibernate</groupId>                 <artifactId>hibernate-entitymanager</artifactId>                 <version>${hibernate.version}</version>             </dependency>             <!-- the Postgis JDBC driver -->             <dependency>                 <groupId>org.postgis</groupId>                 <artifactId>postgis-jdbc</artifactId>                 <version>1.3.3</version>             </dependency>                  <!-- the postgresql driver -->             <dependency>                 <groupId>postgresql</groupId>                 <artifactId>postgresql</artifactId>                 <version>8.4-701.jdbc3</version>             </dependency>                  <!-- Hibernate uses slf4j for logging, for our purposes here use the simple backend -->                    <dependency>                        <groupId>org.slf4j</groupId>                        <artifactId>slf4j-simple</artifactId>                        <version>1.5.11</version>                    </dependency>              </dependencies>                   <!-- add repositories for JTS and Hibernate Spatial and Hibernate (JBoss) -->         <repositories>             <repository>                 <id>OSGEO GeoTools repo</id>                 <url>http://download.osgeo.org/webdav/geotools</url>             </repository>             <repository>                 <id>Hibernate Spatial repo</id>                 <url>http://www.hibernatespatial.org/repository</url>             </repository>             <!-- add JBOSS repository for easy access to Hibernate libraries -->             <repository>                 <id>JBOSS</id>                 <url>https://repository.jboss.org/nexus/content/repositories/releases/</url>             </repository>         </repositories>     </project>      and my **persistence.xml**               <persistence xmlns="http://java.sun.com/xml/ns/persistence"             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"             xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"             version="2.0">         <persistence-unit name="org.hibernate.events.jpa" transaction-type="RESOURCE_LOCAL">            <properties>                <property name="hibernate.dialect" value="org.hibernate.spatial.dialect.postgis.PostgisDialect"/>                     <property name="hibernate.connection.driver_class" value="org.postgresql.Driver"/>            <property name="hibernate.connection.url" value="jdbc:postgresql://localhost:5433/mydb"/> <!-- my port is 5433 -->                <property name="hibernate.connection.username" value="myusername"/>                <property name="hibernate.connection.password" value="mypassword"/>                <property name="hibernate.connection.pool_size" value="5"/>                     <property name="hibernate.show_sql" value="true"/>                <property name="hibernate.format_sql" value="true"/>                     <property name="hibernate.max_fetch_depth" value="5"/>                     <property name="hibernate.hbm2ddl.auto" value="update"/>                 </properties>         </persistence-unit>     </persistence>      Regarding the java classes, they are exactly the same of the tutorial. Esecution and uotput:               $ mvn exec:java -Dexec.mainClass="event.EventManager" -Dexec.args="store POINT(10 5)"      PostGres shell:               WGis=# select * from event;                             id |          date           |                  location                  |  title                    ----+-------------------------+--------------------------------------------+----------                   1 | 2013-12-07 15:44:21.653 | 010100000000000000000024400000000000001440 | My Event     (1 row)     WGis=#      At this point, after bringing the project into eclipse, I load the following libraries:   ![enter image description here](http://i.stack.imgur.com/MaSc8.png) but as I run the project gives me this error.               dic 07, 2013 4:40:24 PM org.hibernate.annotations.common.reflection.java.JavaReflectionManager <clinit>     INFO: HCANN000001: Hibernate Commons Annotations {4.0.4.Final}     dic 07, 2013 4:40:24 PM org.hibernate.Version logVersion     INFO: HHH000412: Hibernate Core {4.2.6.Final}     dic 07, 2013 4:40:24 PM org.hibernate.cfg.Environment <clinit>     INFO: HHH000206: hibernate.properties not found     dic 07, 2013 4:40:24 PM org.hibernate.cfg.Environment buildBytecodeProvider     INFO: HHH000021: Bytecode provider name : javassist     dic 07, 2013 4:40:24 PM org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure     INFO: HHH000402: Using Hibernate built-in connection pool (not for production use!)     dic 07, 2013 4:40:24 PM org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure     INFO: HHH000115: Hibernate connection pool size: 5     dic 07, 2013 4:40:24 PM org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure     INFO: HHH000006: Autocommit mode: true     dic 07, 2013 4:40:24 PM org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure     INFO: HHH000401: using driver [org.postgresql.Driver] at URL [jdbc:postgresql://localhost:5433/WGis]     dic 07, 2013 4:40:24 PM org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure     INFO: HHH000046: Connection properties: {user=pierfrancesco, password=****, autocommit=true, release_mode=auto}     dic 07, 2013 4:40:25 PM org.hibernate.dialect.Dialect <init>     INFO: HHH000400: Using dialect: org.hibernate.spatial.dialect.postgis.PostgisDialect     dic 07, 2013 4:40:25 PM org.hibernate.engine.jdbc.internal.LobCreatorBuilder useContextualLobCreation     INFO: HHH000424: Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException     dic 07, 2013 4:40:25 PM org.hibernate.engine.transaction.internal.TransactionFactoryInitiator initiateService     INFO: HHH000268: Transaction strategy: org.hibernate.engine.transaction.internal.jdbc.JdbcTransactionFactory     dic 07, 2013 4:40:25 PM org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory <init>     INFO: HHH000397: Using ASTQueryTranslatorFactory     dic 07, 2013 4:40:25 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute     INFO: HHH000228: Running hbm2ddl schema update     dic 07, 2013 4:40:25 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute     INFO: HHH000102: Fetching database metadata     dic 07, 2013 4:40:25 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute     INFO: HHH000396: Updating schema     dic 07, 2013 4:40:25 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute     INFO: HHH000232: Schema update complete     Exception in thread "main" java.lang.IllegalArgumentException: Unknown entity: event.Event         at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:878)         at event.EventManager.createAndStoreEvent(EventManager.java:45)         at event.EventManager.main(EventManager.java:24)      how can I solve it? thank you in advance


Postgis 2: Polygon/MultiPolygon in a single column

Storing MultiPolygon and Polygon features in a single column used to be as simple as not creating or removing the geometry type check constraint. Is there a similar simple fix in PostGIS 2?


QuantumGIS EPSG:3857 doesn't match with leaflet

Leaflet documentation said that they has EPSG:3857 as default projection. Using QGIS with open layer plugin, I point to a location to find it's coordinate. I used EPSG:3857 in QGIS as well. The problem is, the location doesn't match. I know that the location in leaflet using "lat-long" format, while location in QGIS is using "long-lat" format. Leaflet documentation said that it used "degree", while (I don't quite sure) I think QGIS use decimal. Does anybody has experience with this? How is the solution? Thanks in advance


Are there strategies for dealing with TopologyException errors in PostGIS 2? Nearly every function I run against two geometries results in a TopologyException (e.g. ST_Intersection, ST_SymDifference). I always try ST_Buffer(the_geom, 0) first, then ST_MakeValid(), then (ST_Dump(the_geom).geom and repeat ST_Buffer. Sometimes a combination of one or more fixes it, sometimes not. Perhaps my data is just not clean enough for PostGIS 2? I feel like I rarely had this issue on Postgres 9.0 with PostGIS 1.5, but now it is almost every dataset.


trouble with UpdateCursor where clause in arcgis 10.1

I'm trying to use UpdateCursor in arcpy, but the where clause I'm using seems to be causing trouble. However, when I open up the table in ArcMap and use Select By Attributes with the exact same clause that causes an error in the Python script, it works fine. The name of a feature class and a dictionary containing strings is passed into a function with the following code:               rows = arcpy.da.UpdateCursor(featureClass, "{0} = {1}".format("PropCode", "'"+hotelDict["hotelId"]+"'"))     for row in rows:         print "stuff" #I just wanted to see if it was making it here      I get the following error: `RuntimeError: Cannot find field 'PropCode = 'FR066''` More info that may or may not be helpful: I'm using ArcGIS 10.1, the field that is being searched in contains text, and using `arcpy.AddFiedlDelimiters(featureClass, "PropCode")` instead of just `"PropCode"` did not fix the problem. There are no results from Googling "RuntimeError: Cannot find field", and `PropCode = 'FR066'` is correct when using Select By Attributes in ArcMap, so I'm kind of stumped. Any thoughts would be appreciated...


ImagePyramid tuning in Geoserver

I am running several WMS layers from a _GeoServer_ (2.2 RC3 at the moment of writing). All layers are _ImagePyramids_ with sizes ranging from 100GB to 1TB in size. I have read the _GeoServer on Steroids_ several times and I'm probably missing half of it still. But there's a few things I'm wondering about. My pyramids consists of 9-10 levels of GeoTIFF files, each level having 1/2 resolution of the previous. Each GeoTIFF has a file size with an average at around 8MB, a defined CRS and a size aspect ratio of 1:1.   1. Is my TIFF file size inefficient?   2. Will I get a performance boots by adding overview to my TIFF's?    3. Will _inner tiling_ increase performance?   4. What could help me increase performance?   5. What have you guys learned from your experiments with ImagePyramids in GeoServer? _1,3) In my view these two comes down to how a TIFF file is being handled in general and especially by GeoServer and I'm clueless here._ _2) If I added overviews to my TIFF files my guess is that it corresponds to jump a level in the pyramid and thus I would only waste disk space?_ **Edit** : _Changed pyramid resolution from (the wrong) 1/4 to (the correct) 1/2. The pyramids are following the powers of 2 guidelines._


What kind of AWS configuration is needed for running a low-to-medium bandwidth Web map app?

Does anyone have experience with running Web maps (tile server + client JS scripting) on Amazon Web Services (S3, EC2 etc...)? What kind of AWS configuration is needed for running a low-to-medium bandwidth Web map app, covering a small(-ish) area (city to small-country size)? All of the tiles would be pre-rendered and uploaded to S3. Ideally I would need a tile serving app on the web server that could serve MBTiles (instead of uploading hundreds of thousands of tile bitmaps individually). So some kind of EC2 instance would be needed, but what kind? Thanks for any hints. **UPDATE:** just to elaborate on my question. What I'm basically looking for is some feedback about how viable AWS is for hosting your own web maps as an individual (which means it shouldn't cost too much, say up to $30/month). I've been hosting my web maps for some time through "ordinary" hosting providers, but these have their own limitations (upload bandwidth is one, speed is another). I'm also looking for any good alternatives to AWS and anything to watch out for when using cloud services for web maps.


How to Average neighboring county data and store in original?

I have data for several rain stations, i have averaged the data and given each county a value. Some counties have null values and I would like to pull the data from the all the bordering counties and use that to create an average for the null data county. here is what i have so far               #Make Feature layer of counties that have 'NULL' for TCPT MNTM     #Select all counties that touch the boundaries of a single NULL county     #Average TCPT and MNTM values for selected counties     #Store average back in original counties layer          arcpy.MakeFeatureLayer_management(countyData,"badRows","\"MNTM\" = 'NULL'")     arcpy.MakeFeatureLayer_management(countyData,"goodRows","\"MNTM\" >= 0")          # a snippet i pulled from model builder and exported python code snippet          arcpy.SpatialJoin_analysis("Dissolved_Counties",climateData,"Average_Temperature_For_Texas_Counties","JOIN_ONE_TO_ONE","KEEP_ALL","""FIPS "FIPS" true true false 5 Text 0 0 ,First,#,Dissolved_Counties,FIPS,-1,-1;Shape_Length "Shape_Length" false true true 8 Double 0 0 ,First,#,Dissolved_Counties,Shape_Length,-1,-1;Shape_Area "Shape_Area" false true true 8 Double 0 0 ,First,#,Dissolved_Counties,Shape_Area,-1,-1;TPCP "TPCP" true true false 4 Long 0 0 ,Mean,#,Climate_Data_for_Texas,TPCP,-1,-1;MNTM "MNTM" true true false 4 Long 0 0 ,Mean,#,Climate_Data_for_Texas,MNTM,-1,-1""","INTERSECT","#","#")               ###      i guess i am stuck here, i had before used the arcpy.GenerateNearTable_analysis to generate the values for the 4 nearest counties (but they werent always bordering and it needs to be bordering counties) anyway if anyone would give me a little help i would much appreciate it


How to import datasets into OpenStreetMap?

A coworker of mine was recently given permission to import our local county government's GIS data into OpenStreetMap. I've made single edits on the OpenStreetMap site before, but I have never imported entire datasets. **Where do we start?** Also, are there any tools that help automate a task like this? I'm assuming there should be a decent amount of custom scripting involved to handle the local GIS's schema. I would like to see how other people have handled this problem. It's also likely that we could get data from other local governments in the future, so if there is anything that would help relieve the burden of building a custom import system multiple times, I would be interested.


Cordenadas 2d transformacion a postgis desde QGIS

This is a three-dimensional shape file, I checked in ARCGIS, where the shape attribute indicates POINT ZM, This is the table               fid        0      shape*     point ZM     atribut1   A     atribut2      B     ESTE      500     NORTE      1000       and when exporting to postgis from QGIS indicated in the item "CLASS OF SPACE" NULL and the following error : "Problemas al insertar objetos espaciales del archivo: D:/gegrafo/BORRARç/COTACACHIa_Merge.shp La base de datos dio un error mientras ejecutaba esta SQL:               SELECT AddGeometryColumn('public','COTACACHIa_Merge','the_geom',-1,'NULL',2)     El error fue:     ERROR:  Invalid type name - valid ones are:         POINT, MULTIPOINT,         LINESTRING, MULTILINESTRING,         POLYGON, MULTIPOLYGON,         CIRCULARSTRING, COMPOUNDCURVE, MULTICURVE,         CURVEPOLYGON, MULTISURFACE,         GEOMETRY, GEOMETRYCOLLECTION,         POINTM, MULTIPOINTM,         LINESTRINGM, MULTILINESTRINGM,         POLYGONM, MULTIPOLYGONM,         CIRCULARSTRINGM, COMPOUNDCURVEM, MULTICURVEM         CURVEPOLYGONM, MULTISURFACEM,         or GEOMETRYCOLLECTIONM     CONTEXT:  SQL statement "SELECT AddGeometryColumn('',$1,$2,$3,$4,$5,$6)"     funciÃ³n PL/pgSQL Â«addgeometrycolumnÂ» en la lÃnea 4 en sentencia SQL"


Converting Raster Data to Polygon data

I am trying to convert a raster data to polygon data. Previously I was using the shapefile.py to create point data on individual lat/lon on the raster. But that will create a Huge data and querying it will be a Big issue. So, it would be better if I am able to convert the raster data into a polygon data. I was able to find SAGA, but it seems that it can only convert the .grd files. Is there a way to convert GeoTIFF format or raster datasets in general to Polygon? **UPDATE: Using gdal_polygonize.py** I am executing the following line of code,               gdal_polygonize.py ~/development/Biodiversity/biodiversity/GeoTIFF/bio11.tif -f "ESRI Shapefile" bio11.shp      But I am getting the following error. My gdal version is 1.9.0.               Traceback (most recent call last):       File "/usr/bin/gdal_polygonize.py", line 34, in <module>         import gdal, ogr, osr       File "/usr/lib/python2.7/dist-packages/gdal.py", line 2, in <module>         from osgeo.gdal import deprecation_warn       File "/usr/lib/python2.7/dist-packages/osgeo/__init__.py", line 21, in <module>         _gdal = swig_import_helper()       File "/usr/lib/python2.7/dist-packages/osgeo/__init__.py", line 17, in swig_import_helper         _mod = imp.load_module('_gdal', fp, pathname, description)     ImportError: libjvm.so: cannot open shared object file: No such file or directory


Field Calculator Runs In IDLE (2.6.5) but not ArcGIS 10 SP3

just wondering if anyone else is having issues with the field calculator in ArcGIS 10 SP3. In the following code I do a pretty simple field calculation with a variable (an array) as one of the parameters in the expression.               exp1 = "Feature = 16"     rows = arcpy.SearchCursor("ObservationMaster", exp1)     li = []     for row in rows:         ObsID = int(row.getValue("ObsID"))         li.insert(len(li), ObsID)     if li != []:         codeblock = """def chStat(stat, ID, li):         if int(ID) in li:             return 5         else:             return int(stat)"""          exp = """chStat(str(!ManagementStatus!), str(!ObsID!), li)"""          arcpy.CalculateField_management("ObservationDetail", "ManagementStatus", exp, "PYTHON", codeblock)      When I run it through IDLE (Python 2.6.5), there are no problems and it runs successfully. However, if I create a script in a toolbox in ArcCatalog/ArcMap using this same code, I get the following error:               <class 'arcgisscripting.ExecuteError'>: ERROR 000539: Error running expression: chStat(str(1), str(1), li) <type 'exceptions.NameError'>: name 'li' is not defined     Failed to execute (CalculateField).      I know this is because it is not treating "li" as a variable, but it does when I run it in IDLE. Has anyone had this same problem and does anyone know a solution to get this working. I really need this script to run via ArcMap. Thanks in advance


Given a line on the earth's surface, how do I plot a line perpendicular to it? Apologies if this is a very simple question. I thought this would be a straightforward task, but it is proving counter-intuitive. I start with the blue line in the figure below (see link -- I'm unable to upload figures yet). I found a perpendicular line by calculating the gradient of the blue line (m), then plotting another line (green) with gradient -1/m. When I plot the lines in Matlab (using 'plot' and 'axis equal'), they look perpendicular, as expected. http://imgur.com/7qMkx However, when I export these lines to Google Earth (using the KML Toolbox), they no longer look perpendicular (see link below; the shorter line is the blue line from the previous figure). http://imgur.com/ncJQ7 I understand that strange things happen on curved surfaces, but I thought the lines should at least look perpendicular locally. I suspect this has something to do with the projection in Google Earth -- in particular, the fact that the grid cells appear to have roughly similar side lengths, yet the longitudinal edge has length = 1 degree, whereas the latitudinal edge has length = 0.5 degree. So, in summary:   * is my method of finding a perpendicular line valid on a curved surface? (i.e., plotting a line with gradient -1/m)   * in the Google Earth image, do the perpendicular lines look as expected, or is something strange going on?  UPDATE: To provide more context: I am looking at radar data taken from a plane. The multi-colored area is the 'swath', where observations have been recorded. The blue line I started with in the explanation above is parallel to the swath: this is the aircraft's flight line (the plane was moving in the roughly south- west direction). The radar looks in the direction orthogonal to the flight line, on the left. I am trying to draw a line perpendicular to the flight line; this should be the direction the radar is looking, and should cut the swath neatly. As you can see, this is not the case. ![enter image description here](http://i.stack.imgur.com/nsGaq.jpg)


How do I create a shapefile showing footprints of Rasters?

I have around 1,000 satellite images in tiff format, and I want to create a shapefile which will serve as an index to the rasters. This is something similar to a raster catalog, but I do not want to build a raster catalog. Some obstacles I can forsee, is that the image are georefrenced, so they are not rectangular in shape (I am talking about the data area). **Update** To clarify, I require the polygon to cover only the non-zero (or non nodata) pixels of the raster, and not the entire rectangular raster. Most of the answers so far, give a rectangular polygon, which covers the data, as well as the non-data pixels. My Image ![A sample Satellite Image](http://i.stack.imgur.com/OTs4r.png) * * * Result given by tools I have examined (like raster catlog, various Arcscripts, custom Python script given in one of the answers): ![Result](http://i.stack.imgur.com/S1DP6.jpg) * * * Result that I want: ![enter image description here](http://i.stack.imgur.com/431El.jpg)


Trouble with Hot Spot Analysis (Getis-Ord Gi*) tool in ArcGIS

I am trying to locate areas with a high rate of accidents involving bicyclists or pedestrians per car accident of any kind. I have a point file of accidents and a point file of all those with bike/ped involvement. I want to use the Hot Spot Analysis tool, but all I can figure out is using it on each point file to tell me the overall crash hotspots and the bike/ped crash hotspots. Is there a way to normalize one by the other? Is there a good way to compare the two hotspot output files? is there a different tool or approach I should look into?


arcpy.Exists not working within standalone script

I have the following code. I want to see if a layer name exists within a map document, not if the shapefile exists in the directory. If I copy paste into the python window within ArcMap works fine. IE. Prints: True If I run the program as a stand-alone script it does not work? Prints False when should print True I have code the sets up the mxd and dataframe.               if arcpy.Exists("project_aoa") == True:         print("TRUE")     elif arcpy.Exists("project_aoa") == False:         print("FALSE")      These layers are withing a group layer should this matter? project_aoa is a shapefile. EDITED: I ended up doing this:               for item in mxds:         mxd = arcpy.mapping.MapDocument(r"{0}".format(item))         df=arcpy.mapping.ListDataFrames(mxd,"Project Area")[0]              for lyr in arcpy.mapping.ListLayers(mxd, "project_aoa", df):             if lyr.name == "project_aoa":                 print("True")             else:                 print ("False")


Labeling text with special characters in ArcMap?

I am trying to display some bird data in ArcMap in the format/notation that it is recorded in the field. The notation is made up of the one/two letter species code followed by a description of the activity underneath (see image below). ![Bird labeling/field notation](http://i.stack.imgur.com/25qPN.jpg)   I do not want to create symbology because I have 500+ species and six possible activities, so I have decided to use labelling in ArcMap rather than symbology. I am able to present data with a circle and underlined but I am struggling with displaying the data that has a double underline or asterix underneath. Therefore, I was wondering if anybody would be able to offer me any help - how do I include these characters in a label? I am running ArcMap 9.3. Many thanks Mark


How do you import simple xyz in QGIS

I have found out how to get tab-delimited X,Y data into a layer but the Z field value is not given as an option on import? I tried to edit the attributes to add and define a new field but it keeps crashing? Any idea Cheers


ArcGIS Displays Wrong Date

I have a postgres database with a series of fields that includes a date field in MM/DD/YYYY format. Through ArcSDE it displays in Arc in a weird format with the wrong date and some made up time. When viewed via PGAdmin or QGIS the date displays correctly. Does anyone have an idea of why Arc is jumbling the date and how it can be corrected? The screenshot below shows the attribute table for identical rows in QGIS and Arc. Notice how Arc includes a random time and the wrong date (everything is year 2000). ![enter image description here](http://i.stack.imgur.com/ScujO.png)


How to replace null values in attribute table ArcGIS 10.2

I have a string field 'Oneway' with three values '+' '-' and Null showing a street accessibility, I would like to replace them with values 'F' 'T' and null as the script for Network dataset expect these values.However it seems that it is not possible to replace values if Null values are present. I tried also changing the field type to double or text but the field properties are not editable somehow (I tried this in arc catalog). I am only able to replace value '+' and '-' with numbers using the field calculator but need to replace them with letters.


What does ‘Response Cache Headers’ and ‘Cache Time (seconds)’ in Geoserver really do?

I am trying to understand what these two settings do and how they can be used to influence how the user’s browser caches a tile. From the Geoserver documentation: “HTTP Settings—Cache parameters that apply to the HTTP response from client requests. If Response Cache Headers is selected, GeoServer will not request the same tile twice within the time specified in Cache Time. One hour measured in seconds (3600), is the default value for Cache Time.” From this I infer that either ‘Expires’ or ‘Cache-Control’ HTTP headers will be added to the response and, if Cache-Control is added, then the value that goes into ‘max-age’ will be ‘Cache Time’. Is this what is meant to happen? However when I turn on ‘Response Cache Headers’ and look at the HTTP response header on the client I see no difference from the case when the ‘Response Cache Headers’ is not on. Cheers Mark


Error using "r.los" in QGIS

I am not a "computer person". So -- I don't know what this error message means. I found this question and answer for this same problem, but the solution did _not_ work for me, dammit. GRASS algorithm r.los does not produce raster I am using QGIS 2.0 (or maybe 2.0.1?). The computer is running Windows 7. I activated the menu **Processing > Commander** and got the command entry line above the map-area window -- no problem there. (The QGIS project I'm using has an elevation raster.) The computer program picks up just fine that I want to use the loaded raster. I copy and paste my coordinates for viewer location just fine. I tried leaving the default, temporary output file, and I also tried creating and entering into the GUI form a new file for this process. Each time, the following error message resulted.               Oooops! The following output layers could not be open     Output raster layer: C:/Users/Cogreg/Documents/GIS, QGiS/Files_Greg_created_via_GIS/300_CountyRd_41_viewshed.tif     The above files could not be opened, which probably indicates that they were not correctly produced by the executed algorithm     Checking the log information might help you see why those layers were not created as expected     This algorithm requires GRASS to be run. A test to check if GRASS is correctly installed and configured in your system has been performed, with the following result:     GRASS seems to be correctly installed and configured