inner convex-hulls in a set of 2D points

A set of 2D Points are scattered randomly (i.e., no specified pattern), we are interested in finding all **inner-convex-hulls** (ICH) in an order of largest in area to a minimum until the entire study area to be covered by set of ICHs, if possible. As shown in the following figure, it appears that the green convex-hull is the largest possible inner one. We mean inner implying that no point can be inside in the desired convex-hull. The boundary condition for the region can be a normal (i.e., conventionally recognised) convex-hull for all points. In Figure for the first largest in area inner-convex-hull #1 is selected first. The area covered by #1 is then excluded to avoid overlapping problem of the next generations. It seems a bit confusing and hard, hope Figure helps. We guess may be the concept of largest enclosed ellipse could help. It is however a starting guess. ![enter image description here](http://i.stack.imgur.com/7EvSi.jpg) **Update 1:**   Well the result of our implementation of the idea given below by `Uffe Kousgaard` is here: ![enter image description here](http://i.stack.imgur.com/5AIzl.png) Numbers are ranks i.e., smaller number, larger area. It shows working, however, we noticed several cases the result is not correct. It may be due to bugs in our implementation or the method as noted by `whuber` below as comment. Here is result of the method mentioned by `Uffe` applied on `whuber`'s data: ![enter image description here](http://i.stack.imgur.com/bkN1i.png) Apparently something does **NOT** work well! **Update 2:**   The correct complete solution is as follows (for `whuber`'s example data): ![enter image description here](http://i.stack.imgur.com/aTw8M.png) There are three stages, therefore, to complete the solution. We apply the method fully on each stage. That is, at stage one when all triangles were visited for possible largest inner convex-hull, the selected ICH is stored and the obsolete associated edges/points are removed from data. The procedure starts again for the remaining data. Found a solution, the steps just mentioned above apply. After exhausting all iterations (in a lucky situation as here) the area is fully covered by ICHs (here by 3 ICH) which is our ultimate goal. Note that the given answers so far are only one iteration. Here we show our understanding of `whuber`'s comment/answer. ![enter image description here](http://i.stack.imgur.com/ffSfo.png) He was correct that greedy approach won't work as demonstrated above. This disqualifies `Uffe`s idea as a fully correct solution, unfortunately. It looks more challenging thus compared to the initial thoughts.


Custom filters (server side) for Openlayers Vector Layer

I have a vector layer in openlayers with source in GEOJSON (custom php server, which I have in complete control) and BBOX strategy. Vector points contain point sources which have different attributes. I want to implement some filters by one or two attributes. I can manage server side php code - for e.g. I can get the filters by adding URL parameters to existing url like:               Existing URL: mywebservice.php     Filtered URL: mywebservice.php?someattributte=somevalue      Can you please help me, how to implement it on the openlayers side? My code is as follows:                           var in_options = {                     'internalProjection': EPSG_900913,                     'externalProjection': EPSG_4326                 };                 var ems_sources = new OpenLayers.Layer.Vector(EMS_SOURCES_TITLE, {                     strategies: [                                  new OpenLayers.Strategy.BBOX({                                      resFactor: 2,                                      active: true,                                      autoActivate: true,                                      ratio: 1.3                                  })                                   ],                      protocol: new OpenLayers.Protocol.HTTP({                          url: EMS_SOURCES_WS,                          callbackKey: 'callback',                          format: new OpenLayers.Format.GeoJSON(in_options)                      })                 });       Thank you very much for your answer. Matej


Tool or environment <MakeFeatureLayer_management> not found, Failed to execute (AttributeSearch)

I have created a arctoolbox with scripts in it. In the script, I set the source script file (a python file), my question is when I run this python using a batch file, it won't cause error, unfortunately when I use the arctoolbox script to run the python script, I got the following error: **Tool or environment not found, Failed to execute (AttributeSearch).** The following is my python script details:               '''----------------------------------------------------------------------------------      Tool Name:     SelectLayerAttribute      Source Name:   SelectLayerAttribute.py      Version:       ArcGIS 10.2     ----------------------------------------------------------------------------------'''     import arcpy     # Set the workspace     arcpy.env.workspace = "c:/Users/lyao/Desktop/PUB_GIS_Tagging/GIS_DMS.gdb"     # get user supplied path, layers and fields     Value = arcpy.GetParameterAsText(3)     # Make a layer from the feature class     feature = "c:/Users/lyao/Desktop/PUB_GIS_Tagging/GIS_DMS.gdb/BQ_Segment_test"     arcpy.MakeFeatureLayer_management(feature, 'lyr')     where = '"DrainName" = ' + "'%s'" %Value     #arcpy.SelectLayerByAttribute_management("lyr", "NEW_SELECTION"," \"ROAD_NAME\" = "'%s'" % Value ")     arcpy.SelectLayerByAttribute_management("lyr", "NEW_SELECTION",where)


Calculating Percent Overlap Between Distribution Maps

![enter image description here](http://i.stack.imgur.com/sGmw0.png) ![enter image description here](http://i.stack.imgur.com/iahZm.png) Hello there, I am currently trying to calculate the percent overlap (basically the total amount of overlap where these two species come into contact) between Lithobates catesbeiana (first image) with the current distribution of all other amphibian species in Asia (second image). I am trying to use Q GIS to do this, and I've tried converting them to vectors, calculating intersect, etc. but to no avail. I would really appreciate it if someone could guide me as to how to do this in GIS? Thank you for your time!


Is there a way to hillshade vector polygons with a DEM in QGIS?

I have a layer of cadastral polygons that I'd like to display as hillshaded. For the elevation model I can use either an SRTM geotiff or use a set of 20m contour vectors. While I could make a jpeg of the cadastral regions and drape that (never done it in QGIS, but I think you can call GRASS to do it), is there a way to directly drape and hillshade the vectors? * * * UPDATE 1: SOLUTION BY MAKING POLYGONS TRANSPARENT. In my first try, I have opted for this method: Basic white hillshaded SRTM DEM, with 10m contour vectors added and coloured cadastral polygons made 60% transparent. Not too bad for minimal effort, but a bit dull. !["Hillshaded" cadastral map](http://i.stack.imgur.com/pJWxw.jpg) * * * UPDATE 2: USING BLEND MODES FOR LAYERS IS REALLY EASY It turns out that the suggestions to use layer blending modes does not require any great delving into the inner workings of QGIS, but is right there in the layer properties, and is as easy as changing a line width or a fill colour. See screenshot below. Also I found some nice examples and discussion of it from the developer, Nyall Dawson nyalldawson.net: Blend modes for layers. ![Layer blending mode command](http://i.stack.imgur.com/gzP2W.jpg) * * * UPDATE 3: **LAYER BLENDING MODE "BURN" GIVES THE RIGHT RESULT. JOB DONE.** The screenshot below provides me with a solution to my initial question, "is there a way to hillshade vector polygons with a DEM in QGIS". I would now say yes, or at least the illusion of it is practically perfect. The Screenshot actually shows two blending modes compared. The one above the thick red line is " **multiply** " applied to a 60% transparent green polygons, while below is " **burn** ", also to a 60% green polygon. Burn gave a brighter, more '3D' result. ![Multiply vs Burn](http://i.stack.imgur.com/GUheE.jpg) Two points to note: I still found the contour lines necessary to promote the effect; without them the DEM lacked visual form. The contours are above the polygon layer this time (looks better), whereas my old screenshot had them under (looks worse). Secondly, when using Burn, I had to put the cadastral boundaries as a separate layer over the green fill layer, because otherwise 'burn' burned the lines out.


Is Nearest not Near enough?

So we have factories, bridges, boat launches and stations that are on our map by latitude and longitude data fed to us from Homeland Security. In a good number of these situations an attack can come from the water even though the "point" where the attack can occur is on the land. I used a process where once we find a point not on the water, we go through this process:   1. Convert the waterway raster to polygons   2. Save all polygons in an array of polygons   3. For the point to be relocated to the water I find the polygon that is nearest, cast that polygon to an IProximityOperator, then call ReturnNearestPoint.   4. Finally for debugging purposes we then call CheckCoincidence and we frequently get back a an indicator that the point STILL is not on the water. Now the stranger part of this is we put the point (that is now Coincident) into a point array and call CostPathAsPolyline which then very nicely throws an exception that tells me diddly poop as to what is wrong with my point. The exception basically states that "all point are at their maximum value in the grid" and naturally ESRI did not document this at all. We assume this happens when either   1. The item is still not in the water (thus surrounded by NoData all around it)   2. OR the point is in a location that cannot reach the main point In testing we make certain the latter is not the case by specifically putting points in an area such that all targets are reachable. So if they get moved to the nearest point on the polygon, the CostPathAsPolyline should still work even if the point is on the outer edge of the polygon. Does anyone have any insight as to why this exception would be thrown when the point is moved onto the waterway???


Combine cached and dynamiclly created tiles in the ArcGIS DynamicMapService

I have a pretty big dataset (~4M points covering all of the North America) that needs to be published to the ArcGIS Server. If I wanted to cache the service for all zoom levels, it would require more than 100TB disk space. Therefore, I thought of caching only smaller scales up to a certain zoom level and generate large scale tiles on demand. In relation to the above, I have two questions:   1. Is it possible to use cached tiles up to a certain zoom level and dynamically generated tiles when the user zooms in further for the same ArcGISDynamicMapService?   2. Or is it possible to cache only a certain layer within a Map Service? Thanks,


How to add flow arrows to groundwater table map?

After I had created groundwater table map, I tried using 3D Analyst>Steepest Path to add groundwater flow arrows to the map. However, it didn't work. Would you please let me know how can I add these flow lines to the groundwater table map?


"ImportError: No module named gdalsrsinfo" What's the issue?

in the python console I can call **import gdal** , and gdal is recognized as a module; however, most gdal programs, such as **gdalinfo** and **gdalsrsinfo** are not recognized. I checked the GDAL source files to see if there was a problem with the PYTHONPATH. They were not in the QGIS application resources, so I moved them manually… this still did not solve the problem. if i enter **gdalsrsinfo /Filepath/File.prj** the console returns the error: > Traceback (most recent call last): File "", line 1, in File > "/Applications/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", > line 453, in _import mod = _builtin_import(name, globals, locals, fromlist, > level) ImportError: No module named gdalsrsinfo However this is a function that should be included in GDAL by default. Why is it not recognized? I am using the latest version from KyngChaos Any help appreciated. Thanks!


Extract layer attributes and addresses QGIS

I have congressional district layer and a csv file with addresses. I'd like to extract all addresses and their corresponding congressional district. How do I do that using Qgis? The CSV File contains 3 columns including X,Y coordinates. When I import the CSV file with addresses the CRS = WGS84 (EPGS 4326). The Congressional District layer CRS = +proj=lcc +lat_1=34.03333333333333 +lat_2=35.46666666666667 +lat_0=33.5 +lon_0=-118 +x_0=2000000 +y_0=500000.0000000001 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs I am using QGIS version 2.0.1. @Morgan Ellingham, after following your steps, I ran into the following error prompt:![enter image description here](http://i.stack.imgur.com/xsX36.jpg)


how to snap two line vertex in two different layers used in QGIS

![enter image description here](http://i.stack.imgur.com/El4zR.jpg) I want to snap between two poly-lines from 2 different layers (Layer1 in Brown and Layer 2(postGIS layer) in Pink color- ), but my snap option don't work. I have changed the tolerance to different levels but still not getting the results. ![enter image description here](http://i.stack.imgur.com/06YbG.jpg) I don't get the magenta + sign to appear near vertices for snapping as many say it online.   1. Which tool used for snapping? I know only the "Node tool" which is not working .   2. I have set both layers editable (toggle editing set: ON)   3. Is there any better plugins there(I have tried many available ones.)? Please give me suggestions since I am a beginner in QGIS.


How to integrate google map to slate template using MapGuide Maestro 5.1?

when I try to add google maps v3 layer through commercial map service layer I get Fusion Error: FATAL: failed to load script: mapguide/fusion/Google/Google.js. I am using WGS84 co-ordinate system. and mapguide server 2.2. what is the exact problem ? whether the problem is with co-ordinate system or some library file for fusion is missing?


How to load big geo-data file into web application

I am building a web app where I show details in map. I load data using geojson file (190 mb). I was looking in different possibilities to show the data, here there are:   * Leaflet GeoJSon: it should make it easy to load huge data, but I am not seeing effects on my work.   * Tile Layer http://bl.ocks.org/glenrobertson/6203331 It doesn't support some data viz libs that I am using   * Leaflet Vector layer http://geojason.info/2012/leaflet-vector-layers/ didn't get good results (having probs with data viz)    * TopoJson : resized the file from 190mb to 170mb. I still face the same problem. The simplest way to load the file is using jquery "getJson".               jQuery.getJSON(url, function(data){     ..     }      Someone suggested to stream the JSON data rather than bulk-load it. I have tried https://github.com/tmcw/geojson-stream . I couldn't get great results in all the cases. Can you please suggest any better approach ?


Add GIS functionalities to existing java based tool/application

I have a tool/application and want to add GIS functionalities to it. I will be mainly working with the vector data. The required functionalities are:   1. Adding/importing the GPS point data and generation of polygons from the points.   2. Classification in maps based on various attributes.   3. Labelling of the features.   4. Generation of maps.   5. Spatial queries (attribute and location based).   6. Network analysis (finding shortest route between two points).   7. Add google/bing map as a base layer. I came across that QGIS is able to all the functionalities mentioned above. Can anyone suggest me if it is possible to integrate the QGIS with java based tool/application or are there any java based GIS tools (user-friendly) able to perform these requirements.


Unable to use pyQGiS in a custom application - import arcgis.core error

I'm using windows 7 and/or 8 64 bit with QGiS 2.01. I'm wanting to us the pyQGiS tools in a custom python application outside of the QGiS environment (i.e by running a python executable located in C:/Python27. To do this I have been following the instructions posted at http://www.qgis.org/en/docs/pyqgis_developer_cookbook/intro.html For the first step (to remove the error "ImportError: No module named qgis.core") i set my pythonpath to "C:\Program Files\QGIS Dufour\apps\qgis\python" As expected I now get an error:   File "C:\Program Files\QGIS Dufour\apps\qgis\python\qgis__init__.py", line 26, in import sip ImportError: DLL load failed: The specified module could not be found. The instructions say to add "the directories where the QGIS libraries reside". I have tried adding a number of paths, with no success. I also cannot locate the sip.dll file anywhere within the C:\Program Files\QGIS Dufour directory? Have I made a mistake on the first step? Does anyone know which paths I need to set? Cheers,


Why do tiles seems to jump around when using ArcGIS cache layer in Openlayers?

I am use Openlayers to add ArcGIS tilecache layers using arcgiscache class or another way which is jsonp. I can show the map properly, but when I pan, zoom or drag the map, the tiles seem to jump around, it does not look any good. Can anybody give me some advice? In **this example** it has been noticed that a problem the users encounter is that the tiles seem to "jump around", but I do not know how to handle it ！               var markers, layer;     var features = [];     var map, baseLayer,         layerURL = "myurl";          function init() {         var jsonp = new OpenLayers.Protocol.Script();         jsonp.createRequest(layerURL, {             f: 'json',             pretty: 'true'         }, initMap);          }     function initMap(layerInfo) {         baseLayer = new OpenLayers.Layer.ArcGISCache("arciscache", layerURL, {             layerInfo: layerInfo         });         map = new OpenLayers.Map('map', {             maxExtent: baseLayer.maxExtent,             units: baseLayer.units,             resolutions: baseLayer.resolutions,             numZoomLevels: baseLayer.numZoomLevels,             tileSize: baseLayer.tileSize,             eventListeners: { //set event handler                 "moveend": moveEvent}                  //displayProjection: baseLayer.displayProjection         });              var zoomControl = map.getControlsByClass('OpenLayers.Control.Zoom')[0];         map.removeControl(zoomControl);              map.addLayers([baseLayer]);         map.addControl(new OpenLayers.Control.MousePosition());              map.addControl(new OpenLayers.Control.Navigation());         map.addControl(new OpenLayers.Control.PanZoomBar());         if (!map.getCenter()) {             map.zoomToMaxExtent();         }     }


why the numZoomLevels is null when I use jsonp to add esri rest layer in OpenLayers?

Here is my code:               function init() {         var jsonp = new OpenLayers.Protocol.Script();         jsonp.createRequest(layerURL, {             f: 'json',             pretty: 'true'         }, initMap);          }     function initMap(layerInfo) {         baseLayer = new OpenLayers.Layer.ArcGISCache("baseLayer", layerURL, {             layerInfo: layerInfo         });        console.log(baseLayer.numZoomLevels);         map = new OpenLayers.Map('map', {             isBaseLayer:true,             initialExtent: baseLayer.initialExtent,             units: baseLayer.units,             resolutions: baseLayer.resolutions,             numZoomLevels:baseLayer.numZoomLevels,             tileSize: baseLayer.tileSize,                   });         map.addLayers([baseLayer]);         map.addControl(new OpenLayers.Control.MousePosition());         map.addControl(new OpenLayers.Control.Navigation());         map.addControl(new OpenLayers.Control.PanZoomBar());         if (!map.getCenter()) {             map.zoomToMaxExtent();         }      There exist a few issues:1,I can not get baseLayer.numZoomLevels,when I use console.log(baseLayer.numZoomLevels),It just shows null.2,when I drag or move the map,it will jump around and disappear out of my control.Any body can give me some advice,thank you very much!


why when i am dragging my map or panning the map,the tiles "jump around" and even out of my control?

I took advantage of OpenLayers API,and in that ArcGisCache.js to load layer for reading tiles from an ESRI ArcGIS Server (AGS) ,but the map's render seems not so comfortable.When i am dragging or panning the map,the tiles seems to jump around.And even unfortunately the map would disappear and out of my view!Here is some of my code: var markers, layer; var features = []; var map, baseLayer, layerURL = "myurl"; function init() { var jsonp = new OpenLayers.Protocol.Script(); jsonp.createRequest(layerURL, { f: 'json', pretty: 'true' }, initMap); } function initMap(layerInfo) { baseLayer = new OpenLayers.Layer.ArcGISCache("arciscache", layerURL, { layerInfo: layerInfo }); map = new OpenLayers.Map('map', { maxExtent: baseLayer.maxExtent, units: baseLayer.units, resolutions: baseLayer.resolutions, numZoomLevels: baseLayer.numZoomLevels, tileSize: baseLayer.tileSize, eventListeners: { //set event handler "moveend": moveEvent}                   //displayProjection: baseLayer.displayProjection     });          var zoomControl = map.getControlsByClass('OpenLayers.Control.Zoom')[0];     map.removeControl(zoomControl);          map.addLayers([baseLayer]);     map.addControl(new OpenLayers.Control.MousePosition());          map.addControl(new OpenLayers.Control.Navigation());     map.addControl(new OpenLayers.Control.PanZoomBar());     if (!map.getCenter()) {         map.zoomToMaxExtent();     }      }


Update license for enterprise geodatabase with GP/Python?

I am attaching dozens of database files to a SQL Server instance and then I have to run sdesetup command to update the geodatabase license by pointing to my ArcGIS Server license. I am trying to find a way to automate this process. Two ways to update the license (as to my knowledge are): 1.Connect to geodatabase instance as administrator user in ArcGIS Desktop (ArcMap for instance) and then use the Update ArcGIS Server License window to browse to the .ecp file or keycodes file. ![enter image description here](http://i.stack.imgur.com/RqNFj.png) 2.Use sdesetup –o update_key ArcSDE command line to update the license. These command line utilities are going to be deprecated soon, though. ![enter image description here](http://i.stack.imgur.com/qWFH4.png) Neither of these alternatives provide any way to automate the process. In the latest Esri blog post on this topic, there was no information on this apart from what I have outlined above. I have not found any related ideas on ArcGIS Ideas either. Is there any other way I am not aware of? Do you know if Esri is going to provide tools for automating license update process?


how to convert grid from Saga gis to have raster in Arcgis?

i am new in Saga Gis, i created grid- LS factor (from Rusle equation for erosis) in Saga gis and now i need to "put" it to Arcgis. How can i do this? I tried a lot of possibilities and none of them worked. Thanks


information from a shapefile to another shapefile

I am very new to GIS and learning by myself so what I'm about to ask is possibly quite basic. I am using QGIS. I have a shapefile, which categorizes areas (land cover) by numbers (corresponding to land cover classes). I have created a wkt file with twelve polygons, with the following structure: id|polygon e.g.:               150-180|POLYGON((559053 4367372,559053 4364372,557553 4366970.07621135,559053 4367372))          120-150|POLYGON((557553 4366970.07621135,559053 4364372,556454.923788647 4365872,557553 4366970.07621135))          90-120|POLYGON((556454.923788647 4365872,559053 4364372,556053 4364372,556454.923788647 4365872))     ....      The polygons from the wkt file superimpose categorized areas from the shapefile. I wish to know the following: how much of each category (from the shapefile) is included in each polygon from the wkt file? e.g.: 150-180: 0.25 of the area is category 232 + 0.70 of the area is category 123 + 0.05 of the area is category 657 how can I do this? many thanks.


ESRI JS API, how to disable panning with the numeric keypad?

We have a web-based mapping application that uses the ESRI JS API. We would like to disable panning with the numeric keypad. There is a method in the API, **esri.Map.disableKeyboardNavigation()** , that disables panning with the dedicated arrow keys and leaves the numeric keypad enabled. We want just the opposite, i.e disable panning with the numeric keypad and leave the dedicated arrow keys enabled. _Why do we want to do this?_ We have a search box above the map, and if you click on the search box to give it focus and start typing, and the _arrow_ cursor (not the _vertical bar_ cursor, which is still in the search box) drifts back down into the map, using the numeric pad to type numbers results in panning of the map instead. We have tried various combinations of capturing the keyup, keydown, keypress events for the map and the search box, but have not found a combination that solves our issue. **EDIT:** ESRI's samples have the same behavior, so here is one of their samples in a jsfiddle: http://jsfiddle.net/Q4NVN/2/. It successfully stops the panning, but numeric input is blocked when the arrow cursor is over the map. Ideally, we should be able to enter digits whenever the vert bar cursor is in the test box, no matter where the arrow cursor is.               $("#search").keydown(function (event) {       var x = event.which;       if (x > 96 && x < 106 && $('#map').is(":hover")) {         var press = jQuery.Event("keypress");         press.ctrlKey = false;         press.which = x - 48;         press.keyCode = x - 48;         press.charCode = x - 48;         $("#search").trigger(press);         event.preventDefault();         return false;       }     });      **EDIT:** This would _appear_ to work, but does not take into account cases where the vert cursor is not at the end of the string (e.g. editing the search criteria):               $("#search").keydown(function (event) {       var x = event.which;       if (x > 96 && x < 106 && $('#map').is(":hover")) {         $(this).val($(this).val() + (x - 96));         event.preventDefault();         return false;       }     });


Tranform Lat/Long NASA points into raster

I have this irradiation file and I would like it to upload it in ArcMap in order to overlay it with other layers to do clips, intersections, etc? http://eosweb.larc.nasa.gov/sse/global/text/direct_radiation


How to Bind attribute fields to combobox?

I'd like to list attribute fields in a combobox. there are two combobox . cmblayers and cmbfields . cmblayers list map layers . user select a layer in cmblayer and attribute fields of selected layer list in cmbfield. i wrote cmblayer but i can't write cmbfield code.How can i write cmbfield using xaml or code behind? cmblayer code :               <ComboBox x:Name="cmblayers"  ItemsSource ="{Binding ElementName=Map, Path=Layers}"    >                               <ComboBox.ItemTemplate>                                         <DataTemplate>                                             <TextBlock Text="{Binding LayerInfo.Name}"/>                                         </DataTemplate>                                     </ComboBox.ItemTemplate>          </ComboBox>      i found the below code . but it just bind to specify layer. i couldn't bind cmblayers to cmbfields               <ComboBox x:Name="cmbFields" ItemsSource="{Binding ElementName=Map, Path=Layers[IncidentsLayer].LayerInfo.Fields}">         <ComboBox.ItemTemplate>             <DataTemplate>                 <TextBlock Text="{Binding Name}"/>             </DataTemplate>         </ComboBox.ItemTemplate>     </ComboBox>


i.maxlik cannot read i.class output signature file

I'm trying to perform a supervised classification using i.class. I'm then using i.maxlik, but this is returning the following error:               GRASS 6.4.3svn (India_01):~ > i.maxlik group=test_group@test subgroup=test_group sigfile=test_sigfiles1 class=test_results1     ERROR: Unable to read signature file <test_sigfiles1>      I'm not sure what other information I should provide. Can anyone suggest the possible reasons for this error? I've tried using i.cluster to generate an unsupervised signature file, and i.maxlik reads this perfectly well. Many thanks.


Splitting a branched river network at point layer

I need to split a country-scale river network (polyine) at certain barriers (point) so the length of (branched) river sections that have a certain minimum length. I used the following procedure: 1) Merge/Unsplit river network to one long line (only one row in the attribute table). 2) Split line at Point. The problem is now that it **not only splits the lines at the barriers, but also at intersections/branchings** within the river network. I also tried Xtool's split line feature with similar results, and gvSIG's sextante toolbox didn't work at all for me. Any suggestions? I am using ArcGIS 10 SP5, but also open to solutions in Qgis or gvSig


ArcGIS Add Join Attribute Table on ModelBuilder

I can Add Join Attribute Tables using two shape files by manual on ArcMap. But I want to add join attribute tables using two shapre files on ModelBulder without ArcMap. Can I do it ? Please let me know some informations.


merge polygon in ArcGIS

I have 300 polygons in a single Shape file, I want merge some polygons together, when I merge two polygons the attribute does not come total count of two polygons, What I need is, when I merge two polygon the attribute value has to add together and the total value has to come in merged polygon attribute.


Why does destroying a popup cause a "this.events is null" error?

I am trying to create dynamically generated popups in OpenLayers with a mouseover event. According to the documentation, it is recommended that the popups be destroyed after use to avoid memory leaks. I set up an event listener that destroy the popup upon a mouseout event as follow:               marker.events.register("mouseout", marker, function(event) {         popup.destroy();     });      While testing on jsFiddle upon map initialisation, I am able to create and destroy the popup on the first mouseover and mouseout. Subsequent attempts of mouseout result in a "this.events is null" error appearing on my javascript console log. It seems to me that the first instance of `popup.destroy()` might have destroyed more than just the popup itself, causing the second instance to fail. Can anyone enlighten me on how to resolve this issue without deviating too much from the current setup?


Can I clip vector shapefiles more efficiently？

I have a river shapefile, got from r.watershed module, and it looks like this： ![enter image description here](http://i.stack.imgur.com/BTiew.png) I have eight points on the river which I want to analyse, and I only want this river segments：(the second photo below is the river I want) ![enter image description here](http://i.stack.imgur.com/xDSYW.png) ![enter image description here](http://i.stack.imgur.com/N8KjQ.png) So I open its attribute table to delete segments I don't want, but I think it's not efficient. I have tried the intersect tool in Geoprocessing tools, but the results were not what I want. Is there more efficient way to achieve this goal？


I've performed hydrological analysis using `r.watershed` using GRASS and now I have some stream vectors for a large area. Next, I'm planning to taper these streams to varying width to make them appear more 'natural'. **Is there an easy way to taper huge amounts of drainage vectors?** I have Inkscape, GIMP, GRASS and QGIS at my disposal. I appreciate any help I can get, thanks.


Display a control (zoom bar) outside map container in Leaflet?

I need to extend a zoom control so that it is functional outside of the leaflet map container. Can this be done? Essentially,the same idea as what is accomplished with this item here but under the leaflet context and not openlayers. How to display a control (zoom bar) outside map container in openlayers? Thanks,


PostGIS: How to understand ST_RasterToWorldCoord() right? (PostGIS 2.0)

After putting raster in to postGIS by this Thank @Sorin for helping me out! Now, I want to output raster tile, then view it on QGIS. But the problem is the output of ST_RasterToWorldCoord(raster rast, integer x, integer y) makes me confused. I have 2 questions here:   1. According to the docs, the function returns (long,lat) of the upper left corner of raster. So what is the use of the last 2 params (x,y)?   2. I run the sql, and got the result of a raster (long,lat) = (563985, 2346615). I don't understand the result here. I think the long, lat values should be with in (-90 -> 90, -180 -> 180).   I output the raster to file, and view it on a map. But the coordinate of the raster seems to be wrong, so it cannot be displayed. Here my query:   SELECT st_rastertoworldcoord(rast,1,1) FROM landsat **EDIT:** I have a raster before putting in postGIS. I can display it in QGIS, and it interscts/overlap some polygons, which come from a SHP file.   However, after cutting it into tiles and putting it into postGIS then run ST_Intersects(rast, geom). The function return 'false' in all rows. **EDIT:** My raster was imported with SRID 4326 **EDIT:** (long,lat) = (-180 -> 180, -90 -> 90).


How to query data like only for point by from a grouplayer by using WMSGetFeatureInfo in Openlayers?

till now I have been known how to query data from a groupLayer by using WMSGetFeatureInfo while the point is it shows a lot of associate results features,so I aim to query a single layer infomation from `enter code here`a groupLayer,just like only query point information.I don't konw whether it is right to use filter or CQL ,does anybody know how to handle this and can anybody give me a demo?               Here is My code:     var styleMap = new OpenLayers.StyleMap({                  "default": {                      fillColor: "#990033",                      fillOpacity: 0.4,                       strokeColor: "#990033",                      strokeWidth: 1,                      strokeDashstyle: "dash"                       }              });                  var highlightLayer = new OpenLayers.Layer.Vector("Highlighted Features", {                 displayInLayerSwitcher: false,                  isBaseLayer: false,                  styleMap:styleMap                 });             this.map.addLayer(highlightLayer);                  var filterCql1 = "ROADCODE IS NOT NULL";             var filterCql2 = "ROADNAME IS NOT NULL";             var filterCql3 = "STARTZH > 0";             var info = new OpenLayers.Control.WMSGetFeatureInfo({                 url : 'http://geoserver:8080/hdmapserver/wms',                 title : 'Identify features by clicking',                 //output:"object",                      /*                  * hover:true, handlerOptions:{ //"click": {delay: 100}, "hover":                  * {delay: 300} },                  */             //  layers:[point,point1],                 maxFeatures : 10,                      infoFormat : "application/vnd.ogc.gml",                 vendorParams : {                     //'CQL_FILTER' : filterCql1/* +";"+filterCql2+";"+filterCql3, */,                     //featureId:"",                     radius : 5                 },                 queryVisible : false,                 eventListeners : {                     getfeatureinfo : function(event) {                         var data = event.features[0].attributes;                         if(event.text != null){                             this.map.addPopup(new OpenLayers.Popup.FramedCloud(                                     "chicken",                                     this.map.getLonLatFromPixel(event.xy),                                     null,                                     "
"+data.num+"
"+"
":"+data.name+"
",                                      null,                                      true));                              }                         //console.log(data);                                  if(event.features.length>=1){                             for(var i=0,j=event.features.length; i<j;i++){                                 console.log(event.features[i].geometry);                                 }                              }                          }                 }


Is it due to irregularity of geoid, we cannot convert the height between spherical datum and local datum by cs2cs?

Is it due to irregularity of geoid, we cannot convert the height between spherical datum and local datum (which uses locally defined geoid and height) by cs2cs? What I mean is that, by using cs2cs, it only accepts x and y / lat and lon as input. The z / height data is not accepted for the conversion program. Does it mean that z / height cannot be directed converted? What if I convert between spherical data, can it be converted directly by using projection formula?


Divide polygon based on points for even distribution

If I have a point layer, how can I create a polygon that includes all of the points and divide that polygon into _n_ sections in which each section contains an equal number of points? Preferably in QGIS, but other systems are acceptable.


Assigning an intersecting line length dependent value to a raster during polyline conversion

I am converting a road network polyline into raster format- my polyline shapefile has an exhaust emissions rate attribute which is in kg/km What I want to achieve is a raster that has (at say 5m resolution) cells with computed emission values that are a function of the length of road that falls within the cell times the emission rate. For example, for a cell of 5m if the road line intersects at 45 degrees through each corner of the cell the raster value should be the emission rate times 7.1 (a^2+b^2=c^2)- at the moment ArcMap is just taking the raw emission rate and making no correction for geometry. Can anyone help? I use Arcmap and QGIS. Thankyou!


How to derive soil water holding capacity from Landsat data

For estimation crop yields, I need some information such as Soil water holding capacity, potential evapotranspiration, crop types of the area, etc. For this purpose, I want to derive Soil Water Holding capacity from Landsat data. Is it possible to use Landsat data and ArcMap or other related software do this?


Importing shapefiles to SQL Server

I often use the brilliant SQL Server 2008 Spatial Tools to import shapefiles into SQL Server 2008. This works absolutely fine but it leaves me wondering, how do Microsoft expect end users of SQL Server to get shapefiles into SQL Server? What is the _official_ method for importing this data? The only references to this I've spotted on GIS.stackexchange are these questions: How to import shapefiles into MS SQL 2008 and then view that data using QGIS? and How to import shape file into SQL Server 2008 R2 using only SQL scripts? , which references spatial tools, GDAL etc. but nothing from Microsoft. Is there something I've missed? Call me naive but I'd almost expect there to be an option in the data source list in SQL Server Import/Export wizard for shapefile! In summary: I'm not asking how to import shapefiles into SQL Server, I'm specifically asking how _Microsoft_ expect us to import shapefiles into SQL Server.


MapInfo / MapXtreme is it possible to get the Features from a Table

I'm trying to get the Features from a table with MapXtreme 7.0.0. I use winforms with the MapControl from MapInfo. Is it possible to get all the Features from a table? Something like: `table.GetFeature();`


Join excel attributes to shape attribute

I am wondering if there is a way to join the attributes from excel tables to shapes in Qgis. I have abbreviations in the shape and want to add the associated complete names from excel file by automatically join. The abbreviation is also given in an excel column. Once there was a tool "join attribute" that is missing now. I tried to join by using properties/ join but then it is only possible to choose shape-files. Thank you for your help!! andreas


How to specify cost attributes for network analysis in QGIS using the GRASS plugin?

I have a road dataset with information about the length, speed and drivetime for each segment. I use QGIS 1.9 with the GRASS plugin to do different types of network analysis, but how do I set up the drivetime attribute as the cost for my analysis? Or perhaps the road length? In GRASS 6/7 you can specify this column when you do the analysis, but not in the GRASS plugin in QGIS? The same applies to my road directions, how can I take into consideration one way streets, which I have information about in the attribute table? Thanks in advance!


Arcobjects - Make new folder

Does anybody know how to create a new folder with arcobjects? This is what I want to do: insert a text in a TextBox and, when I run the aplication, it will create a folder with the name wroten in the TextBox. Thanks, Alex


Python-OGR: nested loop only loops once

I have a polygon file `buffer_stands.shp` with 20 features and I have a line file `OSMroads.geojson` with 9 features. I expected the script to loop through the buffers and print out for each buffer loop the the point count of each of the OSMroads. I know it doesn't sound useful, but the script is a simplification of a bigger script. The outer loop loops all the way through. But the inner loop only loops once. What is causing that and how can I fix it?               import ogr          bufferfn = ogr.Open('buffer_stands.shp')     buffer_lyr = bufferfn.GetLayer()          roadfn  = ogr.Open('OSMroads.geojson')     road_lyr = roadfn.GetLayer()          for buffer_feat in buffer_lyr:         buffer_geom = buffer_feat.GetGeometryRef()         print 'buffer'              for road_feat in road_lyr:             road_geom = road_feat.GetGeometryRef()             print road_geom.GetPointCount()      * * * The output looks like this               >>>      buffer     10     62     17     46     10     28     97     78     121     buffer     buffer     buffer     buffer     buffer     buffer     buffer     buffer     buffer     buffer     buffer     buffer     buffer     buffer     buffer     buffer     buffer     buffer     buffer      It shows the inner loop is running only once.


ArcGIS Server js api - buffer query against polygons and not points

I'm using the below sample and i want to change the queried results from points to polygons http://help.arcgis.com/en/webapi/jav...ry_buffer.html Probably very simple but cant get my head around where to change it. I tried replacing the queryTask to http://sampleserver1.arcgisonline.co...SA/MapServer/1 and changing the symbol style to reflect this but it didnt seem to make much difference. I'm sure that somewhere and i cant see where, i need to make reference to the fact that we are now querying polygon and not point data.


Memory leak in ArcGIS aggregate points/buffer/Addfield/cursor

I am starting to have concerns about the ability of ArcGIS 10 to fulfill a deliverable of mine. It got me to wondering what exactly else there is, that can perform similar functionality? ET Geowizards has been tried, although it doesn't have the same capability of ArcGIS e.g. I cannot aggregate all of the points I have with ET, to the scale I have them plotted. I have no real experience of open source GIS, so am asking what is there, and what limitations do they have, as a synopsis. Thanks in advance. **EDIT** _To specifically state issues. There is a memory leak, which means looping through 700 objects, performing:_   1. Agg Points.   2. Buffer.   3. Add Field.   4. Update cursor. Starts off taking 5-9 secs per object, and continues on to 2 mins per (similarly sized) object. In SP2, it appears AggPoints no longer works to create an FC on the fly. There is more, but it's too long a list to compile! **EDIT # 2** Code, simplied with no buffer, add field or cursor. geom is a collection or arcpy points               def createGeom(geom, scratchDB):         filetime = (str(time.time())).split(".")         outfile = "fc" + filetime[0]+filetime[1]         outpath = scratchDB + "tmpV.gdb/Polygon/"           outFeatureAggClass = outpath+outfile +"_Agg"         arcpy.AggregatePoints_cartography(geom, outFeatureAggClass,"124000 meters")      **EDIT #3** Seems to be that the size of the FGDB we're writing to is one of the main issues; I think the problem is that performance degrades as the local file gdb fills up - significantly. Any ideas how to tune local fgdb?


Geoserver MapFishPrintProvider with rtl text reverse the letters

When sending RTL text to GeoExt.data.MapfishPrintProvider I get the PDF with mirrored text (LTR). I've added function to reverse the text in the client , but If I add English words inside the RTL text , I will get the english words reversed into RTL... Is there any solution for this ? For example : mapTitle "TEST" will be RTL also...               printProvider = Ext.create('GeoExt.data.MapfishPrintProvider', {                                 method: "POST",                                  timeout : 30*1000,                                            url: "http://xxxxxxx/geoserver/pdf",                                 capabilities: printCapabilities,                                  customParams: {                                     mapTitle: reverse("TEST בדיקה"),                                     comment: "בדיקה",                                     dpi:300,                                     outputFilename : "map.pdf"                                 }});                         };


How can I change the highest and lowest value of image?

I want to change the highest and the lowest value of raster image. I want it to have the highest value of 345 and the lowest of 0. The highest value of original image now is 265 and the lowest is 0.02. Is there any way to do this using ERDAS, ENVI and ARCGIS? Thanks in advance.


Canvec Symbology in Arcgis 10?

Is anyone working on porting the Canvec Symbology toolkit to ArcGIS 10? How would you go about it if you were? The canvec symbology toolkit is comprised of a canvec.style file (which is an ms-access mdb with a different extension, containing tables of the style names and embedded symbology bitmaps), and an arcmap composition with some VBA code to loop through the table of contents and apply the styles as appropriate.


Mapguide and OpenLayers SRS WKT

I am trying to create OpenLayers vector features based on WKT strings that I retrieve from a MapGuide server. I have successfully gotten the proper geometry to be rendered, but I do not know how to handle the SRS WKT string. As a result, the vectors are being placed in the north end of the DR of Congo rather than eastern Pennsylvania. I was able to retrieve the SRS WKT string:               PROJCS["NAD_1983_StatePlane_Pennsylvania_South_FIPS_3702_Feet",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",1968500.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-77.75],PARAMETER["Standard_Parallel_1",39.93333333333333],PARAMETER["Standard_Parallel_2",40.96666666666667],PARAMETER["Latitude_Of_Origin",39.33333333333334],UNIT["Foot_US",0.3048006096012192]]      What would be the best way to handle this? The base map is in EPSG: 900913.


How to generate raster from vector in QGIS with resolution matching existing raster?

Is there any way to use open source tools (preferably QGIS) to rasterize a vector to create a raster with the same coordinates and resolution as an existing raster? I know that the map size can be set using gdal_rasterize, but I'm hoping for something more precise...


Draw route direction overlay on Google Maps or OpenLayers

I'd like to display the route direction generated from GraphServer on either Google Map or OpenLayers. The result I want is basically identical to how Google Map shows route directions, by highlighting road segments that incorporate the direction. The only difference is that I use GraphServer instead of Google Map's Directions API to generate route direction. Probably the most trivial approach is to copy over the result from GraphServer, literally point-by-point from every road segments that are part of the route direction, to create polylines or DirectionsStep in Google Map. But since this task seems to be something that is used often, I wonder if there is any easier approach. It can be either on Google Maps or OpenLayer, whichever is easier to implement.


Saving Command History/Outputs to a file - GRASS

Is there any way to save the commands typed and the outputs obtained in terminal under GRASS GIS to a text file? I have read that GRASS saves history for each mapset but I have no much idea about how to obtain that. Although there is "Save Output" in "Command Console" in GRASS GIS Layer Manager, many times I have faced a situation when the saved output has only one line!


ArcGIS Find and Replace attribute search error

I am editing a vector layer in ArcMap 10.1 in the attribute table the no data value for some of my fields is -1.7976931348623157e+308. I would like to replace that with 0. I attempted to use the Find and Replace function in the Table Options using the following settings:               Find what: -1.7976931348623157e+308     Text Match: Whole field     Search: Down     Match Case: Unticked     Search Only Selected Field(s): Ticked     Replace with: 0      Clicking either Find Next or Replace All results in an error message:               Search error     An invalid SQL statement was used.     An invalid SQL statement was used. [Ground_Dissolve2]     An invalid SQL statement was used. [SELECT * FROM Ground_Dissolve2 WHERE (htMN = -1.79769313486232e+308)      What does this error message mean and how do I replace -1.7976931348623157e+308 with 0?


How to link 2 different images in eCognition

I'd like to link 2 different images in eCognition to find the same pixels on both images. The images have same projection (geog lat/long). How can I do this? Thank you so much


saveStrategy and OpenLayers

I am trying to apply code mainly from here http://maps.peterrobins.co.uk/files/ol6.html and create a custom "saving button". Problem is, that my json is loaded (from mysql db) to variable. (This time I am using simple json):               data = {         "type": "FeatureCollection",     "features": [         {             "type": "Feature",         "geometry": {             "type": "Point",             "coordinates": [102.0, 0.5]         },         "properties": {             "prop0": "value0"         }         }     ]     };      ...and then stringified like:               data = JSON.stringify(data);      saveStrategy is copied from example above :               var saveStrategy = new OpenLayers.Strategy.Save();     saveStrategy.events.on({         'success': function(event) {             alert('Changes saved');         },         'fail': function(event) {             alert('Error! Changes not saved');         },         scope: this     });      Layer is initialized like :               var vectors = new OpenLayers.Layer.Vector();     vectors.addFeatures(geojson_format.read(data));     vectors.addOptions({         strategies: [             saveStrategy         ]     });      And finally Control Button :               new OpenLayers.Control.Button({displayClass: 'saveButton', trigger: function()    {saveStrategy.save()}, title: 'Save changes' }),      Data from variable data are visualized on maps, I can see them, I can modify them (when adding OpenLayers.Control.ModifyFeature) and everything looks nice. But after clicking "saveButton", nothing happens (not even an alert) and console shows               "Uncaught TypeError: Cannot read property 'features' of null "      I know storing geographical things in variables is (maybe) bad and blabla and external json should be great. But this time it is way easier for me. So should I somehow modify json stored like variable ? What is wrong with my code? Or do you have some alternatives for me? (I would like to send modified data back to my mysql then.) Thanks for your answers...


Webmap app using geoserver must have source code open?

We have a Webmap that uses geoserver + geoExt + openLayers. Even though the JavaScript code is not obfuscated or compressed, at the moment we do not intend to have a place were someone can got and download our website "source code". A friend said that since we use GPL software, we must make the source code available. Now, I believe the use of geoserver, geoExt, openLayers (with its licenses GPL, FreeBSD, BSD) does not enforce me to distribute our webmap source code, is that correct? Or am I understanding GPL wrong? I'm basing my understanding in two sentences, one from GPL FAQ and another from Drupal FAQ. > From GPL FAQ: If I know someone has a copy of a GPL-covered program, can I > demand he give me a copy? No. The GPL gives him permission to make and > redistribute copies of the program if he chooses to do so. He also has the > right not to redistribute the program, if that is what he chooses. > > From Drupal FAQ: 11: Do I have to give the code for my web site to anyone > who visits it? > > No. The GPL does not consider viewing a web site to count as "distributing", > so you are not required to share the code running on your server.


Split polylines in ramps

I have a shapefile (polylines) of some roads and I want to divide the roads in ramps. Ramp = a piece of the road delimited by the top of a hill and a valley. So, pretending that you're driving in these roads, when you're going up you have one polyline for this part of the path, when you start going down you have another polyline of this path. I have the **Digital Elevation Model** of the area, which I made using the "Topo to Raster" tool from "Spatial Analyst". To make it I used the shapefile of the rivers (stream), the limit (boundary), the point elevation and the contour (10 meters) I hope now you understand, my english is not so good... Thank you! PS: I found a set of tools called **ET Surface** and what I need is exactly what the tool **"Split PolylineZ based on slope direction change"** does, but I don't have the licence to use it.


How can i programmaticly get the WKT from WKID?

Is there some way (in C#/silverlight) to get the WKT from some web service with just the WKID?


Copying an entire column between layers (tables)

I have a raster layer with probabilities as values and I process them using the Spatial Analyst extension. After the processing the values are modified, however I would like to also have the original ones stored in a separate column. It would be nice (if possible) to avoid using two cursors (one to select data from the `VALUE` column and second one to insert data into a new column). Is there an easy way do that? ADDED   OK, so actually the solution with two (or even one as suggested by Jason) cursors won't work, because the probabilities are in floats and I can't build an attribute table without converting them to ints.


How to find area/multipolygon bounded by three other multipolygons?

Trying to get my head around PostGIS and QGIS...I'm trying to find the area (in white) bounded by three multipolygons (in purple) - refer to picture. Each multipolygon only touches the other two multipolygons; there are no intersections. Any help will be much appreciated. **More info:** The purple areas are defined as multipolygons in the PostGIS table. I'm interested in just the coordinates for the white area. The coordinate reference system is WGS84. Basically, the purple areas are maritime boundaries/EEZs which have been defined in the postgis table. The white area refers to international waters/high seas pockets between those maritime boundaries. I'm trying to identify the coordinates of the white areas so that I can create records for them in the same postgis table that has the EEZs. I'm building a web-app for monitoring vessel movements near real-time between EEZs and high seas pockets. ![](http://i.stack.imgur.com/2Rnhn.jpg)


Determining the transformation between a satellite image and long/lat

I'm trying to overlay some data onto a satellite image of the UK. The image is a hi-resolution version of the image below (originally from dundee university): http://www.bbc.co.uk/news/uk-scotland-18239311 However, I'm unable to determine the mapping between longitude/latitude and points on the image, i.e. given a long/lat pair what is the relevant point on the image. Along the way I created a table of landmarks round the edge of the UK and recorded their position on the image (with top-left being (0,0)) together with their longitude and latitude values: https://gist.github.com/pci/4945162 . Sadly I don't know the location of the satellite or the direction the camera was pointing when the shot was taken. I've tried affine transforms, perspective transforms and planar projections from a sphere, all with very little success. Any help is greatly appreciated.


Latest version of ogr2ogr fails with Layer Creation

I am able to successfully run ogr2ogr to add S57 data to PostgresDB. The version I use is GDAL 1.7.0b2, FWTools 2.4.7 and release date 2010/01/19 I upgraded my version to GDAL 1.9.1 and release date 2012/05/16. When I run ogr2ogr on the same files, I get an error as follows               ERROR 1: Layer dsid already exists, CreateLayer failed.     Use the layer creation option OVERWRITE=YES to replace it.     ERROR 1: Terminating translation prematurely after failed     translation of layer DSID (use -skipfailures to skip errors)      Why would this happen when all things being equal? Is the latest version buggy?


How to buffer a point by cardinal distances to create a polygon?

I am trying to buffer a point by distances in a table to create a polygon or line for example For a point with known x,y buffer based on the following radius: North= 20m East= 21.5m South= 14m West= 26m Despite trying I haven't been successful does anyone know if this is possible? * * * Yes am trying to create a circle type shape from the four cardinal points. ![enter image description here](http://i.stack.imgur.com/7SC0Y.jpg)


Negative UTM easting

I am trying to do the following calculation:   1. Given lat,lon of a point (center of a rectangular (in UTM) domain), I find its UTM coordinates.   2. Given domain width and length, I find coordinate of its 4 corners in UTM   3. Finally, I need to find lat,lon coordinates for the corners I'm having a problem with step 2, because one of the corners is outside of the UTM zone in which the center point is located. So I get negative easting numbers and can't figure out how to do the lat,lon conversion. I'm supposing that I need to find the new UTM zone for that point, but I don't know exactly how. Any help will be appreciated. Additional info: I'm using this little Python library to do the UTM<->lat,lon conversion https://github.com/Turbo87/utm It doesn't seem to handle negative eastings.


Vector data(point) is drawn in wrong place on map (OpenLayers)

I need to show a map (world map, used default `OpenLayers` WMS) and one point on it (with events like onhover, etc). Here is my code:                                  var options = {                                 projection: new OpenLayers.Projection("EPSG:900913"),                                 maxResolution: 6000                             };                             map = new OpenLayers.Map('map', options);                                  var wmsLayer = new OpenLayers.Layer.WMS(                             "OpenLayers WMS",                              "http://vmap0.tiles.osgeo.org/wms/vmap0",                             {layers: 'basic'}                         );                               var vectors = new OpenLayers.Layer.Vector("Vector Layer");                              point = new OpenLayers.Geometry.Point(20.088844299316406, 51.8321709083475);                         vectors.addFeatures([new OpenLayers.Feature.Vector(point)]);                              map.addLayers([wmsLayer, vectors]);                              map.zoomToMaxExtent();      But this code locates the point is drawn not in correct place, but somewhere near Africa (that place lat and lon is 0, 0). **Question: Why this happens and can I fix it?** I just need to locate the point to the correct place. Paradox when I print this point in console then it shows that the point lan and lon are as needed (as defined). But it is still in the wrong place...


How to import shp files into postgresql with PostGIS?

I'm a new user of postgreSQL/postgis but I'm having a problem. I'm trying to import some shapefiles (which open perfectly in QGIS or ArcGIS but create an error when i import them). The problem is not because it's in a directory with accents (that was my first problem). When loading the data, I get this message :               > Importing with configuration: nyc_neighborhoods, public, geom,     > C:\Users\Lay\Desktop\NYC\nyc_neighborhoods, mode=c, dump=1, simple=0,     > geography=0, index=1, shape=1, srid=0 Shapefile type: Polygon PostGIS     > type: MULTIPOLYGON[2] Failed SQL begins: "SET CLIENT_ENCODING TO UTF8;     > SET STANDARD_CONFORMING_STRINGS TO ON; BEGIN; CREATE TABLE     > "public"."nyc_neighborhoods" (gid serial, "boroname" varchar(43),     > "name" varchar(64)); ALTER TABLE "public"."nyc_neighborhoods" ADD     > PRIMARY KEY (gid); SELECT AddGeomet" Failed in pgui_exec(): ERREUR:      > la fonction addgeometrycolumn(unknown, unknown, unknown, unknown,     > unknown, integer) n'existe pas LINE 8: SELECT     > AddGeometryColumn('public','nyc_neighborhoods','geom'...     >                ^ HINT:  Aucune fonction ne correspond au nom donné et aux types d'arguments. Vous devez ajouter des conversions explicites     > de type.     > Shapefile import failed.      It's in french though I installed postgis in english to avoid this problem. It says that there is no specific function associated and given to the different types of arguments and that i have to add specific conversions. However, I do not really get what this error means or how I can solve it. I hope some off you know!! Thanks!


Removing/adding values in symbology window with arcpy

I'm using arcmap 10.1 and have one shp with many polygons with different typeID. I want to make a serie of maps showing each typeID on an individual map. Since I have many typeIDs I want to use arcpy. And here is the problem. I don't know which arcpy function to use to select only one typeID and remove all the others; and then repeat this step for all IDs. SOLUTION: Here is my code after I fixed it. Now it works:)               mxd=arcpy.mapping.MapDocument("CURRENT")          def getValueList (inputTable, field):         values = set()         rows = arcpy.SearchCursor(inputTable)         for row in rows:                 values.add(row.getValue(field))         return sorted(values)          list=getValueList('my_shp_file', 'typeID')     lyr=arcpy.mapping.Layer('my_shp_file')     where_clause='"typeID"='          for type in list:         lyr.definitionQuery=where_clause+str(type)           arcpy.mapping.ExportToJPEG(mxd, "C:\\my_location\\"+str(type)+".jpg")      Thanks for suggestions! Rok


Expression to create and populate column based on filtered fields

I wanted to create a column and populate it with data based on data from other fields. If **column_1** contains fields which has similar string (eg. field_1 = "Country: UK", field_2 = "Country: US", field_3 = "City: London"), is there an expression to update fields which ONLY contain part of the string - in this case "Country"?


How to set up a Web Map Service with QGIS?

I am very new to QGIS environment.I wanted to work with creating Web Map Service using QGIS server.Does it possible to create Web Map Service in QGIS sever? can anybody help me with resource link and all. Regards


Esri File GDB multi-user edit through QGIS

I have an Esri File GDB with relationship classes. I would like to import this GDB in PostgreSQL or MSSQL to enable multi-user edit through QGIS (dufour) tool. What are the steps/procedures to follow? Or is there any other way to achieve GDB multi-user edit without ArcSDE and Arc tools?


How to query attributes cross-table in QGIS?

is it possible in QGIS to query a layer with data from another layer?   And if so ... how is the syntax for that? Usecase: I have a lot of image-position points and a lot of monitoring sites. I would like to set the monitoring area layer, so that it only shows areas where we also have images for this year.   I then use the extent of the monitoring area as the coverage layer to render my image-position maps with the Atlas plugin.   Without querying the areas to reduce them, i get a lot unneccesary maps with no image-positions, so i want to get rid of those areas which do not match (and of course not manually) So, is there kind of a query to find out if a value in table1 column xy exists also in table2 column xy ?


CodeDom.Compiler fails in Arcmap add-in, but works from console app

The Test method in the code below succeeds in a console test app, but fails when I call it from within an Arcmap add-in, throwing a ReflectionTypeLoadException with a loader exception saying: > Could not load file or assembly 'KompilerLib, Version=1.0.0.0, > Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system > cannot find the file specified. KompilerLib is a windows class library (3.5) project and this is the only file in the project (one interface and one class). Is there something special I need to do if I'm using CodeDom.Compiler inside an add-in?               using System;     using System.Collections.Generic;     using System.Text;     using System.CodeDom.Compiler;     using System.Diagnostics;     using System.IO;          namespace KompilerLib     {         public interface IKalkulation         {             string Test();         }              public class Kompiler         {             private const string TYPENAME = "Kalk.Kalkulation";                  public IKalkulation Kompile(string language, List<string> references, string source)             {                 CodeDomProvider provider = CodeDomProvider.CreateProvider(language);                 var parameters = new CompilerParameters();                 parameters.GenerateInMemory = true;                 parameters.GenerateExecutable = false;                 foreach (string reference in references)                 {                     parameters.ReferencedAssemblies.Add(reference);                 }                      var results = provider.CompileAssemblyFromSource(parameters, source);                 if (results.Errors == null || results.Errors.Count == 0)                 {                     Debug.Print(results.CompiledAssembly.ReflectionOnly.ToString());                     foreach (Type t in results.CompiledAssembly.GetTypes())                         Debug.Print(t.Name);                     var type = results.CompiledAssembly.GetType(TYPENAME);                     if (type == null)                         throw new Exception("type not found: " + TYPENAME);                     object o = Activator.CreateInstance(type);                     if (o == null)                         throw new Exception("unable to createinstance");                          var kalkulation = o as IKalkulation;                     if (kalkulation == null)                         throw new Exception("unable to cast to IKalkulation");                     return kalkulation;                 }                 else                 {                     StringBuilder sb = new StringBuilder();                     foreach (CompilerError err in results.Errors)                         sb.AppendLine(err.ErrorText);                     throw new Exception(sb.ToString());                 }             }             public static string Test()             {                 var kompiler = new Kompiler();                 var list = new List<string>();                 list.Add("System.dll");                 string path = kompiler.GetType().Assembly.Location;                 if (!File.Exists(path))                     throw new Exception("file not found " + path);                 list.Add(path);                 string source = GetSource();                 var kalk = kompiler.Kompile("CSharp", list, source);                 return kalk.Test();             }                  private static string GetSource()             {                 StringBuilder sb = new StringBuilder();                 sb.AppendLine("using KompilerLib;                          ");                 sb.AppendLine("namespace Kalk                                ");                 sb.AppendLine("{                                             ");                 sb.AppendLine("    public class Kalkulation : IKalkulation   ");                 sb.AppendLine("    {                                         ");                 sb.AppendLine("          public string Test()                ");                 sb.AppendLine("          {                                    ");                 sb.AppendLine("               return \"Hello World\";         ");                 sb.AppendLine("          }                                    ");                 sb.AppendLine("    }                                          ");                 sb.AppendLine("}                                              ");                 return sb.ToString();             }              }     }      **Update** Here's the fix using AssemblyResolve, thanks to blah238. I'm still curious why this is a problem within arcmap.exe, but not within my console tester exe. Also seems like the easiest assembly to resolve should be the one the compiler is running within.               public IKalkulation Kompile(string language, List<string> references, string source)     {         CodeDomProvider provider = CodeDomProvider.CreateProvider(language);         var parameters = new CompilerParameters();         parameters.GenerateInMemory = true;         parameters.GenerateExecutable = false;         foreach (string reference in references)         {             parameters.ReferencedAssemblies.Add(reference);         }              // this sure seems like a hack ...         AppDomain.CurrentDomain.AssemblyResolve += (s,args) =>             {                 if (args.Name == this.GetType().Assembly.FullName)                     return this.GetType().Assembly;                 else                     return null;             };              var results = provider.CompileAssemblyFromSource(parameters, source);         if (results.Errors == null || results.Errors.Count == 0)         {             var type = results.CompiledAssembly.GetType(TYPENAME);             if (type == null)                 throw new Exception("type not found: " + TYPENAME);             object o = Activator.CreateInstance(type);             if (o == null)                 throw new Exception("unable to createinstance");                  var kalkulation = o as IKalkulation;             if (kalkulation == null)                 throw new Exception("unable to cast to IKalkulation");             return kalkulation;         }         else         {             StringBuilder sb = new StringBuilder();             foreach (CompilerError err in results.Errors)                 sb.AppendLine(err.ErrorText);             throw new Exception(sb.ToString());         }     }


How to improve performance when using ArcGIS cursors in Python with big tables?

I have a pretty big point feature class in a file geodatabase (~4 000 000 records). This is a regular grid of points with a 100m resolution. I need to perform a kind of generalization on this layer. For this, I create a new grid where each point lies in the middle of 4 "old" points:                *     *     *     *         o     o     o      *     *     *     *         o     o     o      *     *     *     *      [*] = point of the original grid - [o] = point of the new grid The attribute value of each new point is calculated based on the weighted values of its 4 neighbors in the old grid. I thus loop on all the points of my new grid and, for each of them, I loop on all the points of my old grid, in order to find the neighbors (by comparing the values of X and Y in the attribute table). Once 4 neighbors have been found, we get out of the loop. There is no methodological complexity here but my problem is that, based on my first tests, this script will last for weeks to complete... Do you see any possibility to make it more efficient? A few ideas on the top of my head:   * Index the fields X and Y => I did that but didn't notice any significant performance change   * Do a spatial query to find the neighbors rather than an attribute-based one. Would that actually help? What spatial function in ArcGIS should do the job? I doubt that, e.g., buffering each new point will prove more efficient   * Transform the feature class into a NumPy Array. Would that help? I haven't worked a lot with NumPy so far and I wouldn't like to dive into it unless someone tells me it might really help reducing the processing time   * Anything else? Thanks in advance!


Limit Geocode results based on application extent?

I am creating an Esri Flex API application (not the viewer), and have been creating a tool to use the World Places Locator. For now, I am just zooming to the top scoring candidate returned. If you search for Brighton, it returns you 20 candidates, sorted by score. I read on an older blog post: > You can also filter the results by extent using client logic. The candidates > field to look for in this case are North_Lat, South_Lat, East_Lon, and > West_Lon. Source. I am thinking it would be a good idea to have a tickbox on my search, that limits the results to the current extent of the map in the Flex app. (Or maybe buffer a litte out from the view). I understand the logic on how to go about this, but was wondering if anyone has already done this (does not have to be Flex) so that I can save some time coding it. If not, I will have a go at this next weekend and post my answer.


Jitter or Randomise Points in QGIS

Occasionally I'm asked to plot points that relate to sensitive data items. I would quite like to be able to add a varying level of random jitter to points when plotting so that point density is still evident to viewers but without giving away precise locations. I could do this quite easily by adding/subtracting random values from the co- ordinates in Excel or SQL prior to loading data but this would make it a bit difficult for when I want to do precise analysis based on actual co-ordinates as I would have to swap between real and jittered values (which is just asking for a mistake to happen further down the road). Is there a way of doing this in QGIS? I've had a look through the documentation and haven't spotted anything so my last hope is that someone knows of a plug-in somewhere. I know of other techniques to protect sensitive data on maps (binning, assigning to centroid, heatmaps, contours etc.) but none of these are _quite_ right for the data I'm trying to display (individuals who have used a service multiple times, with point size related to number of times they've used that service). Thanks!


Building a private GPS almanac server - practical experience

I'm trying to provide a source of GPS almanac files (in SEM format) for a non- connected / sometimes connected network. I know that I can download them from the USCG NAVCEN. However I don't want to have to air-gap them across to my network. So the plan is to (somehow) get them from a GPS receiver, format them into SEM, and serve them up using a file share / web server. I'm confident about the last step. I have a rough idea of how to download the almanac, but no code. I've seen some online resources that allow writing SEM, but nothing that provides all of   1. a simple API   2. open source   3. (obviously) maintained So at this stage I'm considering writing the "missing parts". Has anyone actually tried this? Any recommendations for usable (open source) blocks.


How do I add a scroll bar to a custom infowindow in Cartodb?

I'm creating custom infowindows in my Cartodb map, but I'm pretty new to html coding and don't know exactly what I'm doing. Could someone point me to code for a custom infowindow that includes a scroll bar? Thanks!


Example of RasterData class in ArcGIS for Flex

How would I use the RasterData class in com.esri.tasks.supportClasses for ArcGIS API for Flex? I haven't found any documentation for it outside the API and that doesn't give much info either. Could I construct a RasterData object and use it as a workaround for the limitations imposed upon a client's input parameters for a geoprocessor request to ArcGIS Server? For example,               var rasterOne:RasterData = new RasterData();     rasterOne.url = "http://example.com/rasterOne.tif";     rasterOne.format = tif;          var params:Object = new Object();     params.Input_Raster = rasterOne;          var gp:Geoprocessor = new Geoprocessor();     gp.url = "http://example.com/arcgis/rest/services/GPServer/ExampleGP";     gp.submitJob(params);      Assume that the GPService has one input parameter, a raster, and does a simple reclassify. Would this work, and would I even be able to publish the GP service with a raster as the input?


no module named core

Hi I am trying to access and use QGIS modules/class/methods from IDLE on a mac. I have had the same problem as a few other people, and browsing the forums have tried to follow the advice they have been given. when typing: import qgis.core I recieve the msg: ImportError: No module named core I have tried to set path settings as follows: export PYTHONPATH=/Applications/QGIS.app/share/python ...and... export LD_LIBRARY_PATH=/Applications/QGIS.app/lib but I am very new to using command line for the mac and also to python. I have now spent a couple of hours searching for others' answers that could hopefully help me, but now I am giving up and asking for advice Thank you in advance


How to check how much of a line (percentage-wise) is covered by a polygon in arcpy?

I'm searching for an efficient way to check if a line is covered by a polygon (see image, this case should return 2x "true"). ![line in polygon](http://s1.directupload.net/images/140217/taptcb3q.png) Right now I only check wether a line is within a buffer with               line.shape.within(buffer.shape)      But I want to know if a line is covered by a buffer with at least 50%. As I'm doing this fully automated in a script with a lot of lines and buffers this should be fast. Any tips? current code snippet:               lines = arcpy.SearchCursor('lines')     for line in lines:       bufferList = arcpy.SearchCursor("buffers")       for buffer in bufferList:         # here I want to check if a line is just covered by a buffer         if line.shape.within(buffer.shape):             if line.getValue('type') == buffer.getValue("type"):               matchList = arcpy.InsertCursor('MatchList')               matchList.insertRow(line)               break


classify a table via field calculator

I have a dataset of several states and a table with many informations about them, they are already joined, what i want to do now is to create 5 classes about the average lifespan. they have to be within the ranges of 37 - 50 for class 1, >50 - 60 for class 2, >60 - 70 for class 3, >70 - 75 for class 4 and >75 for class 5. Now i have already tried the reclass by table tool but for some reason it wont allow me to use the needed fields. when i tried it via properties and then tried to type in 5 classes i couldnt do it as well. im actually supposed to create a new field and do it by the field calculator in the table but since this field calculator is so different to the selection by attributes im also absolutely lost with that. Does anybody know a way that might work for my problem?


Can't launch GRASS GIS 6.4.3 GUI on windows 8.1

As title, I downloaded GRASS GIS from this website： GRASS GIS - Home, and I choose **winGRASS 6.4.3 standalone installer** to download. After I installed, I click on its icon： ![enter image description here](http://i.stack.imgur.com/Dnn37.png) I can't launch it even though I have used 2 ways：   1. just left-click the mouse   2. right-click the icon and choose **start as an administrator** **can't launch** means after I click the icon, the cmd icon shows up in less than one second on the windows bar below(even no windows come up), and then nothing comes up. ![enter image description here](http://i.stack.imgur.com/1jfVH.png) This really bothers me because I can't open GRASS! I'm working under windows 8.1, is there someone using windows 8.1 facing the same problem like mine？ Please give me some suggestions, thank you!


R generated files getting scrambled on import in ArcGIS

I want to put this out there just in case someone somewhere has experienced similar issues. I have a .csv file that I have generated in R 3.0 using this code: `write.table(SubData,paste(RootOutputFileName,"TimeSubsetData_", Date,"_.csv", sep = ""), sep = ",", row.names = F)` When I bring in the resulting csv file into ArcGIS 10.1 it has scrambled the column order, renamed the columns, moved headings, removed data completely, replaced data with NA's, and all sorts of other odd things. Here's what the csv file looks like outside of ArcGIS:               ID             Date_Time    moose   trial   x      y    label   label.1 dog  Reproduction   Position    EvalPt  DistX   DistY   Dist    Heading TimeDif Velocity    Angle   LocType LocNum     3311_1  2010-10-07 00:20    F07011  1   1476024 6620118 before  before  Ludde   No Calf End 1   10  -5  11.18034    2.034444    0.166667    67.082039   2.034444    Obs 1     3311_1  2010-10-07 00:20    F07011  1   1476019 6620136 before  before  Ludde   No Calf End 1   4.528243    12.549702   13.341664   0.346286    0.166667    80.049984   0.346286    rand    1     3311_1  2010-10-07 00:20    F07011  1   1476059 6620089 before  before  Ludde   No Calf End 1   45.067664   -34.189262  56.568542   2.219792    0.166667    339.411255  2.219792    rand    1     3311_1  2010-10-07 00:20    F07011  1   1476018 6620125 before  before  Ludde   No Calf End 1   4.341216    2.480695    5   1.05165 0.166667    30  1.05165 rand    1     3311_1  2010-10-07 00:20    F07011  1   1476014 6620127 before  before  Ludde   No Calf End 1   0   3.605551    3.605551    0   0.166667    21.633308   0   rand    1     3311_1  2010-10-07 00:20    F07011  1   1476020 6620126 before  before  Ludde   No Calf End 1   5.778044    3.407962    6.708204    1.037901    0.166667    40.249224   1.037901    rand    1      Here's what happens after all I do is AddData and then Open Attribute Table:               ID    ID_X   ID_Y              Date_Time    moose   moose_X          moose_Y    trial   x   y   label   label_1 dog Reproduction    Position    EvalPt  DistX   DistY   Dist    Heading TimeDif Velocity    Angle   LocType LocNum     3311_1  1   33.18333333 2010-10-08 09:20    F07011  -147.4600309    9.81849E+15 1   1476079 6620355 before  before  Ludde   No Calf End 1   -13 26  29.06888371 5.819537698 0.166666667 174.4133022 2.677945045 Obs 1     3311_1  1   33.18333333 2010-10-08 09:20    F07011  -147.4600309    9.81849E+15 1   0   0   before  before  Ludde   No Calf End 1   0   0   16.97056275 3.660738768 0.166666667 101.8233765 0.519146114 rand    1     3311_1  1   33.18333333 2010-10-08 09:20    F07011  -147.4600309    9.81849E+15 1   1476092 6620328 before  before  Ludde   No Calf End 1   0   -1  1   3.141592654 0.166666667 6   0   rand    1     3311_1  1   33.18333333 2010-10-08 09:20    F07011  -147.4600309    9.81849E+15 1   0   0   before  before  Ludde   No Calf End 1   0   0   437.7145188 5.561036001 0.166666667 2626.287113 2.419443348 rand    1     3311_1  1   33.18333333 2010-10-08 09:20    F07011  -147.4600309    9.81849E+15 1   0   0   before  before  Ludde   No Calf End 1   0   0   293.4365349 3.457878782 0.166666667 1760.619209 0.316286128 rand    1     3311_1  1   33.18333333 2010-10-08 09:20    F07011  -147.4600309    9.81849E+15 1   0   0   before  before  Ludde   No Calf End 1   0   0   75.92759709 5.98774447  0.166666667 455.5655825 2.846151816 rand    1      I do not know what R is doing because normally I have no issue, but "normally" for me Ive used write.csv and then didn't have to paste all the rest of that information together. I get that it is something with the formatting coding that goes on in the background and I am wondering if it has something to do with the write.table command and then forcing it into csv? But what is ArcGIS doing by creating ID_X ID_Y adding a moose_X and moose_Y and where are those numbers coming from? Why is it removing values (i.e., 2nd row under x and y values now are 0)? Why is it changing the date_time to 9:20? I will also post this type of question in an R forum here - but if someone has experience or tricks to deal with this from the ArcGIS side of things - that would be great. Right now my work around is to take the R output (my csv file) bring it into some "neutral" program like TextPad and then save it as a new csv or txt file, _then_ I can bring it into ArcGIS and seem to have no problems. Im also having better luck just opening the csv file in Excel and saving as xls and then opening that in ArcGIS. Here is the structure of the R input before I write to csv `str(SubData) 'data.frame': 4740 obs. of 21 variables:   $ ID : Factor w/ 29 levels "3311_1","3313_1",..: 1 1 1 1 1 1 1 1 1 1 ...   $ Date_Time : POSIXct, format: "2010-10-08 09:20:00" "2010-10-08 09:20:00" "2010-10-08 09:20:00" "2010-10-08 09:20:00" ...   $ moose : Factor w/ 15 levels "F01001","F070014a",..: 7 7 7 7 7 7 7 7 7 7 ...   $ trial : int 1 1 1 1 1 1 1 1 1 1 ...   $ x : num 1476079 1476090 1476093 1476097 1476129 ...   $ y : num 6620355 6620319 6620332 6620323 6620317 ...   $ label : Factor w/ 11 levels "after","before",..: 2 2 2 2 2 2 2 2 2 2 ...   $ label.1 : Factor w/ 5 levels "after","before",..: 2 2 2 2 2 2 2 2 2 2 ...   $ dog : Factor w/ 3 levels "Ida","Ludde",..: 2 2 2 2 2 2 2 2 2 2 ...   $ Reproduction: Factor w/ 2 levels "Calf","No Calf": 2 2 2 2 2 2 2 2 2 2 ...   $ Position : chr "End" "End" "End" "End" ...   $ EvalPt : num 1 1 1 1 1 1 1 1 1 1 ...   $ DistX : num -13 -2.35 1.19 5.16 36.63 ...   $ DistY : num 26 -9.62 2.93 -6.43 -12.29 ...   $ Dist : num 29.07 9.9 3.16 8.25 38.64 ...   $ Heading : num 5.82 3.381 0.387 2.466 1.895 ...   $ TimeDif : num 0.167 0.167 0.167 0.167 0.167 ...   $ Velocity : num 174.4 59.4 19 49.5 231.8 ...   $ Angle : num 2.68 0.24 3.53 5.61 5.04 ...   $ LocType : chr "Obs" "rand" "rand" "rand" ...   $ LocNum : num 1 1 1 1 1 1 2 2 2 2 ..."`


How do I draw on a vector map in GRASS?

I have a vector map that has two lines. I want to have the two connected. Is there a way for me to draw a line to connect the two? I am using GRASS gis by the way. The two lines that I want to connect are shown here: ![enter image description here](http://i.stack.imgur.com/pYgh7.jpg)


How do I calculate a weighted centroid with respect to a raster, e.g. population weighted centroid

In ArcGIS 10.0, how do I calculate the weighted centroid of a collection of polygons, where I want the weight to be a raster layer. In particular I am using a raster of population counts and would like to generate the population weighted centroid as a result.


ArcGIS ModelBuilder model works in Edit windows but not from the "open" window - do you have any experience or advice?

I am using ArcGIS 10.1, most recent service pack / patch, and on Windows 7 with 8GB RAM I always run Models from ArcCatalog I have a model that validates and runs from the "edit" window. When I run the exact same model with the exact same input data, but from the "open" window it returns error messages. Do you have any experience or advice to share over this issue? Are there certain tools or processes that can cause this issue? The issue that occurs most frequently is with the Focal statistics and the Get Raster Properties Tools - when the model is run from the Open window these tools can fail because the preceding data does not have valid statistics. It is unclear why the model runs OK (with exact same data) from the edit window. Surely this should be picked up by the model validation process? The errors that occur are > ERROR 001100: Failed because no statistics are available. The solution can be to add in "Calculate Statistics" tools into the models, however the behavior appears erratic and this solution has occasionally not worked, even on the same model , same data, same computer. One of the models that runs OK from the edit Window, into which I have added the Calculate Statistics tool, return the following error only when run from the Open Window. > ERROR 999999: Error executing function. The workspace is not connected. > Failed to execute (Calculate Statistics). Any ideas/ thoughts / help would be much appreciated thanks


Remove duplicates from Spatialite

I have a Spatialite database with points. From time to time now points are added. What would be the easiest way to remove duplicates based on the coordinates? Hints are greatly appreciated.


Create HTML report using Python

i want to create Analysis report after createing model for generating cut/fill. Once it will done , basedon this cutfill/table, would be display statics in html formate using python. is it possible. pl. tell me how it will done. Thanks


How to handle time-based raster data in the ArcGIS Server JS API

The TimeSlider functionality in the ArcGIS Server JS API is great for working with time-based vector features - you can scroll forwards and backwards through time to see the vector features which existed at a given time instant. **Has anyone created a similar time-slider for rasters?** I have a series of monthly weather grids which I'd like to display, allowing the user to scroll to any month (eg, show me the average rainfall for June). The time-slider relies on the featureclass being defined in ArcMap with a Time attribute, but this isn't available for raster layers. The best workaround I can think of is:   * create a separate map document for each raster   * build a separate tiled map service from each map document   * add a DOJO slider to the map, with increments to mark each raster   * use JavaScript to switch the appropriate raster on at each mark on the DOJO slider  Is anyone aware of a better/faster approach? This will be quite a laborious process as it will mean creating and maintaining multiple MXDs and MSDs. Thanks


Modelbuilder - If precondition is false, continue iterating next input

I've built a model in modelbuilder but cannot find an answer to this problem. Please help if you can. Firstly I have an 'iterate feature class' tool drawing inputs out of a folder and then selecting attributes from the input table using SQL. I am then using the "get count" tool (which counts the rows selected) to test if any attributes were selected, this is a precondition to continue the model. However, if this precondition is 'false' then the model stops. I'd like for it to just continue with the next iteration of inputs. Is this possible, and if so, any insight would be great. I was thinking I might need if-then-else logic but not sure how to use it in this setting. Please advise. Here is an image of the model. ![enter image description here](http://i.stack.imgur.com/EWzLi.jpg) Cheers, Ken!


How to save a WMS layer at multiple resolutions as .tif using pyqgis

How can I export a wms-map-extent as a .tif from QGIS? Is it possible to call the "Save as.." function of a WMS-raster-layer from pyqgis? (E.g. by simulating right-clicking the layer, choosing "Save as" and setting the save-as-options?) Im working on this for days now, but I just couldn't find a suitable solution. I managed to export the extent as an image, but this way I am losing the geo- references. I even tried to call gdal_transform from bash, but QGIS-layer- extent-coordinates (shown in the bottom right corner) do not seem to match the coordinates gdal expects (gdal turns them in some negative src values). What I want to do is:   1. Open a wms-layer in QGIS (in my case it is the city-map of Berlin from http://fbinter.stadt-berlin.de/fb/wms/senstadt/k_baugrund?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&layers=0&styles=&CRS=EPSG:3068&format=image/png&dpiMode=7)   2. Zoom/go to a specific extent of the map   3. Use a one-click plugin to export that extent (in multiple resolutions) I know I can do that by just opening the save-as dialog, but in second step I'd like to be able to open the wms and a shape layer and automatically export the masked/shaped part of the wms. This is the gdal_transform command I tried from bash, which resulted in a blank 1x1 .tif-file.                   gdal_translate -of GTiff -a_srs EPSG:3068 -projwin 17907 16971 16623 -sds WMS:http://fbinter.stadt-berlin.de/fb/wms/senstadt/k_baugrund?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&layers=0&styles=&CRS=EPSG:3068&format=image/png&dpiMode=7 export_gdal_berlin.tif      Any help would be highly appreciated!


Specification for US Census GEOID?

I'm writing a program that needs to generate GEOID values from 2000 and 2010 Census data, to link the census data to TIGER/Line records. I'm starting with the state, county, region block, etc, values in the census GEO files, and need to create GEOIDs. I need to work with all of the summary levels, and since the structure of the GEOID value seems to vary depending on the type of geography, it would be really nice to have a spec for constructing it. I found this document, but it only specifies the GEOID structure for the redistricting files: http://www.census.gov/rdo/pdf/0GEOID_Construction_for_Matching.pdf I'd like to get the same thing, but for all summary levels. I've considered downloading all of the tiger files and extracting the GEOID10 values and reverse engineering them from the records attached to the shape files, but the programming would cost more than just paying someone to do it manually by inspecting the files or the documentation ( http://www.census.gov/geo/www/tiger/tgrshp2010/TGRSHP10SF1.pdf ) Any other ideas how to most easily generate GEOID from census GEO files, for all records and summary levels? Alternately, can the 0GEOID_Construction_for_Matching.pdf file, which is written for the redistricting files, be used as a spec for the 2010 SF1 summary levels and the GEOIDs of the corresponding TIGER files? Thanks!


Export dxf files for use in Sketchup

the export to dxf seems like it worked, but Sketchup will not import it. I don't think this is a Sketchup issue, as Sketchup imports other dxf files just fine.


how to calculate a field from a shp currently sected in a arcmap session using a Python script in ArcMap 10?

Hi I nedd to create a script in Python for use in ArcMap 10. This script must be able to calculate a field from the shp currently selected in ArcMap. Any ideas?, I'm new to Python so any code example will be most welcome. Thank you, I'm confident you will be able to help me


PostGIS ST_Distance vs. pgRouting

I am looking to create a city directory web app, and the site will need to be able to calculate distances between two geospatial points (like the distance between the user and a restaurant, or the distance between two restaurants). I am a newbie to geospatial function, and recently started using PostGIS. I have been having a heck of a time installing pgRouting into my PostGIS 1.4/PostgreSQL 8.4 server, so am thinking about giving it up for now until I feel like I need it. I have already spent several hours trying to install pgRouting on my OSX 10.6 Snow Leopard machine with little success. With that said, what exactly am I giving up? It seems like ST_Distance will satisfy most of my needs in the short term and things like the Travelling Salesman Problem won't really apply to webapp (at least not for a while, if ever). Is there something else that I am giving up? Another reason to use pgRouting? (As a side note, if you know of a place that makes installing pgRouting easy, please point me in that direction, as I have already tried about 3 pages worth of several google results for tutorials/instructions).


How to use the "Iterate Rasters" tool in ModelBuilder to link "Raster to Other Format (multiple)" tool to the "Extract by attributes" tool in ArcGIS?

I wish to link the "Raster to Other Format (multiple)" tool to the "Extract by atttributes" tool. The "Raster to Other Format (multiple)" tool only allows you to specify an output workspace, but the "Extract by atttributes" tool requires a specific raster to be named as input. I am attempting to use the "Iterate Raster" tool to provide the specific raster needed as input to the Extract tool but cannot get the 2 tools to link. Any suggestions?


Use GetFeatureInfo with OpenLayers and a Bounding Polygon

I want to be able to draw a bounding polygon and have my MapServer WMS layer return every feature within that bounding box. I have it working for a single point, but I would like for the query to return every single feature within a polygon. Is that possible with WMS GetFeatureInfo? I am using OpenLayers in Java with GWT. There is a bridge between Java and the OpenLayers JS.


Clipping multipart polygons iteratively

I have a shapefile of buffers (n=10) and a shapefile of watersheds (n=10). Both shapefile contain overlapping features. I would like to clip each watershed feature with it's corresponding buffer, based on a common ID field (highlighted area below). I'm thinking ModelBuilder should be able to do this, but haven't been able to figure it out. I also have each watershed as an individual file if that helps. ![watershed and buffer clip](http://i.stack.imgur.com/11qKo.png)


Style Print dijit menu in esri JavaScript API

Trying to add styles to a dijit is difficult enough, as I have to track down the classes it uses after it loads. I've managed to do that, but I'm struggling to find the appropriate classes to alter for the menu that pops out from the esri Print Dijit (`esri.dijit.Print`) that lists the different layout options. This doesn't show up in the structure in the browser's development environment, so I can't track them. Is there a better way to find and alter these style classes?