Saving rasters in a Python for loop fails only on last iteration

I'm a newcomer to Python scripting and I'm having what's seemingly a very simple problem but one that's stumped me enough to send me posting to these forums for the first time. I'm using a for loop to save rasters to a specified folder. The loop executes perfectly, but the last iteration of the loop invariably produces an empty raster with no spatial reference. So, iteration 1 will be an empty raster until I run iteration 2, at which point the product of iteration 1 mysteriously transforms into what I want, & so on w/ iterations 2 & 3, etc. In keeping w/ this pattern, the last raster created by the loop remains empty and unprojected. Code is as follows ("costsurf" & "distDirString" are defined in an earlier part of the script):               for Num in Nums:      focal = arcpy.sa.SetNull("Corr","Corr","VALUE <> " + str(Num))      costDist = arcpy.sa.CostDistance(focal,costsurf)      withhole = arcpy.sa.SetNull(~ arcpy.sa.IsNull(focal),costDist)      withhole.save(os.path.join(distDirString,"dist_%s.img" %Num))      It's supposed to pull out a chunk of the raster "Corr" with cell values Num by setting all else to NoData, run the Cost Distance tool on it, then poke a hole in the result where the source cells are. I have no idea how to think about what's failing here, since the loop does exactly what I want it to, but only if it's not the last iteration to be run. It seems to behave itself if I get rid of the ".img" and save them as GRIDs -- but only sometimes?? And I'd really rather stick to .img if at all possible, which it surely must be. I'm using ArcGIS 10.0 btw. Thanks for your help!


Reassigning raster cell values from another attribute in raster attribute table?

I have a large (size of lower 48 U.S.) 100m resolution raster dataset that has a raster attribute table (RAT). The data were created by someone else. One of the attributes in the RAT has the data values I care about, while the actual raster cell values are meaningless. I've been trying to figure out how to reassign the value of the attribute I care about to the actual raster cell value but have not been able to figure out how to do this. The reason I want to do this is that I have a fairly involved custom Python tool that someone else developed that will do the calculations I need, but unfortunately it doesn't have the ability to use RAT attributes. It only uses the raster cell assigned value which as I said in this instance is meaningless. I tried a roundabout way of running the raster to point tool to create a point feature class with the target field being the attribute I care about, thinking I could then create a new raster from the resulting point feature class. However, the raster to point tool failed stating I didn't have enough temporary memory (I'm running an Alienware machine with 16 GB of RAM and a 1 TB data drive). Do I have any options? I'm using ArcGIS 10, but if I could do what I describe readily in another package I'd be willing to try another way (I'm not married to ArcGIS).


How do I get the pixel value of a GDAL raster under an OGR point without NumPy?

I am working on a computational model of the abundance of wild pollinators across a landscape. The model itself is complete, and I am now struggling with a post-processing step. I have my GDAL pollinator supply raster that looks something like this (lighter colors mean higher pollinator visitation to a pixel): ![Greyscale raster representing pollinator supply on a landscape](http://i.stack.imgur.com/JyglO.png) And I have an OGR shapefile of points representing sample locations on the landscape: ![enter image description here](http://i.stack.imgur.com/UWJdk.png) I'm trying to run some analysis on the pixels under these points, but to do so, I need to be able to extract the value of a pixel under a point. Is it possible to extract the value of a pixel under a point using only OGR and GDAL through Python? I would prefer to avoid reading the entire raster into memory through `ReadAsArray()`, as my output rasters are very, very large (too large to fit into memory). I noticed this post, which is similar, but requires a command-line call.


Summary table with a field that shows components of each summarized record

I have a table with 2 fields the first is for community and the second for the main community that it belongs to, as in the image![Table 1](http://i.stack.imgur.com/CZVMZ.jpg) I want to summarize the second field (Belongs_to) but with an extra field (multiple value field) that shows components of each main community, as in the image![enter image description here](http://i.stack.imgur.com/a8WzD.jpg) Could anyone help me please?


PyQGIS 2.0 API problem reading attributes

Im reading some attributes from shapefile features in a loop. According to this: http://nathanw.net/2013/06/13/new-qgis-20-api/ I should be able to reference my attributes (and getting native python datatypes) like this:               for feature in myLayer.getFeatures():        geom = feature.geometry().asPoint()             #features have attribute called 'name'        print feature['name']        print feature.name      The first print statement simply prints a generic QVariant object address, second one fails saying there is no method named name on the QgsFeature object. Essentially it behaves like the old API, whilst im using 2.0.1. Why?


Are British National Grid (BNG) 1km grid shapefiles displayed accurately in ArcMap?

I have downloaded the UK Ordinance Survey's 1km grids in shapefile format for ArcMap. If you need to download them to have a look first you can find them here look for link in the first Answer to the Question Ordnance Survey grids - download or generate?. They 'supposedly' represent 1km grids however here is where the first problem begins. If I calculate their dimensions and areas in ArcMap their size differ from one another. How is this possible are they not supposed to be regularly spaced every 1km? The second problem I encounter is - of course as a result of the first problem - that if I try to divide the areas into smaller sections they grid would now shift slightly to one side. Can you please advise if there is a way to solve this problem and/or if you get the same results?


Error with publishing Sort tool on ArcGIS Server 10

I have a model that has one tool (Sort), works fine on desktop. When I try to publish get this error.                Geoprocessing service initialization failed.     Invalid parameter: Tool - General Sort : Parameter - Field(s) : Data Type - Value Table      Turns out this data type is not supported, looking for a workaround that would allow users to choose more than one values for Sort field. Thanks, Jay


Looking for a fine U.S. Latitude and Longitude grid (0.25, 0.5 degree)

There is a global latitude and longitude grid data available at 1 degree resolution and higher (http://www.arcgis.com/home/item.html?id=f11bcdc5d484400fa926dcce68de3df7). Is anyone aware of a finer resolution dataset (at 0.25 and 0.5 degree)? Or alternatively a way to make it in ArcGIS/GDAL/Python using the 1 degree product?


Pathfinder Differential Correction: "Use reference position from" who?

How do you choose either "base files" or "base provider"? ![Pathfinder Office Differential Correction](http://i.stack.imgur.com/enCvu.png)


How to compute geodesic area in GeoDjango?

I have some polygons which can be anywhere in the world. I would like to compute their areas. The GeoDjango docs for `GEOSGeometry.area` don't specify whether it is geometric or geodesic area, but given that `GEOSGeometry.distance()` says that "GEOS does not perform a spherical calculation even if the SRID specifies a geographic coordinate system", I suspect that it is a simple geometric area. I'm willing to write a little code, but the shorter the better, of course. We do have a working geodesic distance function already.


Use model builder to select layers by attributes, dissolve them and then merge them

StackExchange team, I would like to reclassify polygons, I want to combine smaller polygons into bigger polygons based on their ID (each polygon has a unique ID). I want to regroup ~800 polygons into ~60 polygons. So in the first round I, e.g, want to select polygons with the ID 3,5,7 and dissolve them into one. In the second round I want to select polygons with the ID 34,666, 45,6,77 and dissolve them...until all the polygons are regrouped and dissolved. Then I would like to merge all the dissolved polygons into a new shapefile with only ~60 polygons. So I thought I can automate this with the model builder, first I tried an approach with Make Feature Layer then Select by Attributes then Dissolve. But that way I still have to change the SQL statement in the Select Layer By Attribute each time. Also I wouldn't know how to save the dissolved output layer after each run so that it doesn't overwrite it. Is there a function that keeps merging the previous model output with the current output? While searching for solutions online I came across the Feature Class to Feature Class option as it apparently makes the Make Feature Layer and Select Layer By Attribute steps unnecessary. How could I then use a list variable of SQL statements and a list variable of string names for the different outputs as input? Any help is appreciated Sandra


Calculating Field B from Field A, except where Field B has existing value, using ArcGIS Desktop 9.3?

Im trying to calculate Field B from Field A except where Field B has existing value in ArcGIS Desktop 9.3. (I suspect its straight forward but I have 'searched' and havent cracked it yet) Any guidance as to how to achieve this please?


is there an API-level error handler in the ArcGIS Server JS API?

I'm seeing an error message in FireBug:               Error: Internal kml parser error.http://serverapi.arcgisonline.com/js.../?v=3.2compact     Line 34      I'm not worried about fixing this error for the moment - I'd like to know how can I **trap** the error, so I can report it to the user elegantly? Eg, if they're not using Firebug I'd still like them to know that there's a problem. The map has an onLayersAddResult event, which contains an Error handler. Is there a similar map-level error handling event which would trap the above KML parser error (and any other errors which might be generated by the API)? It seems like the `map` object needs a generic `onError()` event, but I can't see anything suitable. Thanks


PostGIS not converting GIS data into latitude/longitude values

I am running PostgreSQL and PostGIS. I am trying to do something mind- numbingly simple: determine the latitude and the longitude of a point. Unfortunately, PostGIS stubbornly refuses to transform the SRID of the GIS data from SRID=4269 to SRID=4326, which is necessary to get the latitude and longitude of the point in question:               select pid, landdistri, ST_AsText(ST_Centroid(geom)) from "parcels_new" where pid='016-626-331';          pid     |       landdistri        |                st_astext                      -------------+-------------------------+------------------------------------------      014-626-331 | Similkameen Div of Yale | POINT(1461547.22664562 504522.034305431)     (1 row)          select pid, landdistri, ST_SRID(geom) from "parcels_new" where pid='016-626-331';          pid     |       landdistri        | st_srid      -------------+-------------------------+---------      014-626-331 | Similkameen Div of Yale |    4269     (1 row)          select pid, landdistri, ST_SRID(ST_Transform(geom, 4326)) from "parcels_new" where pid='016-626-331';          pid     |       landdistri        | st_srid      -------------+-------------------------+---------      014-626-331 | Similkameen Div of Yale |    4326     (1 row)          select pid, landdistri, ST_AsText(ST_Centroid(ST_Transform(geom, 4326))) from "parcels_new" where pid='016-626-331';          pid     |       landdistri        |                st_astext                      -------------+-------------------------+------------------------------------------      014-626-331 | Similkameen Div of Yale | POINT(1461547.22664562 504522.034305431)     (1 row)          select pid, ST_AsEWKT(ST_Centroid(ST_Transform(geom, 4326))) from "parcels_new" where pid='016-626-331';          pid     |                     st_asewkt     -------------+----------------------------------------------------      016-626-331 | SRID=4326;POINT(1461547.22664562 504522.034305431)     (1 row)           select f_table_name as name, srid from geometry_columns;         name     | srid     -------------+------      parcels_new | 4269      Pins        |    0     (2 rows)      I don't get any error messages. I am at a loss to understand why ST_Transform REFUSES TO TRANSFORM my data....


cpu usage goes up when i move mouse to show xy coordinates

I want to show x , y coordinates when i mouse move over map in a webgis .The problem is whenever i move the mouse, the cpu usage goes up to a maximum of 40%.Is there any solution to reduce cpu usage? I'm using ArcGIS API silverlight 3.1 , ArcGIS server 10.1 , sql server 2008 R2 , windows 7


Edit and query buttons disabled in geoexplorer

I have an issue: edit and query buttons are disabled in geoexplorer. This app use to be OK and then went wrong without doing anything on my server. How can I fix this ? Thanks


Implementing gs:Nearest WPS process from geoserver

I am implementing gs:Nearest WPS process available in GeoServer using openlayers in OpenGeo Suite SDK. I am trying to implement this process as a openlayers plugin to hook into my custom web mapping application.Though there is many tutorial on how to implement JTS:Split and JTS:Buffer process there is no tutorial for any other wps process.This Process Require Feature collection or Vector Layer as a input. Firebug Error Geometry.CLASS_NAME undefined i think this is because I am not able to collect all the features from the vector layer. So How can I create a vector layer using OpenLayers.Layer.Vector????               var test = Ext.extend(gxp.plugins.Tool, {          ptype: 'myapp_test',          /** Initialization of the plugin */     init: function(target) {         test.superclass.init.apply(this, arguments);              // Create a WPSClient instance for use with the local GeoServer         this.wpsClient = new OpenLayers.WPSClient({             servers: {                 local: '/geoserver/wps'             }         });                        // Add action buttons when the viewer is ready         target.on('ready', function() {             // Get a reference to the vector layer from app.js             this.layer = target.getLayerRecordFromMap({                 name: 'sketch',                 source: 'ol'             }).getLayer();           //I am not getting Feature Collection or can not create Vector layer            this.layer2 = new OpenLayers.Layer.Vector("parks", {                     strategies: [new OpenLayers.Strategy.Fixed()],                     projection: new OpenLayers.Projection("EPSG:4326"),                     protocol: new OpenLayers.Protocol.WFS({                         version: "1.1.0",                         url:  "/geoserver/wfs",                         featurePrefix: "medford",                         featureType: "parks",                         featureNS: "http://medford.opengeo.org"                     })                 });                  // Some defaults             var actionDefaults = {                 map: target.mapPanel.map,                 enableToggle: true,                 toggleGroup: this.ptype,                 allowDepress: true             };                  this.addActions([                      // Action for splitting by drawing a line                 new GeoExt.Action(Ext.apply({                     text: 'TEST',                     control: new OpenLayers.Control.DrawFeature(                         this.layer, OpenLayers.Handler.Point, {                         eventListeners: {                             featureadded: this.nearf,                             scope: this                         }                     })                 }, actionDefaults))             ]);         }, this);     },          /** Handler function for splitting geometries */        nearf: function(evt) {      var wkt = new OpenLayers.Format.WKT();      var pt=wkt.write(evt.feature);     //var f =JSON.parse(this.request.responseText);     //var myline = OpenLayers.Geometry.fromWKT('point(117 22)');      var g = new OpenLayers.Format.GeoJSON();       var f=g.read(this.request.responseText);      this.wpsClient.execute({                     server: 'local',                     process: 'gs:Nearest',                     inputs: {features:this.layer2, point:pt},                     success: this.addResult                 });          },          /** Helper function for adding process results to the vector layer */     addResult: function(outputs) {         alert('Hello World');     }     });          Ext.preg(test.prototype.ptype, test);


Reclassify raster tool in ArcGIS 10 creating no-data cells

I have been attempting to calculate a slope raster in ArcGis 10, and have been encountering a problem where cells which previously had data appear as no data cells in a few places on the raster following the completion of the reclassification tool process. To attempt to solve this we have run the IsNull tool on the original elevation raster to identify where no data cells are. We next ran focal statistics to calculate the mean value of a 50x50 cell rectangle surrounding the no-data cells. This filled in all the no-data cells. Following this we ran the slope tool. The end result every time has fairly large irregular rectangles scattered around the raster with no-data values. What might be the problem here?


Export list of Feature classes to CSV

I am successfully using the follow script               import arcpy     from arcpy import env     import os     env.workspace = ("WORKSPACE")     fcList = arcpy.ListFeatureClasses()     print fcList      to export feature class names from a workspace. I'd like to export the results to a CSV file (creating a simple one column list of Feature Class names); I've looked into the Python help guide but am struggling with the syntax and where to place the csv.writer and import csv functions. How do I get the results to be written to a csv file?


How to create a Esri Context Menu on desktop development

How can i create a context menu on ESRI Arcgis Desktop.And after creating it,how can i use it while a base command is open and active.I use C# but i can understand visual basic. Thanks for your answers...


Online resources for creating shp files performing basic GI functionality

I am looking to build polygons, based on files containing a grid of points. The representation of the polygon would be an aggregation of the points. As the end wares are ESRI, I was wondering if there were online resources for performing this type of object creation; creating shape files based on this? Cheers


Feature Layer Selections

I'm new to arcgis and arcpy, so some of my lingo and terminology may be off. I have a script that takes a feature layer as an ainput. From there I want to be able to count the number of selections in the feature layer. I also want to determine what type of layer it is, i.e. polygon, polyline, point, etc. Again, my terminology may be off. Can anyone help me with this??


Visualization of Geographical information on mobile devices

To complete my thesis i have to develop mobile GIS application which will test/handle some issue related to visualization presentation of geographical/spatial information on mobile devices. I will test the application usability in lab(desktop environment)and application should contain two ,three data layers belong to one specific domain Where to start , which is best tool to develop such application prototype, how will i test usability concerns with that application. Thanks in advance


Implement IEditSketch interface for custom cad tools

I want to build cad tools which will be used in municipality applications on esri.Let me tell the question.The user wants to edit on the map and does it by using IEditSketch.But i want to write a custom IEditSketch.So i want to implement that interface.Can u share your experiments about it.Thanks...


Voronoi polygons that run out to infinity

I have been working on implementing the voronoi.py script (Bill Simon's translation of Steve Fortune's code). According to the QGIS link it is basically the same code that I am working with, but the way to generate the polygons that can extend to infinity differs between the two. In the QGIS case, I presume that some bounding rectangle is generated at some extent beyond the site point extents. In my case, I generate false site points as a circle surrounding the site points of interest. The circle points have a radius twice the diameter of the extent of the site points. The results between the two are shown in the attached figure, QGIS implementation on the left and my implementation on the right. ![Voronoi examples](http://i.stack.imgur.com/0jsRP.png). As one can see, the QGIS implementation produces weird polygons which have no site points (see site 473 as an example in both implementations). This is obvious wrong, but I am not sure whether my implementation is correct either. Since I don't have access to an ArcInfo license for ArcMap, I can't compare it what ArcMap generates natively and I can't see a way to a way to attach the site point shapefile for someone to test. So if anyone has any commentary on my use of an "infinity circle" to help force edge polygons versus an "infinity rectangle", I would appreciate it. Better still, if anyone is interested in testing the output on some other GIS platform I can provide the shapefile of the site points I used. UPDATE It appears part of the problem is that the polygons beyond the site points overlap, so when symbolized without a fill, then appear as distinct polygons. The following figure shows what happens when the polygon about site 473 and 415 are selected. So the original questions remain, but there is a new wrinkle. UPDATE 2 It is a bug (or an "incompleteness"), the correct results in QGIS if a buffer of 0% is used. What still needs to be resolved is whether a dense pattern of circular "infinity points" will yield the same result as rectangular "infinity edges". ![enter image description here](http://i.stack.imgur.com/rrQDX.png)


How to create a button in Arcmap 10 to run a Python program?

I have a script that I want to run within ArcMap when a button in a toolbar is clicked, and so far I have only been able to make the script into a script tool. I need it to run as a command, not as a geoprocessing tool. Running it as a geoprocessing tool takes much longer than when the same code is executed from the command line window. I have just started looking into ArcObjects, but I want to get started using it if it is what I'll need to use. If anyone has any sample code, or resources for creating a button, that would be great.


How to create custom Locator Styles in ArcGIS 10

Does anyone know if there is any public documentation on how to create these?


How to get table Name from IObjectClass

I'm using IRelationshipClass.DestinationClass to get an IObjectClass. From here, I want to be able to get the table name, but can only access the AliasName. Any ideas? UPDATE Aughhh, after searching for ages, and not finding an answer, I ask the question here, only to find it twenty minutes later. The IObjectClass can be cast to a IDataset, which has the Name property, which is not the same as AliasName. I should say thanks to Kirk, as it was some code he posted elsewhere that pointed me in the right direction. For reference,               ((IDataset)relClass.DestinationClass).Name


How to make a button that calls a python script as a command rather than a script tool?(ArcMap 10)

I believe that in Arc9.3, commands could be created using VBA scripts. To add a custom command, you would navigate to Customize > Toolbars > Customize... and click UIControls. However, UIControls is not there in version 10. I am creating two separate scripts for a map book project. One script will save the layout settings to a table, and the other will update the layout with settings from the same table. I want both of these scripts to be commands assigned to buttons in a toolbar. I created them as script tools, but whenever I click on them, they run the script as a geoprocessing tool. It brings up a progress window, and it takes about 10 times longer to execute than if I had run the code in the Python command line window. I don't want the progress window or the much longer execution time. How can I make it so that the script isn't considered a "tool" and is instead a command similar to the Save button?


How to set margin on PageLayout in ArcGIS Engine?

When we create a PageLayout from the A4 Landscape template and print the layout on a pinter with A4 Landscape paper we get four pages instead of one. We are using the IPage.PageToPrinterMapping = esriPageMappingTile and the reason that we get four instead of one page is that the printer by default has a margin for the A4 format. If I try to do the same procedure for a format that the printer doesn't have a margin for it prints only one page. Is there a way to create the same margin on the PageLayout? Steps to reproduce in ArcMap:   1. File | New...   2. Choose Templates | ISO A4 Landscape   3. File | Page and Print setup...   4. Set Printer and Map to the same format A4 and orientation landscape ![Page and Print Setup dialog](http://i.stack.imgur.com/oCB1O.png)   5. File | Print...![Print dialog](http://i.stack.imgur.com/duuF6.png)   6. The Print dialog is showing four pages Update: Tried different approaches using the IPage interface but can't find any API to set the margin.   1. Tried setting the PrintableBounds on the page, but it seems to be readonly:              m_hookHelper.PageLayout.Page.PrintableBounds.Envelope.PutCoords(docPaper.PrintableBounds.XMin, docPaper.PrintableBounds.YMin, docPaper.PrintableBounds.XMax, docPaper.PrintableBounds.YMax)        2. Tried setting the Custom size on the Page and it sets the size correctly, but it corp the layout, because it doesen't set the offset:               m_hookHelper.PageLayout.Page.PutCustomSize(docPaper.PrintableBounds.Width, docPaper.PrintableBounds.Height)        3. Tried to set the FormID to be esriPageFormSameAsPrinter and it workes as long as the user chooses the layouts' orientation and format on the printer. If not, it crops the layout when it is printed.              m_hookHelper.PageLayout.Page.FormID = esriPageFormID.esriPageFormSameAsPrinter


How to install wps geoserver extension to Centos6.5

I installed OpenGeo Suit on CentOS 6.5 and the version of geoserver is 2.5-SNAPSHOT. I made a `yum update` and the version of OpenGeo Suit is 4.1, geoserver version remain 2.5-SNAPSHOT. I would like to install wps extension but I am a very new centos user and don't know the path to put the extensions files. I also want to ask about the path to put GED SDI Portal v.3 to work in my local-host.


Measuring distance between points in ArcMap - what coordinate system to use?

This is a basic -newbie - question. I have some handwritten data points taken off a GPS - so I am assuming they are in WGS 84, and I want to load them in ArcMap 9.3, via excel, and measure the distance between them (they are transects). I would like to know how best to maintain accuracy, and what format the data the coordinates should be when I load them into ArcMap. The coordinates look like: 39. 51 550, 148.16 841 but the way they have been written they could be 39. 51 .50, 148.16.841 or 39 51.550, 148 16.841. Do these look like WGS 84 coordinates and what is the best way to input them into excel? Do I have to set or reset the projection in ArcMap before I take the measurements? As you can see I am not confident with the basics of the coordinate system and projection system so any help and tips would be appreciated.


arcpy, ".lyr" file to shapefile or raster

i am using arcgis server 10 and python 2.6.5. i have created a "test.lyr" file, now i wanted to convert it either to shape file or raster file. i have created the "test.lyr" from "test0.tif" and added symbology from "test0.lyr" files as follows.                arcpy.MakeRasterLayer_management(tifFile,tmpFile,"#","","#")      arcpy.SaveToLayerFile_management(tmpFile,curFile)      arcpy.ApplySymbologyFromLayer_management(curFile,symbologyLayer)      the curFile in the above code is the test.lyr file obtained. can anyone plz show how to convert it to "test1.shp" or "test1.tif" file using arcpy? thanks a lot in advance.


Calculating order of points along a line

I have a shape file with transportation lines and another file with all bus stops along each line (with an attribute which links stops with specific lines to which they belong). I need to calculate line-specific order numbers for all stops - 1 being first stop from which the bus departs, 2 second stop, etc. The shp file containing stops contains duplicates of every physical stop depending on how many bus lines are using it (each of these duplicates have different "line" attribute number). Any suggestions for how to calculate the new "stop sequence" attribute for all stops? OS tools would be preferable. Thanks beforehand ## Karel


Arcgis: How to find polygons within a polygon?

I am new to GIS and ArcGIS. I have a problem I need to solve: I have a set of polygons, some of which enclose other polygons. They are lake polygons, and within lake polygons, are smaller island polygons. So if I have a given lake polygon, how can I select or get a list of enclosed island polygons? Also, some islands may contain lakes within the island... I would like to select those as well. Thanks!


QGis 2.2 layer buggy in 2.3 master

Wondering if anyone else can reproduce this kind of problem? I dual boot windows 7 and ubuntu 13.04 with QGis on both. Have updated QGis to latest on both, and created a layer in my project in 2.2 in Windows (voronoi polygons with 5 data layers). When opened in ubuntu it displays fine, but if I edit the style at all the layer disappears. EDIT: Checked in 2.3 in Windwos 7 and had the same problem, so it's a problem with master not ubuntu/windows. Title changed accordingly. Link to imgur album explaining it. Image sequence: 1: version. 2: appearance when opened fresh. Looks fine. 3: details of that layer: 25 equal counts on the first data layer. 4: changed to pretty breaks and hit apply - layer disappears in background, data field now blank. 5: but no blank data field present. Reminds me of similar bugs I've found before e.g. blank data fields


ERROR 000989: Python syntax error: Parsing error SyntaxError: invalid syntax (line 2)

I have a Field Calculator I am using with Python and I keep getting the above error. Below is the screenshot of my Field Calculator I am using. ![enter image description here](http://i.stack.imgur.com/eRUDh.png) What am I doing wrong here?


Is the "1-band raster colour table" plugin available in QGis 2.0?

I used to use the "1-band raster colour table". Is it still available in QGIS 2.2.0? It seems like I can't install it (I don't find it in the list of plugins available, even after installing the BC Consulting repository). Thank you


R - how to create a pre-determined number of identical square polygons to use for a choropleth map?

I am trying to plot crime data density (again!) over a city map, say of NY. As a well known problem there are plenty of examples on this (http://www.obscureanalytics.com/2012/12/07/visualizing-baltimore-with-r-and- ggplot2-crime-data/). These methods plot the crime density through isoclines, while I need to represent it through identical density squares of a pre- determined area (and the area / side length may change from one iteration to the other). The reason for representing crime density through squares is that the square are the hotspot areas to be patrolled. The size will influence the overall amount of police people required. This is what I am trying to achieve:   1. I would like to be able to create identical square polygons with pre-determined size to overimpose to the map (is it a raster? apologies but I've just started to learn to spell GIS!)   2. I would like to use the above squares as items to colour as in a choropleth map (i.e. different colouring in relation to frequency of crime in the area), probably using ggplot2 or similar.   3. This should allow me to see how the density of crimes per square kilometre varies changing the size (i.e. the area) of the square. I do not have a clue if it is possible to use R to create regularly shaped squares polygons of a pre-defined size to use for this (as the code snipped below attests). Any help or links to examples are welcome. I would be glad to get some indication on alternative ways to calculate the density. I have used the stat_density2 (part of ggplot2) but maybe there are better / faster ways? This is where I got to:               library(rgdal)     library(raster)     library(sp)     #NY boroughs shapefile downloaded from NY website      shp <- readOGR(dsn = "nybb_14a_av", layer = "nybb")     r <- raster(extent(shp))     res(r)=0.05     # using BoroCode as an experiment...     r <- rasterize(shp, field="BoroCode", r)     plot(r)     plot(shp,lwd=10,add=TRUE)     #don't know the result of the above: the laptop basically hangs processing     #plot(r) :)


How to interpolate population data?

I have population data (inhabitants per city and year) of 31 cities of the DR Congo for the years 1960, 1970, 1980 and 1990. I want to interpolate the population of all cities for the year 1990, to estimate the growth of them in order to locate the sites that will minimize the competition for resources. I have used an IDW and a layer of existing lakes as a barrier. However, it seems to me that the resulting layer does not have sense, and so I would like to ask if IDW is the best interpolation tool for my data or it will be better to use other, such as Kriging. Thanks! **Update:** I have to create a protected area in the DR Congo, so I want to estimate the possible growth of the cities in order to find the more suitable place to avoid competition for space and resources. ![enter image description here](http://i.stack.imgur.com/JUmoX.png)


Is there a way to create a named symbol in OpenLayers composed as either a multi-dimensional array or as a MultiPolygon?

OpenLayers provides a minimal set of "well-known" shapes which can be used as point icons:               /**      * Constant: OpenLayers.Renderer.symbol      * Coordinate arrays for well known (named) symbols.      */     OpenLayers.Renderer.symbol = {         "star": [350,75, 379,161, 469,161, 397,215, 423,301, 350,250, 277,301,             303,215, 231,161, 321,161, 350,75],         "cross": [4,0, 6,0, 6,4, 10,4, 10,6, 6,6, 6,10, 4,10, 4,6, 0,6, 0,4, 4,4,             4,0],         "x": [0,0, 25,0, 50,35, 75,0, 100,0, 65,50, 100,100, 75,100, 50,65, 25,100, 0,100, 35,50, 0,0],         "square": [0,0, 0,1, 1,1, 1,0, 0,0],         "triangle": [0,10, 10,10, 5,0, 0,10]     };      extending this is simple, as long as the shape can be represented as a single closed polygon. Is there a way to define a well-known shape as two polygons in OpenLayers? The closest I have gotten is:               // thing = square + triangle     OpenLayers.Renderer.symbol.thing = [0,0, 0,4, 4,4, 4,0, 0,0, 5,15, 15,15, 10,5, 5,15];      But since it draws the shape as one line, there is a line connecting the two parts. Is there any way around this?


ArcGIS custom addin icon

I'm working on a custom addin with C# + VS2010 + Arc10.1 Pre Release and I don't seem to find the way to make custom icons work for a button that the extension holds and for the extension itself. I pointed the Config.esriaddin appropiate attributes to the files which are both png with alpha transparencies (the icon is 16x16 and the extension img is 64x64). Is there any rule about creating images for icons I'm missing? Why would this not work? Thanks in advance.


Converting GeoNames csv file to shapefile?

How can I convert a Geonames csv file (downloaded from http://download.geonames.org/export/dump/) to a ShapeFile?


List of US government free GIS data online

The US government publishes a plethora of useful, high-quality GIS data sources online. The data includes:   * Municipal and international boundaries   * Classified points of interest   * Geographic maps   * Climate charts    * Air transportation maps    * ...and so much more, in the US and outside it. Unfortunately, the data is located in dozens of different web sites, each belonging to a separate agency. **This community wiki aims to list all the known official US data sources available on the web**. Answers should probably include:   * Site name & link   * Agency name and description   * Coverage (US \ International)   * Short description of available data   * Update date (if applicable\relevant)   * Comments about quality or experience with the data   * **One data source per answer**


Show transparency after adding transparent MapBox layer to Open Layers (Openlayers)

I'm new to tile set maps. I am trying to add MapBox layers that I made in TileMill (and have sitting in my MapBox Hosting account) into Open Layers. I have successfully added a non-transparent layer. I have also successfully added a transparent layer, however, that layer does not keep its transparency in Open Layers. It seems to put a white background behind it, thereby hiding anything underneath it. I've seen this example which I can get to work fine, but does not address transparency. I've tried adding every transparency option I can think of in Open Layers, but no luck. I'm wondering if maybe that XYZ format doesn't support transparency, because the Open Layers Getting Started tutorial Ex. 5 shows a working example using the WMS format (which has a `transparent: "true",` parameter. Anyway, here is the code I am using. Thanks for any help.                             <title>OpenLayers MapBox Example</title>


Understanding the .asc file

Reading the ESRI help, Supported raster dataset file formats, I read that ASCII Grid file types are addressed with the singular file extension _.asc_ for both 16 bit signed-integer (for discrete data) and 32 bit floating-point files (for continuous data). They say in ESRI Grid format section: > A grid is a raster data storage format native to Esri. There are two types > of grids: integer and floating point. and then, it describes what both formats are. My confusion comes in the next help section Esri ASCII raster format. There, they only mention the floating point format. So, I would like to know:   1. Is the 16-bit signed integer format for discrete data also considered a **raster** format, besides grid?    2. In ESRI Grid format - Grid data storage, they cite several other extensions such as _.bnd_ , _.hrd_ , etc.? Is the 16-bit signed-integer _.asc_ file, the ASCII version of a ESRI discrete data grid format? I am totally lost. My context motivation for this question is to describe/understand what is a file with extension **_.asc_**.


Geoserver's start process freezes

I am experiencing some trouble with starting Geoserver process. The bat start file runs but the process freezes at some point when calling the org.mortbay.start.main function... It seems it cannot get past that point and I can't find out what's causing it. Any help? I am running Geoserver 2.4.4 on win7x86


Difficulty with using truetype font symbols in Mapserver

I am basically following this workflow and having no luck. I have add a truetype font file to my fonts.list (under the alias 'ddv') however, I cannot get the fonts to render in the service. Any ideas, maybe...?                   # ma_interstate_labels.map          ########## English ##########       LAYER         NAME "county_labels"         GROUP 'county_labels'         TYPE ANNOTATION         STATUS DEFAULT         DATA "ROADS_PT_MA_Interstate_3785.shp"         LABELITEM "RTE_NUM1"         # Visible in map from zoom level 6 onwards         MAXSCALEDENOM 10400256         MINSCALEDENOM 2539         # shell symbol         SYMBOL           NAME shell           TYPE truetype           FONT "ddv"           CHARACTER "#"            END         CLASS            STYLE              SYMBOL shell              ANTIALIAS TRUE            END           LABEL            TYPE truetype            FONT "deja"            SIZE 5            COLOR 52 88 133            ALIGN center            WRAP " "            MAXLENGTH 4            ANGLE 0            PARTIALS FALSE            END # end label         END # end class       END # end of layer


Why do I get 10 GetFeatureInfo responses from ArcGIS Server when symbolized with SLD?

The following wms service is published with ArcGIS Server 10.0. I have symbolized the points with an sld file using the ogc filter "ogc:PropertyIsEqualTo". For the symbology it works fine, but when requesting a GetfeatureInfo response, I get 1 response for each rule - ie 10 reponses! Can anyone tell me why? Here is a link to the map. To get a response, you have to click the upper left corner of the icon. This is another problem which I can´t solve in ArcGIS Server 10.0 as no puffer tolerance can be set! http://geoportal.metropolregion.hamburg.de/mrhportal_heidekreis/index.html?layers=hk_sld,hk_heidekreisgrenze&baselayer=webatlas_halbton&bbox=3549460.0174745,5867679.9175333,3564393.9317435,5875877.8052127&zoom=5&style=simple


Change field map properties in ArcMap

I am trying to import csv files in ArcGIS to do a join. However, some of the fields are identified as double, some as long and some as long. Therefore the join results in bunch of columns with NULL value. I am not sure why it happens. I tried to save the numbers with three decimal position in excel as csv format but when I open the number after decimal does not change. Since I have more than 256 columns, I can't save it as xls/xlsx file. I think using python could be a solution. Any other thoughts? Python experts, could you please provide me any help. Attached is the screenshot.. ![CSV to dbf ](http://i.stack.imgur.com/8zPcn.png)


Mapnik: GeoTIFF flipped (mirrored vertically)

I generated a GeoTiff using the QGIS HeatMap plugin and want to render it on top of some OSM data. The problem is that the raster gets rendered upside-down in the output. Can someone point me in the right direction? ## mapnik xml:               <?xml version="1.0" encoding="utf-8"?>     <Map background-color="#f2efe9" srs="+proj=latlong +datum=WGS84">       <! ... Styles ... -->       <Layer name="highways" status="on" srs="+proj=latlong +datum=WGS84">         <StyleName>highways</StyleName>         <Datasource>           <Parameter name="type">osm</Parameter>           <Parameter name="file">data.osm</Parameter>         </Datasource>       </Layer>       <Layer name="heatmap" status="on" srs="+proj=longlat +datum=WGS84 +no_defs">         <StyleName>heatmap</StyleName>         <Datasource>           <Parameter name="type">gdal</Parameter>           <Parameter name="file">test.tif</Parameter>           <Parameter name="format">tiff</Parameter>         </Datasource>       </Layer>     </Map>      ## $ gdalinfo test.tif               Driver: GTiff/GeoTIFF     Files: test.tif     Size is 709, 500     Coordinate System is:     GEOGCS["WGS 84",         DATUM["WGS_1984",             SPHEROID["WGS 84",6378137,298.257223563,                 AUTHORITY["EPSG","7030"]],             AUTHORITY["EPSG","6326"]],         PRIMEM["Greenwich",0],         UNIT["degree",0.0174532925199433],         AUTHORITY["EPSG","4326"]]     Origin = (...)     Pixel Size = (0.000849347874585,0.000849347874585)     Metadata:       AREA_OR_POINT=Area     Image Structure Metadata:       INTERLEAVE=BAND     Corner Coordinates:     ...     Band 1 Block=709x2 Type=Float32, ColorInterp=Gray       NoData Value=-9999      ## $ gdalsrsinfo test.tif               PROJ.4 : '+proj=longlat +datum=WGS84 +no_defs '          ...      ## render.py               import mapnik     m = mapnik.Map(1024, 1024)     mapnik.load_map(m, "mapnik_style.xml")     bbox = m.layers[1].envelope()     m.zoom_to_box(bbox)     mapnik.render_to_file(m, "map.png", "png")      **edit:** I used gdal & numpy to reverse the pixels and it rendered correctly. But then that raster displays upside-down in qgis.


Can someone explain to me what the "mini dump" error mean in QGIS?

I am struggling to understand what the error "Crash dumped: mini dump written to C:" means in QGIS. I am working with layers stored on a network drive. Whenever I try to read in a few particular .asc files QGIS returns the above error and closes. These layers were working fine until I did some processing of one of them in SAGA and saved out to a new file. Now I can't read any of the original or processed layers, or any new .asc files exported from SAGA for that matter. The original layers still work fine on all other computers in the department, so they are not corrupted, it is something to do with my version. Very confused, so any help would be greatly appreciated! Thanks, Sam


update a row with null geometry arcgis api for javascript

I am working on a project with ArcGIS api for javascript. I want to use something like "Replace Geometry Tool" in advanced editing in ArcMap: My application will generate a shapefile of points. Some rows in the attribute table of this shapefile will have NULL geometry, and I want to edit this shapefile in order to assign point geometry to the rows having null geometry.


Relationship between MS Access DB and Google Maps API/Fusion Tables

We are having an issue with a project that we are working on using Google API and M.S Access. Our project goal is to design a web map in Google API where we can select a parcel of land and have all of the information regarding all of the minor variances that are associated with that parcel come up in a pop up window. We have created a google fusion table of the parcels kml and have it show up on our map. Each parcel has a unique ‘ARN’ number that corresponds to the ‘ARN’ number on the minor variances that is associated with that parcel. All of the minor variances are stored in a Microsoft Access table with all of its associated information (ie Roll Number, City, By Law Numberetc). We want to create a relationship between the parcels layer and the minor variance Access database so that when the parcel is clicked on the web map all of the information for the minor variances that are associated with that parcel (based on the shared ‘ARN’ number) come up in the pop up window. We figure we may have to export our Access database as a CSV and bring it into google fusion tables in order to create a relationship. We have provided a visual below on how we would like our information to be displayed. I created a mock up of how we want the popup windows to look in a very rough form. The fields in the second image are all from the MS Access DB, though not all will be included in the final window. Any information on how to create this relationship between the parcels kml and our Access database would be greatly appreciated. Thanks; ![Mock up of end goal](http://i.stack.imgur.com/gUcDv.jpg) ![Mock up 2](http://i.stack.imgur.com/epsyB.jpg)


Get srid from a shapefile using ogr

I'm writing a script to import shp to postgis, using python, osgeo and psycopg2 ( see my previous question: Import shp to Postgis using Python and ogr ) I'd know if there is a way to get by osgeo library the SRID (for example 4326) of the shp. So I can confirm the SRID or transform it using script directly. Thanks f


Gdalwarp script misbehaving in Qgis 2.0, size increasing

My code: mask = str(shpLayer.source()) output = "C:/Users/.../crop.tif" inputt = str(rasterLayer.source()) subprocess.call(["gdalwarp","-q","-cutline",mask,"-crop_to_cutline",inputt,output], shell = True) My problem: This code was working fine in Qgis 1.8, but when i changed it to 2.0 Gdalwarp began to get into a loop and gdalwarp.exe executing without stop, creating the crop.tif with a increasing size, it only stops increasing when gdalwarp is forced to stop. Anybody got trouble with this before ?


1:250 streams data - USA wide - where can I find it?

I have 1:250 streams data for a few western states. I find this scale to be excellent in many settings as base hydro data. I have never been able to find a USA or better yet, NA wide dataset of this scale. Does anything like this exist for the USA or NA? Look at the attached Idaho jpg for an example of this data ![enter image description here](http://i.stack.imgur.com/yfh1q.jpg)


Creating distributive flow line map showing movement of passengers from bus terminal to several destinations?

I'm writing my final year B.Sc thesis on transportation (pattern of passenger flow from a bus terminal to several destinations). I intend using a distributive flow line method of spatial movement analysis in ArcMap, now i have the software and flowline tool all ready, I also have a raster map showing the defined source region and defined destination regions of passengers, I was able to add a point to signify the source point and several other points to signify the destination points. I also have a record of number of passengers moving to all the various destinations from the defined source point. What i don't know is how to make flow lines of different width, to link the source point to the several destination points, I want to make the width of the lines to be defined by the number of passengers moving through them (i.e the higher the number of passengers, the thicker the lines and vice-versa).


Using Custom Functions in a Python Toolbox

I am trying to put together a python toolbox (Arc 10.1) and would like to use a defined function in my code. The function is:               'sys' is imported at the top of the file         def listdirs(folder):             return [d for d in os.listdir(folder) if os.path.isdir(os.path.join(folder, d))]      It's a handy little bit of code I picked up on stackexchange that returns a list of folders in a given path. I can't seem to figure out how to integrate it into the toolbox, everywhere I put it seems to disagree with the toolbox. Initially I had it in the def `execute(self,parameters,messages)` block. That didn't work, so I moved it outside of that and into the class level. I also tried putting it outside of the class. The toolbox compiles without any errors (Using the 'Check Syntax' tool in the context menu in ArcCatalog) but when I run it my script fails the first time the function is called. No specific error is thrown, but my script exits through the `except` statement and doesn't finish the `try` block Should I put it into an external file and then import that like I do arcpy,sys,traceback etc? Does anyone know if there are certain restrictions to using custom functions inside of a python toolbox and if so, what they are? Thanks in advance. -- EDIT -- So, it seems that the real issue was that I was including `sys` and not `os` like I should have been. Rookie mistake. Anyhow, the script seems to be running nicely now, python toolboxes are great and are making my life much simpler. Regarding the crux of my original question for any folks curious in the future - it doesn't seem to matter where you define a custom function in the python toolbox. As long as it has the classes that ArcGIS needs to know what to do with it anything else is ephemera. Thanks as always for the help in debugging this!


How to work with OGR and GDAL in GP Service in ArcGIS for Server 10.1

I have got a lot troubles with GDAL and OGR in the context of ArcGIS Server on 64 bit server machine. I can run script that use GDAL in ArcGIS as Tool and in the debug mode in PyScripter, then publish script as GP Service. I know that ArcGIS for Dekstop use 32 bit version of Python, and Server use 64 bit. I can see both version in Python27 folder. So in the desktop mode (32 bit) everything is Ok. But when I use submit job by REST I get an ERROR > esriJobMessageTypeError: Traceback (most recent call last): File > "C:\arcgisserver\directories\arcgissystem\arcgisinput\project\Analize.GPServer\extracted\v101\Analize.py", > line 14, in from osgeo import gdal File "C:\Python27\ArcGISx6410.1\lib\site- > packages\osgeo__init__.py", line 21, in _gdal = swig_import_helper() File > "C:\Python27\ArcGISx6410.1\lib\site-packages\osgeo__init__.py", line 17, in > swig_import_helper _mod = imp.load_module('_gdal', fp, pathname, > description) ImportError: DLL load failed: Nie można odnaleźć określonego > modułu. I know that the reason is GDAL library. How to configure environment on ArcGIS Server machine to force to use 32 bit GDAL in the case of ArcGIS for Desktop and 64 bit for ArcGIS Server? I installed: GDAL for Desktop 32 bit according this solution How to run OGR in ArcGIS Scripts? GDAL for ArcGIS 64 bit the same packages but for 64 bit When I change PATH to new GDAL 64 bit script in ArcGIS and Service does not work If PATH is set to GDAL 32 bit script works, but I still get error by REST. It seems that ArcGIS Server does not see the GDAL library on the server machine.


Creating a loop to predict over small areas

Based on a SDM, I am I am trying to use the predict function (raster package) to predict the model to South Africa. It runs off memory and gives me an error when I predict for the entirely country, however it works ok if I use a small section (2x2 degrees) using the function extent. Can someone advise me about the script to run a loop so I can use the prediction function over small areas?


can not delete file after using runalg function

I my plugin I use the runalg function:               processing.runalg("qgis:clip",filepath + "/temp2.shp", Layer, filepath + '/' + layerName)     vlayer = QgsVectorLayer(filepath + '/' + layerName + '.shp',layerName, "ogr")     QgsMapLayerRegistry.instance().addMapLayer(vlayer)      Afterwards I want to delete temp2.shp with               os.remove(filepath + "/temp2.shp")       but I get the error _WindowsError: [Error 32] The process cannot access the file because it is being used by another process: 'C:/Users/toke.nielsen/Desktop/temp/temp2.shp'_ Is there a way to unlock temp2.shp after using runalg? And is there a way to clear all variables and memory when the plugin is done? I have tried this, but it is not working with QGIS 2.2: PyQGIS file lock release


QGIS 2.2 - Opening ArcPad *.tif.aux *.tif.sdw *.tif.sid

I use QGIS 2.2 with Ubuntu Linux and with Windows 7. Under Win7 I can open the ArcPad data without problems. The browser find it and I can add this data in a layer. Under Ubuntu the browser cannot find the data, QGIS can add a layer, but the raster-map is visible but defect. What can I do?


Why isn't Generate (Coverage) Tool working?

I'm using ArcMap 10.2 and I have the Advanced Licence, but when I try running the Coverage (Toolbox) it does not seem to work. Any advice on what is going wrong? ![nothing happens even if I double click on it](http://i.stack.imgur.com/q3M61.jpg) I am trying to Generate Coverage. I've got there searching for **Coverage - Conversion - To Coverage - Generate. Nothing comes up even if I double click on it**


Crash upon heatmap

I am completely new to qgis. I am trying to generate some heatmaps from crime data... and failing miserably. I have tried with my own data and the data in the heatmap guide here http://www.qgistutorials.com/en/docs/creating_heatmaps.html My data imports as a layer but when I click ok in point 8 of the guide above qgis crashes. I have tried this on a macosx intsall and also a windows 7 install (both running on a mac book pro). Same problem with both. Clearly I have missed something...can anyone please point me in the right direction? The error message on crash is below (seems the full message is too long - this was the start of it!): > Process: QGIS [2901] Path:   >  /Applications/QGIS.app/Contents/MacOS/QGIS Identifier:   >  org.qgis.qgis2 Version: 2.2.0 (2.2.0 []) Code Type:   >  X86-64 (Native) Parent Process: launchd [141] Responsible: QGIS [2901] User > ID: 501 > > Date/Time: 2014-04-15 10:51:14.395 +0100 OS Version: Mac OS X 10.9.2 (13C64) > Report Version: 11 Anonymous UUID: A664E1BB-A3B7-88FB-0FD3-91446A0D8BC2 > > Sleep/Wake UUID: 0F168188-E5AA-4DFF-A534-7D965E1619C0 > > Crashed Thread: 0 Dispatch queue: com.apple.main-thread > > Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: > KERN_INVALID_ADDRESS at 0x0000000000000000


How to intersect more than 2 layers in QGIS

I have a dozen layers, some intersecting with others. Using the Intersect tool only allows 2 layers at a time but can you add extra layers to find where it intersects? Even if it's 3 layers as shown in the image where the small black area is the intersection. Thank you. Joseph http://imgur.com/r1lfXxY


QGIS Python - Convert geometry from Postgres to QgsPoint()

I have made a query in Postgres to get some points to use with python. This points are in geometry data. How can I convert that geometry in decimals to use QgsPoint() in python? Thank you


ArcGIS crashes with no error number in Visual Studio

I've been developing Add-ins for a while with Visual Studio 2008 and ArcGIS 10. But in my new Add-in development process, I receive no error from Visual studio and ArcGIS crashes with error "Arcgis encountered serious application error and need to be closed". I tried setting breakpoints and the program stops correctly at the breakpoint. But when I use F8 to proceed, I can identify the line which has the error but no error screen from Visual studio appears, as normal. Can you help me? This way I can't debug and specify exact problem in my code


How to show .shp file on Mapview(ArcGIS Android SDK 2.0.0)

I'm using ArcGIS Android SDK for first time. I have worked on a sample project and am able to get a World map using this..               map = (MapView) findViewById(R.id.map);     map.addLayer(new ArcGISDynamicMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"));      But my problem is:   I have some *.shp(shapefile) files and I would like to show them on mapview. How can i do that? Thanks in Advance...!


Neighborhood boundaries and building footprints for Johannesburg?

Are there any sources for free (or commercial) and distributable neighborhood and building footprint datasets for Johannesburg out there? I've already looked on:   * Google   * OpenStreetMap   * joburg.org.za   * demarcation.org.za   * sa-venues.com   * SOCIOECONOMIC DATA AND APPLICATIONS CENTER (SEDAC)   * geoscience.org.za   * gadm.org and probably some more that I do not remember right now...


Divide a complex shape file into a grid

I have a decently detailed shapefile with polygon/multipolygon features (the file is about 500mb). It's actually a shapefile of the entire world, with the features representing coastlines. I need to divide this data using a grid. To be clear, I don't want to 'sort' the data, but actually cut the polygons up into tiles. I realize this question has been asked before but the solutions I found didn't work for me. I've tried:   * Using QGIS and intersecting my shapefile contents with a vector grid -- the results are terrible. Most of the major landmass magically disappears, though it seems like smaller chunks of land sometimes make it. I should note that this method works really well with much simpler data (ie. less points)   * Using OGR's Intersection tools. I tried it both through ogr2ogr and even by rolling my own C++ tool. Both of them have the same problem as QGIS. They also don't exhibit this problem for simple files, but fail the more complex ones. For reference, I'm using a shapefile of Australia and New Zealand, under 20mb in size, and both QGIS and OGR fail to 'gridify' it. Someone suggested using PostGIS at one point, since it has an intersection function -- but PostGIS's ST_Intersect uses the same GEOS backend as OGR does. In fact they both call the same function as far as I can tell, so I don't think that PostGIS will yield different results. I was looking for suggestions as to what else I could try. I need a robust application or toolkit that can divide highly detailed shapefiles into tiles. EDIT: Adding some more information In response to Simbamangu:   * The shapefile is basically coastline data from OpenStreetMaps. It's a merged version of the 'processed_p' file (so its not split up into tiles) that I got by emailing their dev list. Note that their splitting up of tiles (into 100km x 100km chunks with overlap) isn't necessarily what I want -- I don't want overlap, and I want the freedom to choose the grid size, or I'd just use the default processed_p.   * By default the coastline data has geometry errors reported by QGIS. I fix these errors with a small tool I put together using some code I found designed to specifically address this problem (repairing geometry errors in coastline data: https://github.com/tudelft-gist/prepair). Running over the files with this tool fixes virtually all the errors QGIS picks up. I only attempt to do the intersection after cleaning the files.   * Exactly what I did using QGIS: Open the data to make sure it looks fine in QGIS. Try dividing it into tiles by creating a layer of tiles using Vector Grid with a specified spacing, and then intersecting the two layers -- no go. Try using a smaller data set -- select features in Oceania (Aus, NZ) to try a smaller data set -- this shape file is < 20mb in size. Again try dividing it, doesn't work.   * What I did with OGR: ogr2ogr directly using the '-spat' and '-clipsrc' options with spat_extent. Also wrote a small C++ tool that works on WKT, so I convert the shapefile to WKT using ogr2ogr, then feed the text file to my application. It runs through the file and calls the Intersection() method documented here: http://www.gdal.org/ogr/classOGRGeometry.html. I think it ends up doing the exact same thing as using ogr2ogr directly.  In response to Brent:   1. It does. Everything is in WGS84 Lat/Lon   2. I would have thought that the opposite is true -- that for a given set of grid tiles, it would take way longer to intersect one giant multipolygon rather than a bunch of fragmented features which could be more spatially localized to each tile, but this is an interesting suggestion -- I'll try it and report back.   3. No attribute fields are kept during the process, I'm only interested in geometry.   4. I'm not sure, but I think you're saying I should select the polygons that overlap a given grid tile and then perform the intersection. This is too cumbersome manually with QGIS. My tool already does this to a certain extent with a bounding box check. There's a bit of a speed up, but the end result is still poor and not noticeably different.   5. This isn't an option. Right now I'm trying to divide the data up so that its 1 deg lat x 1 deg lon, and I'm looking for a general/robust methodology that works with all cases. I've tried increasing the grid size (ie 10x10) to see if I'd get better results and I don't see any correlation between grid size and the quality of the output. Edit #2: I've tried playing around with this more and in general it just seems that the results are unreliable both using GEOS and with QGIS (which uses fTools, I don't know if that in turn uses GEOS again). I was wrong in stating the size of the grid has nothing to do with the results -- the bigger the grid is, the better the results (that's good to know but still not a solution). Here's a screenshot of a really spaced out grid that mostly worked, but failed partially in one tile: ![enter image description here](http://i.stack.imgur.com/RR191.png) The geometry is clean -- QGIS shows 0 errors with the "Check Validity" tool. I'm not looking to approach this problem in a step by step fashion; verifying whether or not certain features failed the intersection on a dataset this big when its not visually apparent (and it won't be with smaller tiles) isn't practical.


How to make a 3d visualisation of different peat layer to show the height of each layer?

I have bore hole point data that has about 5 to 7 types of peat layer and also has several depths. I also have digital elevation data of the area. I need to interpolate these layers separately, then visualise the layers sequentially in 3d. Is it possible to to it with ArcGIS? I want to add a Screen shot that may make my querry more clear: ![enter image description here](http://i.stack.imgur.com/7gRXT.png) My points include the measurement depth of 4 different quality pit layer. The left image is my data set and right image is what I want from my data. I want to visualize a block diagram of formation of each peat layer. I did not find a clear description or tutorial to make the block diagram in arcscene.:-(


Which is better, DEM or Triangles (TIN/Terrain)

Which is better DEM or TIN? What are the benefits/negatives of each?


What is wrong with my data receiving from php script for geoJSON TileLayer?

I want to get geo data as geojson for geojson tile layer requests in leaflet. I set up a geojson layer like this: https://github.com/glenrobertson/leaflet- tilelayer-geojson/ A php script answers requests and reads polygon geometries as geojson with `ST_AsGeoJSON` from postgreSQL. Each request is mapped to those php file by an htaccess to geo.php. I can see all requests in Google Chrome in developer tools on network tab. It looks like: .../geo.php/12/2165/1356.json with following response:               {"type":"MultiPolygon","coordinates":[[[[10.42523568,51.79692078],[10.4301414,51.80612562],[10.43525988,51.82238007],[10.4370354,51.82429887],[10.44274896,51.82353972],[10.43982036,51.81211476],[10.45402992,51.8089752],[10.45623312,51.80868153],[10.46150892,51.81088257],[10.46547216,51.81090543],[10.466424,51.8089905],[10.46608272,51.80111316],[10.45419408,51.79484178],[10.45109448,51.79397202],[10.4386608,51.79716873],[10.42523568,51.79692078]]],[[[10.4174298,51.83180235],[10.42399224,51.83617779],[10.42398648,51.83724978],[10.42081272,51.83961867],[10.4292108,51.84436419],[10.43632332,51.84550854],[10.4398488,51.84357831],[10.44083196,51.83844759],[10.425852,51.83020782],[10.42100424,51.83043291],[10.4174298,51.83180235]]]]}      Output is calculated by x,y and z as zoom. Those parameters are calculated and transformed by the following function:               function tileCoord2BBox($url)     {         $parsed = explode("/",$url);              $z = $parsed[3];         $x = $parsed[4];         $y = $parsed[5];              $n = pow(2, $z);              $lon1 = $x / $n * 360.0 - 180.0;         $lat1 = rad2deg(atan(sinh(pi() * (1 - 2 * $y / $n))));              $lon2 = ($x + 1) / $n * 360.0 - 180.0;         $lat2 = rad2deg(atan(sinh(pi() * (1 - 2 * ($y + 1) / $n))));              $bbox =  array();         $bbox['lon1'] = $lon1;         $bbox['lat1'] = $lat1;         $bbox['lon2'] = $lon2;         $bbox['lat2'] = $lat2;              return $bbox;     }      Reference: http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames Those return values are used in sql statement defininig a bounding box which selects those polygons which are in that tile. Postgres returns geojson for resulting geometry. I tested the responses with http://geojsonlint.com/ They all looks great. But on leaflet map, I only see a partial polygon on only one tile. When I zoom or pan over leaflet map then another tile shows up with partial polygon. In tilelayer.geojson.js on line 187 Chrome reports many errors with following output: > Uncaught TypeError: Cannot read property 'type' of undefined > TileLayer.GeoJSON.js:187 > L.TileLayer.GeoJSON.L.TileLayer.Ajax.extend.addTileData > TileLayer.GeoJSON.js:187 > L.TileLayer.GeoJSON.L.TileLayer.Ajax.extend._tileLoaded > TileLayer.GeoJSON.js:246 (anonymous function) It is reported on this line: https://github.com/glenrobertson/leaflet- tilelayer-geojson/blob/master/TileLayer.GeoJSON.js#L187 I think my output from server is ok. I will see a result on one tile and http://geojsonlint.com/ shows correctly that those data is valid for all the other requests. Also all requests have valid output. What am I doing wrong? Why is it still showing an error even though all responses seem to be valid? If someone has a complete example with client and server side code using a geojson layer and with postgres or similiar, I really would appreciate that. I do not know how I can solve my problem.


How to install Python libs for XYtools to read Excel files

I need to use the XYtools plugin to read an Excel file. After choosing the XYtools incon and indicating an Excel file to read in, a message appears "there is a problem with loading a python module which is needed to read/write Excel files. ... see documentation/help on how to install the xlw and xlwd libraries." I found the site where the Python items reside but I cannot understand at all what to do next. Apparently the needed Python libraries are not installed with XYtools. I would appreciate being pointed to somewhere that might give some help with _exactly_ what to do to get XYtools to work with Excel files.   Thanks -


ArcGIS GUI Batch Commands: How to set directory?

I have a question which has been bothering me for ages. When I do a batch command in ArcGIS e.g. Projection transformation the batch dialog has a field for the "new file name". The default Directory is however always the same folder as the original files. If I want to change the Directory but keep the old names, there is a strange syntax which I can use....something like `%n%`...but I would still have to copy and paste the complete path to the new folder. Why is there not the option to simply pick a new folder and viola!?! or is there an easier way than having to search the forums for this syntax every 2 months when I need to run the batch command? Thanks for any help, Robert


How to (using OpenLayers) panTo/setCenter on a OpenLayers GeometryPoint

Xpost from Stackoverflow. First, I'm new to OpenLayers. The following is a snippet of HTML which represents a couple of images on a map rendered via OpenLayers. **QUESTION** : using the information below how can I programmatically bring one of these image elements into view? I.e., I think I'd like to **panTo** or **setCenter** on one of these elements. This is part of a test script where I find the images in the HTML, bring them one-by-one into view and take some action on them. The from projection is EPS6:4326 and the to projection is EPS6:900913. Thanks.               <svg id="OpenLayers_Layer_Vector_98_svgRoot" style="display: block;" width="1663" height="301" viewBox="0 0 1663 301">         <g id="OpenLayers_Layer_Vector_98_root" style="visibility: visible;" transform="translate(-33.02402040717425,-1.0000000016589183)">         <g id="OpenLayers_Layer_Vector_98_vroot">             <image id="OpenLayers_Geometry_Point_106" cx="458.11467034582165" cy="220.41962755130953" r="1" preserveAspectRatio="none" x="432" y="195" width="51.28563443264394" height="51.28563443264394" xlink:href="http://MyURL/service/maps/getDetails/../chart?cht=pc&chco=ee3324CC|ed8000CC&chd=t:78,22&chs=150x150&chf=bg,s,00000000,o,4,00000040" style="opacity: 1" fill="#000000" fill-opacity="1" stroke="#000000" stroke-opacity="1" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>             <image id="OpenLayers_Geometry_Point_108" cx="622.4436271582672" cy="115.50492808134004" r="1" preserveAspectRatio="none" x="594" y="87" width="57.54611514812745" height="57.54611514812745" xlink:href="http://MyURL/service/maps/getDetails/../chart?cht=pc&chco=ee3324CC|ed8000CC&chd=t:0,100&chs=150x150&chf=bg,s,00000000,o,4,00000040" style="opacity: 1" fill="#000000" fill-opacity="1" stroke="#000000" stroke-opacity="1" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>             <image id="OpenLayers_Geometry_Point_110" cx="437.6028635396797" cy="115.08515270121279" r="1" preserveAspectRatio="none" x="412" y="90" width="50.648406931246505" height="50.648406931246505" xlink:href="http://MyURL/service/maps/getDetails/../chart?cht=p&chco=ee3324CC|ed8000CC&chd=t:0,100&chs=150x150&chf=bg,s,00000000,o,4,00000040" style="opacity: 1" fill="#000000" fill-opacity="1" stroke="#000000" stroke-opacity="1" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>         </g>             <g id="OpenLayers_Layer_Vector_98_troot"/>         </g>     </svg>


Geoserver styles - changed feature icon on mouse over

I am using OpenGeo and OpenLayers 3. I managed to set a WMS layer from PostGis (Configure new SQL view) where I show points from coordinates I have in database. I also managed (following tutorial on docs.geoserver) to set the custom icon as graphic. The next step is that this graphic icon changed on mouse over. I understand, that only image is transferred to client from GeoServer since I am using WMS. But there must be a way to do that. Is it? I think I must use WFS, but maybe I am wrong. What then? There are not plenty examples for OpenLayers3. Icon style:                  <FeatureTypeStyle>          <Rule>            <PointSymbolizer>              <Graphic>                <ExternalGraphic>                  <OnlineResource                    xlink:type="simple"                    xlink:href="image.png" />                  <Format>image/png</Format>                </ExternalGraphic>                <Size>32</Size>              </Graphic>            </PointSymbolizer>          </Rule>        </FeatureTypeStyle>


Arcgis 9.3 Conditional Statement

I'm having trouble performing calculations with single output map algebra ArcgIS 9.3 using conditional statements and applying it to several model outputs as they are generated: The statement is: Con(dem%n%<= -0.02,1). I have tried these: Con('dem%n%' <= -0.02,1) and Con("dem%n%" <= -0.02,1) but they seems unstable. What would be a better solution?


How do I manually classify graduated data in QGIS?

Is there any way to manually classify Graduated Data in Qgis. In ArcGIS I always used to apply first the natural breaks method to find adequate group sizes for good visual interpretation. Afterwards I adjusted slightly the group-size to have nicer breaks. So if for example breaks from jenks classification would have been:               1-12     13-21     22-42     43-50      than I could change them manually to:               1-10     11-20     21-40     41-50      by just clicking into the corresponding rows and changing the values.   Anything similar in Qgis? Besides: Has anybody idea why Qgis always finds different group sizes any time I push on Jenks?


How to find the second highest value in a rasterStack in R

I have a rasterStack of rasters representing count data. I want to return a single raster whose values are the index of the raster with the second highest value for each cell. (I used which.max for the highest value.) I'm using the raster package in R, but could use ArcGIS too. Thanks! This works for identifying the raster with the max value:               set.seed(123)     library(raster)     r1 <- raster(nrows=10, ncols=10)     r2=r3=r4=r1     r1[]= runif(ncell(r1))     r2[]= runif(ncell(r1))+0.2     r3[]= runif(ncell(r1))-0.2     r4[]= runif(ncell(r1))+0.5          rs=stack(r1,r2,r3,r4)     plot(rs)          rs.max<-which.max(rs)     plot(rs.max)


How to programmatically change raster symbology after reclassification?

I have created a code in Python that I will use for a custom tool in ArcGIS, the code will create a Eucledian Distance of 6000m around a point and Reclassify the distance from 0-2000, 2000-4000, 4000-6000. The code works but what I was wondering was, is there a bit of code I can add on to make the 0-2000 area red, the 2000-4000 area to be orange and the 4000-6000 area to be yellow. As the code stands the colours are random i guess (blue, green etc.). I have been looking through a few books but could not find a solution.               from arcpy import env     from arcpy.sa import *          # Set environment settings     arcpy.env.workspace = "Z:\\GIS TEST\\Select_by_Location"     arcpy.env.overwriteOutput=1          # Check out any necessary licenses     arcpy.CheckOutExtension("spatial")               # Local variables:     Breakout_Location = "Breakout_Location.shp"     maxDistance = "6000"     Output_direction_raster = "Z:\\GIS TEST\\Codes\\Output"          # Set Extents     arcpy.env.extent = arcpy.Extent(31652.290929,28102.389486,269652.513962,212966.447186)          if arcpy.Exists(Output_direction_raster):         arcpy.Delete_management(Output_direction_raster)     Euc_Dist1=EucDistance(Breakout_Location, 6000, 400, Output_direction_raster)               # Process: Reclassify     Reclass_Output_direction_raster = Reclassify(Euc_Dist1, "Value", RemapRange([[0,2000,1],[2000,4000,2],[4000,6000,3]]), "DATA")          arcpy.SetParameterAsText(0, Breakout_Location)               Reclass_Output_direction_raster.save("Z:\\GIS TEST\\Codes\\Output")


Mouse hover with CartoDB?

Some of the CartoDB maps online, like Illustreets react constantly to mouse hover instead of requiring a click. Is there a way that I can do that with my CartoDB maps?


How to connect Dotspatial with PostGIS/PosgresSQL database and perform SQL function

I am currently doing a project that needs a GIS front-end interface to visualize geographical objects (road networks), and a back-end geo-spatial database to implement network analysis (SQL based). Our development platform is based on C#. I understand QGIS is powerful and available but as we really want to build an independent platform so we do not consider it. Now, the progresses include:   * I have built a front-end Dotspatial based GIS interface, it can display the road networks and query them as we want.   * I have installed the PostgresSQL and its spatial extension PostGIS. However, the current issue is how to connect the Dotspatial GIS platform with PostGIS/PostgresSQL in order to perform the analysis we need. What I really want is to do all activies at interface side. For example, by selecting a button the software do analysis automatically, and everything is going without other operation at PostGIS database side. How can I start? Any information or helps? Many thanks!


CSV and GDAL 1.10 in QGIS

It seems the GDAL upgrade from 1.9 to 1.10 changed the way CSV files are handled so that I now have a non-functioning QGIS. App hangs trying to import csv data file when previously had no problems with this and other csv text files. I have deleted all data files, all files in the hidden .QGIS folder, all prefs and caches etc yet the app continuously tries to load the problematic file that I have deleted. Even replacing the bad file with another CSV file that works in another project fails to prevent the hang. So now I have to recreate the project with customised colour schemes and 100s of hours of devt over the last 6 months while QGIS was stable.


LSA-SAF data reprojection with GDAL and R

The Land Surface Analysis Satellite Applications Facility (LSA SAF) distributes several products derived from the EUMETSAT satellites data. I am working with `R` to read and process the data (the file of this example is available from the Static Auxiliary Data page of the LSA-SAF service.)               library(rgdal)     library(raster)          r <- raster("HDF5_LSASAF_USGS_DEM_Euro.hdf")      Although the file is read correctly, the projection info is missing.               > r     class       : RasterLayer      dimensions  : 651, 1701, 1107351  (nrow, ncol, ncell)     resolution  : 1, 1  (x, y)     extent      : 0, 1701, 0, 651  (xmin, xmax, ymin, ymax)     coord. ref. : NA      data source : /home/oscar/temp/HDF5_LSASAF_USGS_DEM_Euro.hdf      names       : HDF5_LSASAF_USGS_DEM_Euro      values      : -32768, 32767  (min, max)      If I use `gdalsrsinfo` to parse the file and obtain the projection, I get `ERROR 1: ERROR - failed to load SRS definition from ...` which is more or less the same if I use `GDALspatialRef` in `R`:               > GDALSpatialRef('HDF5_LSASAF_USGS_DEM_Euro.hdf')     [1] ""      As far as I know these files use the GEOS projection. However, if I set this PROJ.4 string and the file is transformed to a latitude-longitude projection, the results are erroneous (look at the extent of the `projectExtent` output):               projection(r) <- CRS("+proj=geos +lon_0=0 +h=35785831 +x_0=0 +y_0=0 +ellps=WGS84 +units=m +no_defs ")          > projectExtent(r, CRS(projLL))     class       : RasterLayer      dimensions  : 651, 1701, 1107351  (nrow, ncol, ncell)     resolution  : 8.983153e-06, 9.043695e-06  (x, y)     extent      : 0, 0.01528034, 0, 0.005887445  (xmin, xmax, ymin, ymax)     coord. ref. : +proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0       It seems that the LSA-SAF data are not yet geo-corrected and the images are expressed in the "raw" Column-Row system, so this could be the root of the problem. There are Latitude and Longitude static files which could be used for remapping the rasters. However, I would like to use a more direct approach with a correct PROJ.4 string and a projection transform with `gdalwarp` or `rgdal::spTransform` in `R`. Thanks in advance for any help.


LayerUploadPanel not works

how can i add a layer upload panel tool in my suite sdk? The main problem is when i click "upload layers" button. Appear errors in the firebug. I don't know the reason why those errors appear TypeError:b[e] is not a constructor... TypeError:this.dataStore is undefined:this.dataStore.emptyText = this.dataStoreEmptyText; (in LayerUploadPanel.js line 327). i'm not sure if i haven't added the necessary code to app.js. i want to upload mi own shapes from layeruploadpanel, but i don't how to do it. Anyone could help me please?


How can I access a raster dataset's attribute table?

I need to loop through the rows in the raster attribute table and add a date for each row. Thanks,


contour lines from point shape attribute

I have a point shape file and one of the attribute refers to the altitude. Is is possible to obtain a contour lines shape file in GRASS?


Is a WMS map always a constant scale?

If I get a map back from a WMS server is the scale always constant over them map regardless of the reference system? So if I have a map which is 100 pixels wide, will the point at 50 pixels always be half way between the minimum and maximum values of the sides of the bounding box that defines the map? So can I always linearly interpolate the map coordinates based on the pixel position? Or can there be cases where 50% of the way across the map in pixels is not 50% of the way between the minimum and maximum of the width of the bounding box for some reason, like the projection is not constant?


how to intersect a raster subset with a buffered vector layer (points) in QGIS?

I am a bit new in the GIS and qGIs sphere so maybe my question will look a bit naive, but at the same time it means it should probably be easy for most of you guys ;-) I work in QGIS.I have 2 layers: (1) raster: grid representing global land cover / CRS "WGS 84" (2) vector: a series of point representing factories / CRS "WGS 84" I would like to select a subset from the grid only pixels with value 11 & 14 and intersect these selected pixels with a buffer of 50km around each factory. The result I would like to save as a new layer (preferably raster). How can I do that in a simple but correct way? Thanks Xavier


Traversing a PostGIS table tree

I'm developing a geospatial db for a company that operates at a number of large facilities. Its primary purpose is to help staff locate themselves and equipment within each facilities' multi-storey buildings. I'm using ArcGIS's Building Interior Space Data Model (BISDM) as a schema template and implementing it in PostGIS. The table structure looks something like this:               facility       building         floor           boundary           interior_space             equipment            transport         road         pedestrian_path            perimeter         fence         vehicle_gate         pedestrian_gate      Each parent table has a one-to-many relationship with it's children, so the schema defines a simple hierarchy. Each table has `short_name`, `long_name` and `geom` columns (as well as others, depending on the table). My problem is this: I want to build a reverse-geocoder API that takes lat/long as input and returns a string representing the address of the matching locations. I've gotten stuck on how to construct this string. My idea was to create a query that takes as its starting point the row containing the geom closest to the lat/long point and then traverse up the table hierarchy, collecting the value of short_name for each parent record until it reaches `facility`. So the assembled address in this case might be _'Room 323A, Floor 4, Building 12, Facility Q'_ (`interior_space->floor->building->facility`). However, because I don't know which table my query will start from (since it could be a point anywhere within the facility) I don't know what the parent table names will be in advance, and so I can't construct any `JOIN` queries. I'm familiar with approaches like _adjacency lists_ and _closure tables_ to model hierarchal systems, but these all require the data to be in a single table. The PostGIS requirement (well, strong recommendation) for different geometry types to be kept in separate tables means I can't use these approaches. Can anyone suggest how I can construct this string without having to create a bunch of hard-coded SQL queries?


How to put data in remote geoserver?

I created some layers and upload it to PostGIS and then GeoServer and then styled it using GeoExplorer. I have done all this in localhost. I used the iframe generated in GeoExplorer and used it in my webpage. So I can open it in my computer. But I don't understand how to keep this in remote server so that everyone can access it. I used OpenGeoSuite for doing all this. Is the data I uploaded in PostGIS and GeoServer just located in my computer or in remote server? Please help!! ## Question Extension This is the code that I am trying to run. But it's not working even in the same machine:               var map;          function init() {        map = new OpenLayers.Map('map_element', {});                  var road_name = new OpenLayers.Layer.WMS(                 "IIRS:river_canal_project - Tiled",     "http://localhost:8080/geoserver/IIRS/wms",                 {                     LAYERS: 'IIRS:river_canal_project',                     STYLES: '',                     format: format,                     tiled: true,                     tilesOrigin : map.maxExtent.left + ',' + map.maxExtent.bottom                 },                 {                     buffer: 0,                     displayOutsideMaxExtent: true,                     isBaseLayer: false,                     yx : {'EPSG:4326' : true}                 }              );             Var industrial_park = new OpenLayers.Layer.WMS(                 "IIRS:future_industrial_project - Tiled",      "http://localhost:8080/geoserver/IIRS/wms",                 {                     LAYERS: 'IIRS:future_industrial_project',                     STYLES: '',                     format: format,                     tiled: true,                     tilesOrigin : map.maxExtent.left + ',' + map.maxExtent.bottom                 },                 {                     buffer: 0,                     displayOutsideMaxExtent: true,                     isBaseLayer: false,                     yx : {'EPSG:4326' : true}                 }              );             var land_use = new OpenLayers.Layer.WMS(                 "http://localhost:8080/geoserver/IIRS/wms",                 {                     LAYERS: 'IIRS:current_landuse_project',                     STYLES: '',                     format: format                 },                 {                    singleTile: true,                     ratio: 1,                     isBaseLayer: true,                    yx : {'EPSG:4326' : true}                 }              );        map.addLayers([land_use, industrial_park, road_name]);        if(!map.getCenter()){            map.zoomToMaxExtent();        }     }      Along with the code, I inserted openlayers.js in script and only that. I found myself some mistakes and now I that can load the map but..the images are not loading. This is my edited code :               map = new OpenLayers.Map('map_element', {});                             // setup tiled layer                 var tiled = new OpenLayers.Layer.WMS(                     "earth:ne_10m_railroads - Tiled",           "http://localhost:8080/geoserver/earth/wms",                     {                         LAYERS: 'earth:ne_10m_railroads',                         STYLES: '',                         format: OpenLayers.Format.WMSGetFeatureInfo,                         tiled: true,                         tilesOrigin : map.maxExtent.left + ',' + map.maxExtent.bottom                     },                     {                         buffer: 0,                         displayOutsideMaxExtent: true,                         isBaseLayer: true,                         yx : {'EPSG:900913' : false}                     }                  );                           map.addLayer(tiled);     var bounds = new OpenLayers.Bounds(                     -135.326858520508, -30.5615100860596,                     179.357788085938, 69.604377746582     );                   map.zoomToExtent(bounds);     }


Qgis - Raster clip Problem

I tried to use the Raster (Extration) tool "clipper" and I always get this error log: What is my problem? Fehler bei der Ausführung von Python-Code:               Traceback (most recent call last):       File "C:/Dokumente und Einstellungen/user/.qgis//python/plugins\GdalTools\GdalTools.py", line 342, in doClipper         self.runToolDialog( d )       File "C:/Dokumente und Einstellungen/user/.qgis//python/plugins\GdalTools\GdalTools.py", line 370, in runToolDialog         dlg.show_()       File "C:/Dokumente und Einstellungen/user/.qgis//python/plugins\GdalTools\tools\doClipper.py", line 47, in show_         BasePluginWidget.show_(self)       File "C:/Dokumente und Einstellungen/user/.qgis//python/plugins\GdalTools\tools\widgetPluginBase.py", line 44, in show_         self.onLayersChanged()       File "C:/Dokumente und Einstellungen/user/.qgis//python/plugins\GdalTools\tools\doClipper.py", line 71, in onLayersChanged         self.inSelector.setLayers( Utils.LayerRegistry.instance().getRasterLayers() )       File "C:/Dokumente und Einstellungen/user/.qgis//python/plugins\GdalTools\tools\GdalTools_utils.py", line 161, in getRasterLayers         return filter( self.isRaster, LayerRegistry.layers )       File "C:/Dokumente und Einstellungen/user/.qgis//python/plugins\GdalTools\tools\GdalTools_utils.py", line 156, in isRaster         if layer.usesProvider() and layer.providerKey() != 'gdal':     AttributeError: 'QgsRasterLayer' object has no attribute 'usesProvider'      Python-Version: 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] QGIS-Version: 1.9.0-Master Master, 298f0c0


How to obtain to Max zoom levels for Google layer using Open layers

I was trying to obtain maximum zoom level ( level 22) for Google street map using Openlayers.layer.google script. The following code does not seem to work.It works to the maximum zoom level when Var zoom is set to 15. below or above 15, it set centre to world extent. Any idea what went wrong ? we tried using Google maps API v2 and v3 , same result for Maxm zoom, except for value = 15. var position = new OpenLayers.LonLat(lon, lat).transform(fromProjection, toProjection); var zoom = 22; map.setCenter(position, zoom);


How to Install the ArcGIS JavaScript 3.2 API library on an IIS Web Server?

I would like to deploy Server API for JavaScript 3.2 in my server to use it in my asp.net project instead of connect to server What are the steps to be followed in deploying it to a local WebServer?


How could I compare polygons with appropriate circle?

My problem is that I have a polygon shape file with 1034 records which are the Greek municipalities. My goal is to compare the shape of every record with the circle. In other words, I want to observe the deviation of the polygons from the perfect shape-circle. Thank you!


Using ArcGIS API for Javascript with Chrome on info window popup calls back two instances?

Using the ArcGIS API and harvesting external web map services. When using the application in Chrome when I click on a feature the info window calls back 2 instances of the same layer feature info in the popup. I just wondered if this was a known issue and if there's a way to remedy it?


FME API Module null?

I try to convert my geodatabase to Excel. And i have a strange message: > FME API version of module 'XLS_ADO' matches current internal version (3.6 > 20101014) Trying to find a DYNAMIC plugin for reader named `NULL' Loaded > module 'NULL' from file 'C:\apps\FME\plugins/NULL.dll' FME API version of > module 'NULL' matches current internal version (3.6 20101014) FME API > version of module 'XLS_ADO' matches current internal version (3.6 20101014) > FME API version of module 'XLS_ADO' matches current internal version (3.6 > 20101014) MS Excel Writer: Opening`null' for write operation MS Excel > Writer: Connection failed. Connection string > `Provider=Microsoft.Jet.OLEDB.4.0;Data Source=null;Extended > Properties="Excel 8.0;HDR=YES"'. Provider error`La table externe n'est pas > dans le format attendu.' Failed to open writer The table is not in the expected format. An idea ? Thanks


Can WMS be used to get a local copy of raster data?

I have tried reading up on WMS on wiki and other sources but haven't managed to get my head around a couple of points. 1) Using WMS is it possible to get a local copy of the raster data (say a tiff image tile). The reason, I ask is, I need to use his raster data in a secondary process that needs a local copy of the file. 2) I am primarily interested in allowing users the option of downloading orthoimagery and elevation from the USGS repository. I've tried using the Seamless viewer but I am thinking more along the lines of user specifying a coordinate (or four corner coords) and getting the orthoimage and elevation data corresponding to that. I thought WMS (Geoserver being my first option) is the way to go for this, but not certain. So wanted to get your advice. Thanks in advance. Sincerely, ST.


Error: Algorithm not found

I wrote the following code to start using QGIS APIs. in a very short script seen below, the " **Error: Algorithm not found** " is thrown and " **print processing.alglist()** " is showing none. Any idea why this is happening?               from PyQt4.QtCore import *     from PyQt4.QtGui import *     from qgis.core import *     from qgis.gui import *     import nltk     import sys, os     import shapely      import math     from collections import defaultdict     from shapely.geometry import LineString     import json     import datetime     import time     import itertools     import glob     import sys               app = QApplication(sys.argv)     qgis_prefix = "C:/Program Files/QGIS Valmiera/apps/qgis"     QgsApplication.setPrefixPath(qgis_prefix, True)     QgsApplication.initQgis()     layer1 = QgsVectorLayer("D:/Ehsan/Test/InputData/SHP/OSM_roads_no_psv_latin1_id.shp",     "test" , "ogr")          if not layer1.isValid():         print "Layer failed to load! :("     print layer1.isValid()          import processing     processing.alglist()     processing.runalg("qgis:clip","D:/Ehsan/Test/InputData/SHP/OSM_roads_no_psv_latin1_id.shp","D:/Ehsan/Test/InputData/temporary/tmpotile.shp","D:/Ehsan/Test/LM_Feat_test.shp")      Notice: the imports list is to show that I have almost everything imported and added to the path and pythonpath... Please help me to figure out how to resolve it. So far, the QGIS has seemed to be so buggy and problematic outside its python console. @Lukas Graf


time processing

I am computing NDVI for Landsat TM in grass 6.4.3 in raster map calculator, and time processing is many hours and finally tke message is "failed". trying to find a solution I discovered that it happens in all processes in raster map calculator. any advice? I have 3 images of landsat TM, TM3, TM4 and TM5. I started with GRASS 6.4.3 to correct these images as: Imagery→Satellite image tools→Atmospheric correction using also a DEM of srtm. The outcome seems excellent. Then, I tried to compute               NDVI=1.0 * float ((TM4-TM3))/float ((TM4+TM3))      and the process takes so many hours without results. I also tried to do the simplest TM4+TM3 and also the same thing.


SQL expression error for Select Layer By Attribute

arcpy.MakeFeatureLayer_management("N05-12_Station2_JGD.shp","station_12")          year=2012          arcpy.SelectLayerByAttribute_management("station_12","#",'"closing">=%d AND "opening"<=%d' % year)      > Traceback (most recent call last):File "", line 1, in > arcpy.SelectLayerByAttribute_management("station_12","#",'"closing">=%d AND > "opening"<=%d' % year) TypeError: not enough arguments for format string I want to select records that closing>=2012 and opening<=2012. Above script, it occurs an error. How can I write right script?


Arcgis Javascript code InfoWindow template

I am creating an InfoWindow in javascript code like following.               var htmlForms = "City ID: ${CITYID}"+"
";     htmlForms += "City Name: ${CITYNAME}

";     htmlForms += "
";     htmlForms += "<button id='imgOut'>Hide</button><button id='imgIn'>Show</button>";     htmlForms += "
";          var formContents = {         title: "City Form",         content: htmlForms     };     var formTemplate = new InfoTemplate(formContents);      I wanna hide and Show image in this html script. So I added two button **imgOut** and **imgIn**. When I add dojo/fx wipeOut and wipeIn properties. But not working.                       coreFx.wipeIn({                 node: "cityImage"             }).play();


How send Geoserver WMS GetFeatureInfo query to an area

I am using GetFeatureInfo query to WMS service. When I click a WMS object on the map, the response is coming.               http://localhost:8080/geoserver/wms?     request=GetFeatureInfo     &service=WMS     &version=1.1.1     &layers=topp%3Astates     &styles=     &srs=EPSG%3A4326     &format=image%2Fpng     &bbox=-145.151041%2C21.73192%2C-57.154894%2C58.961059     &width=780     &height=330     &query_layers=topp%3Astates     &info_format=text%2Fhtml     &feature_count=50     &x=353     &y=145     &exceptions=application%2Fvnd.ogc.se_xml      But I want to send a request a polygonal area. Not a single x,y location. How can I do this? Is possible?


How can I create a "setback" buffer in QGIS?

I've been going a bit crazy in trying to create a "setback" buffer on QGIS for coastal lines in a map projecting this buffer outwards towards the sea. I've managed to create a normal Bidirectional buffer, but that's not the outcome that I'm looking for. Does anyone know how to go about this?? Kind Regards, Enrico


KML to Dat Converter?

Are there any free KML to DAT(destinator compatible) converter available ? I tried to use global mapper but was in vain. Also used ITN converter but the line was converted to points.