US Census Data - An orderly means of deducting the area-weighted population of segments of incorporated places from the population of counties?

I'm working in ArcMap 10.1. Currently examining the segment of states with a geographical hierarchy of   1. Counties, coextensive with state boundaries   2. Within counties, unincorporated areas and incorporated places But incorporated places are in most of these cases not restricted to one county; i.e., a given city can span multiple counties. Although these are to some extent exceptional -- most cities are entirely contained within one county -- not all are of this type. I know how to do an intersect, calculate area-weighted populations for the resulting segments of places within counties, etc. But I'm wondering if anyone could give me some feedback on how to take **an orderly approach** to deducting, from the county population numbers, the population of incorporated places lying within, either area-weighted (where the place spans more than one county), or entire: the result I'm looking for would be the population of the balance of the county (i.e., the population of unincorporated areas). By orderly approach, I mean, how should I manage and reshape the data, use database operations, etc. The process of doing what I'm talking about is pretty straightforward when I'm looking at a small set of features and can analyze them piece-by-piece, but I'm looking at a huge set of features. It _may be worth noting_ that the attribute tables for the places layers do not have a foreign key field for the counties in which they lie, which, perhaps, was obvious from the fact that they may span multiple counties. My apologies if I've set this forth in a confusing way. Thanks in advance for any help you could provide! **EDIT** : I ended up taking a different, more straightforward approach to this. See below ...


Is there a way to export online ESRI basemap layers to raster?

I have been working on polygonizing the vegetation areas in some counties from imagery. When I have the mosaic raster locally I can easily get the polygons using Image Classification Toolbar. But when it comes to using online ESRI imagery I don't know what to do. I was wondering if someone could suggest me a way to help in saving these basemap as raster locally. When I right lick on the layer it doesn't give me the Export option.


GeoDjango and Spatial Indexes

I have three questions about spatial indexes management in GeoDjango, and I cant find the answers in the doc. First, I know GeoDjango creates a spatial_index for a geometry field by default when a table is loaded. Is the spatial_index is automatically re- created when the table is updated. For instance, when new features are added to the table through the web application. Second, If a table has more than one geometry fields, is GeoDjango creating spatial index for each of them or just for the first it encounters? Third, I would like to create many spatial indexes on the same geometry table based on an id. Is it possible to do it with GeoDjango? For instance, many countries limits are stored in a single table and I would like to create a different spatial index for each country in the case each country are always queried individually. Thank you very much, any advices and information would be appreciated.


Copy>Paste from meter to feet coord-sys, and coordinates don't change in ArcMap 10

My dataframe coordinate system is in UTM with linear unit Meter. If I have a Polygon shapefile in a UTM coordinate system with a linear unit of Foot_US and I am sent a shapefile in the same UTM coordinate system with a linear unit of Meter. I reluctantly copy/paste the linear unit Meter feature into the linear unit Foot_US shapefile and the vertices' xy are identical in both the linear unit Foot_US and Meter. What am I missing. I would have figured they would be different.


Raster statistics along polygon edges

I would like to summarize raster statistics along the edge of each parcel/polygon in a shapefile. For each parcel shown below in yellow, I would like to calculate the average, min and max value of the raster along the edge bordering the polygon. There will likely be 100,000 polygons that need to be summarized. Note that the polygons will never overlay the raster, they are only adjacent and share an edge. Ideally those stats could be joined directly to the parcels. I have ArcGIS 10.2.2 with Spatial Analyst and am comfortable scripting in Python if that is a good path. ![enter image description here](http://i.stack.imgur.com/77hy5.jpg)


How can I apply stretch in ArcGIS 10 Image Analysis Window?

I need to apply stretch to ArcGIS 10.1 exported raster. The best way to accomplish this task: Image Analysis Window, because there are fine tools to equalize raster data. 1 - This is my IRS-P6 24m cell size, Landsat's ETM+ equivalent. My goal: export the raster with histogram stretch: ![Raster with ArcGIS 10 Color Balance](http://i.stack.imgur.com/geI4V.png) Full Resolution: http://goo.gl/0KlvS 2 - Now we have the exported raster. Unfortunately, the exported raster does not save equalization or color balance adjusted in the original raster data. The file was exported without histogram curves. ![Exported Raster without color balance](http://i.stack.imgur.com/9Y0QS.png) Full Resolution: http://goo.gl/PWpG0 So, the only function of the ArcGIS 10.1 Image Analysis stretch is for visualization?


"Window" definition in Google Maps JavaScript API v3

I am trying to use Google Maps Javascript API in a java application through Nashorn (basically lets you run javascript in java). Anyway when I load the API I get an error that "window" is not defined in the API. Does anyone know where I might be able to find documentation on "window" or where in the API it might be defined? I can't seem to find any documentation and any information would be greatly appreciated.


Change OpenLayers 3 view center

I'm using OpenLayers 3 to interact with some maps. I first declare my map:               map = new ol.Map({                 target: 'map',                 layers: [                   new ol.layer.Tile({                       source: new ol.source.OSM()                   })                     ],                 view: new ol.View({                     center: [0, 0],                     zoom: 2                 })             });      I've an event that triggers an action, to change my map's view center. This way, (my coordinates are in `EPSG:4326` format):               function CenterMap(lat, long) {          console.log("Lat: " + lat + " Long: " + long);          map.setView(new ol.View({                 center: ol.proj.transform([lat, long], 'EPSG:3857', 'EPSG:4326'),                 zoom: 5          }));     }      When the function runs I get this at the explorer console:               Lat: 9.0412851667 Long: -79.5658145000       But the maps goes to `[0,0]`, does anyone knows why this happen?


calculate least cost pathways for a region and create distance rasters to rivers

How do you calculate all the least cost pathways that exists for a region? I would like the output map to display all routes (and was wondering whether this can be done in one set of operations). I want to determine this by taking into account two things: slope and valley floors. I have been informed that I need a DEM raster, and distance rasters to valley floors and rivers. I have a river system shapefile (once is in a polygon and the other is in a line format) but I don't know exactly how to create these rasters. As it stands, this is what the DEM raster and the riverways shapefile look like: ![enter image description here](http://i.stack.imgur.com/RgcHG.png) I have followed the tutorials in ArcGIS help 10.1 but I just don't seem to be going anywhere. I am able to create least cost pathways between two points based solely on slope, and I have tried reclassifying via building models but have been unsuccessful in creating images that display meaningful results - I think the biggest issue is inputting or creating distance rasters to valley floors/rivers and combining that with the slope raster. Can anyone explain in layman's terms how I could create distance rasters to valley floors/rivers from a polygon or line shapefile and how this can be combined with a slope raster to create an output map displaying all existing least cost pathways for a selected study area? Please, any help, advice, suggestions or comments would be immensely appreciated! ![enter image description here](http://i.stack.imgur.com/UneSm.png) ![enter image description here](http://i.stack.imgur.com/kUA1j.jpg)


Time Slider and data driven pages

I have parcel polygon data from 1900 to 2000. Using the Time Slider tool I can animate the parcel map. I would like to parcel attribute information like grantor name as the map is populated over time. I tried data driven pages but could not get the time slider tool and the dynamic text data drven page name to sync. Can this be done? Thank you!


How do you organize your geodata?

A geodatabase doesn't provide much flexibility in organizing your data hierarchically. All feature sets live either at the top level of the database, or one level down in feature datasets. A feature dataset can't, in turn, contain another dataset. I'm interested in hearing how others organize their data, especially in environments where they must use a geodatabase and are stuck with these limitations.


Calculating Runoff / Streams using DEM in ArcGIS

I am just curious about the workflow that many of you use for runoff/stream analysis using a DEM and create a "water network" from the results in ArcGIS 10.1? I know the average rainfall for different seasons throughout the year, but that's really all I have to work with for my area. I mainly want to investigate where water will "end up" given a fairly large rain event. I am guessing you would use ArcHydro for this? Is there a different software suite or suite of tools that you would recommend for this? Thanks!


Polygonizer plugin halts in Windows

I've had some success and some problems using the Polygonizer plugin in the past. I'm using Polygonizer 2.1 in QGIS 1.8 on Windows 7. I'm aware there are sometimes problems using Polygonizer in Windows, but I was wondering if any solutions or work-arounds had come up since I researched the issue the last time. The linear layer I want to convert at present is fairly complex and consists of 18693 lines. When I use the "new method", it reaches 44% completion and just stops. I've had it running for about 3 hours now at 44%. Only rarely do I get an error message. When I use the old method, it is extremely slow, completing about 1% per hour. Last year I was able to run Polygonizer successfully on an older computer with Windows 2000, but that machine has since died! Does anyone have any suggestions? The rarely appearing error message reads: > An error has occured while executing Python code: > > Traceback (most recent call last): File > "C:/Users/George/.qgis//python/plugins\Polygonizer\PolygonizerDialog.py", > line 103, in threadFinished > > msg = QMessageBox.question(self, 'Polygonizer', 'Polygonization finished in > %03.2f seconds. \n %d polygons were crested. \n Load created layer?' % > ((self.t2 - self.t1), polyCount), QMessageBox.Yes | QMessageBox.No, > QMessageBox.Yes) > > NameError: global name 'polyCount' is not defined > > Python version: 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit > (Intel)] > > QGIS version: 1.8.0-Lisboa Lisboa, 6416f38


Can't perform mosaicking of rasters since upgrading to ArcGIS version 10.1

I just updated my ArcGIS to version 10.1. When using ArcMap, I've not been able to perform mosaicking without getting an error when I use the "Mosaic" tool in Data Management Tools -> Raster -> Raster Dataset. The error does not tell me anything. When using "Mosaic To New Raster" I don't get an error, but it also does not create the mosaic. I've checked Environments settings to see if there was a problem there, but they seem to be correct. I'm using elevation rasters for the mosaic. Is there something that I need to do since the upgrade in order to correct this problem? Thanks, Renee


How do I classify or spot a pixel, based on a specific reflectance values of the six Landsat Bands using Erdas?

I have converted the DN values to the reflectance of a Landsat image to classify the rice field by its stages. To specify the reflectance values of each stages, I have sampled the reflectance values from the converted image. However, I would like to find (spot) the rice paddies that have the same or similar reflectance values of the previous samples... How do I do this in ERDAS 9.2? I have tried the ARCGIS but seems to not have such functions in the software. In ERDAS I found 'Target Detection' in the 'Spectral Analysis' but it could only be used based on the library(correct me if I am wrong), not my own specific values. Is there anyone who have tried this kind of work before? Please Help!


World map shapefile including disputed areas

I am looking for a global shapefile that allows you do show data for all disputed areas (like Waziristan, Spratlay Islands, Kahsmir, etc.). Do you have any idea where I can find a shapefile with not only the recognized countries but all disputed territories as well? Thanks a lot for any helpful input! Stephanie


How do I import specific Coordinates from Namibia in QGis?

I have a map here with Coordinates from the Schwarzeck Map Datum Format 1903. They have the following format e.g.: y: 41 944,31 x:363 810,71 I want these point to be pictured in QGis... how is it done? Thank you in advance for your help and time! Lukas


Clean small artefacts from polygon shapefile

With some success, I've been generalising and cleaning Ordnance Survey OpenData VectorMap District woodland polygon shapefiles to make them fit for mid-scale mapping. However, the resulting shapefiles contain small 'tails' that I wish to eliminate. I've put black dots next to some of these on the attached picture. The problem is that the 'tails' are actually part of the larger polygons, so I can't get rid of them using (for example) GRASS v.clean rmarea. If anyone can help with this problem I'd be grateful for suggestions. A sample shapefile (cleaned.shp) is included in this zip archive. Nick. ![enter image description here](http://i.stack.imgur.com/u2Crg.jpg)


How to get the shortest distances between features on separate polygon layers?

Suppose I have a county-level map for the state of North Carolina, U.S. Suppose I would like to compute the shortest distance of each county to any point along the border of Georgia. How would this be done? I have looked all over this site and the internet for suggestions and cannot find much. I am very new to GIS, so I would be very grateful for any detail. Thank you very much for your help!!


How to keep track of changes (version control) to MXD files?

I am trying to use ArcMap for the first time, so please bear with me and don't down vote the question. My superior at the work place has asked me to do some research about the life cycle of an .mxd file. Is there anything called a life cycle of an mxd file, like the life cycle of servlets?


PostGIS Implementation of Brabyn and Skelly Road Network Travel Time Model

Is there a PostGIS implementation of the Brabyn and Skelly road network travel time model for the New Zealand road network? This model is outlined in: Brabyn L, Skelly C. Modeling population access to New Zealand public hospitals. Int J Health Geogr. 2002;1(1):3 and Lauder C, Skelly C, Brabyn L. Developing and validating a road travel time network for cost path analysis. The 13th Annual Colloquium of the Spatial Information Research Centre. 2001.


Question on ArcGIS Online credits

I've been browsing the new ArcGIS Online credits policy, but I don't understand very much how much money this service would cost to my company. I've read two webpages:   * http://www.esri.com/news/releases/12-2qtr/arcgis-online-will-change-how-you-think-about-mapping-and-gis.html   * http://gis-elektrika.blogspot.com.es/2012/06/arcgis-online-pricing-what-is-service.html but I haven't drawn a conclusion. In my company:   * GIS web traffic (with ArcGIS Server): 4 people, who use 0.2 Mbps of the bandwidth   * Vector information: 20 GB   * Raster information (satellite imagery): 100 GB I'm trying to guess the monthly bill, but I'm not able. Any similar experience is welcome. Thank you very much.


How to add EPSG:5235 to QGIS?

First of all I should say I am new to EPSG and QGIS world.Then I want to Georeferced Raster image to EPSG:5235 in QGIS. But in Qgis I can't found above EPSG. How I add this EPSG to Qgis ? Pls help me, Thanks


add description to a new polygon and save -> postgres + geoserver + openlayers -> wfs-t insert

actually it is possible to draw a new polygon with openlayers and save it over WFS-T-insert (geoserver wfs-t 1.1.0) in my postgres-db:               var save = new OpenLayers.Control.Button({     title: "Save Changes",     trigger: function() {         if(edit.feature) {         edit.selectControl.unselectAll();         }          var win = new Ext.Window({         title: 'Beschreibung des Fehlerreports',         html:'<br>',         html:'Bitte beschreiben Sie den aufgezeigten Fehler in der Darstellung:',              layout:'fit',         width:500,         height: 300,         modal: true,         autoScroll: true,         shadow: false,         closable: true,         buttons: [         {             scope: this,             text: 'Speichern',             handler: function() { win.hide(); saveStrategy.save(); }         },{             scope: this,             text: 'Abbrechen',             handler: function() { win.hide(); }         }]     });     win.show();         //alert('saved');     },     displayClass: "olControlSaveFeatures"     });      In the saveing-window i need 3 forms to store some information (character) together with the polygon in the DB. This is the structure of the DB and the the published layer from geoserver: DB - Postgres: http://dl.dropbox.com/u/19066498/db.jpg Geoserver - public Layer: http://dl.dropbox.com/u/19066498/geoserver.jpg Any idea what is a possible way to store these informations together with the wfs-t insert post??


How to create new layer within a DXF file?

Using OGR in Python, I'd like to create some geometries within a DXF file, but not in the "0" layer, but in new ones. I tried with:               import ogr, os, osr, sys     ds = ogr.GetDriverByName('DXF').CreateDataSource('output.dxf' )     myLayer = ds.CreateLayer('entities')     newFeature = ogr.Feature(feature_def = myLayer.GetLayerDefn())     newFeature.SetGeometryDirectly(ogr.CreateGeometryFromWkt( 'LINESTRING(0 0, 100 100)'))     myLayer.CreateFeature( newFeature )     newFeature.Destroy()     ds.Destroy()     ds = None      But I don't have any idea about how to continue and create new layers. I tried also with               layers = ds.ExecuteSQL("INSERT INTO entities (Layer) VALUES ('Layer1')")      but it does not work.   * Any suggestion?   * Is it worth using another DXF+Python library? Thank you very much.


Need help getting started with QgsComposition

I am using QgsComposition for the first time, but I fail at the first step :-(               mapRenderer = iface.mapCanvas().mapRenderer()      > line 31, in mapRenderer = iface.mapCanvas().mapRenderer() > > AttributeError: 'NoneType' object has no attribute 'mapCanvas' Thanks for help or any advice. ### PS: The Script               from PyQt4 import *     from PyQt4.QtCore import *     from PyQt4.QtGui import *     from glob import glob     from qgis.gui import *     from qgis.core import *     from qgis.utils import*          QgsApplication.setPrefixPath("C:/OSGeo4W/apps/qgis/", True)     QgsApplication.initQgis()          name="test.tiff"     fileName = name     fileInfo = QFileInfo(fileName)     baseName = fileInfo.baseName()     rlayer = QgsRasterLayer(fileName, baseName)          QgsMapLayerRegistry.instance().addMapLayer(rlayer)          mapRenderer = iface.mapCanvas().mapRenderer()     c = QgsComposition(mapRenderer)


Using Field Calculator to Convert Data Type In Field

I am trying to convert a field that is listed as "String" because it was imported into QGIS as a CSV (rural poverty population percentages by county in NC). I need to convert the percentages field from "string" to "Real" with at least one tenths decimal place. I have been using the field calculator to create a new field with a data type conversion (toreal( "Field_Name")) with the precision at 2 (for 2 decimal places I am assuming). The expression is valid and I am able to get a result as a new field. The _problem_ is that I keep getting resulting values from the adjacent column to the one that I am trying to convert. I get real numbers with 2 decimal places but from a column next to the one I am trying to convert! (This adjacent field happens to be a "string" data type (RCU codes) so I am definitely not mistaking the data in it's converted state. Has anyone had a problem with the field calculator and it selecting a different field that the one you have identified in the conversion expression?


Obtain virtual output directory path in geoprocessing service

I am publishing a geoprocessing service and I want to be able to access the virtual output directory path configured for the service. Now I know that gp services will magically return virtual paths for output parameters of data type file, but is there a way to access the virtual output directory path string directly? right now I'm doing something very hackish:               def get_results_virtual_path(resultsFilePath):         file_url = urlparse.urljoin('file:', urllib.pathname2url(resultsFilePath))         if 'directories' in file_url:             return SERVER_VIRTUAL_DIRECTORIES + file_url.split(r'directories')[1]         else:             return file_url      Its basically hard-coding the virtual path. Now I know the virtual path can be complicated by load-balancers and subdomains and such, but all I want to do is read the environment variable from the service properties.


Sync features from ArcGIS Online to file geodatabase

Using ArcGIS Desktop Advanced 10.1 SP1, ArcGIS Online for Organizations I'm new to ArcGIS Online and we just purchased an ArcGIS Online Organizational account... I'm interested in taking a feature layer (eg. fire hydrants) and publishing it on ArcGIS Online (which I'm able to do...) and allowing users/public edit the layer by adding and updating hydrants. What I'd like to do then on a regular basis is to sync or download the hydrant layer back to my file geodatabase that I have on my laptop. The only way I've been able to figure out to get data back to my geodatabase is to download the layer from ArcGIS via shapefile and copy/replace the features in my geodatabase... wondering if there is a less cumbersome way to go about this... I've referenced this post but when I download the .pkinfo as @artwork21 suggested, it only seems to reference my feature layer on ArcGIS Online, not download anything to a geodatabase as he indicated... Thanks


Why does my buffer take up the entire screen?

I am using QGIS. I am aware there is a similar question here but the solution (changing the layer CRS) is not working for me. I cannot change my CRS as I am using information for the entire Asia-Pacific region. Is there another option to create a 1000 km buffer zone from all volcanoes in the region? It is currently projected as geographic coordinates, the default WGS:84.


Moving Vehicle through know digital data

I have a set of 3D digital map data for objects within an area. I want to drive a vehicle with known dimensions (3D points for extremities) through the area without hitting anything. I would have sensors on the vehicle to work out the positions of the extremities based on vehicle movement. I know very little about GIS apart from using ArcInfo and MapInfo about 20 years ago. Are there any tools out there that I can use to work out in real time if I will hit anything? Many thanks


Mapnik OGCServer doesn't work if theres no active internet connection

Didn't find anything similar so: I have a mapnik OGCServer on an ubuntu 12.04 virtual machine (vmware player) which works fine. The problem occurs when i disconnect all network connections, when ogc server kind of hangs. On some occasion there was a fault saying something about a broken pipe. I actually noticed this on the airport where i had no connections. Any ideas what might be going on?


how to load gps information in my map and track way points?

i am using QGIS 1.8 in ubuntu 12.04 . i am working with ROBOTIC OPERATING SYSTEM(ROS) and QGIS simultaneously . My ROS system is connected to LIDAR(sensors) that will publish gps message so i could subscribe and print latitude and longitude values continuously in terminal using c++ program. My next task is to take this latitude and longitude values from terminal and plot it in qgis map. then i want to track waypoints. can anyone help to do so? i dont have any idea as i am new to QGIS. please note that everything should be done without depending to internet connection. please suggest your ideas. . . .


QGIS very slow I don't know what to do

I'm new in QGis and I already have a big Problem with the speed of this Program. Till now I have only worked with ArcGIS and have never had a problem like this. Everytime I start QGIS and add Layers it already takes a lot of time to load which I could get over, but the whorst thing about is even when I try to drag the card a little bit with the cursor it takes ages till the progam has finished loading just to move the card a little bit to the site. Is that normal? Has anybody ever had problems like this or maybe a conclusion how I can solve this problem?? As I said I have already worked a lot with ArcGIS and never had any problems like that, I was also told that QGIS is usually faster than other GIS Programs. Please help me. Thanks. Ps. I have already tried several versions of QGIS.


Export shapefile to KML for Google Earth - using QGIS

I am a real beginner with QGIS. I have shape files of my study site. I would like to have the nice google earth background. I would like to be able to see my files in Google earth, then I can zoom and see details at a fine scale. from what I understood, I need to export my files as kml files. I clicked right on the layer and clicked on "saved as", I chose a place to save and a name for the file, I chose WGS 84, and saved. When I open the kml layer in Google earth and/or QGIS it is completely wrong. In Google earth, appears some segments every where on the globe; in QGIS, I have on the right a vertical line. Can anyone explain to me what goes wrong? Thank you very much.


How to add non spatial sqlite table to map using python in qgis?

Is it possible to load pure sqlite 2.0 (without spatial extension) table into qgis using python? I would like to get the same result as in the case of using Add Vector Layer -> All files. I have already modified this example http://www.qgis.org/pyqgis-cookbook/loadlayer.html but it doesn't work in my case. Can someone help me? I use in the python console this code:               >>> db = r'c:\Program Files (x86)\Quantum GIS Lisboa\data\base.db'     >>> uri = QgsDataSourceURI()     >>> uri.setDatabase(db)     >>> schema = ''     >>> table = 'table'     >>> geom_column = ''     >>> uri.setDataSource(schema, table, geom_column)     >>> display_name = 'table'     >>> vlayer = QgsVectorLayer(uri.uri(), display_name, 'sqlite')     >>> QgsMapLayerRegistry.instance().addMapLayer(vlayer)     <qgis.core.QgsVectorLayer object at 0x0CFA08A0>      i also tried with 'spatialite' in vlayer. When I use Add vector layer i can see result table in the TOC. Using this code I can't display table in table of contents. I think the reason of my trouble is trivial, but I have no idea what I should do to see my table


Why do I get unexpected colon syntax error in Gemfile when I try to create dev user?

I run `sudo sh script/create_dev_user ${SUBDOMAIN}` and then I receive the following error:               Gemfile syntax error compile error     on line 9: syntax error, unexpected ':', expecting $end     gem 'sequel_pg',                   '1.6.3', require: 'sequel'      with a carrot below the space after "require:" indicating that the problem is there. What's the problem? I have downloaded and re-downloaded the Gemfile from the CartoDB github repo to make sure it is correct (FYI: when I run the command without `sudo`, it hangs on `\--- Creating databases`


ESRI javascipt agsjs TOC works in version 3.0 but not 3.5 of the API

Is there a way to get the TOC.js to work in version 3.5?


Converting shapefile to raster: Character attributes

I've got a shapefile that I would like to convert into a raster, but the trick is that the attribute I want a raster version of is character data. I'm familiar with geoprocessing using GDAL (in the command line) and R, so solutions using either of those two are preferred. However, I have access to QGIS if necessary, and even ArcMap. I'm using this shapefile. It contains polygons of municipalities in part of Brazil. The attribute NAME_2 is the name of the municipality, and I want a raster version of that. I know that you can't make a raster with characters, so I created a numeric version of NAME_2 in R by doing               library("rgdal")     munisCrop.shape = readOGR(dsn=getwd(), layer="munisCrop")      # Read shapefile     munisCrop.shape$NAME_2_NUM = as.numeric(munisCrop.shape$NAME_2)  # Make new attribute     writeOGR(obj = munisCrop.shape, dsn = getwd(), layer = "munisCrop", driver = "ESRI Shapefile") # Save new version of shapefile      Values in `munisCrop.shape$NAME_2_NUM` range from 1 to 787. I was hoping to then use `gdal_rasterize` on my command line (GDAL version 1.10.1 on Mac OS X 10.9.2) to make a raster version of the shapefile. Here's the code I was trying (separate lines for clarity):               gdal_rasterize -of GTiff -ot UInt32 -a NAME_2_NUM \                    -tr 0.0002777778 0.0002777778 -ot BYTE \                    -co COMPRESS=LZW -l munisCrop \                    munisCrop.shp munisCrop.tif      This completes easily enough. However, when viewing munisCrop.tif in QGIS, I see that the data range from 0 to 255. This is confirmed in R with               library("raster")     munisCrop.raster = raster("munisCrop.tif")     sort(unique(getValues(munisCrop.raster)))      0 makes sense, as NA values got converted to that. However, the maximum value of 255 is no good; remember, the maximum value of that attribute in the shapefile is 787. I think I understand why this is happening, but I'd appreciate if somebody could really explain it to me and suggest a workaround. I've tried various options in `gdal_rasterize` instead of `-ot UInt32` (for example, `BYTE`), and the result is always the same. I've also tried rasterizing it in R:               munisCrop.blankraster = raster(ext = extent(munisCrop.shp),                                     resolution = 0.0002777778,                                     crs = projection(munisCrop.shp)                                     )      munisCrop.Rraster = rasterize(x = munisCrop.shp,                                    y = munisCrop.blankraster,                                    field = "NAME_2_NUM"                                    )      But that seems like it takes forever. `gdal_rasterize` is way faster (a matter of seconds instead of... indefinite), so I'd love a solution using that. Thanks in advance!


Help in importing excel data

I have downloaded the hourly solar radiation data from NREL which is in CSV format but the problem is that the file does not have an exclusive column called latitude and longitude. There are 100s of CSV files like this and each file represents a latitude/longitude(we can say, point location).I have attached a screenshot of the file along with this post. I am not able to figure out how to import it in ArcGIS/QGIS. THe screenshot is for Bangalore city, India. The highlighted portion in RED shows the latitude longitude for the city. Can somebody please help me to import this in ArcGIS/QGIS? Screenshot of the sample file: http://tinypic.com/r/53r86a/8 Please find the same file attached here: http://www.sendspace.com/file/m9t19n This file represents hourly solar radiation data for a particular latitude longitude(In this case, Bangalore)


gdal polygonize in python error, blank polygon created

I am having trouble using the Polygonize function in python. The cookbook example for this can be found here. The relevant portion of my code is:               sourceRaster = gdal.Open('myraster.tif')     band = sourceRaster.GetRasterBand(1)     bandArray = band.ReadAsArray()     outShapefile = "polygonized"     driver = ogr.GetDriverByName("ESRI Shapefile")     if os.path.exists(outShapefile+".shp"):         driver.DeleteDataSource(outShapefile+".shp")     outDatasource = driver.CreateDataSource(outShapefile+ ".shp")     outLayer = outDatasource.CreateLayer("polygonized", srs=None)     gdal.Polygonize( band, None, outLayer, -1, [], callback=None )     outDatasource.Destroy()     sourceRaster = None      I know that the band has relevant information, here is a snippet of `bandArray`:               array([[ 4.,  4.,  3.,  3.,  3.,  2.,  2.,  2.,  2.,  3.,  3.,  3.,  3.,              3.,  3.,  3.,  3.,  4.,  4.,  4.,  4.,  4.,  4.,  4.,  4.,  4.,              4.,  4.,  4.,  4.],      When I open the attribute table in QGIS, it is empty: ![QGIS screencapture](http://i.stack.imgur.com/v00BR.png) **Edit:** The conversion works just fine in QGIS using Raster -> Conversion -> Polygonize tool Screenshot of raster to be polygonized: ![raster to polygonize](http://i.stack.imgur.com/zEsAQ.png) And screenshot of resultant conversion from QGIS tool: ![polygonized raster from QGIS tool](http://i.stack.imgur.com/ERxbA.png) I am using the Enthought distro on Windows 7, GDAL version 1.10.0-3 **The problem is that I cannot polygonize a raster in python using GDAL and the cookbook example, I can polygonize this same raster with no problem in the QGIS GUI**


Modelbuilder - Join - Keep matching records only - export to feature class

I need to join a table to a feature class in a model. Have it keep only the matching records and then export that joined feature class into a new feature class.


How to export from ModelBuilder as script and then run using Python. 3.4?

I'm currently studying for a Msc in GIS. In my assignment I have been asked to produce a model, export that model as a script file and then run that script as a stand alone in IDLE. So I have created the model in model builder and exported it as a script and have even had a go at cleaning the script. But whenever I try to run the script I get an error. I have attached a jpeg of my model and have also attached the script file. Does anyone know where I'm going wrong? Im using Arcmap 10.1 and python 3.4               # -*- coding: utf-8 -*-     # ---------------------------------------------------------------------------     # floodrisk.py     # Created on: 2014-04-21 11:34:26.00000     #   (generated by ArcGIS/ModelBuilder)     # Usage: floodrisk <River_thames> <POI> <SOA> <POI_clipped> <SOA_clipped__6_>      # Description:      # ---------------------------------------------------------------------------          # Import arcpy module     import arcpy     arcpy.env.workspace = "C:\Users\Imran\Documents\MASTER GIS\ASSIGNMENT4\Floodrisk.gdb"     arcpy.env.overwriteOutput = True          # Script arguments     River_thames = arcpy.GetParameterAsText(0)     if River_thames == '#' or not River_thames:         River_thames = "River_thames.shp" # provide a default value if unspecified          POI = arcpy.GetParameterAsText(1)     if POI == '#' or not POI:         POI = "POI.shp" # provide a default value if unspecified          SOA = arcpy.GetParameterAsText(2)     if SOA == '#' or not SOA:         SOA = "SOA.shp" # provide a default value if unspecified          POI_clipped = arcpy.GetParameterAsText(3)     if POI_clipped == '#' or not POI_clipped:         POI_clipped = "POI_clipped.shp" # provide a default value if unspecified          SOA_clipped__6_ = arcpy.GetParameterAsText(4)     if SOA_clipped__6_ == '#' or not SOA_clipped__6_:         SOA_clipped__6_ = "SOA_clipped.shp" # provide a default value if unspecified          # Local variables:     River_thames_buffer1 = "River_thames.shp"     SOA_clipped = "River_thames_buffer1.shp"     SOA_clipped__2_ = "SOA_clipped.shp"     SOA_clipped__3_ = "SOA_clipped__2_.shp"     SOA_clipped__4_ = "SOA_clipped__3_.shp"     SOA_clipped__5_ = "SOA_clipped__4_.shp"          # Process: Buffer     arcpy.Buffer_analysis(River_thames, River_thames_buffer1, "300 Meters", "FULL", "ROUND", "NONE", "")          # Process: Clip     arcpy.Clip_analysis(POI, River_thames_buffer1, POI_clipped, "")          # Process: Clip (2)     arcpy.Clip_analysis(SOA, River_thames_buffer1, SOA_clipped, "")          # Process: Add Field     arcpy.AddField_management(SOA_clipped, "AreaB", "DOUBLE", "", "", "", "", "NULLABLE", "NON_REQUIRED", "")          # Process: Calculate Field     arcpy.CalculateField_management(SOA_clipped__2_, "AreaB", "!shape.area! ", "PYTHON", "")          # Process: Calculate Field (2)     arcpy.CalculateField_management(SOA_clipped__3_, "AreaB", "[AreaB]/1000000", "VB", "")          # Process: Add Field (2)     arcpy.AddField_management(SOA_clipped__4_, "areaP", "DOUBLE", "", "", "", "", "NULLABLE", "NON_REQUIRED", "")          # Process: Calculate Field (3)     arcpy.CalculateField_management(SOA_clipped__5_, "areaP", "[AreaB]/ [AreaSQKM]", "VB", "")      ![enter image description here](http://i.stack.imgur.com/unACW.jpg)


I am trying to add content to the middle of a string by using `MyStr = Mid([MyField], 1, 1)` and I get an error. I've tried `MyStr = Mid([_smallx], 63, 6)` and `MyStr = Mid(["_smallx"], 63, 6)` The string is a file path totaling 76 characters and I need to add `_small` at 63 and keep the 13 characters at the end.


How to cite QGIS in publication?

What is the best way to cite QGIS in a formal publication? I mean, what text should be included in the References / Literature Cited section of a paper or report. I'm also specifically referring to the software itself, rather than the user's manual. I've looked in the user's manual and in Help->About, but I can't find an answer. Thanks in advance for the help.


MySQL: Query the envelope (mbr, extents) of a spatial table?

this question provides a solution to get the evelope (aka: mbr, aka: extents) of a spatial table in PostGIS, but I'm having trouble doing the same in MySQL. The ogr MySQL driver does this, and a solution is noted here on a Ruby forum (circa 2006), but surely this doesn't require external programming? Does anyone have a clean SQL recipe for this case? * * * **[Answer]** After getting pointed in the right direction by @GIS-Jonathan, the working query ends up looking like what follows. _CAVEAT: You may not need to change the`group_concat_max_len` value for a small table, but large tables with many features may need the larger `group_concat_max_len` buffer. It seems safe to me to just increase this value in the session as part of the solution._               # increase group_concat_max_len to be safe          SET SESSION group_concat_max_len = 104448;          # air8 is my geodata table     # shape is the geometry column          SELECT        asText(         Envelope(           GeomFromText(             Concat(Concat("geometrycollection(", Group_Concat(asText(shape))),")")           )         )       )        AS extent FROM air8;      **[Concluding Remark]** I was curious how well this would scale against larger tables and found that it starts to break down around some upper limit I don't have the time to identify. For a table with 60864 features, I had to use `SET SESSION group_concat_max_len = 10444800;`, then it worked (that's up to about 10MB). However, for a table with 242439 features, I tried 104448000 (about 100MB), then 1044480000 (about 1GB), then most rediculously 10444800000 (about 10GB). At that point I quit caring if it would eventually work because surely that violates sensible practice! **Anyway here is the take-home message: If you run this on a large dataset and it returns`null`, you may very well be hitting the upper limit.**


How to use the List field function for a toolbox script?

i´m trying to write a simple script for a toolbox, similar to the Addfield_datamanagement toolbox. The script adds a new field to a table of a feature class or a shapefile with attribute tables. So far so good               # Import system modules     import arcpy     #Workspace     arcpy.env.workspace="C:\\Users\\xxx.gdb"     # Set feature class     inputFC = arcpy.GetParameterAsText(0)     # Get List of Fieldnames     inputString =arcpy.GetParameterAsText(1)     inputString =arcpy.ValidateFieldName(inputString,arcpy.env.workspace)     fieldList =inputString.split(";")     fieldType = arcpy.GetParameterAsText(2)     for fieldName in fieldList:               arcpy.AddField_management(inputFC , fieldName, fieldType)     arcpy.AddMessage("Field generated:" + fieldName)     arcpy.AddMessage ("Script executed")      So this seems to work, but now i want to check first if the fieldname already exists before it´s created and print the existing name! I thought about the list fields together with the built-in len() function:               if len(arcpy.ListFields(fieldName(?) or inputString,?)==1:                  arcpy.AddMessage("Field already exists"+fieldName)      Not sure about the synthax of the ListFields command and how to integrate it in the code above! So, any help is welcome and appreciated!


QGIS Identify tool on vector Crash

I have built QGIS (1.7.4) on Mingw successfully and everythings seems to be alright. My own plugins are also identified and working fine. There is a crash when using identify tool/ attribute table over vector layer. On Raster identify works. GEOS version : 3.3.8 GDAL version : 1.9.2 Proj4 version : 4.8.0 I have built everything in Debug. When run with gdb ( for identify tool over vector) Program received signal SIGSEGV, Segmentation fault. 0x70fddf8f in geos::geom::Polygon::computeEnvelopeInternal (this=0x71067038) at Polygon.cpp:249 249 return Envelope::AutoPtr(new Envelope(*(shell->getEnvelopeInternal()))); (gdb) and for attribute table , it simply crashes away. Please let me know if there are any known issues before I start debugging it. Thank you. Srikanth


What might cause invalid syntax from ArcPy with Raster Calculator and Multiple Rasters?

I am having trouble for writing script in Python (ArcGIS 10.1). The task is generally divide each raster by 100. I have many of these raster files.... So what I've done is the following:               from arcpy.sa import *       arcpy.workspace="C:/Users/Vaio/.../Monthly_Original.gdb"       rasterlist=arcpy.ListRasters(p)       for k in range():          OutRaster=(Raster(rasterlist[k])/100          OutRaster.Name='p_2000_*.*'          OutTaster.Save(OutRaster.Name)      I have an Error in line 6. I am very new to any sort of programming. Thank you in advance!


How to use WKT in Google Map V3?

We have a shape with the following WKT. The problem with google map we normally extract out each of the lat and long value and put into an array and finally will do something like this. It works fine but in this WKT there are few sections in it but with openlayer I just put the whole WKT into this function var feature1 = new OpenLayers.Feature.Vector(buffer.transform(P4326,P900913), null, styleObject); it works perfectly fine without any issue. How to resolve this for google map?               polygon1 = new google.maps.Polygon({                                                 paths: lineArray,                                                 strokeColor: '#1E90FF',                                                 strokeOpacity: 0.8,                                                 strokeWeight: 2,                                                 fillColor: '#1E90FF',                                                 fillOpacity: 0.35                                           });               POLYGON((100.54157334877087 5.124795579269911,100.50169157216737 5.175633231048347,100.48893060559693 5.190782519229377,100.48883685890004 5.190920674118928,100.48041685890006 5.206620683576352,100.48035625412166 5.206766524898229,100.48032538396345 5.206921338503033,100.48032543474828 5.207079174986367,100.48035640452454 5.207233968780704,100.48041710314108 5.207379771251712,100.48050519798412 5.207510979300314,100.48061730361823 5.20762255068534,100.48074911188677 5.20771019779251,100.4808955574719 5.207770552403195,100.4810510125519 5.2078012951316595,100.48120950307525 5.2078012445564505,100.48136493833998 5.2077704026211435,100.48151134505608 5.207709954559655,100.48164309689552 5.207622223348936,100.48175513070903 5.207510580439686,100.48184314109994 5.207379316194805,100.49022348868367 5.191753262740997,100.50293939440304 5.17665749276832,100.50295708150922 5.1766357380872146,100.55158138575345 5.114653464985341,100.61784836581363 5.047494669000269,100.63328064200411 5.045760273775513,100.63344538038619 5.045724117696659,100.63359900089658 5.045654696108101,100.63373481573457 5.045555031237853,100.63384691226155 5.045429461939012,100.64478691226155 5.030239472910412,100.64485714103375 5.030122067725934,100.64490643054278 5.029994524131959,100.64493336141338 5.029860514958455,100.64619300597558 5.018766440281411,100.89601933027687 4.76550530772389,100.90397540484798 4.76251382120199,100.904125498221 4.7624388147297605,100.90425680769607 4.762334529640712,100.90436366963635 4.762205463944471,100.91498366963637 4.746255474257608,100.9150580432529 4.746115668549328,100.91510356406134 4.74596407285823,100.91511847627667 4.745806534382425,100.91510220471923 4.745649129543159,100.9150553769999 4.7454979296113295,100.91497979931266 4.745358766531834,100.9148783867677 4.745237007978542,100.91475505095255 4.745137350316068,100.91461454905823 4.745063637454637,100.91446230038925 4.7450187125847965,100.9143041773355 4.745004308511336,100.91414627886799 4.745020980816285,100.91399469529519 4.74506808642927,100.91385527335358 4.745143808431712,100.91373339069273 4.745245226138226,100.89511556261954 4.764122863341007,100.89441924808347 4.764384677730915,100.92861460308248 4.729467265814491,100.94306861105032 4.717019660578351,100.94308862499464 4.717001837872207,100.9600648087706 4.70137140183913,100.97805150444233 4.690005163726286,101.0032978733881 4.688855369346559,101.02139744198907 4.698874409253193,101.02153571050398 4.698934873115156,101.02168284847642 4.698968658695525,101.02183372382656 4.698974587578459,101.02198307411716 4.698952452968966,101.02212569010408 4.698903026905675,101.0222565974315 4.698828033332999,101.02237123013421 4.698730087971819,101.02246558989572 4.698612607085813,101.03186692696475 4.684358662732975,101.04641937919912 4.681631913397546,101.04654522151539 4.6815976608810255,101.0466638985581 4.681543682997702,101.0626338985581 4.672663691919618,101.06265873346082 4.672649300079806,101.07193873346081 4.667049305582631,101.07206478644287 4.666955391993337,101.07217019642661 4.666838917858445,101.07225096922653 4.666704296595284,101.07230404420704 4.6665566292515965,101.07232741025584 4.66640151121859,101.07232018198869 4.666244820211681,101.07080124929709 4.655762184380661,101.06942217992568 4.64481956709879,101.06939272311594 4.6446829890795245,101.0693400432311 4.64455353405661,101.06926572348885 4.644435092618359,101.06457125429455 4.638224697426946,101.06319926512629 4.632065339533069,101.0631864279256 4.632015335107842,101.05965809799591 4.619901065378956,101.05729160630031 4.611301837098225,101.05827771116607 4.608078035110399,101.05837451798986 4.608017540493808,101.058489797227 4.607909126498835,101.05858164229866 4.607780378456879,101.0586465236503 4.607636244073435,101.05868194792791 4.607482262344451,101.05868655379639 4.607324350696963,101.05863655379638 4.60660435064062,101.05861127892128 4.606452707295678,101.05855757613483 4.606308606552095,101.05847739948697 4.606177291720301,101.0583736663157 4.606063540879937,101.05825015109548 4.605971493021525,101.05811134809807 4.605904497442384,101.05796230786196 4.605864991876384,101.05780845342177 4.60585441379272,101.05765538298354 4.605873148090809,101.05750866622635 4.605920513095127,101.05737364164183 4.60599478535917,101.05725522228572 4.606093262376247,101.05715771700969 4.6062123609150225,101.05708467367768 4.6063477474016885,101.05703875007214 4.60649449560441,101.05696615166936 4.606839338106436,101.05567666227104 4.611054977816131,101.05564623136308 4.611203092992834,101.05564409128449 4.611354267067325,101.05567031736118 4.611503179055542,101.05810031736118 4.6203331764030775,101.05810357207437 4.620344668666436,101.06162634972249 4.632439867617015,101.06303073487372 4.638744658859191,101.06308581972252 4.638907454598495,101.06317427651116 4.639054911411789,101.0678446649334 4.64523344260049,101.06919782007431 4.655970431325576,101.0691998180113 4.65598518148874,101.07064329274297 4.665947058557962,101.06183355569814 4.671263283392991,101.04599114859657 4.680072345516371,101.03123062080087 4.6828380888643055,101.03107509912326 4.682883713338254,101.030931837252 4.682959345378033,101.0308065956257 4.683061943874136,101.03070441010425 4.683187383417033,101.02152658363796 4.697102476341069,101.00388255801093 4.687335579811719,101.00374644848105 4.687275831277903,101.00360166061274 4.68724194258745,101.00345309409626 4.687235060553534,100.97776309409626 4.688405061901499,100.97762450889043 4.688423433455393,100.97749117130599 4.688465325320313,100.97736706846887 4.6885294848210455,100.95913706846886 4.700049496057161,100.95902137500535 4.700138148283603,100.9420012335367 4.715809084690873,100.9275313889497 4.728270349847366,100.92748140376511 4.728317234131123,100.89084289136436 4.765729386924607,100.88857903739637 4.7665805940663155,100.86875468604576 4.764747755821863,100.86852748525929 4.7647587762658,100.8479974852593 4.768688780791709,100.84779668516134 4.768755321284555,100.83633102855727 4.774306706231912,100.82703778821273 4.77294291672017,100.82687125841765 4.772935785811107,100.7928690382914 4.774982310566,100.7619067259743 4.772427068381073,100.76173502182992 4.772431140443018,100.7615680553451 4.772471265016521,100.76141336170892 4.772545631275547,100.76127792223743 4.772650883064091,100.7611678493072 4.772782270361311,100.6687278493072 4.910582361568241,100.66865301195101 4.91072185418806,100.66860697601827 4.910873227876582,100.6685915165044 4.911030646151936,100.66864137306756 4.972952505860876,100.66009346236922 4.9913004519727435,100.64595576422197 5.007756306956835,100.64586418982786 5.007887198342606,100.64580031240318 5.008033503784978,100.64576663858664 5.0081894820473565,100.64477291047628 5.016941706842589,100.61625125341138 5.0460532463404055,100.6130793579959 5.046409728012444,100.61291638011534 5.0464453024506675,100.61276420329115 5.046513443519312,100.61262930836556 5.0466112492457205,100.59598930836556 5.0615212630263375,100.59591729333239 5.061594575864115,100.58139729333239 5.078394589533011,100.5813745376085 5.078422128797729,100.568241718084 5.095052757503959,100.5558565329245 5.107692725364091,100.55190792815084 5.111630975719314,100.55184291849078 5.11170421172008,100.55150998857583 5.1121286259010175,100.50958140376511 5.154917596322795,100.50948245300847 5.155040676578281,100.50940948200127 5.155180602156629,100.50936528873167 5.155332007765464,100.50935156773907 5.155489087927182,100.50936884513898 5.155645819584137,100.50941645844956 5.155796193046173,100.509492581994 5.155934442424661,100.50959429690371 5.156055266717915,100.5097177030391 5.1561540330704085,100.50985806853575 5.156226954412539,100.51001001124239 5.156271234669731,100.51016770509305 5.1562851759732355,100.51032510350089 5.156268243762022,100.51047617120751 5.1562210872795635,100.51061511569779 5.156145514679759,100.51073660930729 5.156044423696323,100.54157334877087 5.124795579269911),(100.89871905240886 4.762767948943637,100.90896767267513 4.752376354194918,100.90316054789211 4.76109794021234,100.89871905240886 4.762767948943637),(100.64661349655054 5.015063009244003,100.64734548944385 5.008616000844607,100.66139423577802 4.992263705850945,100.66151334893807 4.99207906958164,100.67018334893807 4.973469079183367,100.67023954646196 4.9733033059172405,100.6702584834956 4.973129353908616,100.67020868057224 4.911274134430876,100.76224763699163 4.774072078648479,100.7927932740257 4.776592927682631,100.79290874158235 4.776594210842545,100.82688510588919 4.774549247104856,100.83634221178725 4.775937080726917,100.83650305821145 4.775944533666873,100.83666219668962 4.77592007401154,100.83681331483866 4.77586467197369,100.8484073218576 4.770251155446057,100.86871970000875 4.766362818665806,100.88843722762824 4.768185776370008,100.64661349655054 5.015063009244003),(100.89174944562149 4.767110780318271,100.89241584048753 4.766860216725576,100.83228546584598 4.827825906907718,100.89174944562149 4.767110780318271),(100.61964713897322 5.045671590739228,100.64435410761305 5.020630262940911,100.64335031023455 5.029471003274368,100.6327424559458 5.044199836724733,100.61964713897322 5.045671590739228),(100.57884271020993 5.084233488822919,100.58263439073833 5.079431891466035,100.59710904740169 5.062684368787789,100.61351808034122 5.047981338205527,100.61446663282223 5.047874732959801,100.57884271020993 5.084233488822919))      Control for 2 different polygon.                               if(pl==0)                     {                           var polygon1 = new google.maps.Polygon({                                                         paths: cords,                                                         strokeColor: '#1E90FF',                                                         strokeOpacity: 0.8,                                                         strokeWeight: 2,                                                         fillColor: '#1E90FF',                                                         fillOpacity: 0.35                                                       });                         polygon1.setMap(map);                      }                      else                      {                           var polygon1 = new google.maps.Polygon({                                                         paths: cords,                                                         strokeColor: '#FFFFFF',                                                         strokeOpacity: 1,                                                         strokeWeight: 2,                                                         fillColor: '#FFFFFF',                                                         fillOpacity: 0.25                                                       });                         polygon1.setMap(map);                      }


Run FME workspace using python

![error](http://i.stack.imgur.com/q4PCV.jpg)I'm trying to run a second workspace using python command in "Shutdown Python Script" in the first workspace using the following command. But its giving me an error. Is there anything I need to do different? I am using FME 2012 SP 2 Thanks, Sam So as suggested by Safe tech support, I created a batch file with the following code: `fme.exe c:\test2.fmw --SourceDataset_ARCGIS_LAYER C:\ScratchParcel\DevEnv.gdb\AddressPoint --DestDataset_SHAPE C:\temp` and added the following code in the shutdown python script window: `import os os.system("C:\\\temp\\\test.bat")` When I run it, although it says transaction was successful, I don't get any results i.e., the output shapefile is not created.


Replacement of QVariant and setAttributeMap in PyQGIS

I am updating a plugin for QGIS 1.8 to QGIS 2.x. I have the code below.   1. The setAttributeMap does not exist anymore. I have replaced it with fet.setAttributes and it seems to work.   2. When using fet.setAttributes({0:QVariant(fid}), I get the error: PyQt4.QtCore.QVariant represents a mapped type and cannot be instantiated. I have tried to just remove the QVariant() and used fet.setAttributes({0:fid}), but then I get the error: TypeError: QgsFeature.setAttributes(list-of-attributes): argument 1 has unexpected type 'dict' The code worked well with 1.8, so what can I do to replace QVariant or setAttributeMap? I think it could be something with changing setAttributeMap to setAttributes               vl = QgsVectorLayer("MultiLineString", layerName, "memory")     pr = vl.dataProvider()     vl.startEditing()     pr.addAttributes([QgsField("id", QVariant.Int)])     fet = QgsFeature()     addRange = northRange * math.tan(abs(math.radians(bearing)))     noPoints = ((eastRange + addRange) / projEast) + 1     for i in range(0,int(math.ceil(noPoints)), 1):         fet.setGeometry( QgsGeometry.fromMultiPolyline( [[ QgsPoint(minE + offset + (projEast * i) ,minN), QgsPoint(minE + offset + (projEast * i) - addRange,maxN) ]] ))         fet.setAttributeMap({0:QVariant(fid)})         pr.addFeatures( [ fet ] )         fid = fid + 1     vl.commitChanges()     QgsMapLayerRegistry.instance().addMapLayer(vl)      * * * I have change my code to:               vl = QgsVectorLayer("MultiLineString", layerName, "memory")     pr = vl.dataProvider()     vl.startEditing()     pr.addAttributes([QgsField("id", QVariant.Int)])     fet = QgsFeature()     fields = vl.pendingFields()     fet.setFields( fields, True )     addRange = northRange * math.tan(abs(math.radians(bearing)))     noPoints = ((eastRange + addRange) / projEast) + 1     for i in range(0,int(math.ceil(noPoints)), 1):         fet.setGeometry( QgsGeometry.fromMultiPolyline( [[ QgsPoint(minE + offset + (projEast * i) ,minN), QgsPoint(minE + offset + (projEast * i) - addRange,maxN) ]] ))         fet['id'] = fid         pr.addFeatures( [ fet ] )         fid = fid + 1     vl.commitChanges()     QgsMapLayerRegistry.instance().addMapLayer(vl)      but I still need to make an attribute named 'id' I guess before it works. If I use the _setAttributes_ function it includes a QVariant which I am not allowed to do! Or is it me who does not understand. * * * This is the final code, and it is working:               vl = QgsVectorLayer("MultiLineString", layerName, "memory")     vl.startEditing()     vl.addAttribute(QgsField("id", QVariant.Int))     fet = QgsFeature()     fields = vl.pendingFields()     fet.setFields( fields, True )     addRange = northRange * math.tan(abs(math.radians(bearing)))     noPoints = ((eastRange + addRange) / projEast) + 1     for i in range(0,int(math.ceil(noPoints)), 1):         fet.setGeometry( QgsGeometry.fromMultiPolyline( [[ QgsPoint(minE + offset + (projEast * i) ,minN), QgsPoint(minE + offset + (projEast * i) - addRange,maxN) ]] ))         fet['id'] = fid         vl.addFeatures( [ fet ] )         fid = fid + 1     vl.commitChanges()     QgsMapLayerRegistry.instance().addMapLayer(vl)


software architecture for creating routes?

I have a system that can alert staff by email if their device goes into/out of a geo-zone However, we now need to create a route, and then email if someone goes off this route Technically, how would i do this? I have no idea! Do you just check their GPS location and see if it exists within the GPS co-ordinates of a route? I'm using openlayers framework ....an afterthought Is a route a really narrow geozone?


Cartographic technique for detailing a 'Focus Area'

I'm working on updating a planning document. Whoever was in charge of cartography last time around used a great technique to identify and showcase focus areas (where to focus money and effort for maximum return on investment). I'm trying to use this same type of technique by interpreting and recreating the work-flow. ![Digital terrain](http://i.stack.imgur.com/nWxnb.jpg) As you can see, it certainly tells more of the story than a standard flat- filled polygon especially when considering the landscape from a restoration perspective. The focus area seems to be a terrain / colored hillshade -- could I recreate this with the national elevation dataset (NED) from USGS? Suggestions for a solid workflow to get me going would be great.


Calculate complete spatial randomness using Python

I currently use the csr() function from Splancs for R (http://cran.r-project.org/web/packages/splancs/splancs.pdf) to calculate complete spatial randomness (CSR) points to be used for spatial statistics. Does anyone perhaps know python code which can create CSR points? Thanks


Conversion of ArcGIS data to ADRG data?

I have maps generated using ArcGIS (.tfw, .fig, .prj, .sbn, .shp and .dbf files). I need to convert them to ADRG format. Can ArcGIS do that? If so, how?


How to generate thumbnails from shape file and display them on my website?

I tried to generate thumbnails from shape file and display them on my website(using jsp).I had been read this and this question .Very similarity questions ,but I know nothing about python... Is there any open source tools or projects to deal with it?Is there any solution or idea to implement it via ArcGIS javascript api or other solutions ?


Looking for CRS for NAD 83 UTM Zone 30N

I'm curious as to why the UTM zones are incomplete for NAD 83 in QGIS? I have a WGS84 shapefile that I would like to project to NAD83 UTM Zone 30N but can't find it in the QGIS CRS list. I see how one could create a custom coordinate system but the cut and paste I did of proj.4 code for zone 15 (simply changed it to 30) didn't work. Thanks for pointing me to proper proj.4 code or how to project this shapefile from the UK.


Incorrect coordinates when reprojecting NAD27 to NAD83

I have some historic UTM coordinates as NAD27 (556787, 7169250) which I entered into a spreadsheet and have imported into QGIS. I assign them the projection Nad27 / UTM zone 12N (EPSG: 26712) I save as... Projection Nad 83 /UTM zone 12N (EPSG: 26912) When I compare coordinates, the coordinate shift is different than what I know it should be (in particular, there is no east-west component to the transformation), and when I use a separate NTV2 transform there is a shift of ~ 30m north, 50m west. I have looked at This help article which involves projecting across UTM zones, which I am not doing. and This other help article which is solved by using a more robust version of the nad27 projection (EPSG: 26712 instead of EPSG:2027) which I am already doing Am I missing something very simple here? I am running QGIS 1.8.0 on window


Creating a multiple bar graph in ArcMap

I would like to graph my data from a shapefile. The data I wish to display is the sum of the nominal data per each year that it occurred. I have enclosed a screenshot to illustrate my idea. There is the field of data (string) I wish to graph. There are only A's and W's in the field (125 in total) and I want the W's totaled per year and the A's totaled per year as multiple bars like shown in the graph below. Then I can display those bars on a yearly basis with their respective totals. If that makes sense, please help me. Thank you. ![enter image description here](http://i.stack.imgur.com/J8F44.png)


Why is GDALPolygonize so much slower than ArcGIS Raster to Polygon?

I am attempting to polygonize a raster using GDALPolygonize() in a Python script. The script began polygonizing yesterday at 5pm and is still polygonizing now at 9:30 am. I have no clue how far along it is, but I know it is still going because when I refresh my Windows explorer I can see the file size change for the output shapefile. My raster is rather large, but I still don't expect it to take this long. My raster is 35,486 Columns and 23,682 Rows with a 1 meter cell size. It is a binary raster where a value of 1 represents data and 0 is NoData. When I polygonized in ArcGIS using Raster to Polygon in the Conversion Toolbox it took 56 seconds. The resulting shapefile is 200mb while the shapefile still being created by GDALPolygonize is still only 100mb. That makes me think GDAL is about half way done after running all night. Specs: Windows 7 64bit, 8gb RAM, GDAL 1.10 64bit, ArcGIS Desktop 10.2, 64bit Background Geoprocessing for ArcGIS Desktop, Python 2.7.3 64bit **UPDATE** Day 2 - GDALPolygonize is still running. It has gone overnight 2 nights in a row and through a whole day without completing. ArcGIS took 56 seconds.


gdal2tiles.py generating black tiles from .img file

I have a source HFA Erdas Imagine (.img) file which I'm trying to convert into tiles using gdal2tiles.py. I'm running:               gdal2tiles.py -w google -g GOOGLEKEY input_file.img      The HTML is generated correctly, and the tiles are correctly positioned. However, I'm getting black tiles instead of the actual content of the .img file: ![wrong tiles](http://i.imgur.com/cdZJULB.png) I've verified (using QGis and MapTiler) that the .img contains the correct data, i.e. the source file has raster data. Any ideas? Should I transform the .img to something else? Am I missing an option for the command?


IProximityOperator.ReturnDistance returns incorrect result

I try to implement search of nearest features in ArcObjects.NET (please, don't suggest existing tools like Near) and I use IProximityOperator.ReturnDistance to get distances between features and to select nearest one. But I've found that sometimes this method returns incorrect results. Here is test map with one point layer (in general type of geometry is arbitrary): Test Data. Look at the feature with OID = 18. You can see that nearest point is feature with OID = 40 but result of IProximityOperator.ReturnDistance for this feature is greater than for feature with OID = 22. What am I doing wrong? Test code:               var f18 = featureClass.GetFeature(18);     var f22 = featureClass.GetFeature(22);     var f40 = featureClass.GetFeature(40);          var f18AsProximityOp = (IProximityOperator)f18.Shape;          var d18_22 = f18AsProximityOp.ReturnDistance(f22.Shape);     var d18_40 = f18AsProximityOp.ReturnDistance(f40.Shape);      But d18_22 < d18_40. I use ArcGIS 10.2, .NET 3.5, Windows 7. Thank you. P.S. Sorry for my English.


Creating square buffer around point feature using ArcGIS for Desktop?

I would like to create a square buffer from a point feature but I do not understand the code that goes into it. Similar questions have been asked on the forums.esri website but that was over 10 years ago, and it did not work when I tried the code. How do I create a square buffer from a point feature?


QGis 2.01 Fedora 19 vs Windows SQL-Server Access

i just installed QGis 2.01 on Ubuntu / Fedora 19 / windows 8, configured ODBC- support for Fedora 19 and created ODBC-DSNs on the windows machine and the Fedora machine to the same SQL-Server 2012 instance where i stored some layers. When i load these layers in the windows version of QGis 2.01 everything works as expected, but in Fedora i get a strange behaviour: My point-Layers are loaded and displayed but every polygon layer i open, i get nothing or just the smallest polygons in that layer. No error message at all. The connection works perfectly with iODBC, unixodbc and freetds. Since only some small polygons appear: Is this some kind of ressource problem? Thanks in advance. Erik


Numbering Watersheds

I am working with a watershed map, and I was wondering if there is a function or a way that I can get ArcMap to number the watersheds. For instance, if we have watershed X numbered as 0, I want the watersheds that surround/or share a boundary with watershed X to be numbered 1, and the watersheds that surround/ or share a boundary with the number 1 watersheds to be numbered 2 and so on. Is there a way this can be done by building a model in Modelbuilder? I would like to save it so when I change a watershed layer and run the model it will do the same in a new watershed area. Thanks, E ![Image Link](http://i.imgur.com/3en5m.png) PS: Sorry if the image is too small I did it really quickly using paint...


How to convert ESRI grid file to ASCII format, or otherwise import into matlab

I need to import a climate map downloaded from WorldClim into Matlab for manipulation with the mapshow command. I am comfortable reading in ASCII grid data into matlab, but this format is not available from this website. Available are the ESRI format with the file extension ".adf" and generic grid files with extension ".bil" Anyone know how I can get these into matlab? Thanks


Ovi Maps in OpenLayers?

Yahoo stopped their _Yahoo! maps web services_ (link1 : _We are shutting down this service on September 13, 2011. We suggest using maps from our partner Nokia. Please visit the Ovi Maps API for more information_ ). How can I use Ovi map as a layer of my OpenLayers map? I came through this page where it seems they've managed to use OpenLayers with Ovi : link 2


ARCGIS 10- Cutting down a tiff file layer to a smaller polygon?

I have a dynamic land map featuring open forest, closed forest ect of an area which is a tiff layer file. I want to be able to cut the layer file to my area of interest, the polygon I created? I also just want to be able to just retrieve data from my dynamic land map just in that polygon region? Cheers


Keeping a vector layer always on top

I want to know how to keep a layer always on top of other layers!   After adding a vector layer ( QgisInterface->addVectorLayer ), I want that layer to always be displayed on top of layers added later. Can anybody help me with this ?


Touch 'tap' event not available on openlayers 2.11 map (update: click works fine)

According to Will mousedown events fire with Touch events on OpenLayers mobile?, openlayers 2.11 supports click-like behaviour for vector layers only. Separate from that, regular pinching/zooming/panning works on the whole map. Weird thing, though, is that zooming on the ipad triggers a click event... My problem: I don't have a vector layer, but I do want to handle click events on an ipad. I tried attaching 'touchstart' in addition to 'click' to my existing click handler, but that doesn't give any reaction. So my question is: can I have an OpenLayers.Handler.Click handler on the whole map that reacts to touch taps? **Update** : click events work anyway, see below.


How would I go from a set of points representing routes to a set of map tiles for online consumption?

> **Possible Duplicate:**   >  Web-based user editable routing application I have a set of routes as a text file with coordinates. For each coordinate I also have whether or not it is an intersection with another route. I'm completely new to GIS and I'd like to know how I can go from these paths to an online map showing the routes. I'd like to use all free software and would like the resulting tiles to be usable in something like openLayers. I would also like to perform routing algorithms on the paths later, so I think using a spatial database would be appropriate. I'm just not sure what steps would be involved and what software should be used. Also, since I'm completely new, if you can recommend any books, tutorials, or videos that would be great too. Thanks!


How to change the field value of a Shapefile using GDAL/OGR?

I am trying to change the field value of a shapefile. However it doesn't change the value. What's wrong with my code?               import ogr          driver = ogr.GetDriverByName('ESRI Shapefile')     fn = 'dist.shp'     dataSource = driver.Open(fn, 0)          layer = dataSource.GetLayer()     feature = layer.GetNextFeature()          dist = 233          while feature:         feature.SetField("dist", dist)         layer.SetFeature(feature)         feature = layer.GetNextFeature()          dataSource.Destroy()


QGIS affine - form of equation

I am at the mercy of a govt authority who have provided utility information in a cad format with a 0,0 origin and a nonsense grid. About a dozen files, the grid and origin are entirely arbitrary. To do an affine on a vector layer in QGIS, I propose to the use the Geoprocessing Plugin - Vector Affine Transformation. But my math skills betray me.... The matching points for the ground control are               pt1 raw 6.42775 3.61140     pt1 gcp 567742 6450622          pt2 raw 2.7524 4.1539     pt2 gcp 562285 6450858          pt3 raw 6.0293 6.4965     pt3 gcp 566709 6454802      (edited x 2 , there are now 3 points here) A little rough on the correct locations. The ground control is a UTM format. What would be the form of the equation, so as I can set it up in a spreadsheet and plod away? The input for the the plugin is Scale X Scale Y Rotation X Y (not used I expect) Translation X Translation Y Is this the most elegant workflow? many thanks


Polygon symmetry detection

I was wondering if there was any way to create main axis (axis of symmetry) lines for polygons. I have polygons that represents buildings. I will want to find main axes (axis of symmetry) for those buildings and axis direction respect to a cardinal point. Best regards Stefano


Finding similar trips in a database

I have a `trips` table and a `bus_stops` table. The `trips` table has a `from_stop_id` and a `to_stop_id`. The `bus_stops` table has `lat` and `lng` information for each bus stop. How can I order the trips in descending order of popularity, where popularity is defined as the number of other trips in the database that start and end within a particular distance of the given trip? For the moment, I am happy to work with 'as the crow flies' distance between two points. Neither of the tables is spatial but I am using Postgres and adding PostGIS extension is also possible, so if that's the best way forward then I'd love to hear it. thanks a million


How to use ST_Length?

I want to calculate the lenght of the line inside the polygon. If I do this:               SELECT ST_Length(ST_Intersection(ST_Transform('SRID=3035;LINESTRING(4000000 3000000,                                                                          4005000 3005000)',                                      4326),                                      ST_Transform('SRID=3035;POLYGON((4000000          3000000                                                                      (4000000 + 5000)  3000000,                                                                      (4000000 + 5000) (3000000 + 5000),                                                                       4000000         (3000000 + 5000),                                                                       4000000          3000000 ))',                                     4326)))      I get as a result: 0.0809729885483392 Shouldn't I get around 7000? What am I doing wrong?


problem display tile when config tilecache for WMS

i have a problem with config tilecache for WMS when i have shown it. but there are proplem when display tiles. ![enter image description here](http://i.stack.imgur.com/q2uA8.png) any idea?, thanks,


WFS save problem, 'read-only' exception

I am trying to save changes via WFS-T using GeoServer:               var editLayer = new OpenLayers.Layer.Vector("Edit Layer", {             visibility: false,             strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],             rendererOptions: { zIndexing: true },             projection: new OpenLayers.Projection("EPSG:900913"),             protocol: new OpenLayers.Protocol.WFS({                 srsName: "EPSG:900913",                 url: URL,                 featureType: "SETTLEMENTS",                 featureNS: NS,                 featurePrefix: Prefix,                 geometryName: "GEOM",                 version: "1.1.0"             }),             eventListeners: ...      But the server returns error:               <?xml version="1.0" encoding="UTF-8"?>     <ows:ExceptionReport version="1.0.0"       xsi:schemaLocation="http://www.opengis.net/ows http://../geoserver/schemas/ows/1.0.0/owsExceptionReport.xsd"       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ows="http://www.opengis.net/ows">       <ows:Exception exceptionCode="NoApplicableCode">         <ows:ExceptionText>{http://...}SETTLEMENTS is read-only</ows:ExceptionText>       </ows:Exception>     </ows:ExceptionReport>      Why is the feature readonly and how to fix it?


How to make work tablet integrated GNSS (GPS) on Windows 8 with QGIS?

I have tablet - Dell latitude 10, running Windows 8, with integrated Broadcom GNSS Receiver BCM47511 (GPS,Glonass...). Because it is integrated GPS and Windows 8, there is the "new" way of providing GPS data called Windows Location Provider. This "new" way means it doesn't work properly or at all in almost any navigation/localisation software at this moment - because this software expect GPS data coming from COM port. Including QGIS - at this moment it is on the road map - http://hub.qgis.org/issues/7878 Anyway after extensive search I found software which can bypass MS localisation platform. It is called Centrafuse Localizer. This software can simulate COM port and send through it GPS data so some software is able to read it. Unfortunately not QGIS. QGIS can see the port (just to test it I changed COM 1 to 5 and 7) and it changes Serial device list in QGIS but after hitting Connect it always fails. If you are thinking about tablet with integrated GPS think twice! From my point of view it is just too early - probably also no proper drivers yet as what I have read from Broadcom Readme file. Even when GPS "works" the refresh rate and precision is terrible comparing to my phone. And all software must be changed to work with this new interface... **Is there other way I could try to make work tablet integrated GNSS (GPS) on Windows 8 with QGIS?**


OpenLayers: add a listener to a single polygon

I want to add a listener to a single polygon. Currently, I am trying to add one that makes a polygon opaque when you click on it, but I should be able to add any general listener. `OpenLayers.Layer` has an `events` property, but there is no such property for `OpenLayers.Feature` or `OpenLayers.Geometry.Polygon`. This is my setup:   * An `OpenLayers.Layer.Vector` layer, `pLayer`, called `"polygon layer"` that contains all of the polygons.   * A function `handleClick` that sets `this.style.fillOpacity = 1`. `this` is supposed to refer to the polygon clicked on   * For each polygon, I call:              pLayer.events.register('click', polygon, handleClick);      The issue with this setup is that when I click on any of the polygons, it fires the event for all polygons on that layer and every polygon becomes opaque. How do I make it so that the event only fires for individual polygons? I need this to be general. Basically, I want to be able to add any type of listener to a **single** polygon. My overall goal is to create an interface between **Google Maps** and **OpenLayers** , and I **Google Maps** you can add an event to a single polygon. Will I need to put every polygon on a separate layer? If that is the case, how do I set up the renderer for each of those polygon layers? Or is there a way to keep all polygons in the same layer and have the event handle each of them individually?


How to List Tables from current map document (mxd)?

We have many maps containing Feature Classes and Tables in a Personal Geodatabase that need their information updated. Is there a function to List Tables from the current map document like               mxd = arcpy.mapping.MapDocument("Current")     arcpy.mapping.ListLayers(mxd)      in ArcGIS 10.1?


Create Feature to selected layer from database (MSSQL) in GXP

![enter image description here](http://i.stack.imgur.com/gKdrp.png)I want to do online editing,creating new feature for selected layer data from mssql, it is possible to create new feature in shape file, but not able to do in database data.I am using Opengeo GXP,Openlayers,GeoExt,Mssql,geoserver, Please tell me how to do this. I am getting error like Uncaught InvalidCharacterError: The string contains invalid characters from openlayer


Basin numbering according to Pfafstetter Method?

I would like to divide my basin into subbasins and numbers according to the Pfafstetter method. Is there an easy way to implement this in Python using ArcPy? Or are there some freely available Python packages or tools that could be used for preparing an ArcGIS toolbox to do this?


Load surface to SQL using osm2po

Does anyone know, if it is possible to make osm2po able to load extra road data into SQL file, such as the surface tag? [1] I know it is not much used, but when it is, it would be nice to know if the surface is solid or soft. I am able to set a category by using tags, .e.g., wtr.tag.surface.gravel, but then I can only set it to another category. It would be nice if I could pass on both the category and the surface :) Any good ideas? [1] http://wiki.openstreetmap.org/wiki/Key:surface


Geodjango read raster files

I am developing a web app in geodjango (django) framework but I need to import raster files. Is it possible a geodjango app read raster files from a directory? Thanks


How to draw a line in OpenLayers?

I would like to draw a line between few GPS coordination. I tried to use OpenLayers.Geometry.LineString for that, but it uses a OpenLayers.Geometry.Point. Is there any function in OpenLayers that converts GPS coordination (latlon) to Geometry.Point? Or maybe I'm doing this wrong and shouldn't use lineString for drawing a line between latlon points?


replace GIS object with illustrator symbol

My workflow entails exporting ArcGIS Layers into Adobe Illustrator for cartographic output purposes. One problem I have at the moment is that I cannot replace my points with an Illustrator symbol. For example, points from ArcGIS are imported into Adobe Illustrator as circles. I cannot replace a circle with an Illustrator-symbol. What I can do however, is replace a single anchor point with a symbol. Is there a way to convert a circle to a single anchor point? or are there other ways in which I can replace GIS objects with Symbols? So my question is somewhat illustrator based, but I thought as this is such a common GIS workflow, is may be answered here.


Compare two feature layers

I have a base layer on top of which I will plot two separate feature layers, one containing polygons and the other containing points. Now I have to find the points which plot into the polygon. I tried various examples like https://developers.arcgis.com/javascript/jssamples/util_relation.html but somehow things are not getting done. Can anyone suggest a better idea?


Why are 10-bit linear feedback shift registers (LFSR) used in GPS?

The fundamental frequency of the GPS L1 signal is 10.23 MHz, which is related to the fact that the C/A code length is 1023 chips. This number comes from the fact that the codes are produced using 10-bit linear feedback shift registers (2^10-1 = 1023). My question is why was ten chosen as the number of bits? Why not 11 or 9 or some other number?


Can we create a temporary in-memory geodatabase using python?

I have been using in-memory workspace for creating temporary features, but I was wondering if we could create a temporary in-memory geodatabase (using python) and then use it for importing other in-memory features?


How to import DWG file from CorelDraw to MapInfo project?

I have to make polygons of some protected areas in MapInfo. I have the WMS with the protected areas loaded into mapinfo but making polygons from the WMS will take me years. So I took the following steps: -saved the window (.jpg) with polygons from WMS that I was interested in, -imported the .jpg in CorelDraw, -traced the bitmap so I had only vectorized contour of the polygons -exported it as .dwg file -created .tab file from .dwg file in MapInfo Universal Translator And at this point I have a problem. When I open the new .tab file based on CorelWork in MapInfo with georeferenced map or the WMS with protected areas, the new .tab and my polygons are in totally different place and much smaller (few meters comparing to kilometres) than original polygons in WMS. Corel works in cm/in/mm etc. and my project in mapinfo has hundreds of km. Can you help me fit polygons from .tab based on Corel to .tab with proper scale and projection? Sorry if I'm chaotic. Corel and MapInfo are the only programs I can use. I have no access to AutoCad and so on.


project from mongodb to a map

Is there any way I can directly project my coordinates stored in mongoDB onto a map? Some sort of opensource tool like OpenJump or something, which would allow me to connect to mongoDB and extract required data?


Is there an analog to ArcGIS' "Neighborhood Toolset > Point Statistics" for QGIS?

Quick procedural question- is it possible to create a raster with QGIS in which the raster cell value is assigned by summing the number of vector points that are within a certain radial distance of the cell? After much web searching, I can't seem to find it if it exists. As far as I can tell, ArcGIS has this exact function (correct me if I'm wrong- I've never used it) in its Neighborhood Toolset called "Point Statistics." Its **help** will probably explain it far better than I can:


How to retrieve FeatureServer and ClassExtensions error messages?

I am having problems when publishing a service with a FeatureServer capabilities. This service is pointing to a FeatureClass on the Geodatabase and this FeatureClass has a classExtension associated. This classExtension do some validations to ensure that the feature can be saved. In the ArcMap everything works fine and in the server it works also, but I cannot retrieve the error message properly. In ArcMap the classExtension do the validations and inform the user what rule has been violated, so he can fix the error e try again. In the web editing (FeatureServer applyEdits), when some rule is violated, the ArcGIS does not allow the feature to be saved, but the error message is generic like {"error":{"code":400,"message":"Unable to complete operation.","details":["Unable to perform applyEdits operation."]}}. If I configure the ArcGIS Server Manager Log to log detailed information I can see the right error description logged, so the classExtension is working well! Is there a way to get a structured error message or the original error description on the client side (REST)?


How to duplicate this QGIS workflow with gdal/GRASS? (reproject and crop a raster)?

I have a number of rasters (rgb images) that I want to re-project and crop. I have established a workflow for doing this in QGIS, but I'd like to do it using gdal modules, because the output is being imported into a GRASS location anyway and I could more easily automate the workflow if I were using gdal for the whole process. Here's my QGIS workflow: I have a QGIS project that with the CRS (EPSG:32142) set to the target CRS and the desired extent bookmarked (xmin=-985631.39, ymin=7464178.33, xmax=2296529.53, ymax=9628782.84). I import the raster that I want to convert, zoom to my extent, choose save layer as . . . In the 'save as' dialog box, I choose: output mode=raw data extent=map view extent resolution=layer resolution I understand how to use gdalwarp to reproject and set the extent of the output like this:               gdalwarp -t_srs EPSG:32142 \       inputfile.tif \       -te xmin ymin xmax ymax \       targetfile.tif      I also understand (thanks to MappaGnosis) that I can set the resolution for the target file using the -tr argument to gdalwarp. I don't know how to get the source file's native resolution programatically as MappaGnosis suggested in my previous post, and what I'm imagining is a messy process, like using awk or Python to parse the output of gdalinfo to create the required -tr argument for gdalwarp.


How to join data from NHGIS to make choropleth maps in R/ggplot2?

I have downloaded shapefiles of county/state boundaries and census data keyed to those shapefiles from the NHGIS. Both the shapefiles and the census data have a `GISJOIN` column to be used for merging the data. I'm able to do this just fine in QGIS, but I can't for the life of me get it to work in R/ggplot2. This is what the data looks like:               str(churches_1850)     'data.frame':   36 obs. of  30 variables:      $ GISJOIN : Factor w/ 36 levels "G010","G050",..: 1 2 3 4 5 6 7 8 9 10 ...      $ YEAR    : int  1850 1850 1850 1850 1850 1850 1850 1850 1850 1850 ...      $ STATE   : Factor w/ 36 levels "Alabama","Arkansas",..: 1 2 3 4 5 6 7 8 9 10 ...      $ STATEA  : int  10 50 60 90 100 110 120 130 170 180 ...      $ COUNTY  : logi  NA NA NA NA NA NA ...      $ COUNTYA : logi  NA NA NA NA NA NA ...      $ AREANAME: Factor w/ 36 levels "Alabama","Arkansas",..: 1 2 3 4 5 6 7 8 9 10 ...      $ AET001  : int  579 114 1 114 12 6 56 885 282 430 ...      $ AET002  : int  18 NA NA 4 NA NA NA 5 69 187 ...      $ AET003  : int  NA NA NA 252 NA NA NA 1 46 2 ...      $ AET004  : int  NA NA NA NA NA NA NA NA NA NA ...      $ AET005  : int  NA NA NA NA NA NA NA NA 2 5 ...      $ AET006  : int  17 2 1 101 21 8 10 20 27 24 ...      $ AET007  : int  5 1 NA 1 NA NA 1 6 2 10 ...      $ AET008  : int  NA NA NA 5 9 1 NA 2 6 89 ...      $ AET009  : int  NA NA NA NA NA NA NA NA 3 5 ...      $ AET010  : int  NA NA NA 2 NA NA NA NA NA NA ...      $ AET011  : int  1 NA NA NA NA 2 NA 8 42 63 ...      $ AET012  : int  NA NA NA NA NA NA NA NA NA NA ...      $ AET013  : int  577 168 5 185 106 16 87 809 405 779 ...      $ AET014  : int  NA NA NA NA NA NA NA 1 2 57 ...      $ AET015  : int  162 52 3 17 26 6 16 97 206 282 ...      $ AET016  : int  NA NA NA NA NA NA 2 NA NA NA ...      $ AET017  : int  5 7 18 12 3 6 5 8 59 63 ...      $ AET018  : int  NA NA NA NA NA NA NA NA 2 NA ...      $ AET019  : int  NA NA NA NA NA NA NA NA 4 5 ...      $ AET020  : int  4 5 NA 4 1 NA NA 16 30 5 ...      $ AET021  : int  1 NA NA 5 NA 1 NA NA 4 1 ...      $ AET022  : int  3 NA NA 22 NA NA NA 3 7 15 ...      $ AET023  : int  3 13 NA 10 2 NA NA 7 25 13 ...      This is what I'm trying so far:               library(rgdal)     library(ggplot2)     states_1850 <-readOGR(dsn = "shp/nhgis0007_shapefile_tl2000_us_state_1850/",                             layer = "US_state_1850")     churches_1850 <- read.csv("csv/nhgis0007_ds10_1850_state.csv")     states_1850_df <- fortify(states_1850, region = "GISJOIN")     states_with_data <- merge(states_1850_df, churches_1850, by.x="id", by.y="GISJOIN")          ggplot() +       geom_polygon(data=states_with_data,                    aes(x=long, y=lat, group=group, fill=AET001)) +       coord_map()      I've tried a number of other ways of merging the data, but they all either end up not merging correctly, or tearing the shapes of the states/counties, or being so large that plotting them crashes my machine (8GB ram, shouldn't be a problem). This seems like it should be easier. What's the proper way to do this? **UPDATE:** This method of merging data frames seems to be the older way of doing things. Using `geom_map` is much more powerful, since it merges the data on the fly rather than at the beginning. It also allows for easier faceting. See the ggplot2 docs for geom_map. My revised plotting code looks like this:               p <- ggplot() +        geom_map(data = churches_1850,                 aes(map_id = GISJOIN, fill = AET015),                map = shp_1860, size=0.01, alpha=.9) +       expand_limits(x = shp_1860$long, y=shp_1860$lat) +       scale_fill_gradient2(low="white", high="red")     print(p)


Calculate coordinate ( lat / long ) with another coordinate and distance

I already have a formula that can calculate the distance between 2 geographic coordinates:               public function getGeoDistance(Coordinate $geoCoord1,Coordinate $geoCoord2){         if(is_object($geoCoord1) && is_object($geoCoord2)){             $aR = $geoCoord1->getLatitude()*(M_PI/180);             $bR = $geoCoord2->getLatitude()*(M_PI/180);                  $latD = ($geoCoord2->getLatitude()-$geoCoord1->getLatitude())*(M_PI/180);             $longD = ($geoCoord2->getLongitude()-$geoCoord1->getLongitude())*(M_PI/180);                  $a = pow(sin($latD/2), 2)+cos($aR)*cos($bR)*pow(sin($longD/2), 2);             $c = 2*atan2(sqrt($a), sqrt(1-$a));                  return self::getWorldRadius()*$c;         }              return -1;     }      Now, i want to create another function that can calculate coordinates from another coordinate pair and distance value. The prototype is:               public function getGeoByGeoAndDistance(Coordinate $geoCoord1,int $distance):Coordinate      Does someone know the math beyond it? P.S. the code is in PHP. thanks. Shlomi.


OpenLayers: WFS request to GeoServer to retrieve "name" & "featureNS"

Using `WFSGetCapabilities` I sent a `GetCapabilities` request to GeoServer. From the result of `WFSGetCapabilities().read()`, I can loop each featureType and retrieve some basic info(e.g., name, title, featureNS, srsName). Then in order to retieve the `"geometryName`" property of this feature type, (which is needed to load this featureLayer into map), I sent a `DescribeFeatureType` request to server by attaching `"&TypeName="feature.name`. However, I found that the full name of the feature is truncated, i.e., `feature.name` is the feature's name without its namespace prefix. However, this namespace prefix is needed in DescribeFeatureType request URL. My question is: How can I get the full name (with namespace prefix) in order to execute this DescribeFeatureType request and retrieve the geometryName property? Any help is appreciated!!!!


What type of kernel density function does ArcMap use?

I know that there are several types of kernel density functions, such as uniform, cosine, Gaussian, etc. I was just wondering which one the "Kernel Density" functionality in ArcMap 10's Spatial Analyst uses? Thanks!


Are large companies successfully using SQL Server GeoSpatial functionality?

I am working on a project where I have to allow users to find things that are near by. In the past I have just manually stored lat/longs and done my own calculations but I'm curious if it's worth looking into using the GeoSpatial features in SQL Server 2008. Are people out there having success using this for their spatial queries? Are there examples of large companies out there that are using this? Are there any common problems that I should be aware of?


How to change symbol and legend of a feature class in ArcMap?

I want to change the symbol of features and legend programmatically. When I use this code               Dim pSymbolSelector As ISymbolSelector     Set pSymbolSelector = New SymbolSelector     Dim pMarker As ISimpleMarkerSymbol     Set pMarker = New SimpleMarkerSymbol     If Not pSymbolSelector.AddSymbol(pMarker) Then            MsgBox "Could not add symbol"     ElseIf pSymbolSelector.SelectSymbol(0) Then            Dim pSymbol As ISymbol            Set pSymbol = pSymbolSelector.GetSymbolAt(0)     End If      then Symbol Selector is open, but when I select a symbol it is not being applied at the current layer in Table of Contents. Please give any ideas.


Can ESRI Personal Geodatabase be viewed with any software other than ArcGIS?

Is it possible to open a PGDB file in software other than ArcGIS? i.e are there any opensource software available just for viewing the data?


Raster to polygon conversion's raster field takes only "Value"

Recently I am working with raster data and arcobjects.net. Here I find something new for me. And here some question arises in my mind. I tried to search some document that can satisfy my mind, but I couldn't find. Any pointer or document or link would be helpful. When I perform _Raster to polygon_ conversion's, fourth parameter is raster_field. Sometimes I can give either "Value" field or "Count" field in it, sometimes, its only "Value" field. when and why? When does it take only "Value" field?


value field name after raster to polygon conversion

When I perform _Raster to polygon_ conversion using tool, sometimes it creates a field named "GRIDCODE", sometimes the field name is "grid_code". Why does it create random name of a field?


Field added to raster data is not visible in attribute table

I am new to raster data and my background is software engineering so this might be a trivial question for GIS specialists. Some raster files have attribute table but some do not. On those with attribute tables, I can add a field in that table using _Add Field (Data Management)_ tool but I cannot see the field in the attribute table. In fact, when I identify any pixel by _Identify tool_ , it does not show the field name so I am wondering where the field is gone? **EDIT :** I have tried to do Build Raster Attribute Table but it produces error. My raster data's pixel type is: signed integer. Steps I am doing now:   1. raster to polygon conversion(input:inpRaster, output:resultPolygon)   2. polygon to raster conversion(input: resultPolygon, output: resultRaster)   3. add field(input raster: resultRaster) no error occurred. Shows field added message. But does not show it in the attribute table. If I remove the raster layer from arcMap and add it again from arcCatalog, then it shows the field. When I try to create another new field with the same name, it says that field already exists. So why doesn't it show all fields in the attribute table?


Can a single raster pixel hold more than one value?

I am a newbie with raster data. Maybe this is a trivial question. Can a single pixel of a raster hold more than one value?