Speeding up OpenStreetMap PostGIS querying

I have OpenStreetMap data for the Netherlands loaded into a PostGIS database (PostgreSQL 8.3 / PostGIS 1.3.3) using the osmosis schema. This means all tags are stored in a hstore field. In addition to the GIST index that osmosis creates on the geometry field, I created an additional GIST index on the tags field. Trying to query using both a spatial constraint and a constraint on the tags field, I find that it is slower than I would like. A query like this one:               SELECT n.geom,n.tags,n.tstamp,u.name FROM nodes AS n        INNER JOIN users AS u ON n.user_id = u.id        WHERE tags->'man_made'='surveillance'        AND ST_Within(geom, ST_GeomFromText('POLYGON((4.0 52.0,5.0 52.0,5.0 53.0,4.0 53.0,4.0 52.0))',4326));      takes 22 seconds to return 78 records. There are around 53 million records in this table. Is there a way to significantly speed this up? I've heard that hstore is implemented significantly better in PostgreSQL 9, would upgrading help?


Classified Images of RandomForest-Classification look clustered

I performed a RF-classification. I have 6 bands, ~250 trainingpoints in a shapefile, OOB estimate of error rate: 1.56% Picture of take trainingpoints added. My code:               setwd("D:/BA-Workspace/sw_comp_ap_aug/")               library(sp)     library(rgdal)     library(raster)     library(randomForest)               # CREATE LIST OF RASTERS     rlist=list.files(getwd(), pattern="tif$", full.names=TRUE)           # CREATE RASTER STACK     xvars <- stack(rlist)            # CREATE RASTER STACK     xvars <- stack(rlist)       x <- coordinates(xvars)[, 1]     y <- coordinates(xvars)[, 2]          x_rst <- y_rst <- xvars[[1]]     x_rst[] <- x     y_rst[] <- y          xvars <- stack(x_rst, y_rst, xvars)     names(xvars) <- c("x", "y", "fitzefa1_rot1", "fitzefa1_gr1", "fitzefa1_bl1",     "fitzefa2_rot1", "fitzefa2_gr1", "fitzefa2_bl1")     # READ Raster TRAINING DATA     sdata <- readOGR(dsn=getwd(), layer="sw_trainshape")          # ASSIGN RASTER VALUES TO TRAINING DATA     v <- as.data.frame(extract(xvars, sdata))     sdata@data = data.frame(sdata@data, v[match(rownames(sdata@data), rownames(v)),])          sdata@data  <- sdata@data[-c(5,6)]           # RUN RF MODEL     rf.mdl <- randomForest(x=sdata@data[,3:ncol(sdata@data)],     y=as.factor(sdata@data[,"Class"]),                        ntree=501, importance=TRUE)          # CHECK ERROR CONVERGENCE     #plot(rf.mdl)     #sdata@data           # PLOT mean decrease in accuracy VARIABLE IMPORTANCE          #varImpPlot(rf.mdl, type=1)     #setOldClass(SpatialPointsDataFrame)     # PREDICT MODEL     predict(xvars, rf.mdl, filename="RfClassPred.img", type="response",          index=1, na.rm=TRUE, progress="window", overwrite=TRUE)      Here the classified .img ![enter image description here](http://i.stack.imgur.com/arzOD.jpg) The classes are obviously wrong. Could it be due to wrong training-points? I have 7 classes. (No excluded class for shadows or so, because I'm just trying to devide some tree-species) ![enter image description here](http://i.stack.imgur.com/nrNja.jpg) ![enter image description here](http://i.stack.imgur.com/TsqgH.jpg) ![enter image description here](http://i.stack.imgur.com/eOz46.jpg) ![enter image description here](http://i.stack.imgur.com/zIEAD.jpg)


tabbed popup window for Arcgis Javascript

Anyone know examples of a tabbed popup window for Arcgis for javascript, NOT an infowindow? If you could point me in the the right direction it would help.


OpenLayers data moves when panning map

I have an OpenLayers map. On to this I have loaded a GeoJSON file. When I pan the map the GeoJSON data moves relative to the basemap. Surely this isn't right! Can anyone shed some light no why this is happening?


WFS Spatial Operator Query - Crosses AND Within

I'm trying to query my wfs service with a polygon. I want the service to return both features that are inside the polygon and partially inside the polygon. However, when I use the "Within" spatial operator, I only get features that are completely inside. When I use the "Crosses" operator, I only get the features that are partially inside the polygon. I have tried using And/Or to query for features that are either one or the other, but WFS does not support multiple spatial operators in a query. It gives me this error: > "Unsupported filter - filter has more than one spatial operator." Does anyone have an idea of how to get around this without sending two separate ajax requests to the service? Here's an example that returns data with the "within" filter.               var xml = '<ogc:Filter xmlns="http://www.opengis.net/ogc">\n'                  +      '<ogc:Within>\n'                  +        '<ogc:PropertyName>Shape</ogc:PropertyName>\n'                  +        '<gml:Polygon>\n'                  +          '<gml:outerBoundaryIs>\n'                  +            '<gml:LinearRing>\n'                  +              '<gml:coordinates>' + queryObject.geometryString + '</gml:coordinates>\n'                  +            '</gml:LinearRing>\n'                  +          '</gml:outerBoundaryIs>\n'                  +        '</gml:Polygon>\n'                  +      '</ogc:Within>\n'                       +    '</ogc:Filter>\n'      Here's the capabilites of the wfs service:               <ogc:SpatialOperators>     <ogc:SpatialOperator name="BBOX"/>     <ogc:SpatialOperator name="Equals"/>     <ogc:SpatialOperator name="Disjoint"/>     <ogc:SpatialOperator name="Intersects"/>     <ogc:SpatialOperator name="Crosses"/>     <ogc:SpatialOperator name="Touches"/>     <ogc:SpatialOperator name="Within"/>     <ogc:SpatialOperator name="Contains"/>     <ogc:SpatialOperator name="Overlaps"/>     </ogc:SpatialOperators>


OpenStreetMap Neighborhood Boundaries

Is it possible to download neighborhood boundaries from OpenStreetMap? I see on maps that they often indicate neighborhood names; is there a way to retrieve their coordinates and boundary polygon coordinates, much like the Zillow Neighborhood Boundaries data set?


How to get GDAL to create statistics for GTiff in Python

I regularly create my own GeoTIFF rasters with GDAL in Python, e.g.:               from osgeo import gdal     from numpy import random     data = random.uniform(0, 10, (300, 200))     driver = gdal.GetDriverByName('GTiff')     ds = driver.Create('MyRaster.tif', 200, 300)     band = ds.GetRasterBand(1)     band.WriteArray(data)     ds = band = None # save, close      however when the result is viewed with ArcCatalog/ArcGIS, it looks either black or grey, since it has no statistics. This is solved either by right- clicking the raster and choosing "Calculate Statistics..." in ArcCatalog (there are several other ways to do this), or using gdalinfo in a command prompt:               gdalinfo -stats MyRaster.tif      will generate `MyRaster.tif.aux.xml`, which is used by ArcGIS to properly scale the raster. The PAM (Persistent Auxiliary Metadata) file contains the statistics, most notably the minimum and maximum values:               <PAMDataset>       <PAMRasterBand band="1">         <Metadata>           <MDI key="STATISTICS_MINIMUM">0</MDI>           <MDI key="STATISTICS_MAXIMUM">10</MDI>           <MDI key="STATISTICS_MEAN">5.0189833333333</MDI>           <MDI key="STATISTICS_STDDEV">2.9131294111984</MDI>         </Metadata>       </PAMRasterBand>     </PAMDataset>      My question: is there a built-in way of getting GDAL to create a statistics file (other than using the `gdalinfo -stats` command)? Or do I need to write my own?


QGIS 2.4: adding feature with setLineEdit() data not saving to database

A while ago, I struggled to get a combo box working correctly for QGIS 2.0. This involved transforming a combo box into a line edit if the item named "other" was chosen, enabling the user to add a value not already existing in the combo box. Now that i've updated to **QGIS 2.4 using Windows XP** , however, I am having other issues! The combo box still turns into a line edit, but the user-input does not get saved to the database. After the line edit appears, and a new value is added, "Autre" is still the value saved to the database.               #wiring up the signal to my function     Diametrefield.currentIndexChanged.connect(autre)          #changing the combo box to line edit     def autre():         global Diam_autrefield, Diametrefield         if Diametrefield.currentText() == '..Autre':             QMessageBox.warning(None,'Note de saisie',"Definir 'Autre' Diametre")             Diametrefield.setLineEdit(Diam_autrefield)          def validate():         global Diametrefield         if Diametrefield.currentText() == '..Autre':             Diametrefield.setStyleSheet("background-color: rgba(255, 107, 107, 150);")             QMessageBox.warning(None, 'Probleme de saisie',"Veuillez choisir 'Diametre'")         else:             # Return the form as accepted to QGIS.             myDialog.accept()


How are .mif files loaded to QGIS?

I have downloaded sources of Qgis 1.8. I would like to know how it accepts mif file. As I have learnt after choosing add VectorLayer. Method addVectorLayers is called. Then openvectorlayer dialog shows. Afterwards QgsVectorLayer is created. It is constructor               QgsVectorLayer::QgsVectorLayer( QString vectorLayerPath,                                     QString baseName,                                     QString providerKey,                                     bool loadDefaultStyleFlag )         : QgsMapLayer( VectorLayer, baseName, vectorLayerPath )         , mUpdateThreshold( 0 )     // XXX better default value?         , mDataProvider( NULL )         , mProviderKey( providerKey )         , mEditable( false )         , mReadOnly( false )         , mModified( false )         , mMaxUpdatedIndex( -1 )         , mActiveCommand( NULL )         , mRenderer( 0 )         , mRendererV2( NULL )         , mUsingRendererV2( false )         , mLabel( 0 )         , mLabelOn( false )         , mVertexMarkerOnlyForSelection( false )         , mFetching( false )         , mJoinBuffer( 0 )         , mDiagramRenderer( 0 )         , mDiagramLayerSettings( 0 )     {       mActions = new QgsAttributeAction( this );            // if we're given a provider type, try to create and bind one to this layer       if ( ! mProviderKey.isEmpty() )       {         setDataProvider( mProviderKey );       }       if ( mValid )       {         // Always set crs         setCoordinateSystem();              QSettings settings;         //Changed to default to true as of QGIS 1.7         //TODO: remove hack when http://hub.qgis.org/issues/5170 is fixed     #ifdef ANDROID         bool use_symbology_ng_default = false;     #else         bool use_symbology_ng_default = true;     #endif         if ( settings.value( "/qgis/use_symbology_ng", use_symbology_ng_default ).toBool() && hasGeometryType() )         {           // using symbology-ng!           setUsingRendererV2( true );         }              // check if there is a default style / propertysheet defined         // for this layer and if so apply it         bool defaultLoadedFlag = false;         if ( loadDefaultStyleFlag )         {           loadDefaultStyle( defaultLoadedFlag );         }              // if the default style failed to load or was disabled use some very basic defaults         if ( !defaultLoadedFlag && hasGeometryType() )         {           // add single symbol renderer           if ( mUsingRendererV2 )           {             setRendererV2( QgsFeatureRendererV2::defaultRenderer( geometryType() ) );           }           else           {             QgsSingleSymbolRenderer *renderer = new QgsSingleSymbolRenderer( geometryType() );             setRenderer( renderer );           }         }              mJoinBuffer = new QgsVectorLayerJoinBuffer();              connect( QgsMapLayerRegistry::instance(), SIGNAL( layerWillBeRemoved( QString ) ), this, SLOT( checkJoinLayerRemove( QString ) ) );         updateFieldMap();              // Get the update threshold from user settings. We         // do this only on construction to avoid the penality of         // fetching this each time the layer is drawn. If the user         // changes the threshold from the preferences dialog, it will         // have no effect on existing layers         // TODO: load this setting somewhere else [MD]         //QSettings settings;         //mUpdateThreshold = settings.readNumEntry("Map/updateThreshold", 1000);       }     } // QgsVectorLayer ctor      So for now I need to know where the data from .mif file is been parsed.


arcpy.Delete_management not deleting

I'm struggling with deleting an mxd in a for loop. My code is:                   import arcpy, glob, os, datetime, time         from time import strftime              for filename3 in glob.glob(os.path.join(folderPath, "*.mxd")):              fullpath = os.path.join(folderPath, filename3)         basename, filename2 = os.path.split(fullpath)              mxd = arcpy.mapping.MapDocument(filename3)              if os.path.isfile(fullpath):             basename, filename2 = os.path.split(fullpath)                       (shortname, extension) = os.path.splitext(filename2)              mxd.saveACopy(draftloc + "\\" + "SentToDraftOn(" + strftime("%d%b%y %Hh%Mm%Ss") + ")"+ "_" + shortname + extension)         arcpy.Delete_management(mxd)      I'm trying to do some processing on each mxd in a directory and then I want to saveACopy to a new location and then delete the old mxd. I keep getting the following traceback error: > Object: Error in executing tool I think it's an indentation thing, but I can't seem to figure it out. Can anyone suggest what I am missing? Thanks, Mike


How to calculate raster statistics for polygons?

how can I calculate sums, averages etc of raster-points (multi-band) per polygon of a vector-layer. I was told that this is called "zonal statistics". I tried that with QGIS first. There is a way to do it but that is much too slow (convert raster to vector, intersect with second vector-layer, calculate geometry, export numbers, calculate statistics with spreadsheet or other program, re-import the results, takes forever for my 350.000 raster-points). I was also given the hint to use saga-gis. That has "zonal statistics" but those are based on categories from a raster-band, not on polygons from a vector-layer. So to use this I would have to convert my vector-layer to raster and then calculate the statistics. This seems to be the wrong way to solve this. There would be no way to account for raster-points that belong to 2 or more polygons because they are intersected by the polygon-boundary. I assume that polygon-based statistics should be able to handle this so I also assume that I haven't found the correct module yet. Saga-gis has really many modules. Please let me know which one is the right one for this application. THX, stn


Can't Seem to Replicate the KML Layer in jsFiddle

I can't see why I am unable to replicate the KML Layer Example: http://openlayers.org/dev/examples/sundials.html in jsFiddle: http://jsfiddle.net/JPN4C/ I'm assuming that it's the map protocol or something else near the url, but can't see what that is.


How to load WFS in jsFiddle?

I'm trying to implement a WFS service in jsFiddle for an OpenLayers map. It works fine here: http://openlayers.org/dev/examples/cql-format.html My example of it is (the map loads but the filter doesn't): http://jsfiddle.net/L7sFY/ But I can't seem to get the filter to work properly. WFS: http://en.wikipedia.org/wiki/Web_Feature_Service XML WFS file: http://demo.opengeo.org/geoserver/wfs?service=WFS&version=1.0.0&request=GetFeature&typename=topp:states&outputFormat=json&format_options=callback:loadFeatures


javascript function to search all OpenLayers vector features covering a pixel

I have an OpenLayers map that draws features in a vector layer. The features are selectable and have a popup on select. Unfortunately in a lot of cases the features overlap so it can be impossible to select some features. I think that what I need to do to fix this is change my select control so that it uses a click handler and searches the map for features at this point. What sort of function do i need to write? are there any examples of this being implemented before? This is how the features are drawn:               var vector_Layer = new OpenLayers.Layer.Vector();          function GetFeaturesFromKMLString (strKML) {         var format = new OpenLayers.Format.KML({         'internalProjection': new OpenLayers.Projection("EPSG:900913"),         'extranalProjection': new OpenLayers.Projection("EPSG:4326")             });         return format.read(strKML);     };          vector_Layer.addFeatures(GetFeaturesFromKMLString('$newkml'));      And this is how Layers are currently selected:               var select = new OpenLayers.Control.SelectFeature(vector_Layer, {clickout: true});              vector_Layer.events.on({                 "featureselected": onFeatureSelect,                 "featureunselected": onFeatureUnselect});                             map.addControl(select);             select.activate();                  select.handlers['feature'].stopDown = false;              select.handlers['feature'].stopUp = false;      here is the click event listener I was planning on using:               OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {                                 defaultHandlerOptions: {                     'single': true,                     'double': false,                     'pixelTolerance': 0,                     'stopSingle': false,                     'stopDouble': false                 },                      initialize: function(options) {                     this.handlerOptions = OpenLayers.Util.extend(                         {}, this.defaultHandlerOptions                     );                     OpenLayers.Control.prototype.initialize.apply(                         this, arguments                     );                      this.handler = new OpenLayers.Handler.Click(                         this, {                             'click': this.onClick,                             'dblclick': this.onDblclick                          }, this.handlerOptions                     );                 },                       onClick: function(evt) {                     //function that seachers for and selectas features at this point                 },


Map algebra expression with dynamic raster layers

Attached is the model that i am working on. ![Model1](http://i.stack.imgur.com/iaBFm.gif) The "To Value" and "From Value" are model parameters and hence subject to change each time according to requirements, This leads to varying number of files generated each time. This variation in the number and names of output files in a workspace is creating the problem in hardcoding the following calculator expression in a subsequent model directly. ![Model2](http://i.stack.imgur.com/KFVR0.gif) This is the expression in the second map algebra tool that i want to use. The input rasters are those generated from the model shown above. Raster Calculator (output1+(output2/Output1)+(output3/Output2)+(output4/Output3)+(output5/Output4)+....) I saw some effort to a similar question here, Raster Calculator dynamic map algebra expression, but I didn't find it conclusive. (I didn't understand the advice to use the FOR loop there) Help and advice please! I am using ArcGIS-10.1


SPOT NDVI time series

I have 423 spot.vgt ndvi from first April 1998 till 31 Dec 2009. I want to know how to stack these NDVI to have one image for time series analysis? Or better to ask how is it possible to analyze a pixle change during these period?


Batch Aggregate Raster using Python

Trying to write a python script to batch Aggregate a bunch of different rasters. get a Parsing Error Syntax error for line 11.               # Batch Aggregate raster tool     import arcpy     from arcpy import env       from arcpy.sa import *          env.workspace = r"C:\rasters"     out_workspace = r"C:\rasters\agg"          rasters = arcpy.ListRasters()          for raster in rasters         outAggreg = Aggregate(raster, 10, "MEAN")         outAggreg.save(out_workspace, raster + "_agg")


Make InfoTemplate moveable but still highlight attributes

I’m using the esri/InfoTemplate in the Javascript API to identify features. However, it gets anchored to the mouse click and cannot be moved around. Based on this answer I used dojo/dnd/Moveable to make it moveable. However, now I cannot highlight or copy the attributes inside of it. It’s like Moveable turns it into a graphic or something. Is there a way to make the InfoTemplate floating but still be able to highlight and copy the attributes? Thanks in advance for your help. (The other option I’m considering is using the jQuery Dialog Widget, but I cannot get it to highlight the geometry for multiple features. Any suggestions there would be great too. Whichever is easier.)


Looking for GIS Data for Curitiba, Brazil?

I am wondering if anyone knows where to find building footprints, road network, transit, or environment feature data for Curitiba, Brazil. Thanks


Drawing Graphic at street layer/level only

I am new to ArcGIS JavaScript API and would like some help. I have a scenario where a user has to draw a graphic, mainly a polyline and some points on a map. To avoid confusion I want to limit the user to zoom in to street level prior to start drawing. What I am trying to achieve here is when the user clicks on the locality he/she wants to draw on, on the click even the map zooms in to street layers. I have been looking around but can't find a way to do it.


Why do I get a ". not nullable field error" when attempting to split a feature?

I'm trying to split feature, by point, into 2 new features.                var pFeatureEdit = lineToSplit.Feature as IFeatureEdit;      var set = pFeatureEdit.Split(point);      When this feature has configured relation, I got exception. Got next COM error: The field is not nullable [FIELDID] Where FIELDID - not nullable foreign key in database Anybody know how to solve this issue? UPD. When I split this feature using standard Split Tool in ArcMap - it splits successfully. This uses another method to split features?


Qgis Plugin development with postgres data

can someone help me with initial developing on qgis plugin that displays postgres data table on a `QTTableView` or `QTTableWidget`? So far:   * I can connect to database using psycopg2 or using QtSql(tested inside QGIS console)   * Using idle i can't because it does not load the QPSQL drivers...although i have them on my qt binary install.   * I'm using pluginbuilder for initial setup, but i don't know how to get a reference to my tablewidget, to pass data from sql query.   * Using IDLE i can draw a form with a tablewidget that is filled with data from sel query. I already read this question :(but still have doubts...) I need help putting things together. Thanks for reading. _UPDATE:_ In here if i run from terminal i can fill a `qtablewidget` with sql data: http://pastebin.com/Lm6GsUMk I want to draw a widget like this inside a qgisplugin. `My Plugin(TestPlugin)` was buit with plugin builder, asnd inside my `ui_testplugin.ui`, i have a `QtTableWidget` draw with `QtDesigner` and compiled using a generated makefile. I know that i have to insert logic inside `testplugin.py`, inside run block, but i don't know to get a reference to `QtTableWidget`. Hope this makes it clear. Thanks.


Qgis map composer shows a huge red cross

I can show this best by a picture: ![Figure](http://i.stack.imgur.com/twNl3.png) This cross also shows when I export it as raster or pdf. What is it and how can I get rid of it? I am using Qgis 2.4 and the map was done with the help of the Grass plugin `AniMove` on Linux Mint.


OpenLayers Map with custom SRS (without EPSG code)

Is it possible to show geodata by OpenLayers in custom projection? I want to show my geodata in OpenLayers interface. Source layer(s): shape-file(s), standard epsg:4326 lon/lat projection; processed by Mapserver (WMS Layers). Result map: Albers Conic Equal Area projection, with specific central meridian (It has no EPSG code). Definition in PROJ.4 format:               +proj=aea +lat_1=52 +lat_2=64 +lat_0=0 +lon_0=93 +x_0=16500000 +y_0=0 +ellps=krass +units=m +towgs84=28,-130,-95,0,0,0,0 +no_defs      As to Mapserver Layers – they are all well, I can show geodata through standard Mapserver CGI template-based interface, in this custom Albers projection… For OpenLayers I tried to define Proj4js.defs –                         <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>     <link rel="stylesheet" href="ol/style.css" type="text/css" />
OpenLayers Test

                It seems that the presented coordinate transformation works correctly (displaying the appropriate numbers when I move the mouse), but the map does not appear… How can I do this? # ==================== **Discussion of the problem & Answer to the question --**   It looks like I found the answer myself...   (The above source code has been corrected, and already has a working version) I changed WMS-layer upon layer of MapServer type Original (non-working) version was:               ...         var rus_general = new OpenLayers.Layer.WMS( 'Russian Regions',              'http://localhost/cgi-bin/mapserv.exe?map=C:/OSGeo4W/apache/htdocs/test/z-albers.map',          {layers: 'rus_general'}             );     ...      In this case, the bottleneck - WMS-service: I do not know how to specify a custom (non-EPSG) projection in this case ...   This is not a problem for the Mapserver layer type. Mapserver generates a map projection with PROJECTION section in the MAP-file. There are no restrictions such as "EPSG Only"... Thank you all.


QGIS python plugin, segmentation fault, what can I do?

I'm trying to write a python plugin to create an input file for an urban climate model out of three shape files. Unfortunatelly QGIS closes when I try to load the plugin. When I start QGIS from the Terminal (Ubuntu), I get "segmentation fault" when it happens. Thats all. Is there some way to prevent QGIS from crashing or another way to track down the error?


ArcGIS Server won’t release SDE table locks

My ArcGIS Server services are locking tables in SDE. This is a problem if I need to edit or overwrite them. Unfortunately the locks don't go away upon stopping the services. The only solution I have found is to restart the Linux `arcsde` service, which has many implications. Is there a better way to lose these phantom locks?


Unable to inspect GML file

I use FME to make GML file based on SQLServer data. When I create GML, I cann't see anything in FME Data Inspector or Universal Viewer. Like something is missing in file. I have schema, and XMLValidator validates file against schema, but I still cann't see graphical data. Link to Result.gml Link to schema. Does anyone knows what is the problem and what is missing in schema? **EDIT:** As requested! ![FME workspace](http://i.stack.imgur.com/xT1e0.jpg) This is just a part, but main part. All features come into XMLTemplater, like on the picture. Some of them (with non-point geometry) goes first in GeometryExtractor and then into XMLTemplater. These StringReplacers works fine. XMLValidator validates document successfully.


Website, tool or app to produce colored map of the United States?

Does anyone know of a website, Windows program or iOS app that has a clickable map of the United States and colors in the states that are clicked on? Looking to produce a map of states I have visited or lived in. Ideally it would be nice to be able to save and print this image as well. Thanks.


Where is Sextante in QGIS?

I am using QGIS 1.7.3 (can't get 1.8 to work on my WIN 7 64 OS) and I cannot find the Sextante plugin. I have found other plugins with no problems, accessing all the various repositories, I have a list of many to choose from several repositories but there is no Sextante although the Sextante website says it should be downloadable from the QGIS main repository. What am I missing, doing wrong?


When iterating over a vector layer with pyqgis, how do I check whether a feature is selected?

While iterating over a vector layer using the following code (summerized from the example in the pyqgis cookbook), is there a way to check whether a feature is selected?               provider = vlayer.dataProvider()     feat = QgsFeature()     allAttrs = provider.attributeIndexes()     provider.select(allAttrs)     while provider.nextFeature(feat):         geom = feat.geometry()         attrs = feat.attributeMap()         for (k,attr) in attrs.iteritems():             print "%d: %s" % (k, attr.toString())      Alternatively, I could create a list of selected features using `vlayer.selectedFeatures()`, but I'm hoping there is a way to check each feature directly.


How to write XML attributes from feature with ArcView license?

I need to generate xml of attribute data of a feature, but I have only Arcview license so, I can't use Export XML tool. What are my options? What is wrong with this code (after applying search cursor writing the attributes of node):                for row in rows:       order.attrib['name'] = row.getValue('Id')       order.attrib['UTM'] = row.getValue('UTM')      I am not able to see any addition to order tag. missing something... Thanks Ok - just realized there was some issue with the feature: Here is the code and error message after the change (So something is broken fundamentally):               >>> import xml.etree.ElementTree as xml     >>> import arcpy     >>> fclass= arcpy.SearchCursor(r"..\SiteMarker_Project")     >>> order = xml.Element('Order')     >>> site = xml.Element('Site')     >>> order.append(site)     >>> rows = fclass     >>> for row in rows:       order.attrib['name'] = row.getValue('Id')       order.attrib['UTM'] = row.getValue('UTM')          Traceback (most recent call last):       File "<pyshell#8>", line 3, in <module>         order.attrib['UTM'] = row.getValue('UTM')       File "C:\Program Files\ArcGIS\Desktop10.1\arcpy\arcpy\arcobjects\arcobjects.py", line 1011, in getValue         **return convertArcObjectToPythonObject(self._arc_object.GetValue(*gp_fixargs(args)))     RuntimeError: ERROR 999999: Error executing function.**      Thanks


Estimating Landsat 7 azimuth (heading)

I am trying to understand if the Landsat 7 satellite ETM+ orbit has any significant azimuth or if it could be assumed as 0° (as it is not a pointable sensor). I searched in the web but could not find any good answer so far. Zenith is supposed to be equal zero as Landsat images are always nadir. What about the azimuth? Would knowing the scene center coordinates (they're 46.036323 N and 10.456876 E) be of any help? The image looks like a sort of isosceles trapezoid, with the major basis towards the North (as I would expect for the Northern Hemisphere). It is also tilted differently from south to North (as I also would expect). I would appreciate any help, thanks in advance. **UPDATES** One question arised while I was trying to solve my task. The metadata file of Landsat provides coordinates of the four image corners. Anyway they refer to the black background. The azimuth is intended to be calculated through these corners or the corners of the "real"-non-background image? And why do I have to use latitude rather than longitude? Is it not better to use longitude? I thought to use (for instance) the right corners, subctracting the longitudes of them (e.g. upper right long-lower right long) and obtain what I was looking for in terms of degrees, does it make sense for you? Here is an image showing a part of Landsat paths in a Worldwide Reference System (descending orbit) and my Landsat scene. RS is geographic, WGS84. According to this what I should looking at is the non-background image. ![Landsat in the WRS path](http://i.stack.imgur.com/sp8Hu.jpg)


Why is a Shape polygon file not editable?

I received a .shp polygon file. When I choose the edit toggle tool in QGIS the little red X's appear as expected. Then when I try to edit the polygons such as add a polygon all seems to go well, when finishing with a new polygon the dialog box for the attributes appears which allows entries and then upon closing the new polygon disappears. Also when trying to use the node tool it looks like a node can be moved but not really. Or any other editing such as editing the attribute by selecting a polygon with the information tool, the usual table appears and not the dialog table which allows entries into the attribute variables for the selected polygon. The file is not read only, other files are in the same directory which are editable. Any ideas what the difficulty is?


insert cursor "Row contains a bad value"

I'm having a problem copying data from a shapefile to a feature class using an insert cursor. Here is the part that is causing trouble:               newRows = arcpy.InsertCursor(Target)     sourceRows = arcpy.SearchCursor(Christiansburg)          for source in sourceRows:         neue = newRows.newRow()         neue.setValue(TName, source.getValue(CName))         newRows.insertRow(neue)      It takes data from a field in the source row, and then copies it to the new row. The trouble is, when the source row has a forward slash in it, it fails when I try to do the insert, saying "The row contains a bad value.". If I edit the forward slash out of the source data, it works fine. If I replace the variable with a hardwired string that has a forward slash in it, it also works fine, so I am not 100% sure that it is the forward slash causing the problem. I have tried using the str function on the result of getValue, and it still doesn't work. The field being copied from is street names, and the row causing trouble is a street that changes name. If worst comes to worst, I could simply edit out the forward slash permanently, but I would rather not if I can help it. Does anyone know what I am doing wrong here? EDIT: Derped on copy/paste of code snippet. Should be fixed now.


Color gradient in symbology in ArcGIS 10.1 for interpolation raster

I have measured noise and want to create with this measured points a noise map with interpolation....is there any way in symbology to create a flowing transition between the different colors for the created interpolation raster? I used color ramp, so the colors have a gradiation but the borders between these colors are not fluent or in simple words: i want to have a result like a rainbow, where the colors are fluent but without recognizable borders thanks in advance!


Basic arcpy script with cursors running SLOW!

I've got 2 polygons layers (no gaps): IDUs and crops. What I want is to identify the 3 largest crops by % area for each IDU. This seems common enough but I couldn't find a way to do it all using tools, so I decided to try and learn basic arcpy to finish the job. I'm in ArcGIS 10.1 SP 1 (Advanced) and have done lots of PHP but this is my first try at python. I found the Tablulate Intersections tool which works great and gives a table with all the overlapping crops with area and %area fields, but I want to add attributes to the IDU layer for the 3 largest crop codes - eg. LU_1=123, LU_2=201, LU_3=132. Here's the script I wrote. It works, but it's taking 100sec to process 160 test IDU records, and eventually it needs to process 100,000. I've got a 2013 Retina MacBookPro which flies through everything else I've thrown in in Arc so far, so something is obviously poorly done in my code.               import arcpy     idusFC = "c:/Envision/StudyAreas/PEI-Dev/NewIDUs/PEI.gdb/IDUs_Test"     cropTB = "c:/Envision/StudyAreas/PEI-Dev/NewIDUs/PEI.gdb/IDU_CROP2011_table_Sort1"     iduFields = ["CROP2011_A_Code", "CROP2011_B_Code", "CROP2011_C_Code", "IDU_ID"]     cropsFields = ["CROP_2011_GRIDCODE"]     print "Starting processing"     start = time.time()     with arcpy.da.UpdateCursor(idusFC, iduFields) as idus:         for idu in idus:             itr = 0             iduID = idu[3]             whereClause = arcpy.AddFieldDelimiters(cropTB, "IDU_ID") + " = " + str(iduID)             with arcpy.da.SearchCursor(cropTB, cropsFields, where_clause=whereClause) as  iducrops:                 for iducrop in iducrops:                     idu[itr] = iducrop[0]                     itr += 1                     if itr > 2:                         break             idus.updateRow(idu)     end = time.time()     processTime = end - start     print "Processing Completed - {:.1f} seconds".format(processTime)      Is there another way I should do this so that it runs reasonably fast? Thanks!


Adding layer into ArcMap via Python - .pyt versus .py

In the final step of a script I've built, I'm trying to add a layer into an empty blank map document. This is my block of python code below that adds the layer. Everything works fine if its run from a script tool pointing at a .py from ArcToolbox, but if I run the same block of code inside a .pyt toolbox, the layer flashes and then goes away. Is there a parameter to set somewhere that I'm missing? I would like to use the .pyt tool because it makes it easier to distribute to users. -"layername" comes from previous part of script               outlayer = layername[:-4]           arcpy.MakeFeatureLayer_management(layer, outlayer)     lf = arcpy.mapping.Layer(outlayer)     mxd = arcpy.mapping.MapDocument("CURRENT")     df = arcpy.mapping.ListDataFrames(mxd, "*")[0]     arcpy.mapping.AddLayer(df,lf,"TOP")


Custom C# tool populate field combobox parameter from layer parameter

I'm creating a custom tool for arcmap toolbox where user select FeatureLayer in one combobox, and in next combobox user can select a field from selected FeatureLayer. FeatureLayer combobox fills automaticaly from:               ...     inputParameter.DataType = (IGPDataType)new GPFeatureLayerTypeClass();     inputParameter.Value = (IGPValue)new GPFeatureLayer();      The problem arises when I need to fill field combobox. I'm not realy sure how to set up its parameters. right now i'm trying something like this:               inputParameter = new GPParameterClass();     inputParameter.Enabled = true;     inputParameter.Name = "FieldTrg";     inputParameter.DisplayName = "Feature Class Fields";     inputParameter.Direction = esriGPParameterDirection.esriGPParameterDirectionInput;     inputParameter.ParameterType = esriGPParameterType.esriGPParameterTypeRequired;     inputParameter.DataType = (IGPDataType)new GPStringType();     inputParameter.Value = (IGPValue)new GPString();     //inputParameter.AddDependency("FeatureClassTrg");     //IGPFeatureSchema fgs = new GPFeatureSchemaClass();     //fgs.FieldsRule = esriGPSchemaFieldsType.esriGPSchemaFieldsAll;     //inputParameter.Schema = (IGPSchema)fgs      In UpdateParameters function I were able to get fields in selected FeatureLayer/FeatureClass, but I had no idea where and how should I put them back in combobox. Also currently the field 'combobox' isn't really a combobox, but just a string field, so probably GPString isn't corect thing to use as its DataType/Value. Any help regarding this problem would be appreciated.


How do I write a script to list those layers with broken data sources?

In my SHP to GDB toolbox, I create a list of layers in MXD, then I check for those not broken I move them. Despite using ListBrokenDataSources I have errors like this: > Runtime error : [Error 3] Impossible trovare il percorso specificato: > u'J:\20120208_Backup_disco_E\Archivio\ATLArete\Shape Atlarete > 1-1-2008\miste.shp' **Translate:** > Runtime error : [Error 3] Unable to find the specified path: > u'J:\20120208_Backup_disco_E\Archivio\ATLArete\Shape Atlarete > 1-1-2008\miste.shp' Here is my code:               # Create a list of SHP in mxd          list = []         df_list = arcpy.mapping.ListDataFrames (mxd)              for df in df_list:              for fc in arcpy.mapping.ListLayers (mxd, "", df):                 if (fc.supports("DATASOURCE")) and (fc.dataSource.endswith(".shp")):                             list.append(fc)         print("List created")              # Check for borken datasource         for fc in list:             if arcpy.mapping.ListBrokenDataSources(fc):                 list.remove(fc)         print ("Broken data removed from list")              # Move fc to gdb         add_list = []         for fc in list:             fc_date = time.strftime("%Y%m%d", time.gmtime(os.path.getctime(fc.dataSource)))             try:                 dsc = arcpy.Describe(fc)                 out_temp = '_' + fc_date + '_' + fc.name + '_' + fc_prj                 out_name = arcpy.ValidateTableName(out_temp)                 print ('Created ' + out_name + ' to ' + gdb_full_path)             except:                 out_temp = '_' + fc_date + '_' + fc.name + '_' + 'UNKNOWN'                 out_name = arcpy.ValidateTableName(out_temp)                 print ('Created ' + out_name + ' to ' + gdb_full_path)             arcpy.FeatureClassToFeatureClass_conversion(fc, fd_path, out_name)             replace_name = fd_path + '\\' + out_name             fc.replaceDataSource (gdb_full_path, "FILEGDB_WORKSPACE", out_name)             print ('Replaced data source ' + out_name + ' in ' + gdb_full_path)                   # Create a new MXD         new_mxd = os.path.splitext(gdb_full_path)[0] + '\\' + 'MXD' + '\\' +  time.strftime("%Y%m%d", mxd_date )+ '_' + (mxd_name)         mxd.saveACopy(new_mxd)         print ('Created new MXD ' + new_mxd + ' in ' + ws)


How to create a script tool that will create a copy of a feature class and offset it by a given distance? (arcpy)

I want to duplicate a polygon feature class and offset all of the polygons by about 10 feet in both the x and y directions. I asked if there was any way to do this last week, and I was informed that I would most likely need to make my own python script using arcpy. I made my own script using arcpy, but it isn't working:               import arcpy     from arcpy import env     import os          env.overwriteOutput = True          # Get arguments:      #   Input polygon feature class     #   Output polygon feature class     #     inputFeatureClass = arcpy.GetParameterAsText(0)     outputFeatureClass = arcpy.GetParameterAsText(1)     xShift = arcpy.GetParameterAsText(2)     yShift = arcpy.GetParameterAsText(3)          shapeName = arcpy.Describe(inputFeatureClass).shapeFieldName          # Create the output feature class with the same fields and spatial reference as the input feature class     arcpy.CreateFeatureclass_management(os.path.dirname(outputFeatureClass), os.path.basename(outputFeatureClass), "POLYGON", inputFeatureClass, "", "", inputFeatureClass)          # Create a search cursor to iterate through each row of the input feature class     inrows = arcpy.SearchCursor(inputFeatureClass)     # Create an insert cursor to insert rows into the output feature class     outrows = arcpy.InsertCursor(outputFeatureClass)          # Create empty Point and Array objects     pntArray = arcpy.Array()     partArray = arcpy.Array()          # Loop through each row/feature     for row in inrows:         # Create the geometry object         feature = row.getValue(shapeName)              partnum = 0              # Count the total number of points in the current multipart feature         partcount = feature.partCount                   while partnum < partcount:             part = feature.getPart(partnum)             pnt = part.next()             pntcount = 0                  # Enter while loop for each vertex             #             while pnt:                      pnt = part.next()                 shiftedPoint = arcpy.Point()                 try:                     shiftedPoint.ID = pnt.ID                     shiftedPoint.X = pnt.X + float(xShift)                     shiftedPoint.Y = pnt.Y + float(yShift)                 except AttributeError:                     continue                 #shiftedPoint = arcpy.Point(float(pnt.X) + float(xShift), float(pnt.Y) + float(yShift))                 pntArray.add(shiftedPoint)                 pntcount += 1                      # If pnt is null, either the part is finished or there is an                  #   interior ring                 #                 if not pnt:                      pnt = part.next()                     if pnt:                         arcpy.AddMessage("Interior Ring:")             # Create a polygon using the array of points             polygon = arcpy.Polygon(pntArray)                  # Empty the array for the next run through the loop             pntArray.removeAll()                  # Add the polygons (or 'parts') to an array. This is necessary for multipart features, or those with holes cut in them             partArray.add(polygon)             arcpy.AddMessage("Added a polygon to the partArray!")             partnum += 1              # Create a new row object that will be inserted into the ouput feature class. Set newRow = row so that it has the same attributes         # Set newRow.shape = partArray so that the only thing different about this new feature is that its geometry is different (shifted)         newRow = row         newRow.shape = partArray              outrows.insertRow(newRow)              # Empy the array for the next run through the loop         partArray.removeAll()          del inrows, outrows      I keep getting this error on line 70               <type 'exceptions.ValueError'>: Array: Add input not point nor array object      I can't figure out why it's giving me this error, since I defined the input as an array. If anyone knows why I'm getting this error, or if there's anything else wrong with my code, I would greatly appreciate it.


Snapping two polygons together

I have a problem with two vector layers, both polygons. I have been digitising an historical map which contains large areas called townlands, filled by smaller areas called fields. I digitised both as two separate vector layers, both polygons. When digitised the field layers I snapped them to the townland boundaries where the townlands and fields shared a boundary. Unfortunately I managed to shift the field layer by accident so now the fields and the townlands don’t overlap. Is there a topological function to fix this? To snap one layer of polygons back to another? I tried v.clean in the GRASS module but this only appears to work for cleaning within one layer. Thanks for any advice.


Test case for geo-distance implementation?

I wrote a method, based on this presentation, that filters points based on their proximity to a target point. I would like to write a few test case. What would be good test cases for this method?               // The method returns all points in the database that are     // close enough to the target point     List<Point> findPointsNear(double longitude,                                 double latitude,                                double distanceInKilometers);      **Edit** - I'm more interested in a sanity test or two, to make sure I didn't screw anything while adapting/implementing the algorithm. Do you know of existing test code I could use? I'm ok with the method failing near the actual poles, as long it works in most countries.


MATLAB mapping toolbox: write multiple feature mapstruct

I have a few hundred road segments, described as lines, which I am trying to write to a single shape file using MATLAB's mapping toolbox. However I can only manage to get one feature per shapefile, which isn't very useful. I have developed a work around which calls GDAL from within MATLAB using system(), but the company I work for can be sensitive about us using software that they don't specifically support, so if I can find an all MATLAB option that would be ideal. I assume that either it's not possible, or more likely that it's really simple and I'm missing something obvious. The shapewrite() function requires a 'mapstruct' structure item, but the documentation on how to write such a thing is not very clear, I've only succeded in writing single featured mapstructs. The shapewrite documentation only shows how to write a multi-feature shapefile from a mapstruct that was just read using shaperead(), but not how to write your own multi-feature mapstruct structure. Here's what I have so far...               % Lines is a structure containing all of the individual features     LineIDs = fieldnames(Lines);         First = 1;     for LineIndex = 1:numel(LineIDs)           LineID = LineIDs{LineIndex};         Line = Lines.(LineID);            % So now Line is a structure for that individual line, it contains         % such fields as the X and Y vertices, the BoundingBox, the Geometry          % type (line in this case), and other attributes. Line is my single          % feature 'mapstruct'. It can be written to a shapefile using shapewrite.         LineFileName = sprintf('TempFiles\%s.shp', LineID);         shapewrite(Line, LineFileName)         % Now use GDAL to merge this file with all the others into one large file.         % These next lines are the ones I would like to replace.         if First             First = 0;             MergedFileName = 'MergedFile'             MergedFileNameF = 'MergedFile.shp'             % If the file already exists, remove it.             if exist(MergedFileNameF, 'file') == 2                 delete(MergedFileNameF)             end             % Write the file to be merged to.             [status, ~] = system(sprintf('ogr2ogr %s %s', MergedFileNameF, LineFileName));         else             % Merge with the file.             [status, ~] = system(sprintf('ogr2ogr -update -append %s %s -nln %s', ...                           MergedFileNameF, TempFile, MergedFileName));         end         if status == 0             % Merge was succesful             % Delete temp files, etc         end     end      My single feature mapstruct structures look like this:               >> Line     ans =                     Class: 'A Road'                  ID: 28841            Geometry: 'Line'                Name: 'Willowbank Road'                   X: [3.9323e+05 3.9335e+05 NaN]                   Y: [8.0548e+05 8.0547e+05 NaN]         BoundingBox: [2x2 double]           DftNumber: 'A93'            FEATCODE: 25729                  CP: 80026      And they are stored within Lines, which looks like this...               >> Lines     ans =              A: [1x1 struct]         B: [1x1 struct]         C: [1x1 struct]         etc etc


How to merge rasters with negative extents?

I'm trying to form a mosaic from two overlapping images of an old tithe map. I've used the georeferencer plugin using one of the images as canvas to generate a modified version of the other. I then used Raster>Miscellaneous>Merge. This generates the following commandline: gdal_merge.py "/home/ian/Maps/Stubbin/1801 map Stubbin prt 1.JPG" "/home/ian/Maps/Stubbin/1801 map Stubbin prt 2_modified.jpg" This gives an error: ERROR 1: Attempt to create 2768x-1659 dataset is illegal,sizes must be larger than zero. This seems to be related to the fact that image metadata for the original images shows the layer extents as 0.0, -1651.0 : 2339.0, 0.0 and other digital camera images also have -ve extents. How do I work round this? Platform is QGIS 1.8.0 on Debian Squeeze 64-bit.


Python loop with address locator

I was given a list of addresses without any zip codes, and I'm trying to write a python snippet that will loop through a set of possible zip codes and make a set of geocoded shapefiles that I will later merge. My address table is essentially laid out like this: ("Project_" fields are the possible zip codes)               Address          City        Project_1   Project_2  ...  Project_42       123 Main Street  Birmingham  78954       78953      ...  78961      My python snippet looks like this:               import arcpy       from arcpy import env       env.workspace = "N:\Reference\GIS\State\Project\Address Locator"       geocoder = env.workspace + "\State_Addresses_Create_Addr"       for y in range(1,43):           zippo = "Projects_" + str(y)           outfile = '"N:\Project_Geocode_Results_'+ str(y) + '"'           fncgeo = '"Street Apartment VISIBLE NONE; ZIP ' + zippo + ' VISIBLE"'           arcpy.GeocodeAddresses_geocoding("Geocode_Table", geocoder, fncgeo, outfile)        When I try to run the snippet outside of a loop (i.e., based on a single field), the geocode works fine. When I run it as written above, I get: > ERROR 000010: Geocode addresses failed. Failed to execute (Geocode > Addresses). Does anyone have any ideas as to why the geocode won't work in a loop?


Creating table containing all filenames (and possibly metadata) in File Geodatabase?

I need to create a metadata-table for all files in a File Geodatabase or Spatial Database. It would be awesome if it were possible to automatically be updated with new filenames, and possibly even metadata (as created in the ArcGIS metadata editor). Even partial solutions would be highly appreciated


Are there any efficient methods for processing ArcGIS-based database tables outside of the ArcEtc program library?

Let us say, for the sake of argument, that you are working with a table that is over 2 GB in size (so .dbf is automatically ruled out... right?). To even create such a document, ArcGIS requires that you make it a "table" inside a File Geodatabase. Ignoring the hours-long conversion time in such an endeavor, working with the final product can prove to be an even larger nightmare. ArcGIS simply does not work for me when the size of a dataset gets to be several gigabytes. Can anyone suggest alternative programs or methods for processing such large sets of data? I am trying to avoid working with joins between 40-odd million records and the headache-inducing wait times involved there-in. I have been told in passing that using "backend RDBMS" programs can achieve this, but my own research has proven ineffectual. I turn to you, StackExchange. Edit: To further specify the requirements of the data, the table itself will have nothing to truly make it "spatial." There will be fields for X/Y Co- ordinates, but they will be simple double/float fields. I am looking for a proper way to do joins and relates across very large tables, in essence. The data is not spatial in the strictest sense; SDE is not something I need consider, I think. I am hoping that any solution will allow me to host the data locally without creating a server or other such mumbo jumbo. Only I will need to access it, and if it needed to be shared, I would expect a simple export would be possible to a more ubiquitous format than ESRI's geodatabases.


Best Approach to display charts on a web map?

I have a very basic understanding of GIS through some basic work with openlayers in Drupal CMS. I am trying to understand what is the best approach to display a chart on a map (like the one below)? I want the users to be able to at least control/change the numbers of the charts in the map. I understand that the layer itself and the associated legend can be served through a WMS. But what about the statistics that appear above the city. What would be the best "framework" to manage and display such a data? ![enter image description here](http://i.stack.imgur.com/DZaMU.png)


Openlayers Layerswitcher constraints

I´m building a kind of webgis with openlayers with a couple of overlay Layers. Is there a possibility to implement some constraints to the layerswitcher? My idea is to have two lists of layers and from both list you can choose only one Layer a time. The result should be that there are maximum two overlays at the map. Thank you for your tipps and ideas.


ESRI ArcMap TextSymbol

I'm looking to do the following. Create a point on a map at a given coordinate (x,y) and then display text at that point. Right now I can create a shape file but nothing is displayed on the map. Hopefully someone can tell me why Here is my code:               ArcDisplay.IRgbColor color = new RgbColorClass()     {         Red   = 255,         Green = 255,         Blue  = 255     };          IPoint point = new PointClass()     {         X = 0.0,         Y = 0.0,         Z = 0.0,         SpatialReference = myMap.Map.SpatialReference     };          IElement elem = null;     ITextElement txtElement = new TextElementClass();     element = textElement as IElement;          ITextSymbol textSymbol = new TextSymbolClass();     textSymbol.Color = color;     textSymbol.Size = 16;     textSymbol.Font = (stdole.IFontDisp)OLE.GetIFontDispFromFont(new Font("Arial" , 16 , FontStyle.Bold);          element.Geometry = point as IGeometry;          textSymbol.Text = "My Test Text";     txtElement.Symbol = textSymbol;          ((ITextElement)element).Symbol = textSymbol;          IGrpahicsLayer graphicsLayer = new CompositeGraphicsLayerClass();     ((ILayer)graphicsLayer).Name = "Text Layer";     IGraphicsContainer graphicsContainer = graphicsLayer as IGraphicsContainer;     graphicsContainer.AddElement(element , 0);          myMap.AddLayer(graphicsLayer as ILayer);     ((ILayer)graphicsLayer).Draw(esriDrawPhase.esriDPGeography , null , null);      Any ideas?


How do I make this into a working CRS in ArcGIS?

+proj=tmerc +lat_0=0 +lon_0=-114 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs I have this text string which I successfully used to project data in QGIS. How do I use this to define a CRS in ArcGIS and project my data correctly? Thanks


How do I export sensor records from a Trimble GeoExplorer to a mapping program?

So I am fairly new with the GIS world and could use a lot of help!! I am currently surveying with a Trimble Geoexplorer 6000 XH What sort of mapping program can I use to export sensor records to said mapping program. I have GPS Pathfinder office and know the basics of it. What I would like to do is layer the sensor records in some sort of mapping software. Please excuse my inability use the proper terminology used in the GIS world as I am very new to it. Any help would be much appreciated.


Create "starburst" table from two point features with 1:N relationship using Spatialite

I have a point feature called site_investigation and another point feature called sample_location which are in a Spatialite database. They have a 1:N relationship and the primary key is report_id.               CREATE TABLE site_investigation (             fid         INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,             report_id   TEXT UNIQUE NOT NULL,             geometry    POINT     );     CREATE TABLE sample_location (             fid            INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,             report_id      TEXT NOT NULL,             official_name  TEXT UNIQUE NOT NULL,             geometry    POINT             FOREIGN KEY(report_id) REFERENCES site_investigation(shz_report_id) ON DELETE CASCADE     );      I would like to create a table of lines that connects site_investigation to sample_location to form a "starburst" display. I'm a Spatialite novice and would greatly appreciate any help. Thanks, Bob.


Error 000539 - Band_# not defined

I'm trying to do an NDVI analysis of a some World View 2 imagery. It seems no matter what if I enter the term Band_# for any of the 8 bands I get the same error. ![enter image description here](http://i.stack.imgur.com/9huWJ.jpg)


How do I smooth edges of polygons in QGIS?

Is there a built in function or plugin I can use to achieve smooth lines for my polygons instead of the blocky ones I have now? ![enter image description here](http://i.stack.imgur.com/CBf1L.jpg)


run a make query table based on a selection

I have a feature class of land parcels. I do a select by location to select the land parcels that intersect a line feature. Now I want to use the Make Query Table tool in model builder. I include the Shape field to ensure my output is still a feature class however the table is created with all the data and not just the selected features. How do I run a make query table on a selection and not the whole feature class?


Selecting multiple variables by Attribute from different target layers

I have a model with species point data as a source layer and a number of different shapefiles as target layers. To start I run a search by location tool to determine where the source and target layers intersect, and then copy features to create a new target layer. Next I want to use the select by attribute tool to determine where in my original target layer are common attributes to my new target layer. My question is: Is there an SQL expression that would allow the search by attribute tool to select from an individual field in the new target layer and compare it to the original layer?


Create a polyline buffer with Arcpy

I'm trying to write a python script with ArcPy that draws arcs and I've achieved something with creating a buffer and then clipping it with a bounding box so I only keep the length I need (I thought it was easier that way than calculating from my center point and radius, vertex by vertex from my start angle to my end angle). The problem is that the buffer too creates polygon buffers and since I only have ArcVIew (soon ArcEditor) and I can't use the polygon to line tool (licenced to ArcInfo). Is there a way to convert a polygon to a polyline somehow with ArcPy or create directly a polyline buffer? Thanks!


I am trying to execute this code,               import osgeo.ogr          def findPoints(geometry, results):         for i in range(geometry.GetPointCount()):             x,y,z = geometry.GetPoint(i)         if results['north'] == None or results['north'][1] < y:             results['north'] = (x,y)         if results['south'] == None or results['south'][1] > y:             results['south'] = (x,y)         for i in range(geometry.GetGeometryCount()):             findPoints(geometry.GetGeometryRef(i), results)          shapefile = osgeo.ogr.Open("../../Data/tl_2009_us_state/tl_2009_us_state.shp")     layer = shapefile.GetLayer(0)     feature = layer.GetFeature(53)     geometry = feature.GetGeometryRef()          results = {'north' : None,                'south' : None}          findPoints(geometry, results)      and I am constantly receiving this error,               Traceback (most recent call last):       File "identify_northsouth_point.py", line 22, in <module>         findPoints(geometry, results)       File "identify_northsouth_point.py", line 8, in findPoints         results['north'] = (x,y)     UnboundLocalError: local variable 'x' referenced before assignment      I have tried global and nonlocal, but it does not work. Since I am not gettin any input from outside the function, so I anyways would not require global or nonlocal.


Dissolve polygons - group to others with touching corners

I am working with some data that shows land management. There are many places where corners "touch". I would like to dissolve my dataset so that features are grouped (dissolved) with those that they share a touching corner. Each section (square) is a unique feature (row). In the image below I've circled the features that I would like to group in this dissolve. I am using ArcGIS and have an editor and SA license. ![enter image description here](http://i.stack.imgur.com/mk9YM.jpg)


Strange things are afoot with the "Eliminate Polygon Parts' tool

I am working with a polygon that is the result of a buffer and has a bunch of internal doughnut holes: ![Polygon with Holes](http://i.stack.imgur.com/zGf5t.png) What I want is this: ![enter image description here](http://i.stack.imgur.com/H7Z3n.png) I am using arcpy.EliminatePolygonParts_management() to fill in the holes but have a question about how this tool functions. When I run the tool using the "PERCENT" condition I cannot get the holes to fill in. Initially I set the percent to 99 thinking that it would delete any part that was smaller than 99 percent of the total area of the polygon. That didn't work. Thinking that perhaps I had my logic backwards I set the percent to 1, that didn't work either. I did get it to work, and produce a polygon that is just the outer boundary but to do so I had to switch to the AREA condition and set the number ridiculously (for my purposes) high, to 1 billion square meters. I am quite confused by this... Can anyone offer an explanation to help clarify my understanding of how this tool works and why I can't get the "PERCENT" condition, which seems to be the more appropriate choice, to work?


any good blogs about digital cartography?

I´m looking for blogs or good websites about digital/web cartography...i´m not really interested in the deep technical ramblings (i´ve the forum lists for that) but rather inspirational blogs which showcase great digital cartographic techniques or projects and how they are created. If there are such things here in the web, please let me know...I´,m also interested in statistical visualisation blogs like these..http://datavisualization.ch/showcases/, http://flowingdata.com/...but I´ve never seen such blogs which spezialise in digital/web cartography. thanks, Rob


ArcGIS Intersect using Geometry Service

I am using the intersect service from the ArcGIS Geometry service. referring : http://help.arcgis.com/en/webapi/sil....htm#Intersect   I have modified it to make it work with polylines it works fine to intersect a polyline with a polygon but does not return anything when I try intersecting a polyline with a polyline Please guide I am stuck here...


Error 001143 and Error 99999 when using Locate Features Along Routes in ArcGIS10.1

Oddly, what I need to do has worked for about half of my data but not the rest. I'm trying to use the Locate Features Along Routes tool in ArcGIS10.1. I have a smaller polyline layer as the input and another larger polyline routes layer as the input routes layer. Where they occupy the same geographic space, the layers overlap exactly. There is an attribute called "reach code" in both feature classes and they match, this tool will allow me to see "to" and "from" on the input layer when done. I was able to execute it once so I know it works. Basically, I've got four large watersheds that I'd like to do this for. The tool ran smoothly for the first one but will not work for the other three. There should not be substantial differences between these datasets. I've obtained the data straight from the USGS NHD website so it is unaltered with fields and properties identical among watersheds. There was a problem at first and the tool did not work until I saved the output events table to the desktop instead of the network or the hard drive. I have disabled Background Processing since I thought that was the issue. When Background Processing is disabled I get the 99999 error. When it is enabled I get the 001143 error, that says I should turn off background processing. I'm stuck in a cyclic zone of zero productivity. Hoping some of the experts out there can shed some light!


What is the difference between Leaflet and Mapbox?

What is the difference between Leaflet and Mapbox, and how are they used together? Like the API and what exactly are they and is Mapbox using Leaflet?


Python Addin Toolbar only works once

I am writing Python Addins for ArcGIS. I call a Python Toolbox, the Addin tool only works once in ArcCatalog when picked. If you pick it again nothing happens.               import arcpy     import pythonaddins     import os           class OreconDBtoArcGISTool(object):          def __init__(self):              self.enabled = True              self.checked = False               def onClick(self):                  toolboxName = "OreconDB_Toolbox"             toolName = "OreconDBtoArcGISTool"             relPath = os.path.dirname(__file__)             pyt = relPath + os.sep + toolboxName + ".pyt"             pythonaddins.GPToolDialog(pyt, toolName)      If I close and restart ArcCatalog the tool will work one more time again. Any Ideas on how to fix this would be appreciated.


Problems using 2 maps with multiple layers and loadend event

I have 2 or more maps with one ore n layers on each map. Now I want zoom to extent for each map, but the `getDataExtent` returns only for the last layer in the last map a bounds. Can you help me? Here is the code               var jekyllMapping = (function () {         return {             mappingInitialize: function() {                 var maps = document.getElementsByClassName("jekyll-mapping");                 for ( var i = 0; i < maps.length; i++ ) {                     var zoom      = maps[i].getAttribute("data-zoom"),                         lat       = maps[i].getAttribute("data-latitude"),                         lon       = maps[i].getAttribute("data-longitude"),                         layers    = maps[i].getAttribute("data-layers"),                         title     = maps[i].getAttribute("data-title"),                         map, markers, center;                          maps[i].setAttribute('id', 'jekyll-mapping' + i);                          markers = new OpenLayers.Layer.Markers("Markers")                     map = new OpenLayers.Map('jekyll-mapping' + i);                     map.addLayer(new OpenLayers.Layer.OSM());                     map.addLayer(markers);                     if (lat && lon) {                         center = new OpenLayers.LonLat(lon, lat).transform(                             new OpenLayers.Projection("EPSG:4326"),                             new OpenLayers.Projection("EPSG:900913"));                         map.setCenter(center, zoom);                         markers.addMarker(new OpenLayers.Marker(center));                     }                          if (layers) {                         // layers are url's to kml files                         layers = layers.split(' ');                         while (layers.length > 0){                             var m = new OpenLayers.Layer.Vector("KML", {                                     strategies: [new OpenLayers.Strategy.Fixed()],                                     protocol: new OpenLayers.Protocol.HTTP({                                                 url: layers.pop(),                                                 format: new OpenLayers.Format.KML({extractStyles: true, extractAttributes: true, maxDepth: 2 })                                     })                             });                             if (m) {                                 m.events.register("loadend", m, function () {                                     // raises for all layers but only the last layer on second map gives me a bound, why???                                     var bounds = m.getDataExtent();                                     if (bounds) {                                         map.zoomToExtent(bounds);                                     }                                 });                                 map.addLayer(m);                             }                         }                     }                 }             }         };     }());          window.onload = function() { jekyllMapping.mappingInitialize(); }


Efficiently classify raster with irregular polygons

I have a project on my desk to classify an elevation model using different elevation breaks for each polygon in the area of interest. In pseudo code:               FOR each polygon IN layer:         CREATE_MASK FROM this polygon         CLASSIFY elevmod WITH this polygon's LOOKUP_TABLE         SAVE_AS elevmod_classified_this_polygonID          MERGE elevmod_classified*     CONVERT from 16bit float to 256 index colour palette      What is the most efficient way to do this? The workflow I have now is wasteful of processing time and storage. Each `classify` step creates a new raster file for every polygon, and then all are combined into one at the end. The source raster is 650mb compressed and about 30 zone polygons (so 30 times some portion of 650mb for extra storage). This seems rather silly since I can classify a whole raster at run-time in a second using the standard symbology tools. Plus the elevation breaks for each polygon haven't been finalized, so I'll need to run through this exercise a number of times before everyone is satisfied. The classification elevation lookup tables resemble the following. Each number is the upper elevation boundary of that class:               polygonID, class1, class2, class3, ...     169,  850, 1100, 1300, 1450     170, 1000, 1250, 1400, 1600      The final classified raster has cell values of `1,2,3,4,5...` corresponding to class1, class2, ... Though this too is open for change. I have Qgis 1.7 and Arcinfo 10 with Spatial Analyst at my disposal (and Arcview3 for that matter).


IFeature.set_Shape The coordinates or measures are out of bounds

I'm trying to add a point to my map, but something with the way I used shp2sde create caused me to have a incorrect spatial extent or something. So I'm getting "out of bounds" error. How do I go about fixing this in ArcView 9.3.1? (I'll have to use command prompts probably or recreate). My Map Server Info: Intial Extent:               XMin: -197.114430117841     YMin: -95.6461199683022     XMax: 197.694572740662     YMax: 184.916970645712     Spatial Reference: 4326      Full Extent:               XMin: -198     YMin: -99     XMax: 198     YMax: 99     Spatial Reference: 4326      My Layer info: Extent:               XMin: -180     YMin: -90     XMax: 180     YMax: 90     Spatial Reference: 4326      **Here's my log file from what I'm trying to INSERT into the feature layer:**               Check geometry point type=esriGeometryPoint     about to create feature     Create shape(X=38.9300285250005,Y=-74.9343213739996)     Com_point_spatialreference=GCS_WGS_1984     at ESRI.ArcGIS.Geodatabase.IFeature.set_Shape(IGeometry Shape)      The coordinates or measures are out of bounds.      My sdelayer -o describe_long:               Spatial Column .......: SHAPE     Layer Id .............: 21     SRID .................: 5     Minimum Shape Id .....: 1     Offset ...............:       falsex:          0.000000       falsey:          0.000000     System Units .........:       1000.000000     Z Offset..............:          0.000000     Z Units ..............:          1.000000     Measure Offset .......: <None>     Measure Units ........: <None>     XY Cluster Tolerance .:          0.002     Spatial Index ........:       parameter:    SPIDX_GRID,GRID0=1,FULL       exist:        Yes       array form:   1,0,0     Layer Envelope .......:       minx:      -180.00000,        miny:       -90.00000       maxx:       180.00000,        maxy:        90.00000     Entities .............: np     Layer Type ...........: SDE     Creation Date ........: 03/21/12 11:04:05     I/O Mode .............: LOAD     Autolocking ..........: Enabled     Precision.............: Basic     User Privileges ......: SELECT, UPDATE, INSERT, DELETE     Coordinate System ....: GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1     984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.017453292     5199433]]          Layer Configuration ..: DEFAULTS


Projecting OpenStreetMap data in PostGIS

I've loaded an extract of Openstreetmap data into a Postgresql database with PostGIS 1.5 using the following command with`osm2pgsql.exe`:               C:\Program Files (x86)\HOTOSM\bin>osm2pgsql.exe -c -s -H localhost -d osm_cloudmade -b -122.0,18.03,-64.85,46.05 -E EPSG:900913 -U postgres -P 5432 J:\DATA\OSM\usa.osm.bz2 -S J:\DATA\OSM\default.style      I understand that the Openstreetmap data is in Lat/Long WGS 84. If I inspect my table `planet_osm_roads` I see `way geometry` but no SRID. Is there a way that I can project this to another system? Or do I first need to specify what the SRID is of this data?


zero-kb pdf file from arcmap

I have been having this problem too often.   My only fix is to shut down arcmap and restart.   I can't find why it is happening.   Anyone else see this? export to pdf watch it go all the way through and when it should show the file progress (processsing) bar it just goes away and says export complete, but the file is 0kb. arcmap 10.0 sp 2 Not only have I tried refresh, restart, shutdown. I have tried to open the file. the message is... ![0kbfile](http://i.stack.imgur.com/RqFef.gif)   It seems there is something to do with either the original file or arcmap.   I tried to create a jpg "export" from arcmap and get the "can't map metafile to memory" error.   But another document will export both pdf and jpg.   Then a coworker opened it and exported immediately. It also occurs on other machines though.   I cnan't nail down any consistent behavior except that it always doesn't show the file status bar after processing the data and successfully writes a file (0kb).


Cleaning up OpenStreetMap data, building polygons and trying to improve appearance

I'm currently going through my first project with OpenStreetMap data and I'm struggling to see how certain features can be made to look anywhere near as good as in OpenStreetMap.org. I downloaded a pre-built Shp from Cloudmade for Ontario and many of the big lakes in the south are terrible - a polygon might cover a fraction of a lake's actual area and makes for poor visualisation. I think this is a result of OSM data only containing points and lines, and someone having to build polygons from these lines. Furthermore, I looked at the administrative boundaries lines layer and there were 100,000s of line features for all kinds of administrative entities but apparently no attributes that could help me build a single polygon for the province's full border. Now, I know that the Cloudmade Shps have been through some post-processing to whittle the many feature types in the .osm XML down to 7 or 8 layers, so perhaps the way they collate administrative boundaries is not perfect for my area. Also, as the Ontario Shps don't cover the US states that also border the big lakes perhaps this explains why the lake polygons were not well formed, but if I have to download the .osm XML for such a large area and process it all myself this causes other issues - it will take a lot of time and many iterations and I don't know if the end result will be worth the effort (e.g. what if the lines that make up a lake's border don't properly meet up, and snapping introduces unwanted artifacts - or maybe none of the lakes are actually 'closed' because they all have rivers connected to them, so building a polygon is just impossible?) I'm guessing that to make the map in OpenStreetMap.org someone must have processed all the data to build polygons where necessary. Presumably all country / state / province borders were created as polygons and shaded, and either the same was done for all lakes / oceans or the map simply has a blue background and everything else is layered on top? If this polygon data was created for the OpenStreetMap.org map, why can't I access it anywhere? It seems like there should be an additional resource between the raw XML and the state / province-specific Shps that have been processed according a particular rule-set If anyone has come across similar issues and has any kind of advice I'd really appreciate it!


Is it possible to run qgis through python?

I need to build an app to analyze some raster layers in qgis. I thought it was possible to just write code in python (2.7.6) (IDLE) and let it automatically open QGIS, load some layers, do a distance matrix, export that and load this file with python and use that information in the app. Is something like this possible? I have a mac running OSX10.9.1, using python 2.7.6 because I constantly got errors when using python 3.


ArcGIS: Extracting data from large intersect dataset

I have a big dataset imported into ArcMap. For each point, I created a buffers of 200m. And I apply Intersect to all the buffers, resulting in a huge dataset of around 2183962 objects. Previously, I have similar sets of data which are all significantly smaller than this, I export them to shapefile and by using the shapefile module, I created a Python script to extract each polygon (to be precise, each "Intersection") based on an attribute called bbox (in the Python shapefile module) and then do some other operations. Now, because the dataset is too big, I wasn't able to export the dataset to shapefile since the limitation is 2GB although I manage to export to XML workspace of a file size around 13 GB. Is there anyway around this?


Add Attribute and merge .shp's from multiple folders/directories

I would like to run a process to: 1) find all shapefiles in muliple folders/directories (i.e., the directory for each differen folder is "G:\Projects\"variable project #"\GIS\Shapefiles) 2) Add a field for inserting "variable project #" from the file path name(i.e., truncate the file path name to only include "variable project #") 3)Then export and merge these features into a temporary folder. ...if I could even do stpes 1-2 above, it would be a tremendous help. This files are in a couple hundred folders and, due to the length of the file path, it is a bit onerous to try to batch process these manually... Any help would be greatly apprecited, Thanks!


GeoServer 2.2 and KML with multiple layers

I would like to be able to create a single URL that allows the download of three layers in a single KML file. Here's two ways to do that:   * WMS KML Plain   * GeoServer Application Link Both fail. The first complains of un-matched tags in the KML. The other doesn't load any points from one of the layers. The broken layer in the KML works in Open Layers fine... Any ideas on how to fix this, what's going wrong and why? Upgrading GeoServer may happen later but isn't a fix.


How to split a shapefile feature?

The world map that I am using from NaturalEarth.com has France and French Guyana as one feature. I want to split these into two separate shapes. I'm sure there is a quick fix for this, and the others I'm sure to soon encounter. I am using ArcMap 10.2 and need to use a feature that will make it so that when I click on Guyana, France isn't also selected.


.svg georeference?

How would I go about taking a layer from AI or Inkscape and importing it into Arc? I've got a vector drawing I want to use and I know I need to georeference it but I'm lost as to how. I also can't seem to import it as a shapefile. Do I create a geodatabase for it? I've taken basic GIS classes but I'm clueless here!


How to use GROUP BY with arcpy.da.SearchCursor in file geodatabase?

fc = "C:\Users\AuxS3-4\Documents\ArcGIS/Default.gdb\Malla"          fields = ('OBJECTID','Sentido','Carriles','idMalla')          sqlclause=(None, "GROUP BY Sentido")     cursor = arcpy.da.SearchCursor(fc, fields,sql_clause=sqlclause)      **not working** > RuntimeError: An invalid SQL statement was used. [SELECT OBJECTID, Sentido, > idMalla FROM Malla GROUP BY Sentido **arcgis 10.1!!!**


How do I open personal geodatabase in QGIS 2.0?

Good afternoon. I am trying to use an ArcGIS (10.2) personal database MDB as a container for data to pass to a QGIS user. I formerly used QGIS 1.8 for Mac OSX, and after some fiddling around, I was able to open a personal geodatabase and load one or more features from it. I just upgraded to QGIS 2.0 and upon trying to check my MDB test file before sending to my colleague, I am unable to load the geodatabase. In fact, personal geodatabase as a file type no longer appears in the available types QGIS is prepared to open in the File Type drop down box in the load vector data operation. Is there some setting I need to tweak or an additional plugin I need to install in order to regain this functionality? Thanks, Russell


Count points within a given distance of a border

I have a vector layer of counties in Florida and a layer of points. I want to count the number of points that lie within 10km of the boundary for each county pair. This is what this looks like in QGIS -- any ideas on an efficient way to do this? ![points](http://i.stack.imgur.com/dn2UJ.png)


Background Processing Error with Mosaic to New Raster

I get a "Background Processing Error" with Mosaic to New Raster when trying to mosaic two DEMs that are in GRID. I am pretty sure I am inputting things correctly. The two input rasters are in FGDBR format, if that makes any difference. Thank you. I am adding this to my above message about one hour later. I want to add that I am using ArcGIS Desktop 10 (the student version if that matters). I installed all five service packs, and performed Mosaic to New Raster again, and still got a "Background Processing Error", although the geoprocessing ran longer than when I performed it before installing the service packs. Does someone have any suggestions? Thank you.


Problems in making CLM files with DIVA-GIS

I am fairly new to GIS softwares and this will be my first post here. I'm working with DIVA-GIS and was redirected here. I hope this is the correct place. I am doing a research which involves ecological niche modeling for present and future climate scenarios. However, i am having some urgent problems with creating the .clm files for the predicted future climate. I have downloaded the necessary data from WorldClim. I have followed the instructions from "Ramirez & Bueno, 2009, Working with climate data and niche modeling: Creation of bioclimatic variables", but DIVA GIS doesnt seem to want to create the files. Basically, i open up the "Make CLM files" window in DIVA GIS, and have all the necessary 36 .grd files + the alt.grd required for the operation. I have correctly inserted the prefixes and ticked their boxes. As soon as i press "OK", these boxes automatically uncheck, the 36 files are not split into the "selected files" spaces present in the window, and the program only creates the single climate.cli files. I have found this question being asked on the internet but with no answer. I have no idea how to solve the issue as everything seems to have been done correctly. Does anybody have an idea?


Using Field Calculator to Calculate a Mean for Multiple Rows

I am trying to calculate a mean across a multiple number of attribute rows and have this value added to a new field that I have entered in the attribute table. I have an attribute table which has a number of different ecoregion types associated with them. For example: If I select "Arid Canyonlands" there are 3 attribute rows that are selected, each with their own "mean". I am trying to add a new field to the attribute table which will take the "mean" of these three and populate that value in the new field created. I could manually do it through an editing session and using a calculator but just wanted to know if there is an easier way to actually do it through field calculator? Thanks so much for any help.


Joining csv file to vector layer in Processing modeler?

I am trying to join a simple csv file of values to a vector layer within Processing modeler. The match would be on an id held by both files. The csv file has no geometry. I can do this easily in qgis, but want to automate the process in Processing modeler. Is this possible? I have looked through (and tried) a number of the functions but have not found anything that works. I am using qgis 2.0.1


How do I use QGIS 2.2 to plot some locations on a map (of the US by zip code)?

I am a newbie to QGIS. I just installed it on my MAC Airbook with Mavericks. How do I simply plot a few locations on a map of the US? All of the tutorials I can find on the web are for older versions. Version 2.2 seems to be entirely different in terms of look and feel. For example, one tutorial tells me to load the plugin "edit any layer". Under 2.2 no such plugin seems to exist. I simply need to know how to get map loaded and then how to plot some excel or CSV data. Thank you for any help you can provide.


Raster vs. Raster Scatter Plot in ArcGIS

I created two raster datasets from the same world view 2 image. One dataset is NDVI, the other is a normalized surface water index (NDSWI). I would like to create a scatter plot for a pixel by pixel comparison. I've seen a few options for how to do this but they involve running a combination function in raster calculator which only allows for integers. I need the float data. I also have access to ENVI if there is a way to do it in that software. Running ArcGIS 10.2 and ENVI 4.4


How can I make ArcGIS 10.2 overwrite folders instead of pasting a new/copy folder (with a (1) suffix?)

Just upgraded to 10.2 from 10.0 and I have always edited data on the C: drive then pasted this updated folder onto the "work" server. In 10.0 the folder is overwritten. In 10.2 the folder is copied and given the (1) suffix giving me two folders. How can I fix this? Thanks!


How to change Curve Numbers for Measured Effects using HEC-GeoHMS?

Good afternoon everyone. I'm working on a theoretical project of a proposed watershed for a final project, and am using an extension ( **HEC-GeoHMS** ) which I've never used before. I'm dealing with some curve numbers, relating to soils in the proposed watershed. I'm trying to increase the curve numbers to show the measured effects, but when I increase these numbers I do not see any change. The tool I'm using is Generate CN Grid, and between have a soil land use polygon and and a CN Look Up (NCLookUp) Table. I thought that by increasing the Land Use numbers (LUValue) Field in CNLookUp would do the trick but it doesnt. These LUValue numbers correspond to the Land Use field in a soils polygon. I've also tried to increase the curve numbers for "B" field soils, and that did not work either. The "B" field corresponds to the curve numbers in the soils polygon. I'm not sure which number need to be increased to change the curve numbers by 10%. I've attached some pics of the attribute table below... If someone knows how to increase the curve please let me know, and thank you in advance! Sorry for the bad tags.... it wont let me write the best ones because I do not have a high enough Rep Level. ![enter image description here](http://i.stack.imgur.com/AwpIQ.jpg) ![enter image description here](http://i.stack.imgur.com/6GjTC.jpg) ![enter image description here](http://i.stack.imgur.com/h0jeq.jpg)


Where can I find historic aerials for some areas in Dona Ana County, New Mexico?

How do I find several historic aerials from the mid-1970's or early 1980's and where can I download them and I would like them to be free of charge. Cheers, ![Dona Ana County](http://i.stack.imgur.com/9DYJZ.jpg) ![Near Anthony, Texas](http://i.stack.imgur.com/dUHZR.jpg) ![Near Hatch, New Mexico](http://i.stack.imgur.com/k5Riz.jpg)


Get LatLng coordinates from SIRGAS2000 UTM 21s coords

I have a bunch of locations (36k) and they are represented using SIRGAS2000 (UTM 21s) coordinates. I need some way of converting them to traditional LatLng format so I can upload them to my database and use those coords with Google Maps API. I could use either a formula to translate them to LatLng before uploading, or some kind of API to convert them before using them in my app (after uploading them as they are to my database). Any clues?


Customizing CartoDB infoWindow HTML removes 'header' text

Trying to change the HTML of the 'click' infoWindow causes the header text to disappear. I've got an infoWindow configured to display correctly. I'd like to use the 'email' field in my table as a hyperlink on the 'email' text. However, whenever I add the `<a href="mailto:{{email}}">{{email}}</a>` tag, then click 'apply' (or CTRL+S) to save the changes, the header in the infoWindow disappears. (the email link works just fine...) My full 'custom' HTML is below:
       x

city

{{city}}

email

{{email}}


How to create a TIN from UAV images or Google Earth images

I'm starting using ArcGis and I would like to create a TIN from UAV images. What are the steps that I have to follow? I think:   * Mosaic the images, merge o join. (I have 40 aereal pictures in .JPG)   * Georeference the big joined picture with GPS points (I may have these points, but in other cases not).   * Do something else.   * Create the TIN or xyz cloud points to export to AutoCAD. How can I do this? Do I need other tools? Thanks your support.


ArcMap/ArcObjects - Drawing graphics onscreen: Explanation or tutorial for Draw/Refresh/PartialRefresh methods?

I find myself woefully lacking in understanding of when, why, and how (which type) to do screen draw/refresh/partial refresh. For instance, in a standalone Python script outside the application boundary, I have a function that is trying to draw graphic elements in the data view. Specifically, the elements will be a TextElement on top of a RectangleElement. The function loads the two elements into a GroupElement, which is in turn added to the ActiveView's GraphicsContainer for drawing on the screen. (As far as I can tell the graphic elements are valid.) I am really not understanding what Draw/Refresh/ParitalRefresh methods to put where. If anyone can give/point to a good explanation or tutorial about screen drawing/refreshing I would appreciate it. Below is a bit of selected code from my function. I have a PartialRefresh in the last line, but I don't know if that is correct or not.               pGroupElement = NewObj(esriCarto.GroupElement, esriCarto.IGroupElement3)     pTextElement = NewObj(esriCarto.TextElement, esriCarto.ITextElement)     pRectElement = NewObj(esriCarto.RectangleElement, esriCarto.IElement)     .     .     (configure TextElement)  [tedious code removed]     .     .     (configure RectElement)     .     .     ptxtElem = CType(pTextElement, esriCarto.IElement)          pGroupElement.AddElement(ptxtElem)     pGroupElement.AddElement(pRectElement)          pContainer = mxDoc.ActiveView.GraphicsContainer          pGrpElem = CType(pGroupElement, esriCarto.IElement)          pContainer.AddElement(pGrpElem, 0)          mxDoc.ActiveView.PartialRefresh(esriCarto.esriViewGraphics, None, None)      **Added:** So, is creating objects with the following code - as I do now - not creating them in process?               def NewObj(MyClass, MyInterface):         """Creates a new comtypes POINTER object where\n\         MyClass is the class to be instantiated,\n\         MyInterface is the interface to be assigned"""         from comtypes.client import CreateObject         try:             ptr = CreateObject(MyClass, interface=MyInterface)             return ptr         except:             return None      If not, I gather I must use IObjectFactory. Assuming that my current objects are not in process, I must say I haven't seen any great performance hit, but I guess I'm just asking for trouble forcing lots of interprocess calls. Thank you, all, for the help. I shall experiment when next I get the chance and let you know the results.


Comparing 2 vector files

I'm looking for a tool which compares two vector files (eg shapefiles). Eg 2 versions of a river network. Quite a lot of the records are equal, but some are different. A possible output would be eg a shapefile with every geometry and 2 columns which refer to the id of the 2 original files, which can be missing if that geometry is not present in one of the files. I'm thinking about a strategy to program this myself (basically creating a hashed version of the geometry of each part and compare those), but before rushing into programming (I even have a fancy name 'shapediff') I was wondering if such a tool already exists.


GeoServer layers containing cities in each country, given that all the cities reside in the same table

Using GeoServer, I need to provide a graphical representation of the distribution of some metrics on a geographical basis. The geographical regions will be coloured and labelled according to the value of that metric. I would like to have a "world" layer (containing all the continents and only continents), a "Europe" layer (containing only countries from Europe) and a "France" layer (containing all the cities in France). So to speak, "a tree of layers containing the immediate children", given that these entities (continents/countries/cities) reside in three distinct tables with one-to-many relationships defined. I haven't found any "filtering" option when defining a layer from a PostGIS store, so a "cities" layer can only be based on the whole cities table (not on the cities in country X). Is there something I missed ? P.S. I would rather have distinct layers than having one big layer and filtering with every request, because I think the caching feature can only refer to layers. Is this assumption correct ?


Opacity control for KmlLayer in Google Maps V3 API?

Using a KmlLayer object within the Google Maps API, is it possible to control the opacity of a KML's image overlay features ?


Reading BSQ file format

is there a way to open BSQ file format in IDL? thanks in advance.


Upgrading GeoTools

Currently we are using geotools release version **2.7.5**. I checked the versioning of geotools and found that, there is a stable release version 8.* directly after 2.7.*. Do the new release version(accoring to current date **10.4** GeoTools Blog) means always the up-to-date version or different release versions serve different purpose? Thanks in advance!


Are there asset management systems for PostGIS?

Are there asset management systems that use PostGIS for asset storage?


automated georeferencing

I am attempting to fully automate the process of georeferencing a load of .png files - i have xml file containing the co-ordinates - but how can i use them? Does anyone have any advice?