How to save and load elements to/from a layer in correct z-order?

I copy elements from one layer to another like this:               IGraphicsContainer container = _mapControl.Map as IGraphicsContainer;     IGraphicsContainerSelect containerSelect = container as IGraphicsContainerSelect;          containerSelect.SelectAllElements();     IEnumElement enumElement = containerSelect.SelectedElements;     enumElement.Reset();          IElement element = enumElement.Next();     while (element != null)     {       int zorder = 0; // How to get this?       layerContainer.AddElement(element, zorder);       element = enumElement.Next();     }      This works fine so far but I obviously like to preserve the element's zorder. I tried to get the zorder with `graphicsContainer.GetElementOrder(enumElements)` which returns an object (COM object). Well, but what to do with that one, eh? How can I get the zorder of an element? **Update** The `enumElement` is already in the correct order (Thanks, Kirk). I now took a deeper look into it. The elements get saved in the correct z-order, but when I load the layer from file (with `IMapControl.AddLayerFromFile`) they appear in reversed z-order every time. I tried to save them with reversed z-order but on the loaded layer they still appear in the wrong z-order. How can I load the layer with the elements in correct z-order?


Geoserver, OpenScales and flex 3

I am using GeoServer, OpenScales Flex 3 for my web-mapping application, is there any source for the Flex OpenScales API to display the maps. additional from a comment I am working on a project to display the weather data in online. I have loaded point and polygon shapefiles into PostGIS and created a PostGIS store in GeoServer. Using Adobe Flex 3 and OpenScales i have designed and displayed the both shapefile as WMS and WFS. Now i want to display animated GIF in the map. any idea.... thanks in advance..


ArcObjects 9.2 SDK: How to intersect two SelectionSets (in-memory pointers) and return a FeatureClass?

[ **Update** ] Since posting this question, I've come to the conclusion I'm not fighting flaws in the BasicGeoprocessor object, but more likely having issues with poor object lifecycle management on my part (there is some helpful info cited by @blah238 in this thread). I accepted @Jakub's answer to close the question so it won't appear in the unanswered questions list perpetually. However, at present I believe there's nothing wrong with my BasicGeoprocessor implementation, and the issue is related to hanging references elsewhere in my code. * * * [ **Edited** ] I maintain a small ArcObjects solution using the 9.2 SDK ~~that isplagued by inconsistent failures in its `BasicGeoprocessor.Intersect()` implementation~~. It seems to be failing more frequently than it succeeds. While it succeeds on every first run, it tends to fail on subsequent attempts. Although, sometimes it still works on the second run, so it's been difficult to truly isolate the cause of errors. ~~I'd certainly ratheruse this approach and apply the Geoprocessor, but it can only do wholesale intersections at the shapefile level, and I only want to intersect two in-memory `SelectionSet` objects. Could the `ITopologicalOperator` do this? In the past I've been unable to make it work on real-world data, and it seems some others have too.~~ Here's the relevant block of code calling the `BasicGeoprocessor`. It's argument variables are explained in the comments, and if you follow the link above, you can see the example it's patterned after. I suspect my references to either `parcelTable`, `soilTable`, and/or `parcelFCursor` may be lingering between calls, creating the errors.               'perform intersection     Dim BGP As IBasicGeoprocessor     BGP = New BasicGeoprocessor     BGP.SpatialReference = parcelFeature.Shape.SpatialReference          Try         'THE VARS ARE AS FOLLOWS. THEY ALWAYS LOOK GOOD IN THE DEBUGGER:                 ' parcelTable and soilTable are ITable         ' True (useSelectedInput argument)         ' True (useSelectedOverlay argument)         ' 0.0# (the mythical Tolerance value, I've also tried 0.0, and 0)         ' pFCN (IFeatureClassName)              intersectFC = BGP.Intersect(parcelTable, True, soilTable, True, 0.0#, pFCN)          Catch ex As Exception              MsgBox("unable to intersect input data")         Exit Sub          End Try          '(blah238's answer, first link above, suggests this is **NOT** the way to do this)     'Clean up. This chunk shows all the variables preceding the Try block, too.      parcelLayer    = Nothing 'IFeatureLayer     parcelFC       = Nothing 'IFeatureClass     parcelFeatSel  = Nothing 'IFeatureSelection     parcelSelSet   = Nothing 'ISelectionSet     parcelFCursor  = Nothing 'IFeatureCursor     parcelFeature  = Nothing 'IFeature      parcelTable    = Nothing 'ITable          <--- I think this one is the culpret.     parcelSF       = Nothing 'ISpatialFilter     soilLayer      = Nothing 'FeatureLayer     soilFC         = Nothing 'IFeatureClass     soilSelSet     = Nothing 'ISelectionSet     soilTable      = Nothing 'ITable          <--- and or this one.     pWSN           = Nothing 'IWorkSpaceName     pFCN           = Nothing 'IFeatureClassName     pDSN           = Nothing 'IDataSetName     intersectFC    = Nothing 'IFeatureClass     BGP            = Nothing 'IBasicGeoprocessor      I'd love to know what other folks are doing to perform in-memory intersection on `SelectionSet` objects or if anything stands out as obviously wrong here. As always, thanks so much for any assistance and insights you have.


postgresql how not to show the first result returned st_distance

I have a query that calculates the distance away from a given point, however currently my query returns the point I am actually querying a distance for. How would I prevent site 1 from showing in my results? Site 1 = 0.00km site 2 = 0.15km site 3 = 3.5km `st_distance(the_geom, st_geomfromtext($geomdistanceaway,27700))::numeric(10,2) AS distanceaway from distancetbl ORDER BY distanceaway asc limit 3`


How to generate a grid programmatically in Python without GUI?

Is there a QGIS Python binding for generating a grid programmatically without using the GUI?


Making a layer read-only in arcgis 9.3.1

Is there a way to make a layer (a independent shapefile or a layer in a SDE gdb) read-only - so that people will be able to see it but not edit it? (I'm using 9.3.1)


Incorporating Length of Route Value into Cost Evaluator Function (ArcGIS Network Analyst)?

A friend and I (who more frequently than I posts on this board) are creating a walking network and we have run in to a snag. We would like to attribute a cost evaluator to our network dataset using a self determined safety metric. We have the equation set up so that all we need to do is divide a field value based on the length of a route to get our "safety value". We just need to know in the cost field how to write the vb script or other evaluator so that Cost Value=[FieldValue]/"total length of individual route". Each route length will be different once each analysis is run, but we have a length value for each line segment, so we know there should be a way that adds up these pieces for the route for a total route length that can be divided by our field value. It seems like it should be a simple script line or something to put in the field evaluator box. Any suggestions? Thanks


Limit data imported into PostGIS database?

I am building a web application in which members will be able to find other members in their area. This is your typical "nearest neighbor" search which I'll perform using their latitude and longitude. I'll do the geocoding using one of these searches:               1. Search by street address + city + region + postal code + country     2. Search by postal code + country     3. Search by city + country      I plan to use OpenStreetMap data imported into a PostgreSQL 9.1 database using PostGIS 1.5.3. I'll use Nominatim as my geocoder because my users can be anywhere in the world. The problem is that I only have a small 8-CPU Debian 7 VPS server (on linode.com) with 1-GB of RAM while the compressed planet OSM file is around 30-GB. I'm afraid I won't be able to load that much data with so little RAM. And even if I can load it, it will take forever. What I really need is a server with 16-GB of memory but they're very expensive and I'd only need a server that size to initialize my geocoding server and perhaps to do quarterly updates. Here are my questions:   1. Which loader should I be using to put the data in an optimal format for the geocoding queries shown above? I've loaded a small Illinois .pbf file using osm2pgsql but there is also Osmosis and Imposim. I've read that Imposim is good if you have limited memory but I read that osm2pgsql might be best if I'm geocoding.   2. Can I reduce the loading time with one of these loaders by only loading those elements that are needed to perform the above geocoding queries? If so, which elements are needed for the loader in question? osm2pgsql mentions "import styles" while Imposim has a mapping file.   3. Would it perhaps be a good idea to spin up an Amazon EC2 or RDS server to download the planet file and load the data into a database and then back that data up, copy the backup over to my linode, and restore it there? This would save me the cost of upgrading to a more powerful linode. Thanks for your response!


What prevents GRASS and SAGA integration into QGIS when users aren't administrators?

Windows version of QGIS 2.0 using the stand alone installer. I have been able to tie up the functionality using the Options and Configurations settings in the Processing menu. This works fine in a standard PC and logged in as an "administrator". However something is preventing it from working with the same QGIS setup conditions when not logged in as administrator. Can anyone shed any light on what might be happening here - especially what process the Processing tools go through when a non-QGIS module is activated. Non-administrators cannot write to the QGIS folder, nor can they put executable files into temporary folders. Could it be one of these issues?


Cropping Geotiff with gdalwarp

I downloaded a geotiff from the recently published 25m-DEM of the European Union (see: http://courses.neteler.org/eu-dem-new-digital-surface-model- at-25m/). One tile has about 5GB so I would like to crop it to a smaller extend. I'm trying to use `gdalwarp` but I can't figure out the correct commands ... Here's my **bounding box** : `N48 W15 S43 E5` This is **the command I tried** :               gdalwarp -of gtiff -t_srs EPSG:3857 -te 5 43 15 48 input.tif output.tif      This is the **error message** that `gdalwarp` returned: > "Creating output file that is 0P x 0L. ERROR 1: Attempt to create 0x0   >  dataset is illegal,sizes must be larger than zero." ... could anybody give me a hint, please? Thank you, Ralf


What are the benefits of Multipart Features?

Multipart points, lines, and polygons are implemented in nearly every GIS, but what benefits, if any, do they provide? In a relational database attributes shared by different features can be stored once, and IDs used to link them to separate geometry records. So are multipart features a legacy of flat file data storage? ![alt text](http://i.stack.imgur.com/qkMqx.gif)


Has anyone successfully made a FeatureLayer from a view in DB2 and ArcSDE 10?

Lately it seems like every new ESRI feature fails for me - I must be cursed. I'm testing the use of a FeatureLayer to see if helps display and query features using the JavaScript API 2.0. This layer was registered with ArcSDE from a view. The data is in a DB2 database. We have used the view for a long time in a MapService on our server. I copied the MapService MXD to a new file and published it as a FeatureLayer. As a MapService it shows up in ArcCatalog and can be previewed. It also shows up in ArcGIS Service Manager. The MapService doesn't show up in the ArcGIS Services Directory page. If I enter the URL in a browser, it returns an error. If I try to add the layer to a JavaScript API map, it raises an error **"missing } in XML expression"** in Firebug for the script arcgis?v=2.0, line 52. Is there anybody who's used a FeatureLayer successfully? Any pointers or hints?


ArcGIS 10.2 Broken Project Data Source Error when publishing a Geoprocessing Service

I have a python script that creates a temporary feature class, creates a feature layer from the temporary feature class, uses the feature layer, then deletes the feature layer and the feature class. When I try to publish the python script as a Geoprocessing service I get an ERROR saying that my project contains a broken project data source on my temporary feature layer. So far my work around is to leave the temporary feature class in my workspace. Is there a way to delete it before the process completes? Here is the code snippet that generates the error:               acadian_holder_fpath = "\\\\my_server\\GIS\Geodatabases\\Acadian_Holder.gdb\\Acadian_Holder_Dataset\\Acadian_Holder"     xxcrown_fpath = "\\\\my_server\\GIS\\Geodatabases\\Temp_WorkSpace.gdb\\xxholder_src"     arcpy.analysis.Select(acadian_holder_fpath,xxcrown_fpath,"LOC in ('BB','BC','BM','IQ','JC','JN','JS','JW','PH','QB','RB','RG','RS','SQ','SV','UG')")     dnr_regions_fpath = "\\\\my_server\\GIS\\Geodatabases\\Acadian.gdb\\dnr_regions"     xxregions_fpath = "\\\\my_server\\GIS\\Geodatabases\\Temp_Workspace.gdb\\xxregions_src"          arcpy.analysis.Intersect([xxcrown_fpath,dnr_regions_fpath],xxregions_fpath)          arcpy.management.Delete(xxcrown_fpath)          at_road_network_fpath = "\\\\my_server\\GIS\\Geodatabases\\connection_to_my_sde.SDE\\AT_Road_Network"          # Use select by location instead of intersect so we get the entire road if it exits crown land.          at_road_network_flayer = arcpy.management.MakeFeatureLayer(at_road_network_fpath,"at_road_network_flayer")          xxregions_flayer = arcpy.management.MakeFeatureLayer(xxregions_fpath,"xxregions_flayer")          # Select YTD roads          where_clause = "Region = 1 or Region = 3 or Region = 4"     arcpy.management.SelectLayerByAttribute(xxregions_flayer, "NEW_SELECTION", where_clause)     arcpy.management.SelectLayerByLocation(at_road_network_flayer, "INTERSECT", xxregions_flayer)          # Do stuff with at_road_network_flayer               # Delete the temporary feature class          arcpy.management.Delete(xxregions_flayer)     del xxregions_flayer     arcpy.management.Delete(xxregions_fpath)


Trip travel matrix on OSM data

Here's my situation:   * I'm modeling travel logistics   * I have 1,000 nodes, on my road network   * I'd like to generate the minimum driving time distance between all these nodes   * This process will be done 24 times (24 hours / day) Is this possible?


Is there a way to locally add links to an OSM data set

Here's what I'm trying to do:   * I'm modeling some transportation logistics data   * I want to test the effects of a "new highway" on existing travel demand   * The new road will be created from an arbitrary point (usually not on the existing roadway) to any point on the road network (road line layer)   * The new road should acquire the same fields / attributes as the road it connected too Is this possible with OSM data?


How can I display raised error messages to the user in the ArcGIS geoprocessing results window?

Question: Can print statemnts raised from a custom exception be displayed in the gp results window? Background: I modified a script that I found that takes two inputs from a user, finds the associated feature, then zooms to the feature. The tool works fine. I am trying to make it more user-friendly by automatically formatting the inputs to have the correct amount of characters. I added a messagebox that tells the user if they have too many characters in the input box, but I used easygui to create that (a Python library for GUIs). Instead, I would like to use the gp results window to display the message. I thought that I formatted the raise and except statements correctly but the tool runs and I get a completed result and not my error message. I tried the arcpy help from esri and did not get the results I was looking for.               class BadInputError(Exception):         pass          # Import arcpy module     import arcpy, sys, string     from arcpy import env          try:         def checkInput(inp):             mNCount = len(inp)             trigger = 0             while trigger == 0:                 if  mNCount == 4:                     trigger = 1                 elif mNCount > 4:                     inp = ''                     trigger = -1                     raise BadInputError                 elif mNCount == 3:                     inp = '0' + inp                     trigger = 1                 elif mNCount == 2:                     inp = '00' + inp                     trigger = 1                 elif mNCount == 1:                     inp = '000' + inp                     trigger = 1             return inp                   # Script arguments         MapNumber = arcpy.GetParameterAsText(0)         MapNumber = checkInput(MapNumber)         ParcelNumber = arcpy.GetParameterAsText(1)         ParcelNumber = checkInput(ParcelNumber)              Expression = (""" "MAP" = '%s' AND "PARCEL" = '%s'""") %(MapNumber,ParcelNumber)              # Local variables:         GISData_GISDATA_CAD_PARCEL2009_WHOLE = "Database Connections\\GISUser.sde\\GISData.GISDATA.CAD_PARCEL2009_WHOLE"         Output_Layer_Name = Expression         Output_Layer = "ParcelSelection"              # Process: Select Layer By Attribute         arcpy.SelectLayerByAttribute_management("2009 Parcel Points", "NEW_SELECTION", Expression)              # Zoom to Selected Features         mxd = arcpy.mapping.MapDocument('CURRENT')          df = arcpy.mapping.ListDataFrames(mxd, "Layers") [0]          df.zoomToSelectedFeatures()         df.scale = 8000         arcpy.RefreshActiveView()          except BadInputError:         print "Too many characters.  Run again"          except Exception, e:         # If an error occurred, print line number and error message           import traceback, sys         tb = sys.exc_info()[2]         print "Line %i" % tb.tb_lineno         print e.message


how to assign keyboard key to python script in arcmap

I have a python script and I use it through my toolbox but I use it many times in a day. Is it possible to assign a keyboard shortcut to my tool ?


calculate value using maximum value from different feature class

I'm trying to get the maximum numeric value from one feature class and use that value in an expression to calculate values of a different feature class. fc2.bldg_id = max(fc1.bldg_id)+1 Can this be done using the advanced field calculator? If so, what would my syntax look like? Do the feature classes need to be in the same fgdb and feature dataset? Thanks in advance.


Getting unique value records from a field

Building a desktop application using C#.net and arcobjects. I'm trying to retrieve records from a shape file using IQueryFilter. Having trouble writing the where clause in my scenario and the applicable logic. Here is the scenario. I have a **'Category'** and **"Completed"** field.( both are of type string ) What I need to do is , for a given category to see whether all the values in the **completed** field are unique. if values are not unique I need to display those records out. Sample data ![alt text](http://i.stack.imgur.com/CgdLO.jpg) In the above example Category B and C does not have unique values. So all these records for B and C should be displayed. I suppose a using an IQueryFilter interface should work. But puzzled on how I can achieve this by using a correct where clause. ( I just need to get where the combination of Category and Completed fields are not unique) Please help.... Thanks


Annotation stored in a database is not showing my leader lines

I am using 10.2.2, I initially tried to use just plain annotation to label my features. This however was not useful as it was very laggy and took at least 30 sec or more to choose each individual annotation. ESRI help did not have a clue as to why this was happening. We tested and showed that storing the annotation in a database was much quicker. This being said, I really need it to have leader lines, when I initially labeled the features I did make the label the way I liked with the leader lines, once it got into the annotation format in the database the leader lines mostly disappear and the ones that show up disappear when I adjust the label. I am using Microsoft Windows 7 Enterprise ![a snapshot of leaderlines, some show but when I move the annotation it dissappears](http://i.stack.imgur.com/lfRtH.png) ![leaderline menu](http://i.stack.imgur.com/8HA1y.jpg) Any clue to why this is happening would be wonderful! This map was needed last week! Thanks!


How to interpolate temperature correctly?

I tried to interpolate the mean avyerage annual temperature to produce a "realistic" surface.In qgis I used Raster-Interpolation-Interpolation. Both methods TIN and IDW did not deliver a "realistic" surface (e.g. compared to a good map in an atlas). ![IDW with factor 3](http://i.stack.imgur.com/vLyIw.png) ![TIN linear showing also my interpolation points](http://i.stack.imgur.com/lZKqU.png) any hints howto get a "better, more realistic" interpolation?


What is the opposite of height?

Considering that _depth_ denotes the distance below sea-level to a point on an object located below sea level, and considering that _height_ denotes the distance to some point above the surface of the earth as measured from a point on surface of the earth, it seems there ought to be a term that denotes the distance to some point below the surface of the earth as measured from a point on the surface of the earth. For example, suppose someone dug a mine shaft down into the earth from an elevated point, but not so far down that it descends below sea-level; what term ought we use to denote the points below the surface of the earth?


How to bulk print maps using ArcGIS or QGIS?

I have a polygon layer that I would like to print images or PDFs from in bulk as there are a large number of them. Rather than having to manually scroll and print each individual'site' in the print composer (QGIS 2.0 or ArcGIS 10) are there any tools that I could use or scripts etc?


Disable panning/dragging on leaflet map for div within map

This may be a bit trivial, but does anyone know how to suppress panning when you click and drag over top of a div box embedded within the map itself? Not sure if this question has been asked in another way, but getting at the same thing, but i do not see it. For example here, when you click and drag over top of the legend, the map drags with you. I want to suppress that function. I am aware if this technique, but i want to know if this is the only way:               map.dragging.disable();      Thank you. P.S.: Please grant me a thumbs up if you found this relevant, so that i can begin to give others credit for their great answers on other questions. Cheers.


How to create several header files to open AVHRR NDVI3g (GIMMS) files?

I have downloaded GIMMS NDVI3g data from http://ecocast.arc.nasa.gov/data/pub/gimms/3g/ I now need to open the files in arcgis. I have the follwing GRID PARAMETERS:               grid-name: Geographic Lat/Lon         pixel-size: 1/12=0.0833 degrees          size-x: 4320         size-y: 2160          upper-left-lat: 90.0-1/24         upper-left-lon: -180.0+1/24         lower-right-lat: -90.0+1/24         lower-right-lon: 180.0-1/24      I want to ask if someone has worked with these files yet since the release is recent and how you opened the files? And if a header file is needed how do I create multiple header files in one step? (there are 700 files covering 3 decades)... Best regards, Johan


Merging attributes from parcels within a census tract

I am working with land parcel data and Arcmap 10.1. Each land parcel has a code (1,2,3,4) depending on the type of water supply source that it uses. I am trying to take a tally of each code within each census tract. I've been able to devise a very primitive method to do this:   1. Load parcel layer (points) and census tract layer (shapes)   2. Select one census tract, and use "Selection by Location" to select all parcels that fall within the census tract.   3. Open attributes table   4. Copy and paste into Excel   5. Use Excel to get the sum There are around 4000 census tracts, and I would have to do this for every parcel. I then tried spatial join. However, there are too many data points for the computer to handle. Once I can get a spatial join, then it would be very simple. I have other data that is much more manageable, and I tried spatial join and tallying up the data by forming a new field on the attributes table, and it worked. The main problem is that spatial join is taking way too long.


Translate coordinates in GeoJSON export

I am wondering if there is a way to apply a translation in coordinates for a GeoJSON export. Currently, there are negative coordinate values in my export, which I cannot have. I am trying to use this GeoJSON data to create a map in javascript, and I consulted the developers of the javascript library and was told that if my x values were translated 160, making them positive, the map would display correctly. Is there an easy way to translate these values in the export or possibly do this with an expression? I am very new to QGIS so I am unsure how to approach this problem. Basically, I want to change values like this               [ -160.07380334546815, 22.004177347957729 ],      to this               [ 0.07380334546815, 22.004177347957729 ],


In ArcMap 10.2, exporting raster as .tif with "use renderer" and "force RGB" still produces inaccurate colors

I have a DEM and my aim is to change its color ramp using ArcMap, then export this colored raster as a geotiff (8 bit). I checked "use renderer" and "force RGB" options but the results are not good (EDIT: when viewed in ArcMap). With some color ramps, the results are really off, and with others, they are slightly off. For example: ![example 1: in ArcMap](http://i.stack.imgur.com/1hsJd.jpg)![example 1 exported](http://i.stack.imgur.com/DlwSQ.jpg) ![example 2: in ArcMap](http://i.stack.imgur.com/E7ZFO.jpg) ![enter image description here](http://i.stack.imgur.com/RfpHM.jpg) Is this a bug, or is this an artifact stemming from the the original image being simplified into an 8 bit image? (Does ArcMap stores its color ramps with more than 8 bits?) EDIT: it seems that results only look strange in ArcGIS - if viewed in other applications, colors look right. So why is ArcMap displaying the exported rasters inaccuractly? Do I need to change some settings somewhere to have them display correctly?


How to solve an "Error found when retrieving conflicts." error in ArcMap?

I uncovered this error when testing ArcMap 10 SP2 for a customer: ![enter image description here](http://i.stack.imgur.com/p4rTT.png) This occurs when the conflict is detected--ArcMap is attempting to show the conflicts window but fails. I get this error on all workstations at the customer's location (all Windows XP). But I don't get the error on my systems (I've tried XP and Windows 7). I've tried various oracle/sql server combinations and I still receive the error on the customer's workstation. It appears to be a compatibility issue and I have an open Esri incident which hasn't yielded any results, so I thought I'd tap the gis.se. Has anyone experienced this error with this set(or similar set) of conditions? _Update From Comments:_ I initially got this in an Oracle10/9.3.1 sde database, but also replicated the error with a sqlexpress/arcsde 10. I only have this issue with the customer's ArcGIS Desktop workstations and each experience the same issue. **Data from crash:**               00:04:14.578: First chance exception 0xC0000005 (Access Violation) occurred in "c:\program files\arcgis\desktop10.0\bin\VERSIONUI.DLL" at address 0x39458983.     00:04:14.578: LoadLibraryW("DbgHelp.dll") called from "c:\program files\arcgis\desktop10.0\bin\AFCORE.DLL" at address 0x00714A04.     00:04:14.594: Loaded "c:\program files\arcgis\desktop10.0\bin\DBGHELP.DLL" at address 0x0B770000.  Successfully hooked module.     00:04:14.594: DllMain(0x0B770000, DLL_PROCESS_ATTACH, 0x00000000) in "c:\program files\arcgis\desktop10.0\bin\DBGHELP.DLL" called.     00:04:14.594: DllMain(0x0B770000, DLL_PROCESS_ATTACH, 0x00000000) in "c:\program files\arcgis\desktop10.0\bin\DBGHELP.DLL" returned 1 (0x1).     00:04:14.594: LoadLibraryW("DbgHelp.dll") returned 0x0B770000.     00:04:14.610: GetProcAddress(0x0B770000 [c:\program files\arcgis\desktop10.0\bin\DBGHELP.DLL], "MiniDumpWriteDump") called from "c:\program files\arcgis\desktop10.0\bin\AFCORE.DLL" at address 0x00714A14 and returned 0x0B7CD4F0.     00:04:14.610: Second chance exception 0xC0000005 (Access Violation) occurred in "c:\program files\arcgis\desktop10.0\bin\VERSIONUI.DLL" at address 0x39458983.     00:04:14.657: Exited "c:\program files\arcgis\desktop10.0\bin\ARCMAP.EXE" (process 0xC0C) with code -1073741819 (0xC0000005).      **New Information (8/4)**   * Client is getting this in ArcGIS 9.3.1 as well--they so seldom get conflicts that this hasn't been an issue until now.   * I'm nearly certain that this issue is caused by some other software that was pushed out to these machines. _We're still troubleshooting and I'll update this question with an answer once I know more._


Why does my text symbol change when .mxd is converted to pdf?

I copied a small bit of text from a word document into a label which had the ' ← ' symbol in it (2190, alt+x). Whenever I export the map to a pdf, the '←' symbol becomes a spiral. If I make the arrow symbol bold, it becomes a fleur de lis in the pdf. I have tried checking the 'Embed All Document Fonts', 'Convert Marker Symbols to Ploygons', changed all the Picture Symbol settings and nothing seems to keep the arrow from becoming something else. It does not appear to matter if the text is a label taken from the attribute table, a Label Expression or is an annotation as the end result is the same. ![Where did my arrow go? aka wicked awesome fleur de lis ](http://i.stack.imgur.com/7QHhI.png) If I save the word document as a .pdf, the arrow remains an arrow and does not change. Additionally, if the text with the spiral/fleur de lis is copied from the map pdf and pasted into Notepad, the spiral reverts to an arrow. I realize there are _many, many_ workarounds to this problem (not using the arrow, inserting a symbol etc), but I am more curious as to **why** it only seems to happen in ArcMap. It is now a matter of stubbornly trying to keep the arrow from being converted by ArcMap as a matter of principle. Does anyone have any insight on why this occurs / how to keep the arrow? **_Solution_** By using               "<FNT name = 'Arial'>" +  ' ←' + "</FNT>" + ' Pathway to Moosehide Village '        it came out fine. Thanks for all the suggestions.


How to script shapefile editing with open source tools?

I would really like not to disturb anybody and find my answer by a Google search, but I don't really know where to start. I have a .shp vector layer with several points on streets, each having a list of attributes (about 40K). I want to create a line between certain points. For example: I at the corner of a street, one point has an attribute "East", the one facing it an attribute "West". I want to streamline a process where (for example) every point with the attribute "West" from a particular street (included in the attribute) is connected to the corresponding "East" point. In short, how to script modifications, based on attributes, on a .shp? The output has to be a shapefile. Could you please guide me to some relevant documentation please? I don't have ArcGIS. Thanks a lot!


Landscape software to analyze amount of dirt moved

I'm about to embark upon a design project for re-contouring landscape around my home. Assuming I get an accurate measurement of the landscape into the computer, and after I modify the landscape model to represent the proposed result, I want to produce the 'diff':   * A visual representation showing the volumes where dirt needs to be removed.   * A visual representation showing the volumes where dirt needs to be added.   * A report of the actual volume of dirt being moved (the sums of those volumes).   * A report of the delta (+/- of dirt that will be needed, or will need to be removed). What software exists that can produce this report for me? I will prefer inexpensive software and software that is easy to learn quickly, but will accept any that meets the above criteria.


Is there a way to automatically increment the Version value in the Config.esriaddinx file?

I don't think there is an out-of-the-esri-box way to do this, but has anyone hacked up a way to change this value automatically for a build? Perhaps using a pre-build event command?


How to create a raster from scratch

I realize this isn't a geographic question as I'm not trying to make this into a geographically placed image. But I hope you all will know how to do this. I want to make a raster from scratch. I have a database that I would like to be able to query and display the results as a sort of color map. I can figure out how to do the math and raster calculating, but I can't figure out how to make a raster. I expect that I need to add a couple of fields for the x and y coordinates, then give each record a value. Just 1s and 0s to begin with. I work with ArcGIS, Oasis Montaj, and Microsoft Access at work all day, but I'd like to do this in QGIS and whatever other tools are necessary. I have spent almost no time with QGIS but would like to learn and work with it on my own projects. But I need to point in the right direction for this one. Thanks


Dataset required with GPS and accelerometer data

Can anyone please suggest me **site or provide me a dataset** which has **GPS data** with **accelerometer** data as well.I am doing a project where using accelerometer data i am trying to improve the accuracy of GPS data received. Thank you.


How to set cell size for vector to raster conversion in QGIS GRASS plugin?

I'm converting a vector (loaded in GRASS plugin in QGIS (1.7.0.-wroclaw) and would like to convert this to a raster with a defined cell size. At the same time I need a value from the attribute tabel to be used as raster value. This tool: v.to.rast.attr looks promising. however, I cannot define the output cell size, or a snap raster. In ArcGIS (esri) this is quite easy. Is there a way to do the same in QGIS?


Convert shapefiles in nested folder to geodatabase

I currently have approximately six hundred old .mxds, and all the data source links are broken due to an upgrade in the GIS computer. In the past, all the spatial data was stored as shapefiles in nested folders ie 2009/2009-040-01/BurialSites.shp or 2005/J2005-022/J2005-022aoi.shp. The data was organized by year, and to some extent, by the associated project. What I would like to do is import all the old data into a geodatabase and use a python script to repair all the broken data sources in an efficient manner. ![file organization](http://i.stack.imgur.com/98kUg.png) The issue with the shapefiles organized in this manner is that certain projects from 2009 will reference past projects, which makes manually repairing the data sources a frustrating and time consuming process. ![referencing old map projects](http://i.stack.imgur.com/LQEwG.png) Ideally, I would like to do is organize the old shapefiles into a geodatabase so it is not quite so messy, and fix the map documents using this geodatabase. The main issue I have is that there are multiple shapefiles with the same name (Export_Output.shp), and when these are brought into the geodatabase a number is attached as a suffix (Export_Output_1, Export_Output_2 etc). In many instances the data with the same name but in a different folder is completely unrelated, but in other cases it is the same feature, but with an additional field in the attribute table. It appears as though there are three options - 1) Import the shapefiles into a geodatabase and attempt to repair the broken data links 2) Keep the shapefiles in the current folders and repair the broken data sources 3) Repair the data sources in each map document on an 'as-needed' basis Does anyone have advice on importing shapefiles into a geodatabase and repairing the data links before I spend lots of time on it? How big of an issue is it that file names have had a number tagged on the end? This is not a priority job, but it is something that I would like to eventually finish.


time complexity of selected algorithm - SQL

I use PostGIS - SQL 1) I need know time complexity of algorithm which in I use these functions: ST_Equals, ST_Overlaps, ST_Distance_Spheroid and ST_Dwithin Is a time complexity diferent when I use functions in one algorithm or when I use functions ST_Equals and ST_Overlaps separately and functions ST_Distance_Spheroid and ST_Dwithin together? for example: ST_Equals(points.geometry,geometry) 2) Then I have next function (requirement): points.id != id and rostlina = points.rostlina my all algotihm is: ST_Equals(points.geometry,geometry) and points.id != id and rostlina = points.rostlina other algorithms are similar I need know time complexity again.


MapServer - map rendered at the wrong angle

I've just started using MapServer to check the topology in my database, and whenever I render a map I have to flip the image vertically and then rotate it quite a bit to get it facing North. I've set the projections to WGS84 but it doesn't seem to have any effect. Any ideas what I'm doing wrong? The way I'm calling MapServer               http://localhost/cgi-bin/mapserv?map=test.map&layers=all&map_imagetype=JPEG&mode=map&mapext=52.8055+-2.0924+52.8175+-2.0785&map_size=1000+1000      The map file can be found at http://pastie.org/pastes/1647658/text Here's an image showing how the map gets rendered and also what angle it should be at.. ![MapServer render](http://i.stack.imgur.com/pZIlc.gif) Also, when I try to overlay the image onto Google Maps I can't get any of the roads to line up with the Google ones. I know that my data is correct as I've checked the lon/lat values in the database against Google and they match up perfectly.. it's only when I output via MapServer that it doesn't match up. Any thoughts would be appreciated!


Creating a marker proportionally offset along a line in QGIS 2.4 when re-projecting

One of the nice new features in QGIS 2.4 is to be able to offset markers (e.g. arrow heads) along a line as part of the styling. I am trying to display a dataset of simple lines (not polylines) with an arrowhead 90% of the way along the line. My attempted method is as follows: Layer Properties -> Style -> Symbol -> Change...   * Select "Marker Line"   * Marker placement: on first vertex only   * Offset along line: Map Unit   * Data Defined Properties...      * Offset along line = $length * 0.9 This works fine when my layer projection was the same as for the project (all EPSG:27700 - OSGB 1936 / British National Grid). However, now that I have added an OpenStreetMap basemap layer, it seems that can't be re-projected so I have to switch my project CRS to that of OpenStreetMap (EPSG:3857 WGS 84 / Pseudo Mercator). Putting in a "fiddle factor of" 1.6 seems to do the trick ($length * 0.9 * 1.6), but that's a bit of an unpleasant hack. Better solutions?


Create a local tile package from online world imagery

Is it possible to create a local tile package (.tpk file) containing data from an online source - for example something like world_imagery.mxd? ArcView 10.2 allows me to set up such a map document, but when I choose to Share As | Tile Package it says: 00005 Layer Type is not supported. I understand that it would need to download the images. The point of this is to create an off-line base map. I've successfully created base maps from the EDN data that I downloaded from ESRI, but I don't have satellite imagery. An alternative would be a terrain map that shows shaded hills and mountains, but I don't see that on the edn data either.


Set datasource form world map.mxd

Noob question here: I've downloaded a data set from ESRI as part of EDN, and it contains world data in a folder such as this: C:\Download\ESRI\EDN Data\DataMapsArcGIS2013_1\world\World Map.mxd When I double-click this .mxd file, it opens up in ArcGIS 10.2, but nearly all of the data source links are broken. How can I fix these links? What is the data source for this map? Thanks!


SQL Prefix for arcpy.da.SearchCursor

Does the sql prefix - `DISTINCT` work well on SDE tables? http://resources.arcgis.com/en/help/main/10.1/index.html#//018w00000011000000 Syntax:               SearchCursor (in_table, field_names, {where_clause}, {spatial_reference}, {explode_to_points}, {sql_clause})      An SQL prefix clause is positioned in the first position and will be inserted between the SELECT keyword and the SELECT COLUMN LIST. The SQL prefix clause is most commonly used for clauses such as `DISTINCT` or `ALL`. My following example is resulting in all rows, not distinct rows.               rs = arcpy.da.SearchCursor(sTableName, (sSelectField1, sSelectField2), sSqlExp, None, None, ("DISTINCT", sSqlPostfix))         1. What else could I do to get truly distinct records only?   2. I store the values in a list and is there a function to get unique values in a list? Example [1,2,2,3,3,3,5,6,7] to [1,2,3,5,6,7]. Also set(xyz) won't work because I'm using a list, whereas set(xyz) works on tuples.


Convert a UK postal code to a city name?

is there any service to convert a UK postal code to a city name? Does one postal code always map to one city, or to more than one? Is there a free web service to do this conversion for me? Thanks.


Which version of pgRouting should I use with PostgreSQL 9.1 and PostGIS 2.0 (on win xp)?

I am new to GIS. I want to install pgRouting on my system (win-xp 32-bit). I am trying to run routing_core.sql file and got the following error: ERROR: incompatible library "C:/Program Files/PostgreSQL/9.1/lib/librouting.dll": version mismatch DETAIL: Server is version 9.1, library is version 8.4. What should I do for proper installing of pgRouting ? Thanks for your suggestion/comments.


Concatenating text and string in Field Calculator expression (python)

I'm trying to copy an attribute value from one field to another (sum of raster values), but I'm having issues in writing a functioning expression for a Calculate Field script. I'm adding a field called `SUM` and trying to copy the value from the field `"SUM_" + filename[0:-4]`. I have multiple files I am trying to do this on and the field names are different in each, which is why it is being written in this manner. Here's the code I have so far:               for table in arcpy.ListTables():         arcpy.AddField_management(table, "SUM", "DOUBLE")         expression = ["SUM_" + str(filename[0:-4])]         arcpy.CalculateField_management(table, "SUM", expression, "VB")        This doesn't work as I receive the following error:               File "C:\Users\kellyj\Desktop\Projects\CostAnalysis\Route_Cost_Analysis.py", line 82, in <module>         arcpy.CalculateField_management(table, "SUM", expressionvalue, "VB")     File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\management.py", line 3354, in CalculateField         raise e     RuntimeError: Object: Error in executing tool      Any thoughts as to how I can fix this?


Where i can find Mapbox tiles gallery

I have discovered that cloudmade tiles service has been discontinued, so to switch to mapbox tiles, i imagine that i can find a gallery (like in cloudmade ) where i can choose the tiles style convenient. i searched a lot, i've just found a demo made by a techslides. where i could find a place where users shares thier style or any gallery?


What is UTM Zone 0?

I am currently working with some roadway link data and it is being projected in UTM. After importing the shapefile into GRASS I can view the map and it looks correct but when I view the projection values it does not make sense. I am new to UTM and from what I've read, the projection ranges should not be negative?                |         Projection: Universal Transverse Mercator (zone 0)                 |      |               N:  3819419.55631945    S:   3790632.2916996                 |      |               E:  -139393.68501688    W:  -175353.36149413                 |      As far as I am aware UTM zones range from 1 to 60... My PRJ file says that the projection should be of `NAD_1983_UTM_Zone_12N` =>`GCS_North_American_1983` So given GRASS's report and what my PRJ file specifies, is this correct? I have also imported the shapefile into postgreSQL and also get the same negative range of eastings. Also, if they are correct I don't understand how to "go" to `-139393.68501688,3819419.55631945` on a map so I can verify that it's around where I expected it to be.


zoom to cluster onClick & have hover event

I've made a simple mock-up trying to combine two openlayers examples. I want to have clusters on which I can hover (so I can display an infowindow about it's content) and I want users to be able to click on them to zoom to these clusters. The last part I've allready made. Take a look at this jsFiddle http://jsfiddle.net/BzcAD/2/ You might recognize the following two examples: http://www.openlayers.org/dev/examples/highlight-feature.html http://www.openlayers.org/dev/examples/strategy-cluster-threshold.html Now the jsFiddle halts on the error : "TypeError: this.layer.getZIndex is not a function" You can stop this error by uncommenting the lines regarding the selectCtrl. Like so:               // var selectCtrl = new OpenLayers.Control.SelectFeature(     //     {clickout: true}     // );        map.addControl(highlightCtrl);     // map.addControl(selectCtrl);        highlightCtrl.activate();     // selectCtrl.activate();      then you get a working example, except that it does zoom to the cluster on hover. I realy don't know how to fix this. Any ideas? Many thanks in advance


GPS Datalogger with USB Interface and GPX Output

I'm looking for a reliable, robust and reasonably priced GPS datalogger, to measure time, distance on tracks. The logger should be reasonably priced but ready for outdoor activities. Mud, dirt, a little water shouldn't harm the device. Another point is, it has to be plugged into a PC/Mac and handled as a normal USB drive to download the GPX files. GPX File is a must have as well. To summarize the needs:   * GPX   * USB drive / no proprietary software   * reliable If anyone is a GPS crack, I'm happily to get an answer! Thanks Martin


How to enclose clustered points with polygon?

I have a raster with forest (1), no forest (2) data. "1" is represent single/few trees and there is gaps between them. I want to create a polygon around these trees to a forest map. It is not a dense forest, so it is not possible to filter the data to fill in the gap between trees. Is there any tools in ArcMap 10.0 or extensions that could work to use? I have seen a tool doing this a while ago, don't remember if it was a ArcMap tool/extension or if it was in another GIS software. Regards


Add a Google basemap to ArcGIS Javascript API

Please review the code below for correctness. I am trying to display a Google basemap (hybrid) in a web map built on the ArcGIS Javascript API 3.8. I have a Google Maps API key, which was removed for this example. So far, I have reviewed the documentation here http://gmaps-utility- gis.googlecode.com/svn/tags/agsjs/1.05/docs/googlemapslayer/examples.html, but I am still stuck.               <script>     var djConfig = {               parseOnLoad: true,               packages: [{                 "name": "agsjs",                 "location": 'https://gmaps-utility-gis.googlecode.com/svn/tags/agsjs/2.04/xbuild/agsjs' // for xdomain load               }]             };                    <script src="http://maps.google.com/maps?file=api&v=3&key=" type="text/javascript"></script>     <script src="http://js.arcgis.com/3.8/"></script>          <script>       dojo.require("dijit.layout.BorderContainer");       dojo.require("dijit.layout.ContentPane");       dojo.require("esri.map");       dojo.require("agsjs.layers.GoogleMapsLayer");       dojo.require("dijit.layout.TabContainer");       dojo.require("esri.dijit.Legend");            var map, googleLayer;            function init() {         map = new esri.Map("map", {           center: [-82.65862, 29.820309],           zoom: 16         });              googleLayer = new agsjs.layers.GoogleMapsLayer({                 id: 'google',                 apiOptions: {                   v: '3'                 },         });              map.addLayer(googleLayer);            }            dojo.ready(init);


From NBM to UWN

Okay, I'll start this off by saying that I'm not a GIS expert by any means. I'm also working with data and places that most people don't work with, but I'm hoping it can be boiled down to basics. I've been working with ArcMap 10.1. I've been taking shapefiles from the National Broadband Map (http://www.broadbandmap.gov/analyze) and trying to get a file that Ubiquiti's site (www.goubiquiti.com) will accept. From talking to a couple GIS guys (one in the RF mapping industry that actually talked to Ubiquiti), they don't know what they're doing. They accept KML, GeoJSON and GPX as file types, but I guess they convert everything to a GeoJSON on the backend. Okay, so let's upload a GeoJSON. I exported a shapefile after performing a simplify of 0.5 miles on it to reduce the file size to fit within their 500 kb restriction. I used ogr2ogr to get it into a GeoJSON. A couple GeoJSON validation sites confirm that I am using valid JSON and one even maps it out as expected. Their site just sits there and doesn't do anything. They said they tried importing it while watching server logs and didn't see any errors. https://www.dropbox.com/s/o3y02l1iyyzrvir/ICS-coverage.geojson Does anyone have any ideas as to what I may be able to do to my file to get it to accept. I understand that without having feedback from the server side, help is limited. I'm just hoping someone can find something in my file that I can change that might work better. I don't know anything about the format of these files, so I don't know if there's a way to cut out extra information that might be causing their server to flip out. KMLs aren't any better and I haven't tried GPX as I haven't looked into how to make one. I did Try running a buffer on the data and that cut the GeoJSON down to about 19 kb. I was hoping that would be a lot less complex and maybe fit... but it didn't. TIA


Is there free GIS reader that supports transparency of JPEG layers?

I need to make from my ArcMap layers (which are georeferenced JPEG files) a file that can work on a free and easy to use program. The program needs to be able to open multiple layers so we can put them on top of each other and to be able to change the transparancy of the layers. Does anybody know a solution?


ArcGIS Viewshed's show no visibility to south east

I'm using ArcGIS 10.2.2. I've been running some viewsheds using DTM files from EDINA Digimap and data that I've imported using .csv files. These files only contain the X Y details and a code for each site. The DTM files were 'stitched' together using the 'Mosaic to New Raster' tool in the ArcToolbox. Out of nine that I've run, six viewshed's show no visibility to the south east. I've checked the following.   * I've run the viewshed again just using the one square and nothing else. That was fine.    * I've run it using the mosaic to new raster on the NE, SE, SW and NW cells as one. This was fine.    * I then ran it again using the mosaic to new raster but this time included the four cells below, so its not 74 NE, SE, SW and NW 75 NE, SE, SW and NW all stitched together. This showed the same problem with no view to the south east.  Has anyone had any issues like this before? It seems odd (to me anyway).


Geoserver auto rollback after JBoss Restart

I deployed Geoserver 2.3.5 inside JBoss successfully , but when i restart jboss all the changes made to the geoserver getting vanished and a fresh geoserver get start up how to solve this issue i also like to know how to use data directory of geoserver like we do in tomcat


How to get the height according to EGM96 for a point?

For a program I have to calculate the height according to EGM96. I found http://earth-info.nga.mil/GandG/wgs84/gravitymod/egm96/egm96.html - this site delivers files with parameters and a fortran-program. But I feel unable to understand what is going on in this Fortran-program and have no idea how to use the parameters to generate the correct height. Can someone explain the algorithm to me?


Why is sometimes geometryType not returned in JSON from ArcGIS Server layer REST API?

Does someone know why the geometryType not always get returned from ArcGIS Server layers? According to the API documentation Layer / Table the geometryType is returned on layers:               //properties specific to layers only      "geometryType" : "<geometryType>",      But on some layers the resulting JSON looks like this:               "geometryType" : "",      The layers I'm testing on is our own and as far as I can see they are set up in the same manner,:capabilities with mapping and web access enabled. Dynamic layers. Some layers return the correct geometry type and some don't. Update: Clearing the cache See rest admin does not help.


Layer added but not displayed until i turn off then on in LayerSwitcher

I'm using OpenLayers to add a WFS layer. It works fine when i add it to init() function. But when i add the code to a function that is called by a button, layer gets added, but it does not display. It only displays if i uncheck and recheck the layer in the LayerSwitcher control. I tried different things like the display and drawFeature funtions but they didn't work for me. IE:               wfs.display(true);       **What can i do to Add AND DISPLAY my wfs layer?** here is my test code:                                 <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />          <meta name="apple-mobile-web-app-capable" content="yes" />          <link rel="stylesheet" href="../js/OpenLayers/theme/default/style.css" type="text/css" />          <link rel="stylesheet" href="style.css" type="text/css" />          <title>WFS: GetFeature Example (GeoServer)</title>
WFS Test

      WFS, GetFeature

          Shows how to use the GetFeature control to select features from a WMS layer.

         <input id="cmdAddLayer" type="button" value="button" onclick="AddResultsLayer(); return false;" />


Should I use WFS, WMS or SOS considering performance and security?

My task is to develop a web application which will visualize the temporal data on map and produce a kind of data flow (or animation) from the images/data which have been received from server. For this purpose, I am thinking to use OpenLayers API and OGC web services WFS or WMS or SOS. One of the main requirements is to send data securely and fast with high performance. The question I have is: Which service out of WFS, WMS and SOS will be good to use for such a web application in terms of performance, security, reliability etc.? I know each web service provides different features. But, if I use WMS for my temporal data to get map images by performing some kind of aggregation in database (as it is temporal visualization), then my application will get slow on some devices like mobile phones/tablets as it may take lot of time to fetch images. On the other hand, If I use SOS or WFS, there will be risk for our application to send raw data, which is really not secure. It will be really great if anyone can give me an advice or thoughts on it. If you think, this question can't be just answered , then can anyone give me an idea how should I proceed further for such an research based problem? Many Thanks!


Zoom to Feature hotkey in ArcMap Table View

In ArcMap 10 table view, is there a way to set up a hotkey that when a feature is selected, pressing say "z" is equivalent to right-click-->Zoom To? I would like to be able to highlight a record and just press "z" to zoom to the feature, "p" to pan to the feature and keep the same zoom, etc. It seems simple enough, but I cannot seem to find a place to set up this function. Am I missing something simple? I just want to replicate the function shown below without the 2 additional mouse clicks. ![enter image description here](http://i.stack.imgur.com/YdkEv.jpg)


"Flood fill" polygon capture mechanisms in various GIS

Within our organisation we have a requirement to capture lines dividing land into chunks and then to create polygon features using aggregates of these divisions. In the example image below (containing two polygons which share one cell), the centre of each cell would be selected and, once the required area is selected, the polygon would be formed. ![Example Image](http://i.stack.imgur.com/2gx2b.png) A couple of points to note: The actual geometries we capture are not cell based, they tend to follow physical and legal boundaries. As such they can be quite complex. The GIS we're using currently (Cadcorp) has a nice way of doing this using topology and a flood fill type approach. I've very little experience with other GIS's so my question is: does this type of flood-fill functionality exist within other GIS's? If so, what are people's experience of its quality? I've tried googling, but have found nothing - this question is an attempt to validate the nothing! Thanks in advance.


ArcMap shuts down when I perform GWR with distance as explanatory variable

I have an integer dependent variable, one integer explanatory variable, and one float/double explanatory variable. The float variable is distance of the given observation from a single point on the map. I am using a projected coordinate system, as recommended, though it may not be the coordinate system that the distance variable was calculated in. When I run regressions, I am able to successfully regress the dependent onto the integer variable, but whenever I run regress onto the integer AND distance, ArcMap shuts down and I get the old "Send Error Report" message. This occurs for both OLS and GWR regressions. I am using ArcMap 10.1. Edit: It only shuts down when I disable background processes. However, the regressions still do not work after I enable background processes. The exact error message I get is: > Your background geoprocessing operations did not complete successfully due > to an error. And then I have the option to send an error report. What's happening? There is no severe multicollinearity.


Create Minimum Spanning Tree or Steiner Tree Using ArcGIS Network Analyst: Solving for "n-incidents/ total"?

ArcGIS 10.2.2 - What would be the best approach for applying minimum spanning tree or Steiner tree logic to solving a network? Incidents: 100, Facilities: 20 Goal: Connect any subset (n-incidents of 100) to any 20 facilities that create the least cost network. I want to find the best route to connect any n-incidents, say 80, of the 100 incidents to any facilities using the least route distance? It would be a no- circuit network that would use only the facilities necessary to connect the best 80 incidents. I've found some information but don't fully know how to implement the process.


ST_ClosestPoint in 2D but retaining Z value

I have a query in PostGIS where I have a two geometries, a MultiLineStringZ and a Point. I want to find the 3D point on the MultiLineStringZ closest to the Point by it's flat 2D plane distance, so essentially ST_ClosestPoint(myMultiLineStringZ, myPoint). However I need to retain the Z value on the returned point. ST_ClosestPoint drops the Z, and ST_3DClosestPoint does a 3D distance calculation. How do I do this?


How to align edge of a polygon from one shape file with edge of polygon from another shape file

Initially I had a kml file of geographic regions. Each region is a single polygon. I have imported the kml file into ArcGIS as a shape file. Several of the sides of the regions are supposed to align with county boundaries but don't. I also have the county shape file from the US Atlas. What I would like to do is update the regions to align with a county boundary as appropriate. I'm new to ArcGIS and am having trouble figuring out how to do this.


ArcGIS Spatial Statistics: Distance to 3rd/4th/5th closest feature

We have an algorithm which requires us to produce a score based on the distance from any given cell in an output raster to a score calculated from the distances of the 3rd closest, 4th closest, and 5th closest point features in a separate feature class. For example, our score might be calculated as score=a/(3c+4d+5e), where a is a constant and c, d, and e are the (Euclidean) distances to the 3rd closest, 4th closest, and 5th closest points on the input feature class, respectively. Can anyone point me in the direction of how to write a custom function to calculate such a cell statistic? I have looked at the various Proximity Analysis functions, but they all seem to leave no room for defining custom scoring metrics. Thanks!


What causes this error when loading plugin

After installing pyspatialite on my Mac two plugins fail to load with this error:: This plugin is broken invalid literal for int() with base 10: '2-spatialite' I am fairly sure that the offending string '2-spatialite' is part of the version string associated with pyspatialite (2.6.2-spatialite.2.4.0-4) The two plugins giving this error are Qspatialite and opengeo-explorer. What is weird is that the opengeo plugin does not use spatialite. I assume that something in the plugin support is splitting the version string on '.' and expecting to get integers back.


Saving large volumes of .grd and .dat files automatically on Surfer 8?

Here's our data: we have air sample measurements for every hour for two complete years. All measurements are in one large .csv database. Our task: Each hourly measurement for two years needs to be retrieved from the database, saved as a .grd file and a .dat file on Surfer 8 in the correct name format. So, that's 2*2*24*365 files we're talking about retrieving, re-naming, and saving. There are several of us working on this but I think it would _ridiculous_ to not try writing some program to automatically retrieve and save large volumes of .grd and .dat files. However, I have no experience programming, much less with Surfer's Scripter BASIC programming language. I looked up Automation Help and it seems there's a way to do this with the "SaveAs" method. Can I apply this to thousands of files?


Search by street name/postcode in OpenLayers

Can anyone help me search by street name in OpenLayers? I essentially want to be able to search fir streets/postcodes in openlayers in the same way I can search on google maps. Is this possible. Thanks, Alan


Modifying a projection ArcMap 10.0 Arcpy

I have the need to project data from wgs84 to UTM 15N NAD1927 FOOT_US. I would like to have arcpy do this for me. I can project the data using one of ArcMaps predifined prj files in the Coordinates folder..but how would I do the "Modify" piece? UTM 15N NAD1927 is defined in the prj file as "Meters" but I would like to do the arcpy.project_management using a prj file that has been modified either in ArcMap and then saved to disc or my another method... I found this but am a little unsure. Thanks for any insight or solution to using a modified prj file when doing a arcpy.project_management on shapefiles.


Projecting data from WGS84 to NAD27 UTM BLM Foot ArcMap

When I use the NAD27 BLM 15N prj from the projected>>UTM>>north america>> in ArcMap 10.0 and go from WGS84 to that..using the NAD_27_To_WGS_84_1 transformation..my resulting shapefile doesn't line up with the wgs84 data. I've set my data frame to each and tried new mxd's with no success of having them line up. Should they line up in ArcMap with re-projecting on the fly by ArcMap? Thanks.


What is the best map provider solution for repetitive routing use?

**[edit]** What is the best solution in terms of cost effectiveness, stability & speed for running a lot of routing requests and comparing them. lots of times over and over? I understand now that it can be a combination of several tools. _A simple solution is always better..._ **[original]** I want to take a route I've gotten via a routing service like Google-maps or CloudMade and add several way-points to it. then check how they affect the time and distance of the route. the problem is that i need to do this Many, many times per day. (i have big list of routes and way-points) and this can get expensive. the services are not free.. a) What is the best map / routing provider for such a thing? b) Alternatively, is it possible to download an entire database of such maps & a routing solution to use it in-house? (only if it's cost effective) Thanks!


How to convert 4-channel PNG files to grayscale geoTIFFs?

I suspect that there exists a gdal tool (gdal_translate?) that will convert a 4-channel PNG (+ world file) to a 1-channel (gray-scale) geoTIFF. From the gdal_translate man page, it appears simple to go in the other direction, i.e. to expand a monochrome raster to a 3 or 4-channel image, but I can't figure out how to go from many channels to one. If not gdal (hardly conceivable), then another *nix command-line tool?


Source for GeoJSON data for the US

Does anyone know of any good sources for US data (counties, congressional districts, etc) in GeoJSON format? Has anyone converted public-domain shapefiles/sources to GeoJSON that they would be willing to share? Thanks


How to unpolygonize and remove outermost border?

QGIS has "polygon to line" but this isn't exact reverse engineering of "line to polygon". I want no overlapped border closed lines, just segmented (on each intersected point) lines. Additionally I want to remove to outermost boundary (if it can be automatically done). Example: in the case of a kite shape (4 triangle polygons) will turned into inner skeleton cross lines (4 segments)


Geoserver 2.2.5 tomcat unable to load servlet2.5.jar

am trying to use geoserver 2.2.5 with tomcat 7.0.34 following this tuto: http://ian01.geog.psu.edu/geoserver_docs/software/geoserver.html but am getting this error concerning the servlet jar:                    5 mai 2013 14:10:25 org.apache.catalina.core.StandardEngine startInternal          INFO: Starting Servlet Engine: Apache Tomcat/7.0.34          5 mai 2013 14:10:25 org.apache.catalina.startup.HostConfig deployWAR          INFO: Déploiement de l'archive C:\Users\OUK\Desktop\PFE\tomcat-7.0.34\apache-tomcat-7.0.34\webapps\geoserver.war de l'application web          5 mai 2013 14:10:26 org.apache.catalina.loader.WebappClassLoader validateJarFile          INFO: validateJarFile(C:\Users\OUK\Desktop\PFE\tomcat-7.0.34\apache-tomcat-7.0.34\webapps\geoserver\WEB-INF\lib\servlet-api-2.5.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class          log4j:WARN File option not set for appender [geoserverlogfile].          log4j:WARN Are you using FileAppender instead of ConsoleAppender?          05 mai 14:10:35 WARN [config.CustomEditorConfigurer] - Passing PropertyEditor instances into CustomEditorConfigurer is deprecated: use PropertyEditorRegistrars or PropertyEditor class names instead. Offending key [org.geotools.util.Version; offending editor instance: org.geoserver.platform.util.VersionPropertyEditor@126456a          5 mai 2013 14:10:35 org.geoserver.platform.GeoServerExtensions checkContext          GRAVE: Extension lookup occured, but ApplicationContext is unset.          05 mai 14:10:35 ERROR [geoserver.global] -       can anyone figure out how to solve this problem, thnks.


3D visualization for marine navigation

Is there anyone who has some experience or knowledge on 3D visualization and/or GIS softwares capable of displaying 3D bathymetric data and 3D ship model together? Nearly all GIS softwares work with 3D data in grid format but I especially would like to learn whether it is also possible to put a 3D ship model on bathymetric model and dynamically visualize a ship's navigation by displaying its underwater sections. Thanks,


How to digitize a map in QGIS?

I am relatively new to QGIS and using it on windows vista. Problem:   1. I have to digitalise an aerial map and then extract the coordinates.   2. I have absolutely no idea how to start Thanking you in advance for any help shown towards me.


problem with building WKB from a geometry

I have some points in an array,stored by user click on the map in ArcMap,and I want to build a polyline and create a Well Known Binary sequence. I use IPointCollection interface to add this points to Polyline object,and when I draw this polyline,it shows line successfully but the function "CreateWkbVariantFromGeometry" returns E_OUTOFMEMORY error when I pass this geometry into it.What's wrong with this method for creating a plolyline?               IPolylinePtr ipPL(CLSID_Polyline);          IPointCollectionPtr ipPC;          if(ipPL->QueryInterface(IID_IPointCollection,(void**)&ipPC)!=S_OK)             return E_FAIL;     for(int i=0;i<myPointCount;i++)     {         IPointPtr ipP=this->GetPoint(i);         if(this->m_ipDispTrn->ToMapPoint(this->m_Points[i].x,this->m_Points[i].y,&ipP)!=S_OK)             return E_FAIL;         if(ipPC->AddPoint(ipP)!=S_OK)             return E_FAIL;     }     IGeometryPtr ipG;     if(ipPL->QueryInterface(IID_IGeometry,(void**)&ipG)!=S_OK)         return E_FAIL;          //.Drawing line on the screen catch . ipS is a SimpleLineSymbol object     //....................................................StartDrawing here     this->m_ipSDisplay->SetSymbol(ipS);     if(this->m_ipSDisplay->DrawPolyline(ipG)=S_OK)//This line works successfully         return E_FAIL;     //....................................................FinishDrawing here          //.Building WKB from geometry     IGeometryFactory2Ptr ipGF;     IGeometryEnvironmentPtr ipGE(CLSID_GeometryEnvironment);     if(ipGE->QueryInterface(IID_IGeometryFactory2,(void**)&ipGF)!=S_OK)         return E_FAIL;     VARIANT var;     HRESULT hr=ipGF->CreateWkbVariantFromGeometry(ipG,&var);//hr=E_OUTOFMEMORY     if(hr!=S_OK)         return E_FAIL;


C#/.Net Library that can draw a line across the date line

I want to be have an embedded map in my application that can handle drawing lines across the date line. I have tried out dotspatial and sharpmap and neither have been able to handle this. Edit: Here is an early example of the kind of information that would need to draw over the date line http://imgur.com/B3Fg7R5 Please excuse the very low res map product. The software needs to support loading custom map products via geotiffs or something similar. This is a c# winforms application.


Tiling Vector data without losing geometrical and topological information

I am trying to figure out a way to sub-divide a vector based map into smaller blocks. I can tile the map based on different strategies such as q-tree. However, it is unavoidable to cut some polylines and polygons that cross the boundaries of the blocks. By doing this, we will lose their geometric and topological attributes. The tiled data can only be used for display but not for spatial analyses because they have partly lost their geometric and topological attributes. Do you have any suggestion or experience with sub-dividing the vector data and still maintaining their us usability for spatial analyses?


Arc Objects and non-spatial table

I am a new Arc Objects user, with little ESRI experience. We are using VBA to create a spatial report on a Map Control using a mdb table. The mdb table contains a Lat and Long field, and this data is collected in the Access application. For the reporting, we need to display a map with the locations from the mdb table. My questions are: 1. How do I access data in a mdb table, as spatial data? Does it have to be registered as spatial? I am not sure if this can be done at runtime or has to be done using Arc Catalog. 2. At runtime, if the data from the mdb table is in a spatially recognized table, do I just create a new layer, set the symbology, and then set a "where" clause on the new layer? Thanks for your help with this newbie question.


Backup in Mysql periodically

I have trouble scheduling a backup in mysql periodically, most of the tools do not recognize the geometric field, for example navicat which says > Can not get geometry object from data you send to the GEOMETRY field others simply do not create the table or do not fill the field with the information, someone knows a solution that is free and effective for this problem


ArcGIS REST Server Object Extension Examples

Hi I'm looking for a few good examples of a REST SOE showing more than the common ESRI sample. I'd like to see some RestOperation samples as well and a few different TryGet statements (ie. returning ints and strings). Looking at ver 10.2 using SQL. Thanks!


64 bit Python on ArcGIS 10.2.2 for Desktop

I am trying to have `Python 64-bit` with ArcGIS so that I can use my entire RAM when doing data analysis. Apparently ArcGIS 10.2 Desktop comes just with 'Python 32-bit'. Should I install a fresh `Python 64-bit` and import `arcpy` from there? Is that going to work? I need to use `arcpy` and `scipy` libraries for my data analysis and I need to call both of these libraries in my Python code. Is there a better way to run 'Python 64-bit' with ArcGIS?


QGIS Grass Plugin fails with r.cost.vect

I tried the following in QGIS with the Grass Plugin:               r.cost input=preCostSurface@albi start_points=OSMroads@albi output=cost0109 max_cost=0      And I get the following error:               Dev note: Adapted sites library used for vector points. (module should be updated to GRASS 6 vector library)          ￼No start points      Finished with error      What is causing that and how can I fix it? * * * Edit: It seams like this is a general Grass 6.4.3 issue and will be resolved in Grass 7. Does anybody know a workaround for that problem meanwhile?


Define line height for features in Autocad Map

What is the procedure to assign a specific lineheight to a feature in Autocad Map. I understood the style definition but I can only assign a thickness between 0 and 5 instead I want a specific height (1mm). Thanks a lot


What countries allow commercial use of drones to collect aerial imagery?

Currently the US government forbids commercial use of drones to collect aerial imagery. The FAA is supposedly reviewing this to determine what sorts of restrictions are needed to allow this to happen while minimizing threats to privacy. From the Denver Post: > Last year, Congress mandated that the Federal Aviation Administration create > a plan for the safe integration of unmanned aerial vehicles into the > national airspace. Those regulations should be complete by 2015, and the > agency expects a commercial boom — as many as 30,000 drones airborne in the > U.S. by 2020. But public fears about police spying could stall the > technologically advanced industry eager to be unleashed. What countries currently allow commercial use of drones to collect aerial imagery? In these countries, have there been problems with invasion of privacy? **Update** > The influential head of Google, Eric Schmidt, has called for civilian drone > technology to be regulated, warning about privacy and security concerns. - > _BBC News_


Trying to use OS Translator plugin and cant find ogr2ogr.exe

I have installed the OS Translator plugin from the Faunalia Repository but when I try to use the plugin I get a "Can't find ogr2ogr[.exe], can't continue" error message. I have tried reinstalling the complete GDAL package but to no obvious effect. I am running QGIS on a MacBook Pro with an up to date version 10.8 of OS X and installed packages from the KingChaos site. Any ideas please? Update. I have managed to find the ogr2ogr.exe file and, as it exists, that suggests that the installation of the the GDAL Framework does not properly edit the PATH to the file. I'm still trying to re-learn some basic bash shell commands under the OS X Mountain Lion environment to make the necessary changes to PATH. Nige


How to calculate the density of settlement per 100 square kilometers?

I have a point shapefile representing settlements. I want to calculate the density of settlement _per 100 square kilometers_. Should I use point or kernel density? I am working with ArcGIS. Is there any way to achieve this directly from the density analysis, or is there another way?


Adding additional parameters to image classification in ArcGIS for Desktop?

I have an RGB ortho rectified Image and I have another grid data with Elevation values. However, an image with only three bands does not give a good classification of landcover, so it is important to add additional information e.g. pattern or elevation data from another dataset. I only have access to ArcGIS software so I wish to know how I can do this in ArcGIS for Desktop? ![The following Image will be the Input of classification.](http://i.stack.imgur.com/rO1NG.png)


Elevation profile geoprocessing service - error 000840

I am trying to create an Elevation Profile service using the Python code found on the Setting up an on-premise elevation Profile service page: And I followed all the instructions. I am able to run the tool with no errors in ArcGIS and I can publish the geoprocessing service, but when I run the gp service inside ArcGIS I get an error saying:               Error executing tool.: Failed to execute. Parameters are not valid.      ERROR 000840: The value is not a TIN Layer.      ERROR 000840: The value is not a Raster Layer.      ERROR 000840: The value is not a Terrain Layer.     ERROR 000840: The value is not a LAS Dataset Layer. Failed to execute (InterpolateShape). Failed to execute. Parameters are not valid.      ERROR 000840: The value is not a TIN Layer.      ERROR 000840: The value is not a Raster Layer.      ERROR 000840: The value is not a Terrain Layer.      ERROR 000840: The value is not a LAS Dataset Layer. Failed to execute (InterpolateShape). Failed to execute (Profile). Failed to execute (Profile).      The problem seems to be in the Interpolate Shape analysis in line 307 in the Profile Tool.py but I am not sure what is wrong with it. Do you guys have any ideas?


control which feature classes in an ArcGIS Network Dataset are "snappable" for incidents/facilities?

I'm using ArcGIS Network Analyst in conjunction with the GTFS extension to answer the question: How far is a random sampling of houses in my town from the nearest McDonald's? via transit/walking. My problem is that the Facilities (McDonald's) and Incidents (residential buildings) are being located along the Transit Lines feature class in my Network Dataset; then when I go to solve the analysis, any features that get located along a transit line aren't evaluated because the "network element is not traversable". Is there a way I can restrict which feature classes in the Network Dataset can be used to locate facilities/incidents? Thanks.


River boundary (bank) extraction from LiDAR

Is there any way to extract a river boundary (bank) from LiDAR data and its products (DEM, intensity image and slope) automatically? Digitizing is very time consuming.


Create a buffer with a pre-defined area?

I have a road (line) system and need to create a polygon from it to show the right-of-way area. The right-of-way area is calculated in the field from taking measurements from the road centreline. From these measurements a total right-of-way area is calculated (m2.) I am wondering if it is possible to create a buffer with a pre-defined area based on the measurements taken in the field. Possibly through a Python script? Without a tool to do this, it takes some time as I have to guess the average right-of-way with and create a buffer using that measurement. So it takes a lot of trial and error time. I am using ArcMap 10.2.


Merging .dbf Tables in Python w/o merging all fields of same name

I'd like to merge several tables together using Python. They all have the same field names: "TIME", "X", "Y", and "VALUE". I would like the "VALUE" fields to remain separate when merged, so that the new table has the fields: "TIME" "X" "Y" "VALUE1" "VALUE 2" "VALUE3"...and so on. I wrote a script based off the ERSI script for merging, and tried to use Field Mapping in a way that would let me rename "VALUE" for each table before merging.               # Name: Merge.py     import arcpy     from arcpy import env          # Set environment settings     env.workspace = "C:/Users/user1/Documents/Processing"          # Get tables to be merged     listTable = arcpy.ListTables("*", "ALL")          # Create FieldMappings object to manage merge output fields     fieldMappings = arcpy.FieldMappings()     i = 1          # All tables have a column "VALUE" only I don't want them to merge     for tables in listTable:         fieldMappings.addTable(tables)         fldMap_SOSvalue = arcpy.FieldMap()         fldMap_SOSvalue.addInputField(tables,"VALUE")         SOSvalue = fldMap_SOSvalue.outputField         SOSvalue.name = "SOSvalue" + str(i)         fldMap_SOSvalue.outputField = SOSvalue         fieldMappings.addFieldMap(fldMap_SOSvalue)         i += 1          # Use Merge tool to move features into single dataset     mergetable = "C:/Users/breezevi/Documents/ConModelTest/Tables/2013.dbf"     arcpy.Merge_management(listTable, mergetable, fieldMappings)     print "Merge is done"      This script runs, however, it does not seem to merge correctly. The resulting table has the fields "TIME" "X" "Y" "VALUE1" "VALUE2" "VALUE3" ... but all the numbers in each "VALUE#" column seem to be the same (e.g. it reads 1 | 1 | 1 | 1 across the whole row, but it should read 1 | 3 | 5 | 2 ). Almost like the script is creating all the new fields, but only filling them with values from one table. Only, I'm not sure where I went wrong in the script.


Openlayers ZoomOffset

Hopefully someone can help. I've created a TMS Layer in OpenLayers which has some local tiles these tiles are OSGB OpenData. I'm trying to get the initial zoom to be level 4 instead of 0. However OpenLayers seems to be ignoring the zoomOffset option. Here is an example of my layer:                var newLayer = new OpenLayers.Layer.TMS("Test Layer", "", {             type:"png",             getURL:overlay_getTileURL,             alpha:true,             setIsBaseLayer:true,             'buffer':0,             transitionEffect: 'resize',             projection:new OpenLayers.Projection(projection),             displayProjection:new OpenLayers.Projection(displayProjection),             units:"m",             resolutions:[400.0, 200.0, 100.0, 50.0],             maxResolution:"auto",             maxExtent:new OpenLayers.Bounds(0.0, 0.0, 700000.0, 1300000.0),             zoomOffset:4         });            map.addLayer(newLayer);      Thanks


How to create a pop up attribute table for each crash located on a roadway segment in arcmap

I am trying to create a simple user interface that displays information for each crash located on the routes. I also need to display a graph along with that. I am a beginner in Python with no prior programming knowledge. Please help!


Map location of unknown point with distances to two known points

I'm trying to develop a function in R that will locate a point (A) on a map given distances between that point A and two other points (B and C), for which exact coordinates are known. The problem I'm coming up against is that my approach is sensitive to the shape of the triangle, and thus the number of conditions in my algorithm is higher than I think it needs to be, probably because my middle-school maths aren't good enough, so I'm looking for somebody to be really condescending, tell me how silly I'm being, and help me to a general approach to this problem. For example, I'm looking for a single algorithm that can place point A in all of these circumstances:   1. (x,y): B(1,2); C(4,1), distances: A to B = 6, A to C = 2   2. (x,y): B(1,1); C(4,2), distances: A to B = 2, A to C = 3   3. (x,y): B(1,1); C(4,1), distances: A to B = 2, A to C = 6 For the record, I'm aware that there are two possible points in space that satisfy these assumptions. I'm happy to have both. Lastly, I'll point out that while this sounds like homework, it's actually ecological research, albeit performed by somebody apparently underqualified to be doing it.


Is there a way in arcpy to convert map units from feet to decimal degrees?

This is my problem: I have an arcpy script that finds the XMax, XMin, YMax, and YMin of a polygon. It shows the results in feet, but I want them to be in decimal degrees. In ArcMap I can change the data frame's display units to decimal degrees. But every time I run my script it shows the numbers in feet again. Is there a solution for this in arcpy?


Using TauDem Tools in Python (like Arcpy)?

This may be a completely ignorant question so have some patience. But is it possible to use TauDem tools within an Python (Arcpy) script as per the other tools in ArcGIS? When you look at the help files of the TauDEM tools it gives a Syntax that looks similar to the syntax for the standard arcpy tools (this is what got me thinking). In particular I am wanting to use the D-Infinity methodology for deriving flow direction and accummulation. Feel free to shoot me down if I'm missing something obvious but I can't seem to find an answer anywhere. I am using ArcGIS 10.


How to split single address field into 4 fields (House No., Direction, Name, Suffix)

I have to do some massaging of our parcel data to make it usable by a program in sheriff helicopters. The program requires one of the following address formats within the fields: ![enter image description here](http://i.stack.imgur.com/vIbfO.png) Our addresses are currently in one field: ex: 1234 W Main St. Is there a way to automate the splitting of the fields into either of these desired formats? I can imagine the two field format would be easier by just calling for a split after the numbers, but could also cause a problem for streets such as 1st Ave, etc.


Requesting help designing the query in a Query Layer

I am pulling data from our OMS SQL database to show our SAIDI and SAIFI numbers visually for our operations department. I have a functioning query that can pull in the needed data, and currently I use a labeling expression to perform the math from the basic data to give the numbers I need to show. This is the query I am using:               SELECT Milsoft.dbo.Outage.Substation, Milsoft.dbo.Outage.Feeder, COUNT(Milsoft.dbo.Outage.OutageName) As Outages, SUM          (Milsoft.dbo.Outage.CustomersOutInitially) AS MemOut, SUM((Milsoft.dbo.Outage.InterruptionDuration*Milsoft.dbo.Outage.CustomersOutInitially))           as Time, Milsoft.dbo.CustomerServedElement.Total As Members FROM Milsoft.dbo.Outage, Milsoft.dbo.CustomerServedElement WHERE           (Milsoft.dbo.CustomerServedElement.Year='2014' AND (Milsoft.dbo.CustomerServedElement.DayOfYear='181')) AND          (Milsoft.dbo.Outage.Feeder=Milsoft.dbo.CustomerServedElement.ElementName) AND (Milsoft.dbo.Outage.OutageStartTime >= '6/1/2014' AND           Milsoft.dbo.Outage.OutageStartTime <= '6/30/2014') GROUP BY  Milsoft.dbo.Outage.Substation, Milsoft.dbo.Outage.Feeder,           Milsoft.dbo.CustomerServedElement.Total      I can probably clean this up, I am just starting to learn this (previously used access database and its query wizard instead of building it like this). I am trying to add the math for SAIDI, SAIFI, and CAIDI. One of our IT guys said that as soon as the column name variable was declared I should be able to use that name in my query which lead to this:               SELECT Milsoft.dbo.Outage.Substation, Milsoft.dbo.Outage.Feeder, COUNT(Milsoft.dbo.Outage.OutageName) As Outages, SUM          (Milsoft.dbo.Outage.CustomersOutInitially) AS MemOut, SUM((Milsoft.dbo.Outage.InterruptionDuration*Milsoft.dbo.Outage.CustomersOutInitially))           as Time, Milsoft.dbo.CustomerServedElement.Total As Members, (Time/60/Members) AS SAIDI, (MemOut/Members) AS SAIFI, (SAIDI/SAIDI) AS CAIDI FROM           Milsoft.dbo.Outage, Milsoft.dbo.CustomerServedElement WHERE (Milsoft.dbo.CustomerServedElement.Year='2014' AND           (Milsoft.dbo.CustomerServedElement.DayOfYear='181')) AND(Milsoft.dbo.Outage.Feeder=Milsoft.dbo.CustomerServedElement.ElementName) AND           (Milsoft.dbo.Outage.OutageStartTime >= '6/1/2014' AND Milsoft.dbo.Outage.OutageStartTime <= '6/30/2014') GROUP BY            Milsoft.dbo.Outage.Substation, Milsoft.dbo.Outage.Feeder, Milsoft.dbo.CustomerServedElement.Total      This throws the error: > Time is an invalid column name and will throw a similar error if I change the name, I tried Duration and Dur both as column names and received the same error saying it was an invalid name. This lead to my third query:               SELECT Milsoft.dbo.Outage.Substation, Milsoft.dbo.Outage.Feeder, COUNT(Milsoft.dbo.Outage.OutageName) As Outages, SUM          (Milsoft.dbo.Outage.CustomersOutInitially) AS MemOut, SUM((Milsoft.dbo.Outage.InterruptionDuration*Milsoft.dbo.Outage.CustomersOutInitially))           as Time, Milsoft.dbo.CustomerServedElement.Total As Members, (SUM          (SUM((Milsoft.dbo.Outage.InterruptionDuration*Milsoft.dbo.Outage.CustomersOutInitially))/60/Milsoft.dbo.CustomerServedElement.Total) AS Saidi,           (SUM(Milsoft.dbo.Outage.CustomersOutInitially)/Milsoft.dbo.CustomerServedElement.Total) AS Saifi,           (((Milsoft.dbo.Outage.InterruptionDuration*Milsoft.dbo.Outage.CustomersOutInitially))/60/Milsoft.dbo.CustomerServedElement.Total)/(SUM          (Milsoft.dbo.Outage.CustomersOutInitially)/Milsoft.dbo.CustomerServedElement.Total)) AS Caidi FROM Milsoft.dbo.Outage,           Milsoft.dbo.CustomerServedElement WHERE (Milsoft.dbo.CustomerServedElement.Year='2014' AND (Milsoft.dbo.CustomerServedElement.DayOfYear='181'))           AND(Milsoft.dbo.Outage.Feeder=Milsoft.dbo.CustomerServedElement.ElementName) AND (Milsoft.dbo.Outage.OutageStartTime >= '6/1/2014' AND           Milsoft.dbo.Outage.OutageStartTime <= '6/30/2014') GROUP BY  Milsoft.dbo.Outage.Substation, Milsoft.dbo.Outage.Feeder,           Milsoft.dbo.CustomerServedElement.Total      This query now works thanks to papadoo's answer, but there is still something wrong as the data is zeros giving a devide by zero error if I leave the CAIDI part in. The strange thing is that the data for the individual columns that make up the equation come in fine. Any suggestions on what I am doing wrong?


Counting building polygons in neighborhood polygons

I have two layers, one of them is neighborhood data and the other is the buildings in the city. I want to count the buildings in a neighborhood (by using borders) and add this value to the neighborhood table as a field. How can I do this in ArcMap?


How to write GML with Geotools?

I'd like to write GML using Geotools. Unfortunately, I can't find documentation on a GML Writer (except for this one from 2006: http://docs.codehaus.org/display/GEOTOOLS/WFS+++GML+DataStore). Could you point me at documentation/examples?


ArcGIS Runtime for WPF basemap disappears when zoomed in

I have a problem where the http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer basemap is disabled and the images are removed when you zoom in to a large scale. I've set the MinimumResolution=0.01, which used to work. At the dev summit last year there was much boasting about how the basemap images would persit beyond the max zoom level of the service and they would just pixelate. This is what I need to happen, but that seems to have been removed from the 10.2 versions. Does anyone have an answer for this problem?


What Makes a Map be classed as Badly Designed?

A poorly designed map can not only look visually unappealing, but can convey the wrong message, which could lead to bad decisions being made. I would like to ask people to **post examples (that are in the public realm) of poorly designed maps, WITH justification on why it is bad design.** Although this 'question' does not have a clear answer, IMO it will proove a useful resource to see what merits bad design, so others can learn what NOT to do. I will let the votes choose the 'right' answer. I would also like to see examples of bad design around web-mapping. I would argue that although GIS Professionals generally know how to create a good looking map, I would say that they also have a tendency to over- complicate web-maps, by trying to re-create a GIS desktop application on the web: ![alt text](http://i.stack.imgur.com/MtiEV.png) Also slow to use, and a PITA to even get to the map. I think now that normal people are more used to Google Maps style/simplicity, web-maps should follow a similar approach. With the explosion of 'NeoGeography' particularly in the web realm, we now have a lot of non-GIS professionals creating maps for the web. A lot of these developers are often very good at user-interface design, but not trained in cartographic principles. IMO, with web maps, its all about combining the skills of both cartography and user interface design.


Delete the least populated polygons

Here is the plan. I need to delete every metro's least populated census tracts (in terms of population density). To what extent? As to preserve 98% of the metro's total population. I don't know how to program. Is there any existing tools I can use? Thanks everybody!! S.


How to convert GML Surface to SHP Using OGR?

I have a very large .gml file with multiple layers in it. I would like to export one of these layers to .shp. It is a polygon layer (of lakes). However, I am getting the error: ` ERROR 1: Unrecognised geometry type `<Surface>`. ` The ogr command I was using: ` ogr2ogr -f "ESRI Shapefile" output.shp input.gml layername ` Any thoughts? Is it possible the polygon layer is somehow incorrectly defined as a surface in the GML? Any way I can force it to be a polygon? Or is it something else entirely? I don't often work with .gml, so may be missing something obvious... EDIT 20101202: Here is a snip of (what appears to be) the relevant info from an example feature in the example file linked below: ` `<gml:featureMember`>   `<gml:surfaceProperty`>   `<gml:Surface srsName="EPSG:4140" srsDimension="2"`>   `<gml:patches`>   `<gml:PolygonPatch`>   `<gml:exterior`>   `<gml:LinearRing`>   `<gml:posList`>52.2023177 -77.596532 52.2024007 -77.5963559 52.2028141 -77.5962899 52.2028362 -77.5964181 52.2026119 -77.5967049 52.2024106 -77.5967968 52.2023273 -77.5966966 52.2023177 -77.596532`</gml:posList`>   `</gml:LinearRing`>   `</gml:exterior`>   `</gml:PolygonPatch`>   `</gml:patches`>   `</gml:Surface`>   `</gml:surfaceProperty`>   ` So, the file is identifying it as a 'surface' as well as a 'PolygonPatch'? Perhaps the question should be: what is a 'surface' in a .gml file?


Mapping Data to Graphical ; three ways of representing objects

Chapter 3 of _introduction to Data Mining_ , on a section about _visualization_ , the paragraph is titled _Representation: Mapping Data to Graphical Elements_ : > Objects are usually represented in one of three ways. > > First, if only a single categorical attribute of the object is being > considered, then objects are often lumped into categories based on the value > of that attribute, and these categories are displayed as an entry in a table > or an area on a screen. (Examples shown later in this chapter are a cross- > tabulation table and a bar chart.) > > Second, if an object has multiple attributes, then the object can be > displayed as a row (or column) of a table or as a line on a graph. > > Finally, an object is often interpreted as a point in two- or three- > dimensional space, where graphically, the point might be represented by a > geometric figure, such as a circle, cross, or box. Could you please provide examples for each of the three ways of representing objects so that I can understand everything better? I'd be grateful.


Proximity query approach

Let's say that I have two tables in PostGIS, tracks and cities, each table has two columns, in both cases the columns are called name and way, name is a string, way is a geometry. I want to retrieve a list of tracks by name, something like:               SELECT name, way FROM tracks WHERE name = 'Mountain Trail';      But I also want to retrieve the name of the closest city to that track. Something like:               SELECT name, way, closest_city_name FROM tracks WHERE tracks.name = 'Mountain Trail';      But there is no closest_city_name column, I want to calculate the closest city as part of the query. I'm familiar with ST_Distance and using joins and subqueries but I'm not sure how best to put it all together for this query. Is there a way to JOIN cities to tracks using "closest"? Or should I query against the tracks table and a subquery on the cities table or vice versa? Sorry this is quite a vague question, I'm just really looking for someone to point me in the right direction, perhaps an example query that you have used to do something similar? Any suggestions greatly appreciated. Thanks!


Publishing a map with geoserver

I don't know why the users that visit my website cannot see the map i have published with geoserver. The steps i took to do this have been: importing the data to geoserver   * adding the layers to geoexplorer   * i have changed the style a little   * hit publish map on the geoexplorer   * selected the tools i want to have - next   * copied the link that i need to copy in the webpage   * changed from localhost to the name of my pc   * pasted the code in my webpage.   * i can see the page with the map frame, but the visitors cannot. the error they get is: "the server refused the connection" thank you.


Automatically display related records for selected feature in tablewindow with ArcObjects

Is there a way through ArcObjects to automatically display the related table(s) for the selected feature in ArcMap in the attribute window (tablewindow) without the user having to click on it and select the related table. I can add a button that displays the tablewindow but I don't see how I can automatically display the related tables tab that appear in the window when the "related tables" button is clicked. There is an ITableViewCallback interface that has a ShowRelationshipTable method to display related records. I can create a class that implements that interface but that doesn't seem to be what I want. I really just want to call the "ShowRelationshipTable" method of the tablewindow which doesn't seem to be exposed. I've also tried executing the command for "Related Tables" in the tablewindow which I think is: esriGeoDatabaseUI.TableContextMenuRelationships but that doesn't do anything either. Is there a way with ArcObjects to automatically display the tabs for the related data without the user clicking on it?