Spatial distance join between polygon and points using R?

I'm figuring out how to do a Intersection (Spatial Join) between point and polygons from shapefiles. My idea is to get the closest points and those points that match completely inside the polygons. In ArcGIS there's a function for match option named CLOSEST and they have defined by: "The feature in the join features that is closest to a target feature is matched. It is possible that two or more join features are the same distance away from the target feature. When this situation occurs, one of the join features is randomly selected as the matching feature." I have a function to intersect points into polygons, it was kindly contributed by Lyndon Estes at the r-sig-geo list and the code works very well when all the polygons have filled all areas. The second case is known as a Spatial join distance and in ArcGIS is know as INTERSECT when match_option is CLOSEST, as ArcGIS does. So, you can modify the minimal distance between the point and the polygon when the area is not filled by all polygons, but I don't have access to ArcGIS. Here's the data (direct to my public ftp) and the function of the first INTERSECT:               library(rgeos)     library(sp)      library(maptools)     library(rgdal)     library(sp)     xy.map <- readShapeSpatial("http://www.udec.cl/~jbustosm/points.shp")     manzana.map <- readShapeSpatial("http://www.udec.cl/~jbustosm/manzanas_from.shp" )          IntersectPtWithPoly <- function(x, y) {      # Extracts values from a SpatialPolygonDataFrame with SpatialPointsDataFrame, and appends table (similar to      # ArcGIS intersect)     # Args:      #   x: SpatialPoints*Frame     #   y: SpatialPolygonsDataFrame     # Returns:     # SpatialPointsDataFrame with appended table of polygon attributes            # Set up overlay with new column of join IDs in x       z <- overlay(y, x)            # Bind captured data to points dataframe       x2 <- cbind(x, z)            # Make it back into a SpatialPointsDataFrame        # Account for different coordinate variable names        if(("coords.x1" %in% colnames(x2)) & ("coords.x2" %in% colnames(x2))) {         coordinates(x2) <- ~coords.x1 + coords.x2         } else if(("x" %in% colnames(x2)) & ("x" %in% colnames(x2))) {         coordinates(x2) <- ~x + y        }            # Reassign its projection if it has one       if(is.na(CRSargs(x@proj4string)) == "FALSE") {         x2@proj4string <- x@proj4string         }       return(x2)     }               test<-IntersectPtWithPoly (xy.map,manzana.map)      Sharing some ideas with Lyndon Estes, he told me this: I think the easiest thing to do would be to put a buffer around each of the points (you could specify 50 m if it is in projected coordinates), converting them to polygons, and then your task becomes an intersection of two different polygon objects. I haven't done this type of operation in R, but I suspect you could find your answer with the following functions:               library(sp) ?over          library(rgeos) ?gBuffer ?gIntersects      Maybe someone else who has a better idea on polygon to polygon intersects/overlays could suggest the method. I know that this functions could help to achive it.               library(sp)     ?over          library(rgeos)     ?gBuffer     ?gIntersects      On the other hand, I think perhaps making the points bigger could help??... but im not sure! Any comment or help, would be very apreciated! thank in advance, José


What software for direct editing of a DBF file?

I am currently processing GPS log data from my holiday and need to add information to the points. I remember I used OpenOffice and later LibreOffice to directly edit the files but currently I am really upset because I always get a tiny DBF + huge DBT file instead of only one DBF. QGIS is then not able to load the shapefile correctly... :-( Tried various software but no success. Even old OpenOffice 2.4 which I currently downloaded and ran using Wine does the same problem. Gnumeric is not able to save the table, Sdbf probably does not support UTF-8... My reason for manual attribute editing is that I cannot comfortably edit them in QGIS - it was much easier for example to mark beginning and ending point and than copy the atributes in spreadsheet... Have no idea why it is not possible yet. Tried win machine with newest LibreOffice and unfortunately the same problem. any ideas? thanks


Do any of the USGS WMS services work with GeoServer 2.1.x as a store?

This page displays a number of WMS services: http://seamless.usgs.gov/service_access_list.php?serviceid=Dataset_7&dataset=HRO In a local copy of GeoServer, I can successfully create a WMS store and publish a layer from the WMS URLs provided on that page, however the layer preview options all throw NullPointerExceptions: `at org.geoserver.catalog.impl.WMSStoreInfoImpl.getWebMapServer(WMSStoreInfoImpl.java:39)`


Reprojecting Tiles Using PixelBender in a Flex Client

I am pondering the possibility of somehow reprojecting tiles for display in my Flex application using Pixel Bender or something equivalent. The tile cache in question here is not owned/maintained by me, so I have no control over its output. I know I could use ArcGISDynamicMapServiceLayer to reproject to the desired coordinate system, but that will be very slow. Hopefully the following use case explains the need to do so: I have a Flex app that is using ESRI ArcGIS Online basemaps in the standard Web Mercator projection. I use a service that returns polygons around and over the polar regions. Displaying in the Web Mercator projection looks like crap. So, I guess my questions are: 1. Does anyone know of any good examples/tutorials...etc showing how this can be done? 2. Will this overwhelm the processing power of the client browser?


How to calculate mean coordinates from big point datasets?

I know there are several questions related to speed issues in QGIS, but I am having problems when running Ftools. I have a vector with ~70,000 points in it. When I run the generate mean coordinates operation 99% of the time QGIS will crash. When QGIS chooses not to crash, it will take ~ 2 hours to generate the mean coordinates required. Is there a way to speed up the process/prevent crashing? Or would the best option simply be to leave the program running until it decides to respond again? Thanks for your help. e/ @James s shapefile format, 1.8.0 Lisboa


v.what.rast trouble in GRASS GIS 6.4.2

I'm facing a problem using the v.what.rast comand. I'm trying to update the vector "canali" which represents some streams, with the slope value for every single point of the lines. The slope values are contained in the raster map "Pendenza". I then created a column by entering: v.db.addcol canali column='slope integer' and that works fine: it creates an empty column named "slope". Then I run the command line: v.what.rast vector=canali@PERMANENT raster=Pendenza@PERMANENT column=slope but it tells me the following: No record for category 0 in table 1250 categories loaded from table 1 categories loaded from vector 1 categories from vector missing in table 0 duplicate categories in vector 0 records updated 0 update errors Anyone out there can help me? I'm new to Grass and I don't want to give up!


How to set up QGIS + georeferencer for easiest georeferencing

The goal is to make converting scanned paper maps to map tiles as easy as possible. I've done a few, but the slow part is manually entering coordinates of points. What I'd like to do is for each point on the scanned paper map, click on a satellite image (ie a Google Map) to automatically set its coordinates. I know this should be possible with QGIS and the georeferencer plugin (I'm using 1.7.2) but... If I set QGIS to use WGS84 projection, I haven't found a way to display Google Maps in QGIS so that the georeferencer plugin tool will take coordinates from it. If I set QGIS to use EPSG:900913, I can use the Openlayers plugin to add a Google Maps layer, and the georeferencer plugin tool happily takes coordinates from it. But gdal2tiles won't process the resulting geotiff file that georeferencer produces. So currently I set QGIS and georeferencer to use WGS84, type in lat/lon pairs manually, and then gdal2tiles processes the resulting geotiff successfully. Has anyone found a workflow that avoids the problems I described above? Thanks & regards, David


Exporting polygon features to individual image pngs

I have a shapefile with a few thousand polygons, ArcGIS [9.3] (and even PostGIS). I would like to export each of those polygons into its own thumbnail image file without any real context. What is the best approach?


How can I create a choropleth from the 2010 census ZCTA shapefile using R and ggplot2?

I have created state and county choropleths in R using ggplot2. The method I have used for this came from Winston Chang's "R Graphics Cookbook". For those choropleths the map was already represented as a data.frame in R (as opposed to a shapefile). I now need to create choropleths of the continental US at the ZIP code level. The boundaries that I would like to use are the US Census ZCTA boundaries which you can download as a shapefile here (select "ZIP Code Tabulation Areas" from the dropdown). The shapefile is large, at over 500MB zipped. I do not have a background in GIS, and attempted to create a choropleth from the shapefile in R using ggplot2 by following the advice on the ggplot2 wiki: Plotting Polygon Shapefiles. However, when I attempt to follow the advice listed there the program just hangs:               require("rgdal") # requires sp, will use proj.4 if installed     require("maptools")     require("ggplot2")     require("plyr")          setwd("~/Desktop/tl_2013_us_zcta510")     zcta = readOGR(dsn=".", layer="tl_2013_us_zcta510")     zcta@data$id = rownames(zcta@data)          zcta.points = fortify(zcta, region="id")      The call to fortify hangs - even running it overnight it did not complete. I have dug into the code for fortify a bit and can see the line that it causing it to hang (`coords <\- ldply(model@polygons,fortify)`), but am not sure how to fix it. I have also tried to follow the advice I have seen on numerous other websites about reading in shapefiles into R and ggplot2, but they don't seem to work for me either. I can't tell if it is because of the size of this shapefile or for some other reason which I do not understand because of my lack of knowledge about GIS. It would be great if someone could help me with this.


python dissolve by field error

I would like to dissolve a feature class by a field. When I run the code, I receive an error that says, "invalid topology [out of memory]" I have 16GB of RAM and terabytes available on the hard drive. Here is my code:               #Import system modules     import arcpy     from arcpy import env          # Set environment settings     env.workspace = "Q:/LandTrendr_04/lt_ancillary/landtrendr_file_geodatabase/templates_testing/LandTrendr_GRPO_python.gdb/"          # Set local variables     inFeatures = "raster2polyg"     outFeatureClass = "polydissolve"     dissolveFields = ["UNIQUE"]          # Execute Dissolve using UNIQUE as Dissolve Fields     arcpy.Dissolve_management(inFeatures, outFeatureClass,dissolveFields,"","MULTI_PART", "DISSOLVE_LINES")      I would like to dissolve on the 'UNIQUE' field, no stats, create multipart polys, and dissolve lines. I've tried to run this same tool through the toolbox and it works just fine. I would like to have this in a python script to help with my workflow. Here is the output from the cmd prompt when I run the script. ![enter image description here](http://i.stack.imgur.com/O3IxI.png) Thanks -al


No AuthenticationProvider found geoserver

I installed geoserver and added new roles and users under the "default" role services. I tried to connect to the geoserver via rest api but I have this error: No AuthenticationProvider found for org.springframework.security.authentication.UsernamePasswordAuthenticationToken. This request requires HTTP authentication (No AuthenticationProvider found for org.springframework.security.authentication.UsernamePasswordAuthenticationToken) Can someone help me how to fix this?


Google maps kml and polygon eventclick error

I have a google map polygon kml file that I am loading on a google map. When I click on the polygon, I draw a line from that polygon to places on the map. To do this I am using the code:               //Add KML layer     var fregLayer = new G.KmlLayer(           'http://dl.dropbox.com/freg4.kml',           {  suppressInfoWindows: true,               map: map         });           // Add listener to kml layer      google.maps.event.addListener(fregLayer, 'click', function(kmlEvent) {               //parse click event     var text = kmlEvent.featureData.name;          //make polylines using my function 'make'      make(text);                });      However, after clicking a polygon the kml layer looses 'focus' and I can no longer click any other polygons to generate other lines. Reading about this problem, it is suggested to make your polyline not clickable which I tried using `clickable:false` in the options. I also tried `google.maps.kmlEvent.stopPropagation();` however neither of this options solved the problem. * * * ## Entire Program ##                  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">                    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>               <title>Connectivity</title>


Relative areas projection independent?

I need to calculate how much (in percent) each of thousands of spatial polygons shrink after some events. I use R and the very useful sp-library. Example:   * Projection: "+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0"   * poly.1 is a Spatial Polygon. It has an area-slot with a value   area.1   * poly.2 is the poly.1 after shrinking. It has an area-slot with a   value area.2.   * I need to calculate area.2/area.1 = percent after shrink. I know that to get the square-meters etc. of the polygons, they must first be transformed to the appropriate projection. But I hope to avoid to do the transformation, to save calculation-time. To calculate the percentage-difference, can I use the projection above? I’m not sure what unit the areas are in, square-degrees? Each polygon is less than 200x200 meters.


Update point coordinates in QGIS after manually moving locations in edit mode

I have imported point coordinates from a database, but I need to manually adjust a lot of the locations. Is there a way for QGIS to automatically update the point locations in the attribute table after you move your points?


How to draw a polyline in Leaflet?

This is my coding I used in Leaflet:                   var pointA = new L.LatLng(28.635308, 77.22496);         var pointB = new L.LatLng(28.984461, 77.70641);         var pointList = [pointA, pointB];              var firstpolyline = new L.Polyline(pointList {         color: 'red',         weight: 3,         opacity: 0.5         smoothFactor: 1              });              map.addLayer(firstpolyline);      The map is not showing any result. I just need straight line from one point to another, just visualize it, not geodetic correct. Points (in Leaflet "circles") are showing perfectly on the map. Thank you for any help.


What does ValueError: invalid literal for int() with base 10 indicate?

# Process: Get Raster Properties     Max_Aggl = arcpy.GetRasterProperties_management(EucDist_Aggl, "MAXIMUM", "")     print (Max_Aggl)     print float(Max_Aggl.getOutput(0))     b = int(Max_Aggl.getOutput(0))     c = b/2     print c     delta = int(Max_Aggl.getOutput(0))     print delta     a = delta/1000     print a      This is a part of the code, and the value of Max_Aggl=44250.27734375 (more than 10 digits) and I have error : > 44250.27734375 44250.2773438 > > Traceback (most recent call last): File "D:\NEO\bbbb.py", line 22, in b = > int(Max_Aggl.getOutput(0)) ValueError: invalid literal for int() with base > 10: '44250.27734375' you help me first time to convert the result to value, thank you all.


How to install qgis2 on centos6.5

I'm trying to install qgis2 on centos6.5, but I always get an error message: Error Downloading Packages: qgis-2.0.1-1.el6.x86_64: failure: qgis-2.0.1-1.el6.x86_64.rpm from qgis: [Errno 256] No more mirrors to try. I followed the instructions for 'QGIS stable' on 'http://www.qgis.org/en/site/forusers/alldownloads.html#rhel-centos- scientific-linux'. Is there another rpm that I could use? Thanks, Ingrid


Do Personal Geodatabases show up when trying to Export Data using ArcGIS 10.1 SP 1 (on Windows 7)?

I work with ArcGIS 10.1 SP 1 (on Windows 7), and I tried to export a feature layer to a personnal geodatabase using "right click in the table of content > data > export data". However, when I select "file and personnal geodatabase", only the file geodatabase are visible (though the mdb are visible in ArcCatalog). Of course, the obvious workaround is to use "feature class to feature class", but I would like to know why this "data > export data" is disabled. Is this because .mdb will disappear from ArcGIS in a near future ?


How to a convert LiDAR XYZ files to DEM / DSM?

Normally consultants (LiDAR survey) provide me with data to my specifications; already in ESRI GRID or ASCII GRID format. This way LiDAR data can be easily used with ArcGIS. This time I only have xyz files. Previously I would use a utility by Min-Lang Huang named GridBatch that would convert XYZ to ASCII GRID then to ESRI GRID files. Unfortunately the utility is crashing since i upgraded my machine to W7 64bit and ArcGIS to version 10. Is there another way to batch convert LiDAR XYZ data to ESRI GRID files? (Convert to points -> Interpolate is an option I would like to avoid considering there are 300+ tiles to convert)


Why can't I clip vectors with 2 different projections?

I am using QGIS. I am trying to clip parcel data with a stream buffer. The two have different projections. Parcels are NAD83 State plane feet and streams are NAD83 State plane meters. I keep getting an error that says something like `detected different projections, some data may not disply correctly`. When it runs the clip the output file has no data in it. I have enabled on the fly projection.


Calculating distance in WGS84 (MySQL and Geoserver)

Here is the environment in which I work:   * An application using geo-referenced data   * Database MySQL 5.5, storing georeferenced points   * A Geoserver server, connected to the MySQL database Here is the context (common to many people): I have to calculate the distance between two points stored in my DB (and better, I want all the points within a known distance) I have searched about the methods available to me on the net, and here are my results:   * MySQL: I can use the method GLength of the LineString type , but the result is in degrees, which is useless. In addition, the SRID (mine is 4326) can not be used.   * WFS protocol: I can connect to GeoServer WFS with a query, but currently there is an open issue with DWithin method (the one that interests me), indicating that the parameter "unit" cannot be used (http://jira.codehaus.org/browse/GEOS-937).   * WPS protocol: I saw a method "Distance". But there is little information, and this method does not seem to use a calculation method that suits me (https://wiki.state.ma.us/confluence/display/massgis/GeoServer+-+WPS+-+Distance). I have not found other potential solutions. First, are there errors in the results that I described? Secondly, would you have any suggestions or additional ideas for me? Edit: I cannot install and use PostGre. I know that it can be done with it.


Is there a way to use ArcPy and PyGRASS tools in the same Python script?

I´m trying to write a Python script, that includes different ArcPy / ArcGIS commands and want to combine it with GRASS geoprocessing tools. Unfortunately importing the GRASS libraries doesn´t work.               import grass.script as grass      ends in an error:               Traceback (most recent call last):       File "<interactive input>", line 1, in <module>     ImportError: No module named script      I know that GRASS GIS installs it's own Python version. Isn´t there a way to combine the ArcGIS and the GRASS GIS installation of Python? I tried copying the pygrass module (or what I thought it might be it) to the C:\Python26\ArcGIS10.0\Lib\site-packages\ folder. I´m getting a different error message, but it´s still not working.               Traceback (most recent call last):       File "<interactive input>", line 1, in <module>       File "C:\Python26\ArcGIS10.0\lib\site-packages\grass\script\__init__.py", line 1, in <module>         from core   import *       File "C:\Python26\ArcGIS10.0\lib\site-packages\grass\script\core.py", line 38, in <module>         gettext.install('grasslibs', os.path.join(os.getenv("GISBASE"), 'locale'))       File "C:\Python26\ArcGIS10.0\lib\ntpath.py", line 96, in join         assert len(path) > 0     TypeError: object of type 'NoneType' has no len()      I´m using ArcGIS 10 and GRASS 6.4.2 on a Windows 7 64 Bit machine. Any help would be highly appreciated.


How to change length to 2 decimal places?

I'm trying to work out how to calculate the length of a line to only 2 decimal places in QGIS. When I use the field calculator to create a new field, it doesn't matter what changes I make to the field type, field width or precision, I continually get the length to 13 decimal place.


Selecting features with attachments

Is there a way to select features in a layer that have an attachment. I want identify all features on a map that have an attachment accociated with it Thanks


How to select a number of rows based on current sort order

I would like to be able to select a certain number of rows from my attribute table based on their ordering and not their attributes. For example, if I sort by `ObjectID`, I then want to select the top 100 rows. If I then alphabetise the `Name` field, I want to be able to select the top 150 rows. According to the help files on building a query expression: > Because you are selecting columns as a whole, you cannot restrict the SELECT > to return only some of the columns in the corresponding table because the > SELECT * syntax is hard-coded. For this reason, keywords, such as DISTINCT, > ORDER BY, and GROUP BY, cannot be used in an SQL query in ArcGIS except when > using subqueries. In this SO question it shows how to achieve this using a subquery, but it seems to depend on the `WHERE` clause being part of the subquery.


How do I add a lot of data to a shape file in QGis?

I have some nice shapefiles from Agesic in Uruguay, I need to add to them some information (not as shapefile) that I got from Dinamige to the attribute table. These institution are not the point, the point is that I have a lot of new information to add to the shapefiles. I was able to add new columns, they look very nice and empty, so I want to copy and paste the new information there and not write it one by one. I have just one attribute that is the same, all the other stuff is new information. The thing is I´m a new QGis user and I don´t understand how Phyton Console works, that is like out of my league. I was searching someone with the same problem but I don´t find it. Does anyone know how to do this? Thanks! ;)


How to Persist a Network Analysis Route Layer?

I'm using `ArcGIS 10.0`. I'd like to be able to specify the location (path) where to create the route layer, for network analysis, when I click on `Network Analysis -> New Route`. Is that possible? If it is not, how can I have access to the location where the route layer is created? I'm using the route layer in a task of a geoprocessing service, and I'd like to give to the task the exact location (absolute path) of the route layer. Could anybody help?


ArcObjects Library of Sample Scripts

OK, I'm still not getting help on how to code for accessing a folder. So does anyone know where they keep sample scripts for people to go look and borrow??


How do I create multiple polylines from single polyline that consists of disjunct sections?

My goal was to create a network of polylines in NHD plus based on start and end points associated with sampling locations. Dissolving by stream name was my first step and has worked just fine for named streams, as I just split them accordingly in an edit session afterward. However, after dissolving, all of the unnamed sections are represented by one entry in the attribute table of the new dissolve shapefile. This was not a big deal until I realized that some sites were on unnamed sections of the NHD network. When I select an unnamed segment in an edit session and try to split it, an unnamed section 20 miles away is also highlighted. Is there a way to extract single pieces from a polyline that has numerous disjunct sections? Or do I have to retreat back to the pre-dissolved NHD layer and sort out the unnamed sections from there? I suppose I could go back to that original layer and provide names for all unnamed sections of interest, then dissolve by name again but that seems extremely tedious. Thanks,


How to create an error map to support an average kernel density map?

I've created an average kernel density map by running KDEs on points stacked within the same spatial extent. For example, say we have three point shapefiles representing seedlings in three different forest gaps of the same shape and size. I ran a KDE for each point shapefile. The output from the KDE were then stacked based on spatial extent in order to calculate the average in Arc's raster calculator, for example: `Float(("KDE1"+"KDE2"+"KDE3")/3)`. Here is the final product: ![enter image description here](http://i.stack.imgur.com/4JY5a.jpg) Now I'm interested in creating a map depicting the error associated with the averaged KDEs. I hope to use the error map to visually depict how much error is associated with the hotspots (e.g. is the SW hotspot due entirely to the points in one gap?). How should I go about creating a map of the error associated with the averaged KDEs? Would MSE be the most appropriate measure of error in this case?


How to program select by attribute unique values using ArcGIS silverlight API?

I'd like to create a select by attribute window in my webGIS using silverlight api . this is like select by attribute in arcgis desktop . i create select layer combobox ( cbolayers)and select fields combobox(cbofields) to select fields of selected layer . the application needs a listbox to list unique values of selected field like arcgis desktop unique values listbox . i surf in the internet but couldn't find any good source to help me about How can i create unique values listbox .could you please help me about this subject?


Is there a way to create a new vector layer from a template?

I would like to be able to set up a template for a vector layer with a standard set of attributes rather the having to specify them time. Similar to SQL "CREATE TABLE blah LIKE foo" Is this possible?


What resources are there to create a WPS from a web app?

I am developing a web app using the Weight of Evidence method and I need to create a web processing service out of it or enable it for web processing services. The code is in C# and includes an engine file, some GUI related files, and a plethora of different files. Are there any in particular I should look for? Or I guess are there any particular frameworks or wrapper classes for this transaction? Are they intuitive or is there any workaround? Essentially this will take some inputs as necessary from a user and apply it to a programmatic weight of evidence formula and return a result. Based on what I can see from the code there are raster analysis frames and a variety of different files I'm not entirely familiar with. It wouldn't serve any purpose to post any code as it is a large file that I don't have experience with. I can say it uses the following libraries as well as other system libraries:               using System.Runtime.InteropServices;     using ESRI.ArcGIS.DataSourcesRaster;     using ESRI.ArcGIS.DataSourcesFile;     using ESRI.ArcGIS.Geodatabase;     using ESRI.ArcGIS.GeoAnalyst;     using ESRI.ArcGIS.Geometry;     using ESRI.ArcGIS.Geoprocessor;     using ESRI.ArcGIS.Geoprocessing;     using ESRI.ArcGIS.AnalysisTools;     using ESRI.ArcGIS.SpatialAnalyst;     using ESRI.ArcGIS.Carto;     using ESRI.ArcGIS.Display;     using ESRI.ArcGIS.esriSystem;     using ESRI.ArcGIS.Framework;     using ESRI.ArcGIS.DataSourcesGDB;     using ESRI.ArcGIS.GeoDatabaseUI;     using ESRI.ArcGIS.ArcMapUI;      However, according to the project details I need to find a workaround to not using any ESRI packages.


Add and Remove layers in openlayers on-the-fly

I am using OpenLayers 2.13.1 in my application and I have a couple of layers which need to be added/removed to the map on-the-fly. Here are the core codes:               var layers=[layer1,layer2,layer3];  // both of them are instances of ol.Layer.WMTS     var map=.....;     removeLayer();     map.events.register("moveend",map,resetLayer);  // when the center of the map changed, re-decide which layer should be visible     .....               function resetLayer(){         var activated=[];              var bounds=map.getExtent(),zoom=map.getZoom()         for(var i=0,len=layers.length;i<len;i++){             var lay=layers[i];             if(checkVisible(bounds,zoom,layer1)){                 if(!lay.activated){                     map.addLayer(lay);   // #1                     lay.activated=true;                 }                 activated.push(lay);             }else{                 map.removeLayer(lay);                 lay.activated=false;             }         }              if(activated.length==0){             //no layers avaiable,add the first layer             var lay=layers[0];                 if(!lay.activated){                     map.addLayer(lay);  //#2                     lay.activated=true;                 }         }     }      Now, I came to the `too much recursion` problem. It seems that when the `moveend` event fired, the `resetLayer` will be called (expected). Once I re-add/remove the layer to the map (see comments of #1 and #2), the map object will reset the baselayer which will cause the `setCenter` to be called for the map, and the `moveend` event will be fired once again. Any ideas on how to fix this?


How to troubleshoot cartodb windshaft?

I installed CartoDB on a digital ocean instance of Ubuntu 12.04. I am able to log in and import data. Table view is fine, but map view does not show tiles with the message "There is a problem with your connection". I assume this means problems with the Windshaft tile server. Windshaft installs ok:               git clone git://github.com/CartoDB/Windshaft-cartodb.git     cd Windshaft-cartodb     git checkout master     npm install      but `make check` fails; nine failing tests with two primary errors:               AssertionError: "2.1.0" == "2.1.1"      and               Uncaught Error: listen EADDRINUSE         at errnoException (net.js:769:11)         at HTTPServer.Server._listen2 (net.js:909:14)         at listen (net.js:936:10)         at Server.listen (net.js:993:9)         at dns.js:71:18         at process.startup.processNextTick.process._tickCallback (node.js:244:9)      The only thing I changed in config/environment/test.js was to set Mapnik version to 2.1.1. I've posted the full output of `make check` here: http://pastebin.com/CWSfijR8 Any ideas on what I'm not configuring or installing correctly? Or how else to troubleshoot these errors? (follow up and update from question originally posted in CartoDB google forum)


Converting wkt to geojson with OpenLayers

I am trying to convert wkt to geojson wit OpenLayers. I wrote my code based on this question (geojson to wkt). That's what I have so far, but it is not working. Any ideas?               var = 'GEOMETRYCOLLECTION(MULTIPOLYGON(((-0.12072212703174 51.51899157882951,-0.128597092699465 51.51191439062526,-0.129004788469729 51.51260880491084,-0.129584145616946 51.51374388239237,-0.130120587419924 51.51494569831,-0.130614113878664 51.51653471734371,-0.125507187914309 51.51718900318654,-0.121001076769289 51.519178508517115,-0.12072212703174 51.51899157882951))))';     var geojson_options = {};     var wkt_format = new OpenLayers.Format.WKT();     var testFeature = wkt_format.read(val);     var geojson_format = new OpenLayers.Format.GeoJSON(wkt_options);     var out = geojson.write(testFeature);          alert(out);      Try it in action: http://jsfiddle.net/Pp5FF/


Mobile Cache Not Saving Edits

I used the Create Mobile Map geoprocessing tool in ArcGIS 10's toolbox to generate a mobile map from an MXD. The MXD has one layer which featureclass is:               1) in a geodatabase     2) registered as versioned and      3) has a globalid      all the ridiculous requirements for generating a mobile cache just to take advantage of ArcGIS Mobile's mapping capabilities (like I couldn't send my edits back to my own webservice and manage edits my own way). I then took the MapSchema.bin file and dropped it in a folder on my Windows Mobile device. I wrote a small test Smart Device application in Visual Studio that has this code:                       using (MobileCache cache = new MobileCache(mobileCachePath))             {                 cache.Open();                      FeatureLayer layer = cache.Layers[0] as FeatureLayer;                 FeatureDataTable table = layer.GetDataTable();                      FeatureDataRow row = table.NewRow();                 row["area_id"] = 1;                 table.Rows.Add(row);                      int recordsAffected  = table.SaveInFeatureLayer();                 //recordsAffected is always 0                           using(FeatureDataReader reader=layer.GetDataReader(null,null))                     while (reader.Read())                     {                         //never reaches here                     }                      table = layer.GetDataTable(new QueryFilter("area_id="+1));                 int foundRows = table.Rows.Count;                 //foundRows is always 0                      cache.Close();             }      As you can tell from the comments in the code, I can't find my new records anywhere. I open the MobileCache.db file in a Sqlite browser and the tables are empty. I read that I could use the MobileCache in a headless fashion, is this not what ESRI meant? Can anyone fill me in on what I'm missing? OR EVEN BETTER does anyone know another mobile mapping API that is SIMPLE (just plot stuff on a map already for crying out loud), works with locally stored maps and stores geometry in some open format?


Installing ArcGIS 10.1 on Win7 64 bit

Just reformatted my PC with Win7 64bit to try and take advantage of 64-bit python processing. However I'm not sure what to do here: Our office runs ArcGIS 10.1, TOAD and SDE for Oracle. Toad says I need to install a 64-bit client before I can connect to Oracle. The ArcGIS Resource Center says before I can connect to SDE I need to install a 32-bit oracle client. Confused... ![error message](http://i.stack.imgur.com/NYgTt.jpg) Appreciate any guidance you can offer. Thanks


Is there a limitation in quantity of joined tables using spatialite views?

I've one point layer in qgis and several non spatial tables in a spatialite database. Now I want to create a view as you can see in the following: `CREATE VIEW testansicht10   AS SELECT baumkataster.baum_ID AS ROWID,   baumkataster.geom AS geom,   gattung.gattung AS gattung,   art.art AS art,   sorte.sorte AS sorte,   baumkataster.b_hoehe AS b_hoehe,   baumkataster.kro_durchm AS kro_durchm,   baumkataster.kro_ansatz AS kro_ansatz,   baumkataster.age AS age   FROM baumkataster JOIN gattung ON baumkataster.gattung = gattung.gattung_ID   JOIN art ON baumkataster.art = art.art_ID   JOIN sorte ON baumkataster.sorte=sorte.sorte_ID;` When I do this the result is an empty view table though there are entries in my spatial table. If I exclude one of my joined tables (for instance "sorte") in the view I get the desired result - the view table with the existing entries. Is there a limitation in quantity of joined tables? The view should consist of about 65 coulomns (36 are from joined tables).


How to pass OAuth token to fetch web map without passing userid?

I'm using the ArcGIS JavaScript API 3.7 for web map service. The web map is based on Oauth2 authentication. I use java code to fetch the token. Then I need to fetch the map in javascript by calling esri.arcgis.utils.createMap(). But How to pass the token with this request? I know ArcGIS JavaScript 3.7 offers an API called esri.IdentityManager.registerToken() that can pass the token will the request. But this method requires the user name as parameter. I don't want to put the username in the javascript code, as it's not safe. Are there any other ways to pass the token with the request? The api for esri.IdentityManager.registerToken() is **here**.


Google geocoding rate and quota limits...is there any way to lower them?

My question is all about Google Maps API direction request quota and rates limits. Has anyone noticed that Google lowers the priority of your requests after you made some requests in batch? The more request you do, the bigger is the number of OVER_QUERY_LIMIT response you get, the bigger is the delay between requests before you have a successful result, and the bigger is the number of requests before you have a successful result. I know that this is in place so people do not abuse. Is it a reality for every direction service? Is it the same for Google's Direction API? Is it as strict as Google Maps API? Is there a way to lower the rate and quota limit? Thank you.


How to add a custom map tile layer?

I am trying to display the following background map in QGIS 2.0: http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/${z}/${y}/${x}. In a custom web map client, this is quite easy: http://dev.openlayers.org/releases/OpenLayers-2.13.1/examples/xyz-esri.html I tried to use the "OpenLayers plugin" in QGIS, but there the list of background tile maps is predefined and I cannot add my own custom map tile layer. Is there any easy workaround (without any programming) how I could show the custom map tiles layer in QGIS?


How do I use gdal_proximity.py from the QGIS python console?

How do I run gdal_proximity.py from the QGIS python console?


how solve this proplem :NoneType' object has no attribute 'start'

patternRE = re.compile('(^|\s|\")([^\s]+?)\",{'+str(HeaderLineIndex)+'}')     #patternRE= '\n("."){'+str(HeaderLineIndex)+'}'     #patternRE=re.compile('(^|\s|\")([^\s]+?)\",')          Buffer = localDisk.ReadFileBuffered(ifile, DataBufferSizeMB=1,StartPosition=0,whence=1)     compRE = re.compile(patternRE)     print '????/'     searchObj = compRE.search(Buffer)     print '????/'     ValueLocation=searchObj.start()     print ValueLocation     searchObj = compRE.search(Buffer,ValueLocation+1)     ValueLocation=searchObj.start()     print ValueLocation


A tool as part of a dialog box

I have a button created using Python Add-Ins which pops up a dialog box which is built using wxpython. I am wondering if I can place a tool (Select Layer by Location) within that dialog box to get location coordinates of layer (basically select that layer). Once a layer is selected, it will fire back some values to the already open dialog box. Any word of advice on whether it is possible and how to create a class for tool would be very helpful here.


Adding subnodes to layermanager

I’m creating an application using OpenGeo Suite SDK and I need to create a two level layer manager. I can create the first layer tree with the "gxp_layermanager" using the following code in the suite-sdk:               {         ptype: "gxp_layermanager",         groups: {             "default": "Capas",              "MGN":{                  title:"Marco Geoestadístico Nacional"                 },             "TelCom":{                  title:"Vías de comunicación"                 },             "background": {                  title: "Mapa base",                  exclusive: true             }         },         outputConfig: {             id: "tree",             border: true,             tbar: []              },         outputTarget: "westpanel"     },       That will put the layers in groups but what I need is to create subgroups or children nodes, pretty much like the left panel here. Looking arround all I can find ... once again any ideas are quite welcome


calculation precision during projection transformation

I am using wgs 84 base tiles, and the tile is not rendered as image but with geojson format. I try to draw them in the tile according to the data. And the geometry of the returned feature is lng and lat format. This is the formula I used:               double tileNumWidth = 1 << (zoom+1);     double tileNumHeight = 1 << zoom ;     float px = (float) ((tileNumWidth * fromLngToX(x) - tileX) * 256);     float py = (float) ((tileNumHeight * fromLatToY(y) - tileY) * 256);          public static double fromLngToX(double lng) {         return (lng + 180) / 360d;     }          public static double fromLatToY(double lat) {         return (90 - lat) / 180d;     }      It worked as expected in a lower zoom level: http://pbrd.co/1qBajKH However once the map is zoomed to a higher level like 18+, then I will found that the lines cross two tile may be not conjugated: http://pbrd.co/1qBaN3k You may notice the obvious drift(not much, seems only 1 px). So I wonder if this is caused by the precision of calculation?


How to return raster values based on polygon (shapefile) boundaries in QGIS? Is this an elementary question, because I am finding it hard....... Ideally I would like a neat workflow as I am likely to repeat the task, even if it includes using GRASS. I want to take a remote sensed raster ( Landsat ), and load it up with a shapefile containing irregular polygons and return the avg, max min of the raster values for each polygon. Ideally I would also like to clip out the polygons as separate files for each polygon, perhaps that is another post, but probably it is a related process, which I haven't been able to tackle yet. And is QGIS the right platform to be tackling this in? I have loaded up the RASTERCALC Plugin which does give better functionality than the default raster calculator, so have made a little progress there. Any thoughts appreciated


How to automatically generate least-cost paths between several polygons?

What is the fastest way to automatically generate least-cost paths (LCPs) between several polygons with ArcGIS ? I created a python program to do this by using the functions "CostDistance" and "CostPath" of ArcGIS but my program is much too slow. I need to rapidly build 275493 LCPs. Here is my code:               # Import system modules       import arcpy       from arcpy import env       from arcpy.sa import *            arcpy.CheckOutExtension("Spatial")            # Overwrite outputs       arcpy.env.overwriteOutput = True            # Set the workspace       arcpy.env.workspace = "C:\Users\LCP"            # Set the extent environment       arcpy.env.extent = "costs.tif"          rowsInPatches_start = arcpy.SearchCursor("selected_patches.shp")           for rowStart in rowsInPatches_start:                  ID_patch_start = rowStart.getValue("GRIDCODE")           ## Define SQL expression for the fonction Select Layer By Attribute     expressionForSelectInPatches_start = "GRIDCODE=%s" % (ID_patch_start)           # Process: Select Layer By Attribute in Patches_start     arcpy.MakeFeatureLayer_management("selected_patches.shp", "Selected_patch_start", expressionForSelectInPatches_start)          # Process: Cost Distance     outCostDist=CostDistance("Selected_patch_start", "costs.tif", "", "outCostLink.tif")          # Save the output      outCostDist.save("outCostDist.tif")          rowsInSelectedPatches_end = arcpy.SearchCursor("selected_patches.shp")           for rowEnd in rowsInSelectedPatches_end:          ID_patch_end = rowEnd.getValue("GRIDCODE")           ## Define SQL expression for the fonction Select Layer By Attribute     expressionForSelectInPatches_end = "GRIDCODE=%s" % (ID_patch_end)           # Process: Select Layer By Attribute in Patches_end     arcpy.MakeFeatureLayer_management("selected_patches.shp", "Selected_patch_end", expressionForSelectInPatches_end)          # Process: Cost Path     outCostPath = CostPath("Selected_patch_end", "outCostDist.tif", "outCostLink.tif", "EACH_ZONE","FID")          # Save the output     outCostPath.save('P_' +  str(int(ID_patch_start)) + '_' + str(int(ID_patch_end)) + ".tif")          # Writing in file .txt     outfile=open('P_' +  str(int(ID_patch_start)) + '_' + str(int(ID_patch_end)) + ".txt", "w")     rowsTxt = arcpy.SearchCursor('P_' +  str(int(ID_patch_start)) + '_' + str(int(ID_patch_end)) + ".tif")     for rowTxt in rowsTxt:         value = rowTxt.getValue("Value")         count = rowTxt.getValue("Count")         pathcost = rowTxt.getValue("PATHCOST")         startrow = rowTxt.getValue("STARTROW")         startcol = rowTxt.getValue("STARTCOL")         print value, count, pathcost, startrow, startcol         outfile.write(str(value) + " " + str(count) + " " + str(pathcost) + " " + str(startrow) + " " + str(startcol) + "\n")     outfile.close()


Font color in legends ArcGIS 10

I've got a parcel feature class in ArcGIS 10. Some of the parcels were in the shapefile when I got it. Others I've added after importing the shapefile to a feature class in a personal geodb. I want to change the font color to white. The code below works for the features I've added, but not for the ones that already existed. For those, the label displays with the code displaying also, and no color change. I don't know why the code would work for some features but not others. The only difference I can think of is that the original shapefile that I received was probably created in ArcGIS 9, maybe earlier. Any suggestions on how to get them all to display with the formatted label? Thanks.               Function FindLabel ( [F_NAME], [L_NAME] , [Min_Owner] , [Exp_Date] , [Option_Yrs]  )       If Not IsNull( [Min_Owner]) Then         FindLabel = "<CLR red='255' green='255' blue='255'>" & [Min_Owner] & vbnewline & [Exp_Date] & " + " & [Option_Yrs] & "</CLR>"        Else          FindLabel = [F_NAME] & " " & [L_NAME]        End If     End Function


ArcObjects: How to remove a custom layer?

How is a custom layer supposed to be destructed? I have a custom layer that implements drawing by overriding IActiveViewEvents::AfterDraw. The problem is that sometimes when the custom layer is removed from the Scene/Table Of Contents it is still drawn!? The FinalRelease() method is never called in my custom layer.   1. I would expect it to be ArcScenes responsibility to delete my custom layer when it is removed?; which in turn would call my FinalRelease() method.    2. If my custom layer is not in the Scene/Table Of Contents; how comes it receives IActiveViewEvents::AfterDraw calls? I would expect ArcScene to draw only layers in the Scene/Table Of Contents. Here is an overview of my code:                   class ATL_NO_VTABLE MyLayer :         public ILayer,         public IGeoDataset,         public IGraphicsContainer3D,         public IActiveViewEvents,         public IPersistVariant, ....          {              public:         HRESULT FinalConstruct()         {             return S_OK;         }              void FinalRelease() // newer called!         {             return S_OK;         }              // called after layer has been removed!?         STDMETHOD(AfterDraw)(IDisplay * Display, esriViewDrawPhase phase);               ...         };                   HRESULT addMyLayer() // called by user clicking a button         {           IMyLayerPtr myLayer(CLSID_MyLayer);           IApplicationPtr ipApp(CLSID_AppRef);            IDocumentPtr doc;           ipApp->get_Document(&doc)           if(doc)             return S_FALSE;           ISxDocumentPtr sxdoc;           sxdoc = doc;           if(!sxdoc)             return S_FALSE;           IScenePtr scene;           sxdoc->get_Scene(&scene);           if(!scene)                 return S_FALSE;           return scene->AddLayer(myLayer, VARIANT_FALSE); // I add the layer, but who removes it?         }      Thanks in advance for any answers! Andreas


How to extract latitude/longitude values for specific points from a shapefile?

I have obtained public crash data for the state of Minnesota. I would like to be able to programmatically extract the latitude/longitude of each crash using this data in combination with a series of shapefiles that cover all roads in the state. For each crash, I believe I have enough information to do this, but my knowledge of GIS is keeping me from getting things done. I'll start with a simple example in the hopes that someone can point me in the right direction. You'll have to forgive me if my GIS terminology is not what it should be. The shapefile I'm using is here: http://www.dot.state.mn.us/maps/gisbase/datafiles/county/ramsey.zip Accident 090710194, for example, should be at mile 1.228 along TIS_CODE 0462000015. When I use a tool like Quantum GIS to find all attributes with a TISCODE of 0462000015, there are 81 features to choose from. If I select the feature with a BEGM (beginning mile) and ENDM (ending mile) that encapsulates 1.228, I find one feature that goes from BEGM of 1.21 to ENDM of 1.3. This puts me "in the ballpark" for a precise location. Then, I can use Quantum GIS' "Coordinate Capture" plugin, to guess that it's somewhere around -93.20228,45.05062. I know these measurements are right, because a double check on Google Maps shows the same approximate location as Quantum GIS: http://maps.google.com/maps?q=45.05062,+-93.20228 Really, there are 2 problems with the above approach: 1) It's very slow; I need to do this for over 500K crashes, so I need to do something programmatically, and 2) It's not very precise. I've been told by folks in the Minnesota Department of Public Safety that if I had ESRI ArcMap (the tool they use), I could "create a point event", which sounds like a precise measurement along the feature I selected, and from there I would see the precise location, and (I'm hoping) could probably get latitude/longitude. I don't have this software, but it sounds something like what is shown in the following video, where toward the beginning of this video they're creating a "route event". Since I'm not allowed to post more than 2 links in this post, in order to see what I mean you'll need to Google "arcgis point event" and select the first link, which is to webhelp dot esri dot com. Everything boils down to 2 questions for me right now: 1) Is programmatically extracting this information possible, even with ESRI ArcMap, and 2) If so, what (preferably open source) tools can aid me? PostGIS? Geotools? Geoserver? Any advice at all would be appreciated.


Projection Decision

I'm deciding on whether to use a geographic projection (lat/long) or a lambert conformal conic projection for a web servicing project that will use raster, vector, and point data, for queries, generating statistics, calculating measures based on area (for example), and also modeling. Models will be mostly based on raster data, but vector to raster conversions may be used depending on the clients request. Any suggestions? Between the two (lat/long versus LCC)? Or is there another projection you would suggest? I thought about a UTM projection, but study areas cross multiple zones.


Changing extent on a raster in QGIS

I rasterized a shape. The resulting raster (lets call it raster 1) has a different extent. I made a virtual raster with the original polygon and I tried to multiply the virtual raster with raster 1 selecting the virtual raster's extent using raster calc... but I can't get the raster 1 to change the extent... does anyone know how to fix that? In the picture, the blue part shows the difference between the original vector and the resulting raster. ![In the picture, the blue part shows the difference between the original vector and the resulting raster](http://i.stack.imgur.com/KL06m.png)


Why can't I "turn on" a map view in Google Earth?

Why can't I toggle between map view and satellite imagery in Google Earth as I can in Google Maps? Is there an easy way to add Map View to Google Earth?


How to install OTB/Sextante plugin on QGis 2.0 (OSX)

I remember the Sextante plugin used to be available for my previous version of QGis. When I got a new computer however, I downloaded QGis again and got 2.0. Searching for "Sextante" or "OTB" yields no results in the Manage and Install plugins list. What's the best way to get Sextante working here? I'm worried about trying to install a previous version of qgis for fear of messing up the dependencies and so on...


How to detect broken hyperlinks with arcpy?

I have zero experience with python but am trying to search for broken hyperlinks in a large gdb (temporarily converted to a shapefile)- Used code from a previous question (Hyperlink broken path - python check) and adapted it to fit my problem (didn't know if I could ask a new question on that post...)               import arcpy     import os          fc = r"G:\GISDATA\misc\project_arcpy.shp"     fields = ["PROJECT_DW"]          with arcpy.da.SearchCursor (fc,fields) as cursor:     for row in cursor:         Roll = str(row[0])         if os.path.exists(Roll):             pass         else:             f = open(r"C:\Users\GIS\Documents\brokenlinks.txt","a")             f.write(Roll + os.linesep)             f.close()      Instead of writing broken hyperlinks to my text file, it writes all they hyperlinks to the file...any advice?


Arcpy Closest Facility script not running correctly

I am running a script in ArcGIS 10.2 to automate the Make Closest Facility tool, as below, to identify the nearest chemist. This works fine. However, I then want to run it for another facility (a doctor), using the same incident. That is the second script. But this time, it keeps the same facilities from the first (chemist) solve. Whatever I try and delete, this always happens. You can see the deletes I make after the chemist script If I comment out the chemist script and just run the doctor solve, I get the correct result. Have I missed a delete somewhere? I can't seem to clear the memory properly.               arcpy.FeatureToPoint_management("Siteslyr", "Sitepoint")     inNetworkDataset = "C:\Users\Ant\Documents\ArcGIS\OSMaster.gdb\ITN_Network\ITN_NetworkDataset"     impedanceAttribute = "Drive"     searchTolerance = "5000 Meters"     accumulateAttributeName = ["Length", "Drive"]     inFacilities = "TL_chemistsv3"     inIncidents = "Sitepoint"     outLayerFile = "C:\Users\Ant\Documents\ArcGIS\ITN.gdb\ProxChemistsSites.lyr"     outNALayer = arcpy.na.MakeClosestFacilityLayer(inNetworkDataset, "ProxChemistsSites", impedanceAttribute, "TRAVEL_TO", "", 1, accumulateAttributeName, "NO_UTURNS", "", "", "", "TRUE_LINES_WITHOUT_MEASURES")     arcpy.na.AddLocations(outNALayer, "Facilities", inFacilities, "", searchTolerance)     arcpy.na.AddLocations(outNALayer, "Incidents", inIncidents, "", searchTolerance)     arcpy.na.Solve(outNALayer)     outNALayer = outNALayer.getOutput(0)     subLayerNames = arcpy.na.GetNAClassNames(outNALayer)     tableName = subLayerNames["CFRoutes"]     if arcpy.Exists("ProxChemist"):         arcpy.Delete_management("ProxChemist")     outTable = "ProxChemist"     arcpy.CopyFeatures_management(tableName, outTable)          del inNetworkDataset, impedanceAttribute, searchTolerance, accumulateAttributeName, outLayerFile,     outNALayer, inFacilities, inIncidents, subLayerNames, outTable, tableName          if arcpy.Exists("ProxChemist"):         arcpy.Delete_management("ProxChemist")          arcpy.Delete_management("in_memory")          arcpy.RefreshActiveView()     arcpy.RefreshTOC()          arcpy.AddMessage('Getting Doctor Map')     inNetworkDataset = "C:\Users\Ant\Documents\ArcGIS\OSMaster.gdb\ITN_Network\ITN_NetworkDataset"     impedanceAttribute = "Drive"     searchTolerance = "5000 Meters"     accumulateAttributeName = ["Length", "Drive"]     inFacs = "TL_doctorsv2"     inIncidents = "Sitepoint"     outLayerFile = "C:\Users\Ant\Documents\ArcGIS\ITN.gdb\ProxDocSites.lyr"     outNALayer = arcpy.na.MakeClosestFacilityLayer(inNetworkDataset, "ProxDocSites", impedanceAttribute, "TRAVEL_TO", "", 1, accumulateAttributeName, "NO_UTURNS", "", "", "", "TRUE_LINES_WITHOUT_MEASURES")     arcpy.na.AddLocations(outNALayer, "Facilities", inFacs, "", searchTolerance)     arcpy.na.AddLocations(outNALayer, "Incidents", inIncidents, "", searchTolerance)     arcpy.na.Solve(outNALayer)     outNALayer = outNALayer.getOutput(0)     subLayerNames = arcpy.na.GetNAClassNames(outNALayer)     tableName = subLayerNames["CFRoutes"]     if arcpy.Exists("ProxDoc"):         arcpy.Delete_management("ProxDoc")     outTable = "ProxDoc"     arcpy.CopyFeatures_management(tableName, outTable)


Speed drastically reduced when including geometry, is there a way to improve?

-- EDIT: Issue is that the shape files being used are at too small of a precision and way too large, output was 488M total, looking for different source -- I'm having some speed issues with a complex query that includes a geometry, but I've tried to distill it down to a smaller set. Postgres: 9.2.4 Postgis: 2.0.4 create table loc_shape (shape_id int, type_id int, name); select addgeometrycolumn('loc_shapes', 'the_geom', '4269', 'MULTIPOLYGON', '2'); indexes on shape_id, type_id and geometry populate . . . (4 types . . . 4245 records) Query info:               DB=> select shape_id, type_id, name from loc_shapes where type_id = '2';     Time: 4.358 ms                                     QUERY PLAN     ----------------------------------------------------------------      Seq Scan on loc_shapes  (cost=0.00..314.96 rows=3234 width=16)        Filter: (type_id = 2)          DB=> select * from loc_shapes where type_id = '2';     Time: 1034.859 ms                                          QUERY PLAN     -----------------------------------------------------------------      Seq Scan on loc_shapes  (cost=0.00..314.96 rows=3234 width=303)        Filter: (type_id = 2)      .004 without the geometry, 1.034 with the geometry, the only difference being the width. What can I do to optimize the return with the geometry? Is it better to store the geometries outside as a geojson file and merge the count / contains sets outside of the databases?


Statistically compare two density maps?

I (will) have a modelled distribution and an observed distribution of animals. If I were to interpolate these position datasets to reflect some density distribution (perhaps using a kriging interpolation method in the python HPGL), what would be the best way of statistically comparing one against the other? I am doing most of my post processing in python, so suggestions with a python solution are extra appreciated. Thanks!


Adding more fields in locator style to creat customized address locator

I have a database following the structure of "US Dual Range Addresses" and I want to, in addition of the fields used in dual range addresses, add more fields and I want to know what are the changes I have to make or the steps I should follow.


Is it possible to rename a field with the current date

I'm trying to figure out if it is possible to rename a field with the current date. What I am trying to accomplish is a table to table conversion, dropping a dozen fields, leaving only two fields, Name and Status. I want the Status field to be renamed to Status_yyyy_mm_dd. The script will then run a join field to another table, thus creating a history of the status field by day. I am running Arc 10.1. I have everything working, except the naming bit. Any help would be greatly appreciated.               import arcpy     import time          uiq = "uiq_data_set"     gdb = "c:\\Temp\\default1.gdb"     newFieldName = "Status_" + time.strftime('%Y_%m_%d')          arcpy.TableToTable_conversion(uiq, gdb, "uiq_historic", "", "Name \"Name\" true true false 255 Text 0 0 ,First,#,c:\\Temp\\default1.gdb\\uiq_data_set,Name,-1,-1;Status\"Status\" true true false 255 Text 0 0 ,First,#,c:\\Temp\\default1.gdb\\uiq_data_set,Status,-1,-1", "")


Shapely LineString and Polygon intersect?

here is my python code, it does not intersect and when I plot this in google map , I see the intersection. shapely.geometry is in Cartesian plane, how you are solving this?               l = "40.65:-114.07 40.21:-112.96 40:-112.66 39.4:-112.7 39.39:-113.28 39.68:-113.94 40.42:-114.26 40.6:-114.22"         points = [[float(x) for x in c.split(":")] for c in l.split(" ")]         print(points)         polygon = Polygon(points)         path = LineString([(42.049999,-96.25), (38.0880979565,-119.609216457)])         if path.intersects(polygon):             print("intersect")      ![here is the intersection on google map](http://i.stack.imgur.com/6Q9ej.jpg) here is my code for google map: https://gist.github.com/anonymous/8393151


tap on points on touch screen with openlayers

I have openlayers 2.13 along with geoserver 2.1.3. I have a vector layer where points created, after a CQL filter is activated. I have a click event for those points. In pc/laptop works fine, but in mobiles (iphone4s safari and android vimicro firefox) if I tap with my finger a point, nothing happens. I only load the openlayers library `<script type='text/javascript' src='OpenLayers.js'></script>` and zoom/pan on the map works in mobiles. CQL filter also works and the points are render in mobiles. But I can not tap them. How can I fix this ? Thanks in advance the code (I can provide more, if you think is neccessary):               mylayer = new OpenLayers.Layer.Vector("my layer", {renderers: ["Canvas", "SVG", "VML"]})          //Add a select feature control      var select_feature_control = new OpenLayers.Control.SelectFeature(mylayer, {multiple: false,toggle: true});          map.addControl(select_feature_control);          //Activate the control      select_feature_control.activate();          function selected_feature(event){     //do stuff     }      **EDIT** I have this now , trying to use `Control.GetFeature`               //create layer     mylayer = new OpenLayers.Layer.Vector("mylayer", {renderers: ["Canvas", "SVG", "VML"]})          //set protocol     var myprotocol = new OpenLayers.Protocol.WFS({         url:  "/geoserver/wfs",         featureType: "mylayer",         featureNS: "http://www.mysite.gr"     });          //set control     var select_feature_control = new OpenLayers.Control.GetFeature({       protocol: myprotocol,       click: true,       maxFeatures: 1,       clickTolerance: 1,       box: false,       hover: false     });          //add the control     map.addControl(select_feature_control);          //activate the control     select_feature_control.activate();          //register it an connect it with the function     pins.events.register('featureselected', this, selected_feature);          //the function - gets the id by splitting the fid     function selected_feature(event){     var sf = event.feature.fid;     var sfs = sf.split(".");     var sff = sfs[1];     showtext(sff);     }      thats the part of the cql filter               //pass the filter to the layer     var prot =  new OpenLayers.Protocol.WFS({         url:  "/geoserver/wfs",         featureType: "mylayer",         featureNS: "http://www.mysite.gr",         defaultFilter: filter_final});          var _CallBack = function(resp) {         pins.addFeatures(resp.features)     }               var response = prot.read({callback: _CallBack});               //refresh to render POIs     mylayer.refresh({force:true});      I can search the layer and see points on the map. But I still can not select in mobile. In pc, I can click a point, but the cursor of the mouse becomes hourglass and nothing happens. Can you spot what is wrong? Thanks a million


Openlayer not loading in middle

I am facing an issue to load the layer in middle. The layer is loading from the bottom right of the screen. How to get the layer in middle of screen. I am using `map.zoomToMaxExtent()` also. tried with `map.setCenter(new Openlayers.LonLat(lonvalue,Latvalue),0)`;               var bounds = new OpenLayers.Bounds(-268, - 405.489910347329, 10952, 4573.440469368996);     mapOptions = {             projection: new OpenLayers.Projection("EPSG:3997"),             units: "m",             numZoomLevels: 7,             maxResolution: 10,             zoom: 5,             maxExtent: bounds,            // center: [-12356463.476333,5621521.4854095],             controls: [             new OpenLayers.Control.Navigation({                         dragPanOptions: {                             enableKinetic: true                         }                     }),             new OpenLayers.Control.Zoom(),             new OpenLayers.Control.Scale(),             new OpenLayers.Control.MousePosition()]         };         map = new OpenLayers.Map('map-id', mapOptions);            map.addControl(new OpenLayers.Control.LayerSwitcher());        map.addControl(new OpenLayers.Control.MousePosition());             map.zoomToMaxExtent();


How to export a Vector Layer with OGR2Layers Plugin

I'm using QGIS 2.0 Dufour on my Linux (Ubuntu 12.10).I'm download shapefile of Croatia country from this site (http://www.gadm.org/country) and i added a new vector layer where i created some polygons. (a picture is attached). When i created OpenLayers HTML map using OGR2 layer plugin, desired polygons are not displayed in open street map. Where I'm wrong and if it is even possible. Sorry for my bad english. Thank you![Vector layer in QGIS](http://i.stack.imgur.com/KwTNr.png)


Effective way for creating Open Source Web mapping applications

Sorry for asking such a basic question, but these days there is lot of advancement on open source technologies. My requirements for my application are below   1. Basic Map application with zoom, pan, etc   2. Dynamic Attribute Query based on the Layer selected on TOC   3. Input Data is from mostly Shape files / PostGIS I know about GeoServer + GeoEXT or MapServer + Fusion or any other alternative if so please suggest But need advice from real programmers for extending the application in further and also wanted to know best open source web mapping practice. Thanks in advance


How to add CSV data with no coordinates to a polygon layer in QGIS?

I would like to add attributes from an spss database (around 300 cases) to a polygon layer in QGIS. Both datasets have a column with unique IDs. I exported the spss data to a CSV file which does not contain x,y values. The "add delimited text layer" plugin seems to require x and y values. How can I add the CSV data to the polygons?


How to process GRIB2 Data for Visualization?

My goal is to extract wind information from data provided to me in the GRIB2 format as it has been done in the attached image. I was curious if anybody had any experience with this format. I'm not sure if I am going in the right direction or what format I should be exporting it to. My end goal is to display this information through openlayers. So far, I have used gdal_translate to extract specific information ex. Temperature from band 25 (see command below).               gdal_translate -of Gtiff -b 25 weather.grib2 band25.tiff      I also have access to FME Desktop professional edition.


How can I use feature templates on layers with joins?

I find this particular feature of the ArcMap 10 framework quite annoying: When I define a join on any layer, templates cannot be added to the create features window. I have to remove all joins from the layer, then add the template, then modify/edit/add features and again define the join(s). In fact, when I use the Organize Feature Templates window to add the template on a layer with a join, it does not add it to the list and no errors are raised. However, if i remove joins from the layer the templates I've added while the layer had a join suddenly appear in the Create Features templates list. **Without having to do this programatically, Is there a way to use add templates on layers with joins?** (Assuming entering attributes that satisfy the join would somehow have to be enforced) When editing older maps I often forget that a layer has a join and it takes me a while to figure out I have to first remove it before I can use the templates to edit the features. **Even a message would be nice, i.e. _"You have to remove joins to use templates."_** or something like that but I suspect that this is not possible using a default tweak. Any ideas?


Bing Map REST API is not working

if i place the below URL in my browser http://dev.virtualearth.net/REST/v1/Locations?q=bangalore+karnataka+india&key= The response is below                   {     authenticationResultCode: "ValidCredentials",     brandLogoUri: "http://dev.virtualearth.net/Branding/logo_powered_by.png",     copyright: "Copyright Â© 2014 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.",     resourceSets: [     {     estimatedTotal: 0,     resources: [ ]     }     ],     statusCode: 200,     statusDescription: "OK",     traceId: "f54d507047604f1585db1e00254b9a7d|SINM000007|02.00.183.2300|SINMSNVM000034"     }      Not getting the resources Any issue in the URL?


Is there a time limit on post-processing GPS data with Pathfinder Office?

Do I need to post process my GPS data within a certain amount of time after collection? Do the services that provide the correction data to Pathfinder Office only make that data available for a certain amount of time?


How to write table blob field to file using ArcObjects?

I have a table with blob field and some others as well. I am trying to read blob field and save it to file using IBlobStream, and the thing compiles. The problem comes up in run-time, when calling blobStream.SaveToFile() method, saying:               'object' does not contain a definition for 'SaveToFile'      the following code:               int blobFieldID= table.Fields.FindField("MODEL_NAME");     int nameFieldID= table.Fields.FindField("MODEL");     ICursor cursor = table.Search(null, true);     IRow row = cursor.NextRow();     while (row != null)     {         IBlobStream blobStream = (IBlobStream)row.get_Value(blobFieldID);         blobStream.SaveToFile(@"C:\TEMP\" + row.get_Value(nameFieldID) + ".tbx"); //error         row = cursor.NextRow();     }      When i hover mouse over SaveToFile method it says:               (dynamic expression)     This operation will be resolved at runtime      I can't figure out what's the problem in here


ArcGIS: how to clear selection in Attributes Table with a keyboard shortcut?

ArcGIS: how to clear selection in Attributes Table _with a keyboard shortcut?_ I'm getting tired of going to Options, Clear Selection; I work with Attribute Tables frequently. Thanks!


Power Outage and ArcSDE

I'm working on a hostile environment. Power outages, despite our efforts to minimize them, are often here. Yesterday we had a power outage and we had 2 ArcSDE databases working. I have two sets of connections, that are essencially equal. The only difference is the instance that the database points to. Now, after the power outage, all connections we had pointing to our main server gets a bad login user and we cannot connect. I can connect trought oracle using that password. So, the database is fine. My guess that the problem is the service (when I direct connect it works fine too). I need to fix the service. Any ideas on how to do that WITHOUT running another post install? The host OS is sadly a Windows 7 Ultimate machine. I'm in the amazon forest, so please, be kind :P **Solution found** : deleted service. Recreated one tru command line, but it did not start. Deleted that one too and created one tru post-install. Seems to work. Thanks


How do I convert my coordinates to the limit of geographic region (outer edge)?

I am trying to use r.in.bin. The parameters of north, south, east, and west needs values: north=float Northern limit of geographic region (outer edge) south=float Southern limit of geographic region (outer edge) east=float Eastern limit of geographic region (outer edge) west=float Western limit of geographic region (outer edge) I only have the values for my map, which is in this format: north: 15N south: 10N east: 125E west: 120E rows: 6000 cols: 6000 How do I convert them?


How to draw lines of specified lengths in specified directions in Mapinfo?

I have an Excel file with the following data:               1) longitude and latitude which represents a point     2) Angle which represents where line turns from North     3) length of line.      Is is possible to draw these lines in bulk? Note : I know how to create these lines individually using a tool, but not in bulk.


How do I generate code from ESRI GPServer wsdl?

I'm trying to use svcutil to generate code from this GPServer wsdl. So I run this command:               svcutil GPServer.wsdl      Which generates ESRI_Currents_World_GPServer.cs. The code has comments saying the code generator "requires additional schema information", is there some other file I can pass to svcutil that has this additional info?               [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]     [System.ServiceModel.ServiceContractAttribute(Namespace="http://www.esri.com/schemas/ArcGIS/9.3", ConfigurationName="GPServerPort")]     public interface GPServerPort     {              // CODEGEN: Parameter 'Result' requires additional schema information that cannot be captured using the parameter mode. The specific attribute is 'System.Xml.Serialization.XmlArrayAttribute'.         [System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")]         [System.ServiceModel.XmlSerializerFormatAttribute()]         [System.ServiceModel.ServiceKnownTypeAttribute(typeof(Patch))]         [System.ServiceModel.ServiceKnownTypeAttribute(typeof(Field[]))]         [return: System.ServiceModel.MessageParameterAttribute(Name="Result")]         GetJobInputValuesResponse GetJobInputValues(GetJobInputValuesRequest request);      I get the same results with               svcutil GPServer.wsdl /ser:XmlSerializer      I'd like to implement the interface in a web service and have it appear to clients (like arcmap) as if it were arcgis server. Has anyone done this? **Update:** This article addresses the issue, but the solution is to change your WSDL so that it's compatible with svcutil. I can't do that, can I? **Update 2** It appears what I'm trying to do is referred to as "WSDL first design". Here's a good discussion. This description could apply to ArcGIS desktop as well as Microsoft office: > And this it may be counter intuitive for some people. The client > application, in this case, Microsoft Office, specifies the on-the-wire > contract, the WSDL. Lots of people have a server-centric design perspective, > and assume that the server defines the contract. That often makes sense, but > not in this case. Because there are so many deployments of Microsoft Office > out there, it makes sense for the client to define the contract. **Update 3 (Simplified summary)** Esri's REST API is open, yet incomplete. Some features supported by SOAP are not supported by REST, like cancelling a GP job. Since the wsdl is public, it should be possible to write a mapservice that implements both the SOAP and the REST API. Does anyone know of a tool that helps me implement a mapservice that adheres to Esri's SOAP contract?


Intersection between points and polygons in QGis

I have the following problem. I have a shapefile of points and a shapefile of polygons. I want to know WHAT points (not how many) fall inside EACH of the polygons of my multipolygon shp. I thought the "Intersect" function was the best option to deal with this, but actually it seems that it is implemented to intersect only polygons with polygons.In fact if I try to run it I get an empty table. I was wondering if any other function has been implemented to deal with this issue.


onSelect event on dynamically created layers

I'm creating different layers dynamically full of features, everything on-the- fly, and I need to do some stuff when each specific feature is selected. I can't paste the actual source code here as it has dependencies and it's quite long also, but you can imagine something like the following:               if (e.Bubbles) {          jQuery.each(e.Bubbles, function (i, obj) {              jQuery.each(obj, function (n, el) {                       /* features and layers ... */                  var point = new OpenLayers.Geometry.Point(el[1],el[0]);                       /* some code here ... */              });                   layer = new OpenLayers.Layer.Vector(i, {styleMap: e.Style});              map.addLayer(layer);              e.Layers.push(layer);                   /* etc. */      When I'm trying to bind the `onSelect` event to the layer, it works but it replaces the previous layer behavior, so the last layer in the `loop` works fine when you clicking on the features, but only the last layer. Here is my code (inside the loop):               selectControl = new OpenLayers.Control.SelectFeature(         Layer,         {             clickout: false,              toggle: false,             multiple: false,              hover: false,          }      );          selectControl.activate();          layer.events.on({         "featureselected": function(event) {         console.log(event.feature);         }     });      So, the `selectControl` will be replaced inside the loop each time and it will lose its own functionality for the previous ones, and just works for the latest layer. I tried pass all the layers as an array as well (which is supposed to work) but without any success.               selectControl = new OpenLayers.Control.SelectFeature(         e.Layers,         {             clickout: false,              toggle: false,             multiple: false,              hover: false,             onSelect: function(event) {                 console.log(event.feature);             },         }     );          selectControl.activate();      I hope somebody has been solve the problem!


Creating the node ids：Is this SQL error related to geometry type？

I loaded a **multilinestring** layer into PostGIS Manager： ![enter image description here](http://i.stack.imgur.com/diYlI.png) ![enter image description here](http://i.stack.imgur.com/QV8sZ.png) and use the SQL query, trying to get the table with the node ids：               ALTER TABLE split_4 ADD COLUMN source integer;     ALTER TABLE split_4 ADD COLUMN target integer;     SELECT assign_vertex_id('split_4', 800, 'geom', 'gid');      and got this error：               Error: Function StartPoint (geometry) does not exist     LINE 1: SELECT gid AS id, StartPoint (geom) AS source, EndPoint (geom) ...                           ^     HINT: did not comply with the specified name and parameter types of function. You may need to add explicit type conversion.     QUERY: SELECT gid AS id, StartPoint (geom) AS source, EndPoint (geom) as target FROM split_4     CONTEXT: PL / pgSQL function "assign_vertex_id" line 23 at target EXECUTE statement FOR      Is this error related to the **multilinestring** geometry？ I work under **WIN7-64bits** , with **postgres 8.4** , **pgadmin 3** , **PostGIS 2.0** installed, and download Windows Binaries of **pgrouting** ：pgRouting-1.03_pg-8.4.2.zip.


Displaying 3D city model from PostGIS 3D backend

I know that openlayers doesnt support 3D yet. I heard about Kartograph has 3D features but Does Kartograph support reading data from backend database especially PostGIS? I would like to create a 3D city model about my city. Is it possible from Lidar point cloud? And then I would like to publish it on the internet. So I would like to replicate street view like interactive map but not from pictures.


How to create styled markers with custom marker tooltip

How to create custom markers and when mouseover on marker i need a tooltip can any one suggest me how to do these type of markers...i need markers like below image ![enter image description here](http://i.stack.imgur.com/jYP6J.png) Thanks in advance


Referencing Qt UIs external to plugin with python

I'm developing a plugin that sets up a working environment for a user: loading layers (from db), applying styles and several custom designed (Qt) UI files etc. Primary user interaction is in the Attribute editor (Attribute Table) where there's a mix of Autogenerated and custom designed UIs. Some of the custom UIs contain Qt objects/widgets that I need to interact with e.g., a QPushButton and a QTabWidget with QWidgets. Since the plugin is only setting up the working environment, letting the user work freely afterwards, how can I react to user actions/events calling python functionality? From the following posts I get the notion that my plugin needs to act as the widgets launch platform to be able to send signals and listen on slots.   * How to reference to my in QT designer created buttons in python?   * Connect not working for custom QGIS form So, in short, I'm trying to interact with custom (Qt) forms external to my plugin. How can I accomplish this?


Which is better for storage? Geometry column or varchar?

Objective: Need to store and retrieve a list of geometries from the database. Basically these are drawn by the user using OpenLayers which I would like to save and present again as a list (kind of like a recent history). When user clicks on a certain item on the list then that feature is drawn on the layer. My way of going about it: With my existing code, I would like to construct the feature from the geometry using OpenLayers ie., each of the geometries are sent to the client(as coordinates sets understood by OpenLayers) via AJAX when the client page loads. I don't want to have a layer and display these via GeoServer. Question: With the above in mind, does it matter how I store the geometries in the backend (Postgres with PostGIS)? If yes, which is better, storing the geometries as `GEOMETRY` column or just as normal strings(ie., `varchar`)?


Importing Lat/Long coordinates as CSV file & only displaying single point in QGIS

I am using QGIS and trying to import Lat/Long coordinates as delimited text layer. All points show up in my attribute table, however, only one point is displayed on the map? Any ideas?


How to display ONLY local country names in google maps?

I am using google maps in an application where it is important that country labels display the country name in the local language. If you pass in certain language parameters that google maps recognizes, but doesn't fully support (language=ka here), it displays localized place names with english labels underneath: ![enter image description here](http://i.stack.imgur.com/WtLSi.png) Which is great, except that I don't want the English labels at the bottom. Is there any way to do this?


What is a simple binary raster storage format which ArcGIS can read?

I have a C++ program that manipulates raster digital elevation models. I have been using ArcGrid ASCII format for results. It is simple to code and gets the job done, but it necessitates a decimal output. This means a loss of precision in floating-point numbers. Is there a simple binary raster format which I could write to and ArcGIS could read from?


Value at a particular spot on Geoserver Heatmap

Geoserver is drawing from a PostGIS database to generate a heatmap using this SLD extension. Leaflet then overlays the heatmap over the base layer. **Question:** How can you determine the value at a particular spot on the heatmap? This value to display will be `color ramp value X * constant C`. In other words, how can we determine the color ramp value at that particular spot on the heatmap? There's probably other methods of finding this value without using the heatmap's color ramp mapping. ![enter image description here](http://i.stack.imgur.com/eTv77.jpg)


Refresh combo box in add-in

I've got an add-in with a combo box and want to refresh the list in the combo box after an event in one of the other tools in the same add-in toolbar. Can I call the combo box somehow to refresh it outside of the object's onSelChange event?


Black/white hatching pattern fills in QGis

I am looking to replicate black & white maps in QGis, using hatching patterns and greyscales to indicate different categories of a continuous variable (example below). It is possible/straightforward to do so in QGis? At first sight I only see color gradients and symbol fills. ![example](http://i.stack.imgur.com/FDvAE.png) ).


Why do these annotations appear stacked/overlapping?

I've encountered a strange problem while trying to populate an annotation feature class programmatically (ArcObjects, C#). As you can see in the image below, the characters in each text string seem to be stacking upon eachother, rather than laying-out horizontally as I would have expected. I'm pulling in several values from MySQL (created by a different application), and those look fine in the debugger. I've tried using a mixture of unknown/projected coordinate system, as well a few different Element interfaces. If anyone has seen and conqured this issue before I would sure appreciate a push in the right direction. Here's the relevant portion of my C#:               IFeature feature = featureClass.CreateFeature();          ITextElement textElement = new TextElementClass();     textElement.Text = textString;                         // value like: '183          IElement element = textElement as IElement;     element.Geometry = pointGeom;                         // Point: x=2986785, y=629058          (feature as IAnnotationFeature2).Annotation = element;     (feature as IAnnotationFeature2).AnnotationClassID = 0;     (feature as IAnnotationFeature2).Status = annoStatus;  // ESRI constant for 0, "placed"          feature.Store();      And as promised, here's a look at the results I'm getting: ![enter image description here](http://i.stack.imgur.com/gAH0u.png) **[Update]** Per @Radar's advice I tried the following revision, but it still renders stacked/overlapped annotation text:               ISymbolCollectionElement scElement = new TextElementClass();      scElement.CharacterSpacing = 5;      scElement.Geometry = pointGeom;      scElement.Text = textString;           (feature as IAnnotationFeature2).Annotation = scElement as IElement;      (feat as IAnnotationFeature2).AnnotationClassID = 0;      (feat as IAnnotationFeature2).Status = annoStatus;      Anyone have any additional insights? **[Second Update]** Basically I'm trying to accomplish what @murdoch did in this "old" ArcScripts post (see his second entry). I reviewed his approach again and noticed he's using the IFormattedTextSymbol interface, so I tried that, yet I continue to experience the same problem with stacked/overlapping text in the placed annotations. Here's my latest thrust of C#:               IFeature feature = featureClass.CreateFeature();          IFontDisp font = new StdFontClass() as IFontDisp;     font.Name = "Arial";     font.Bold = true;     // font.Size = 30;          // load in some reasonable default values..     IFormattedTextSymbol fmtTextSymb = new TextSymbolClass();     fmtTextSymb.Font = font;     fmtTextSymb.Size = 30;     fmtTextSymb.VerticalAlignment = esriTextVerticalAlignment.esriTVABottom;     fmtTextSymb.HorizontalAlignment = esriTextHorizontalAlignment.esriTHALeft;     fmtTextSymb.Angle = 0;     fmtTextSymb.CharacterSpacing = 100;     fmtTextSymb.CharacterWidth = 100;     fmtTextSymb.FlipAngle = 90;     fmtTextSymb.Leading = 0;     fmtTextSymb.WordSpacing = 100;     fmtTextSymb.Text = textString;  // my special text value..          ITextElement textElement = new TextElementClass();     textElement.Symbol = fmtTextSymb;     textElement.Text = textString;          IElement element = textElement as IElement;     element.Geometry = pt;          (feature as IAnnotationFeature2).Annotation = element;          feature.Store();      Anyone take issue with this? or have a favored-implementation? Here's what it looks like now; as you can see, the approach changed somewhat, but the results are the same: ![enter image description here](http://i.stack.imgur.com/SQsOu.png) **[Third Update]** On final analysis, the problem was not the code I used to create the individual annotations but as @Kirk Kuykendall revealed, the problem was how I initially created my AnnotationLayer with `IAnnotationLayerFactory.CreateAnnotationLayer()`. I was submitting `null` for the `IGraphicsLayerScale` argument, assuming it would resolve to functional, if not ugly, default values. Apparently it does not. I created that object as follows, and it fixed my problem:               // Set the map scale and units the annos should be "cooked for".     // To get ReferenceScale, open ArcMap and zoom to an appropriate level.      // In the Standard toolbar, click the 1:N button (tip says "MapScale").     // It'll output something like 1:1,200. Drop the 1: and the comma     // and that's the value you want for ReferenceScale.          IGraphicsLayerScale graphicsLayerScale = new GraphicsLayerScaleClass();     graphicsLayerScale.ReferenceScale = 1200;     graphicsLayerScale.Units = esriUnits.esriFeet; // this should agree with your proj      Voila! ![enter image description here](http://i.stack.imgur.com/oKobC.png)


Sequoia 2000 Benchmark data?

In reading about DBSCAN clustering it mentions the SEQUOIA 2000 Benchmark database was used for benchmarking. Is this data set available anywhere? Or, is there another set like it? So far my searching hasn't turned up anything.


Why "DataBase Connections" mapped to "Dataset DataBase Connections" in ArcCatalog?

I am trying to Export data from a geodatabase by a existed sde file(created by ArcCatalog), the Error Messges: > Executing: ExportCAD 'DataBase Connections\Connection to GIS- > WANG.sde\SDE.water\SDE.ControlValve' DWG_R2010 D:\117.DWG > Ignore_Filenames_in_Tables Overwrite_Existing_Files # Start Time: Thu Oct 13 > 16:46:59 2011 ERROR 000622: Failed to execute (ExportCAD). Parameters are > not valid. ERROR 000732: Input Features: **_Dataset 'DataBase Connections_** > \Connection to GIS-WANG.sde\SDE.water\SDE.ControlValve' does not exist or is > not supported Failed to execute (ExportCAD). Failed at Thu Oct 13 16:46:59 > 2011 (Elapsed Time: 0.00 seconds) Why "DataBase Connections" mapped to "Dataset DataBase Connections"?


What's the difference between Geographic coordinate system 4019 and 4121?

I have a DEM with cell size 100,100 with geographic coordinate system GRS_1980_Transverse_Mercator, Datum: D_GRS_1980. I created some extra shapefiles with projected coordinate system: Greek_grid, projection: Transverse_Mercator and geographic coordinate system: GCS_GGRS_1987 and datum:D_GGRS_1987. Adding them in ArcMap I have the message that my layers use different spatial reference which is reasonable because the shapefile datum was different from the DEM I am using. I checked online and found in http://edndoc.esri.com/arcims/9.2/elements/gcs.htm the geographic coordinate systems I am using. They are the 4121 and 4019. They look to have the same characteristics. Does anyone know why they exist with different names? Or am I missing something?               4121    GCS_GGRS_1987     GEOGCS["GCS_GGRS_1987",DATUM["D_GGRS_1987",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]          4019    GCS_GRS_1980     GEOGCS["GCS_GRS_1980",DATUM["D_GRS_1980",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]      Thanks in advance, chch


Displaying WFS Features Based on Zoom Level

I have a WFS feature layer with ~25,000 features and have been experiencing significant performance issues with my OpenLayers map. My first approach to solving this has been to pre-compute feature clusters on the server side, instead of relying on the clustering in OpenLayers. I wrote a script to cluster my features based on the resolution at each zoom level, and I placed the clusters for all of the zoom levels in my PostGIS database. My hope was to use a filter like the one below to select only those features in the database that are tagged with the zoom level equal to the current zoom level of the map:               function init() {                  var zoomLevelIndicator;             var renderer = OpenLayers.Util.getParameters(window.location.href).renderer;             renderer = (renderer) ? [renderer] : OpenLayers.Layer.Vector.prototype.renderers;                  map = new OpenLayers.Map ("map", {                 controls:[                     new OpenLayers.Control.Navigation(),                     new OpenLayers.Control.PanZoomBar(),                     new OpenLayers.Control.Permalink(),                     new OpenLayers.Control.ScaleLine({geodesic: true}),                     new OpenLayers.Control.Permalink('permalink'),                     new OpenLayers.Control.MousePosition(),                                         new OpenLayers.Control.Attribution()],                      maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),                 maxResolution: 156543.0339,                 numZoomLevels: 19,                 units: 'm',                 projection: new OpenLayers.Projection("EPSG:900913"),                 displayProjection: new OpenLayers.Projection("EPSG:4326"),                      layers: [new OpenLayers.Layer.OSM(),                          new OpenLayers.Layer.Vector("Filtered by Zoom Level", {                             strategies: [new OpenLayers.Strategy.BBOX()],                             protocol: new OpenLayers.Protocol.WFS({                                 version: "1.1.0",                                 url: "http://localhost:8080/geoserver/wfs",                                 srsName: "EPSG:900913",                                 featureNS: "http://localhost:8080/myworkspaceuri",                                 featurePrefix: "MyWorkspace",                                 featureType: "clusteredtestpoints"                             }),                             renderers: renderer,                                  filter: new OpenLayers.Filter.Comparison({                                 type: OpenLayers.Filter.Comparison.EQUAL_TO,                                 property: "zoomlevel",                                 value: zoomLevelIndicator                                  })                               })                          ]                       } );                  map.events.register('zoomend', this, function (event) {                 zoomLevelIndicator = map.getZoom();             });                           var switcherControl = new OpenLayers.Control.LayerSwitcher();                 map.addControl(switcherControl);                 switcherControl.maximizeControl();                       if( ! map.getCenter() ){                 var lonLat = new OpenLayers.LonLat(lon, lat).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject());                 map.setCenter (lonLat, zoom);             }         }      Specifically, I am trying to update the zoomLevelIndicator variable each time a zoom event occurs. When I test this, the features for the initial zoom level show up, but do not update when I change the zoom level. Does anybody have any ideas as to why this is not working? Thanks, -Rob


Error ArcMap 10.1 - "The geometry is not M-Aware"

I'm trying to use the ModelBuilder in ArcMap 10.1 in order to use the Clip function. Even though I did the exact same steps in entering input and output as a collegue of mine, I keep getting the error "invalid characters: The geometry is not M-aware". Any help sorting this mess out will be highly appreciated. All the best


Accessing ArcGIS layers from separate thread using ArcGIS Engine?

I've got an ArcEngine application, referencing a MXD for it's data (and map display). I'm running a query against all layers, so can take quite some time. I would normally run the query in a separate thread, which would allow me to return the results as they come in for each layer, rather than wait till all are layers are queried, then return a giant result set. The limitation however is that I can't access any of the existing ArcObjects in my second thread, due to the STA threading model of ArcObjects. The only way around it at this stage, appears to be to re-create my data environment from scratch in the second thread, simply for querying. The problem with this approach is that the layers have joins and attribute queries against them. For a number of reasons, it's just not a simply exercise to go this route. I've looked at the IXMLSerialize interface, hoping to find some object, which would allow me to bridge between threads, which I could deserialize/serialize, but nothing sprang out to me. Any other ideas? UPDATE: Because it was so important that I query against the layers, not the datasource, at this point, I save the search layers to .lyr files, then in my second thread, load them using the ILayerFile interface. This then gives me access to the layers with joins/relates/definition queries intact. The problem at this stage however, is that the ILayerFile.Layer call is very slow. So am looking for a way to speed that up. The threaded search does however perform wonderfully, and has improved the UI greatly!


Problem with SetValue method in ArcGIS 9.3

I am trying to make a python script for ArcGIS 9.3. I have a problem with the SetValue method. I try to use it in a very simple code but it still doesn't work : No error is return but my field is not populate. The code is the following :               import arcgisscripting     gp = arcgisscripting.create()          gp.workspace = r"Z:\PPR\PPR76\Tentative Macro Amelioration MNT"          try:              input = gp.GetParameterAsText(0)         field = "TEST"              rows = gp.UpdateCursor(input)         row = rows.Next()         while row:             expression = 3             row.SetValue( field , expression)             row = rows.Next()     except:         print gp.GetMessages(2)      Thanks for your help


Dynamic data on overlay layer in openlayers

I am using openlayers to visualize an industry using image as the layer. On the raster layer I have created an overlay layer.Is it possible to show updated values (dynamic runtime values - as integer) in the overlay layer that gets updated every second? If so please help me how to get this done in openlayers.