Can you set the PostGIS SRID when creating a Feature class through ArcCatalog?

I have ArcSDE installed in a Postgresql database and I am using PostGIS geometry. I'm not a DB minded person so feel free to let me know if my process is not right. I create my feature class in ArcCatalog (no probs) I then go into PgAdminlll to check out the new table. There are two things I notice when I check out my new table. 1) The record for my new table in the public.geometry_columns table has an SRID of -1. Is there any way to set the SRID during the feature class creation? If not how do I do this in PgAdminlll? Is it something like updateGeometry or addGeometry? 2) Also I notice that in PgAdminlll under the newly created tables properties there is no primary key assigned. So what I have been doing is assign the sde created objectid field as the primary key. Is this acceptable or should I be creating a new PK? Thanks Ando


arcpy: creating polyline features from the following text file format

I am looking into a way of reading the following file format with python, where 0 0, 0 1, 0 2, ect... is the polyline object number and 0(1) 464736.1645 260940. 098377 are x, y coordinates of polyline feature start/end. How I can scan through this text file to read a polyline object and correspsonding start/end coordinates. PS. CreateFeaturesFromTextFile ESRI script tool does not work properly in arcpy (arcgis 10) hence the need to create polylines from text file. Your help is much appreciated. Many thanks, Meryloo ![enter image description here](http://i.stack.imgur.com/CLiGu.jpg)


Truncate arbitrary File Geodatabase tables in FME

I have one FGDB with over 30 tables. Also have few WB and they write data to output tables in FGDB, but each of WB write data to different tables but still at the same FGDB. Output tables are being truncated first (set option Parameters). But I also need the rest of tables in this database to be truncated every time WB is started, no matter which one. Because the problem is that FGDB is going to be updated only with data accoridng to spesific WB, but there are still data in other tables not used by WB. I hope someone understand my issue. Tnx.


error while trying to compile quantum gis: unresolved external symbol class QgsSearchTreeNode

i'm trying to compile the quantum gis sources code following the step by step how to compile guide, but i'm facing an error when code is linked. I'm compiling in Windows 7 x64 in Microsoft Visual Studio 2010 Professional and i'm using the environment variables created by OSGeo4W.bat file. The exact message error is this one:               1>     Creating library C:/qgis-1.7.4/build/src/core/RelWithDebInfo/qgis_core.lib and object C:/qgis-1.7.4/build/src/core/RelWithDebInfo/qgis_core.exp     1>qgssearchstring.obj : error LNK2019: unresolved external symbol "class QgsSearchTreeNode * __cdecl parseSearchString(class QString const &,class QString &)" (?parseSearchString@@YAPAVQgsSearchTreeNode@@ABVQString@@AAV2@@Z) referenced in function "public: bool __thiscall QgsSearchString::setString(class QString)" (?setString@QgsSearchString@@QAE_NVQString@@@Z)     1>flex_qgssearchstringlexer.obj : error LNK2001: unresolved external symbol "union YYSTYPE yylval" (?yylval@@3TYYSTYPE@@A)     1>C:\qgis-1.7.4\build\src\core\RelWithDebInfo\qgis_core.dll : fatal error LNK1120: 2 unresolved externals      When i compile the qgssearchstringparser.cpp.rule with diagnostic i have the following messages! The problem is from bison compilation? It as bison conflicts shift reduce. How can i resolve them? 1> C:\Progra~2\GnuWin32\bin\bison.exe -oC:/qgis-1.7.4/build/src/core/qgssearchstringparser.cpp -d -v -t C:/qgis-1.7.4/src/core/qgssearchstringparser.yy 1> if errorlevel 1 goto :VCEnd (TaskId:11) 1> Generating qgssearchstringparser.cpp (TaskId:11) 1> C:\Progra~2\GnuWin32/share/bison/yacc.c:158: m4: Warning: Excess arguments to built-in `_m4_popdef' ignored (TaskId:11) 1> C:\Progra~2\GnuWin32/share/bison/yacc.c:1071: m4: Warning: Excess arguments to built-in`_m4_popdef' ignored (TaskId:11) 1> C:\Progra~2\GnuWin32/share/bison/yacc.c:1740: m4: Warning: Excess arguments to built-in `_m4_popdef' ignored (TaskId:11) 1> C:\Progra~2\GnuWin32/share/bison/yacc.c:1741: error: m4_divert_pop(0): diversion mismatch: (TaskId:11) 1> C:\Progra~2\GnuWin32/share/bison/yacc.c:155: m4_divert_push: 0 (TaskId:11) 1> stdin:1: m4_divert_push: KILL (TaskId:11) 1> C:\Progra~2\GnuWin32/share/bison/yacc.c:1741: the top level (TaskId:11) 1> C:/qgis-1.7.4/src/core/qgssearchstringparser.yy: conflitos: 15 de deslocamento/reduþÒo (TaskId:11)


Need to hyper link my personal data to a shape file

I want to hyper link my personal data like excel file to a shape file. Can I do it in QGIS. Kindly help.


How to select features that intersect but don't touch (using ArcObjects)?

So how do I do that? ArcMap's _Select By Location_ selects also all features that touch, but I only need the ones that **actually** intersect the area. I currently use `esriSpatialRelEnum.esriSpatialRelIntersects` and there doesn't seem to be an option for what I need. `esriSpatialRelOverlaps` isn't an option because it doesn't cover the case when the geometries are excatly the same size and over each other. `esriSpatialRelCrosses` also doesn't work because it doesn't support Area/Area intersection. So is this possible at all?


Why is this spatialite polygon layer not displayed properly?

In QGIS, I have a spatialite multipolygon layer that have full objects in attribute table but do not display random ones as I scroll and pan around:   1. Vietnam map at zoom level 1:16000000 - some provinces missing in the northern part creating holes. ![enter image description here](http://i.stack.imgur.com/3mST7.png)   2. Scroll mouse wheel to zoom closer one level (1:8000000). The northern most province in the view is missing. ![enter image description here](http://i.stack.imgur.com/AMhMD.png)   3. Zoom closer to the southern part. ![enter image description here](http://i.stack.imgur.com/ouekn.png)   4. Moving one step closer. The large number of missing polygons make it hard to mark all of them with circles. ![enter image description here](http://i.stack.imgur.com/LVh5f.png) When I pan around, the polygons may re-appear at some places and disappear at some others. If I export this layer as shapefile and add to the map, there is no missing polygon at all. Test data Does anyone know how to fix this?


How to perform datum transformation in ArcGIS server REST API exportmap

I have a ArcGIS server 10.0 mapcontext in one projection (swedish grid sweref99 TM) which uses its own datum, also named Sweref99 . When I use the REST API's map service export function I want to specify the coordinatesystem of the exported map to another coordinatesystem with another datum (Swedish grid rt90). If add the imageSR argument with SRid for RT90 the returned map is offset by the amount that usually corresponds to the error induced by lack of datum transformation. It does not help to add a transformation to the data frame in arcmap before saving the MSD-file. The MSD-file will contain a definition of the transformation, but it seems like it is not used. It seems to me the transformation is only used to transform layers within the map service. The documentation on the REST-API is very vague on this point, if it is by design or a bug, as it doesn't mention datums at all. Can anyone tell me if it is supposed to work or if there's some way of telling arcgis server which datum transformation to use?


I am having a raster file with runoff depth Q in mm which was obtained from SCS method. I want to calculate hydro power potential at any location on my DEM. In the formula Q is in m3/s but we are getting Q in mm from SCS method. Is there any tool/script/software dealing this? How to find Q in m3/sec from a raster having Q in mm for hydro power calculations? I am using arcgis (9.3 and 10).


ESRI javascript API layer order

I have the below code which ensures a layer is valid before adding it to the map. mapConfig.Services is an array of service url's and loadMapService is a simple function which returns an ESRI layer. The layer is added once it is "loaded" using an index (defined in mapConfig.Services). This works fine for two layers because no matter what order the event onLoad fires, they come in they will be normalised (0 will end up at position 0 regardless of if 1 was added before it). My problem is that I think that these could be different servers in different locations firing the onLoad event with varying speeds. For example, if I had 5 layers and by chance the onLoad event fired in the order 4,3,2,1,0 they would remain in that order since the index would always be greater than the number of layers and therefore append to the end (the objective is to order them 0,1,2,3,4). I could use map.reorderLayer() to compare back to the original array, however, how will I know once all of the layers have been loaded? map.onLoad fires after the first layer is added so I can't do it here. Also assume that some of the layers could be missing and will not fire onLoad (I have connected to the onError event). I don't really want to check the layer order after a maximum timeout period. Maybe there is something really obvious I'm missing? Many thanks, David               for (var i = 0; i < mapConfig.Services.length; i++) {         layer[i] = this.loadMapService(mapConfig.Services[i], true);         if (layer[i] != null) {         //In Internet Explorer, due to resource caching, the onLoad event is fired as soon as the layer is constructed. Consequently you should check whether the layer's loaded property is true before registering a listener for the onLoad event:         //http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jshelp_start.htm#jshelp/inside_events.htm                  if (layer[i].loaded) {                      this.map.addLayer(layer[i]);                  }                  else {                     layer[i].index = i;                     dojo.connect(layer[i], "onLoad", dojo.hitch(this, function (addlayer) {                     var self = this;                     self.map.addLayer(addlayer, addlayer.index);                 }));            }         }     };


How to calculate the area of raster catchment zones?

I have a raster with irregular shape and I need to calculate the area. The "classic" method (Vectorize+field calculator) didn't work, it makes thousands of polygons. Any ideas? Thanks a lot! ![Raster image](http://i.stack.imgur.com/GSrWF.jpg)


Identifying inserts, updates, deletes, and conflicts between a parent and child version in ArcSDE with ArcPy

I'm looking for a way to identify records that have changed between the present and the last time a version was reconciled. It would also be great to be able to identify conflicting records. Ideally I would be able to read in the attributes of the records that have changed or are conflicting. I suspect that this is possible doing some sort of comparison with the delta tables, though I have very little experience with versioned features and ArcSDE itself. I've looked around and haven't found any information on how to actually read or access those delta tables. Is there a way to achieve this within Arcpy?


How to convert a polygon into a set of points within its border using Mapinfo? (or other tool)

I need to convert a polygon into a set of points in Mapinfo with a specific inter distance, i cant insert them manually as i need to have a large number of points (up to 10,000) at each run. Thanks


Pgrouting functions and geoms type not found. Install failed?

I have installed a `postgresql 9.1` and `postgis 2.0` from source. I couldn't launch this :               # Add pgRouting launchpad repository ("stable" or "unstable")     sudo add-apt-repository ppa:georepublic/pgrouting[-unstable]     sudo apt-get update          # Install pgRouting packages     sudo apt-get install postgresql-9.1-pgrouting      So I compiled and installed `pgrouting 2.0` (after some hours searching for dependencies). I created the extension on my database in `postgresql`. I included the function from the `sql` files `pgrouting.sql` but the functions I need are in `pgrouting_legacy.sql` and `pgrouting_dd_legacy.sql` When I try to load them, the error I get is : `psql:/usr/share/postgresql/9.1/contrib/pgrouting-2.0/pgrouting_legacy.sql:299: ERROR: type "geoms" does not exist` Postgresql and Postgis are working fine... What did I wrong ? Maybe I forgot something or the install failed ? I followed this documentation : http://pgrouting.org/docs/1.x/install.html http://www.bostongis.com/PrinterFriendly.aspx?content_name=pgrouting_osm2po_1


Embedded python script module import issue

I have two ArcGIS python scripts. One is a primary python script that calls a number of functions from a second python script. Everything works well, i.e. primary tool calls and uses functions from a second script, when the two scripts are placed in the same directory and the primary python script is NOT embedded into python toolbox. However when the primary python script gets embedded into ArcGIS toolbox, the second script cannot be access any more by the primary script and therefore cannot be imported into the primary script as a module and functions cannot be used. The work around would be to copy over all functions from the second script to the primary script or to copy second script into the toolbox directory but that is not the proper way to solve this issue. Is it possible within ArcGIS to embed a script into a python toolbox with other scripts that are used by the primary script? Any help will be appreciated. Thank you


Drop Markers and MarkerCluster together from database

I've been working on my map which gets it's details from a MySQL database. I use MarkerCluster Plus to cluster my markers but would like to add the drop animation to it. I found this thread, but cannot get it to work with my database. Using Drop Markers and MarkerClusterer together? Would anyone please be able to help me figuring out how to add the drop animation to my code? My test map is here: http://mymap.mooo.com Really appreciate any help or pointers.                var customIcons = {       BOO: {         icon: 'http://labs.google.com/ridefinder/images/mm_20_blue.png'               },       CIE: {         icon: 'http://labs.google.com/ridefinder/images/mm_20_green.png'        }      };          var cluster =[];          var min = .999;     var max = 1.001;               function load() {       var map = new google.maps.Map(document.getElementById("map"), {         center: new google.maps.LatLng(0,28.287167),         zoom: 3,         mapTypeId: 'roadmap'       });            var infoWindow = new google.maps.InfoWindow;           var mcOptions = {gridSize: 20, maxZoom: 19};           // this variable will collect the html which will eventually be placed in the side_bar        var side_bar_html = "";             // Change this depending on the name of your PHP file       downloadUrl("phpsqlajax_genxml2.php", function(data) {         var xml = data.responseXML;         var markers = xml.documentElement.getElementsByTagName("marker");         for (var i = 0; i < markers.length; i++) {           var name = markers[i].getAttribute("assetno");           var address = markers[i].getAttribute("address");           var type = markers[i].getAttribute("type");           var assetdesc = markers[i].getAttribute("assetdesc");           var location = markers[i].getAttribute("location");           var point = new google.maps.LatLng(               parseFloat(markers[i].getAttribute("lat"))* (Math.random() * (max - min) + min) ,               parseFloat(markers[i].getAttribute("lng"))* (Math.random() * (max - min) + min));           var html = "
" + name + "
" + assetdesc + "
" + location + "
";           var icon = customIcons[type] || {};                setTimeout(function() {             var marker = new google.maps.Marker({                 map: map,                 position: point,                 icon: icon.icon,                             animation: google.maps.Animation.DROP                });                      return marker;                  setTimeout(function () {                                 bindInfoWindow(marker, map, infoWindow, html);                        cluster.push(marker);                    // save the info we need to use later for the side_bar                 // add a line to the side_bar html                 side_bar_html += '' + name + ' - ' + assetdesc +'<\/a>
';                }, 1500);           }, i * 50);              }                              var markerCluster = new MarkerClusterer(map, cluster, mcOptions);            // put the assembled side_bar_html contents into the side_bar div         document.getElementById("side_bar").innerHTML = side_bar_html;               });          }          // This function picks up the click and opens the corresponding info window     function myclick(i) {         google.maps.event.trigger(cluster[i], "click");     }             function bindInfoWindow(marker, map, infoWindow, html) {       google.maps.event.addListener(marker, 'click', function() {         infoWindow.setContent(html);         infoWindow.open(map, marker);       });     }          function downloadUrl(url, callback) {       var request = window.ActiveXObject ?           new ActiveXObject('Microsoft.XMLHTTP') :           new XMLHttpRequest;            request.onreadystatechange = function() {         if (request.readyState == 4) {           request.onreadystatechange = doNothing;           callback(request, request.status);         }       };            request.open('GET', url, true);       request.send(null);     }          function doNothing() {}


Convert Lat/Long to UTM specifying which zone to use (Java)

I have a set of coordinates in decimal degrees spread across two UTM zones in my Java application that I want to export to use in Petrel, so they need to be in the same UTM zone. Is there a java library out there where I can specify what zone I want to use for the outputdata? tried quite a few libraries now and they only have utils for converting to the correct UTM zone.


How to print an OpenLayers map with its popups open using Mapfish printing module?

I'm using GeoExt and Mapfish printing module for geoserver. There is a functionality, in the application I'm developing, that allows users to create popups on the map. I'd like that printing functionality allows popups to be printed with the map. Is that possible with Mapfish ? Best regards.


Can I move points by editing x/y in attribute table?

Im new to QGIS and I just cannot figure out how to do this one hopefully simple thing: I have a bunch of points in shapefile and i need to move some of them around by hand / coordinates. I've understood, that if i move points by hand its possible to update their new xy to attributes table by field calculators $x and $y operators (Just select the column and insert that operator i suppose?). However, how about reverse? I thought that the features position on screen could be changed by editing the xy columns on attribute table...but the point remains on the same old location. Am i doing something wrong? thanks!


Postgis, get the points that are x meters near another point, in meters

I'm trying to find the points within a certain distance, in meters, from another point. I'm using the function ST_Buffer, but I don't get how to express the distance in meters. I'm trying with something like this:               select     1 as cartodb_id,     ST_Buffer(       ST_Transform(         ST_GeomFromText(           POINT(-58.38145 -34.60368)'           , 4326         )         , 3857       )       , 500     ) as the_geom_webmercator      I have the coordinates from google maps (in wgs84, 4326) then I transform them to webmercator (3857) and then I pass 500 as parameter, and I get something that looks like the desired area, but after comparing it with what google maps says it falls short for a non neglectable distance. Is this the right way to achieve it? note: you can try the sql query in cartodb \-- From this question: http://gis.stackexchange.com/a/44481/19461 I came with the following code (I use SRID 31997 to calculate the buffer, and then go back to webmercator)               select     1 as cartodb_id,     ST_Transform(       ST_Buffer(         ST_Transform(           ST_GeomFromText(             'POINT(-58.427185 -34.624592)'             , 4326           )           , 31997         )         , 2000       ), 3857     ) as the_geom_webmercator      Now if falls short for no more than 20 meters. I thought mercator (EPSG 3857) was in metric units.


Bonjour, Peut-on avec Quantum GIS redresser une photo aérienne avec des points caractéristiques connus en 3D (XYZ) ? **\-- Translation:** Hello, Is it possible to rectify an aerial photo with known control points in 3d, in QGIS?


How to set opacity for GRASS layers using command line?

In the process of learning GRASS, I am finding that I can learn many of the command-line methods that I need for scripting tasks from using the wxGUI, as it conveniently shows most of the underlying commands that it runs. This has not turned out to be the case for setting the opacity of layers. A little Googling turned up a module called g.pnmcomp, which may be responsible for controlling layer opacity. Unfortunately, that module appears not to be intended for end-users and I have not found documentation that is sufficient for me to make use of it; I'd need to know how to generate the PPM/PGM pairs that it stacks, at least. There to not appear to be arguments for opacity in `d.rast` or `d.vect`, and I suspect that it's the png or tif driver that would actually be handling the opacity of layers. That's the background, but my question is quite simple. How can I set the opacity of layers in maps created via the command line?


Can ArcGIS Server be called ArcSDE? I'm confused about terminology

I'm confused about some ESRI terminology. If I have ArcGIS 10.1 Server installed and we use Enterprise geodatabases with versioning capabilities but we use direction connections does this have anything to do with ArcSDE or SDE? I know that ArcSDE isn't even installed on our server, but I see ArcSDE experience being requested quite a bit but I never know if they truly are using ArcSDE or that's just what they are used to calling it. Can someone clear this up for me?


Good Symbology for Interactive Web Mapping

When a user clicks on a map what should they expect to see? I would say a symbol for where they clicked. A pushpin seems to be the most accepted icon for generic data. Google has pushed the upside down tear drop. What are other ideas/options and is there a place for finding professional gis oriented icon packs? I ended up creating this, ![pushpin](http://i.stack.imgur.com/FW721.png) This just popped up from the guys at map box. Clean maki icons


Error when using pgsql2shp

I try to export geographical data from a postgis database to a shapefile with pgsql2shp. Normally this works fine, but now I receive the following error.               Preparing table for user query... Done.      Initializing... ZMflagQuery: ERROR:  function zmflag(geometry) does not exist     LINE 1: SELECT max(zmflag("geometrie"::geometry)) FROM "__pgsql2shp7...      The query I use is:               pgsql2shp.exe -f 'foldername' -h luna -p 5432 -u user-P pw -g geometrie dbname "select * from bag.adressen a where a.wnpcode = '3386'"      I haven't had any earlier problems with pgsql2shp. Hope someone can help.


Meridian convergence. True north, magnetic north and grid north

I'm having difficulty wrapping my mind around meridian convergence, the horizontal angular distance between true north and grid north. Say I want to determine if a feature lies to the east or west of the central meridian (CM) by using true north and grid north designations on a topo map. I realize grid north is parallel to the CM, while true north points to the poles, and magnetic north is the direction a compass points and constantly changing. Looking at the figure below, I see grid north points to the east of true north. So does this fact alone mean everything on the grid is to the east of the true north, and therefore the CM? Does this simple fact mean that features in this grid lie to the east of the CM, or am I missing something. Also, I realize I can just look at the tick marks and and see that this this grid in particular covers -80°22’ to -80°15, and the CM for zone 17R lies at 81°. But had I not known that and wanted to use the north arrows. Please explain. ![enter image description here](http://i.stack.imgur.com/gnrZb.png)


Can I create a virtual mosaic using other virtual mosaics?

I am following this example - http://linfiniti.com/2009/09/image-mosaicking- with-gdal/ I have 6TB of aerial imagery in 6 folders 1TB each and each folder has many subdirectories including the geotiffs. I am using gdal_translate to compress the data first. Then I use gdalbuildvrt to create the mosaics, and finally I build the pyramids/overviews for the mosaics using gdaladdo. My target is to use geoserver to serve all the aerial data connected together. My concern is that a subdirectory may be 100GB which takes quite a while to process (either compress or building pyramids). This is why I did not use gdal on all 6TB at once and preferred handling them in different directories. Thus, my question is whether or not I will be able to use something like gdal_merge to connect all the pyramitised mosaics together to a bigger mosaic and serve it using geoserver or similar OS software. Apologies for the huge post! Thanks in advance for any hints or tips.


How to insert new line text in popup

I'm using Leaflet Marker Cluster and I need to show five different lines in a popup. But when I write this, they are all in the same line. Can someone help me to be one under another?               var a = addressPoints[i];                 var title = a[2];                 var univ = a[3];                 var direct = a[4];                 var city = a[5];                 var state = a[6];                 var marker = new L.Marker(new L.LatLng(a[0], a[1]), { title: title } );                 marker.bindPopup("Student: " + title + "University: " + univ + "Direction: " + direct + "City: " + city + "State: " + state);                 markers.addLayer(marker);             }              map.addLayer(markers);


Shapefile output customization via WFS in Geoserver?

I'm running Geoserver 2.4 and I've created a layer that I'm using WFS to download as shapefile (or, rather a zipfile with shapefiles). This works fine, and a request like:               http://localhost:8080/geoserver/bw/ows?yservice=WFS&version=1.0.0&request=GetFeature&typeName=ns:layeroutputFormat=SHAPE-ZIP      returns a zip-file containing the shapefile(s) i requested. No problem. The only problem is that this file contains a wfsrequest.txt file that I'm rather sure my users won't need or worse: be confused by. After diggig a bit around in the geoserver docs I've found this page which says that I can use freemarker templates to customize the zip-file. But, for the life of me I cannot figure out _where_ to put the freemarker template file and what it's _filename_ should be! In addition it seems to me that the only thing the template let's me configure is the name of the textfile, not it's content or if it's included or not. Any pointers to where to place this template and what I can do with it?


How to generate non-merging buffers in QGIS?

I'm using QGIS to construct some fixed width buffers from a coastline shapefile. Is there a way to easily handle overlaps/ median lines? (I'm not sure if there's a particular term or phrase I should be searching for here.) More detail: I have a shapefile for several islands. I need to create a 12nm territorial sea coastal zone. This is straightforward with the buffer function. However, if the distance between two islands is less than 24nm (12 + 12), the boundary should follow the median line. Is there a way to calculate this in QGIS so that, instead of a merged polygon, I can generate two polygons (one around each island) with a boundary along the mid point. For bonus points, I need to generate a second smaller coastal zone. This lies 4nm from the coast, or 1/3 of the distance to the territorial sea boundary described above. Is there a way to construct a buffer with a proportional distance? I hope my explanations make sense. Please let me know if anything is unclear and I'll add more detail.


Tiles refreshing with geoserver

I use geoserver geowebcache for displaying tiles using google maps API. Data comes from Postgis. My problem is that I have to change geometry of some features (not very frequently). I would like to achieve automation simillar to this from openstreetmap, where after source data change tiles that cover area of changed feature regenerate themselves automaticly. How to do this? Now I have to delete all tiles from geoserver and generate them once again. I do not use pure WMS as service is rather popular and WMS may work slowly...


Select record from table attributes in QGIS and Python

Can anyone tell how I can access to the attribute table of a shp and select a record from a specific row and column using Python (with console or a script). I've been looking for in the qgis API, but I'm frustrated, I don't find anything. Thank you very much in advance. Lucas


cannot get rid of sr.lock files while FOR LOOPING dbfTables

I am new to Python and to this community as well, hope someone could help me. I am running script to extract and merge toghether the tables of some Raster. Each Attribute Table presents only one row and the same field names. My script works fine until the very end of it, when I try to merge all the tables. It seems the tables are locked (I can see an "sr.lock" file for each Table I want to merge in my folder) and I cannot access them. Strange thing: I do access them if I simply use a sample (for instance) of two of these so created tables in the Python window within arcMap and type their names instead of using a FOR LOOPING... Guess it might have to do with the Here is my script: #import relevant modules, create geoprocessing dispatch object import win32com.client, sys, string, os, arcpy               gp = win32com.client.Dispatch("esriGeoprocessing.gpDispatch.1")          # Remember to change this to wherever your files are stored     gp.workspace = "G:\\Chile_2012\\MODIS10A2.V005\\provvisoria\\ATTRIBUTE_TABLE"     out_dir = "G:\\Chile_2012\\MODIS10A2.V005\\provvisoria\\ATTRIBUTE_TABLE"          try:         rasters = gp.ListRasters("*", "all")         rasters.reset()         rst = rasters.Next()              while rst:             # Create the new field             gp.AddField_management (rst, "FILENAME", "text", "", "", "50")                  # Apply the filename to all entries                    gp.CalculateField_management (rst, "FILENAME", '"' + rst + '"')             rst = rasters.Next()          except:         print gp.GetMessages ()          listRaster = arcpy.ListRasters ()          for raster in listRaster:         arcpy.TableToTable_conversion (raster, out_dir, raster+ '.dbf')          listTable = arcpy.ListTables ()          for table in listTable:         arcpy.Merge_management (table, 'Cl_Rio_Aconcagua.dbf')      The code is taken from others, I simply adapted it for my needs. Anyway, the error I am receiving so far doesn't have to do explicitly with LOCK topics, but since I have those files in my folder I need help to find out how to get rid of them.               ERROR 000732: Input Datasets: Dataset 'Cl_Rio_Aconcagua_2007121.img.dbf' does not exist or is not supported     Failed to execute (Merge)


Interpreting Firebug results on ESRI Javascript feature layers in the NET tab

This was cross-posted to the ESRI Javascript API forum yesterday. I need help in interpreting what I am seeing and wondering why I'm seeing duplicate features. I'm using this example: http://help.arcgis.com/en/webapi/jav...efinition.html "Feature layer with layer definition applied" on my own server and viewing the results after opening the page in Firefox. I modified the tooltip code so I can see the OBJECTID. Your results may be different from what I describe here. I used the tooltip to find the OBJECTID on screen and then expanded the URLs to find the same OBJECTID. I'm specifically looking at the shaded area next to the I-35 sign on the map. When I expand the keys under the URLs in the JSON tab on the NET tab I can see where the featurelayer (fields) is being created (the line starts as GET1?). Then there are 3 more lines that when expanded have a key called "features". The first one has 1 feature (0), the second line has 4 features (0,1,2,3) and the third line has 2 features (0,1). In the second line with 4 features, the 4th feature has an OBJECTID of 5095 and in the third line the 2nd feature has an OBJECTID of 5095. Does that mean that this feature is being downloaded twice? I'm not moving the map around at all. There are also URLs that when expanded do not show any features. They appear to show the same keys as the ones I described above but the features key cannot be expanded. These have a size of 2.6kb. I'm not sure what is happening here. In this example the sizes that are being downloaded are not a big deal. In my own data I have some large features and when I run this example against my own internal data and limit the definition expression to one feature I get six URLs returned. I'm assuming the first two are about the creation of the actual feature layer. The next four seem to be pairs of duplicates. The URLs with a size of 865B have a key called features that appears to be empty. The URLs with a size of 4.2KB have a key called features that is listing the feature I defined. So, I asked myself if in fact it was downloading the feature twice. Am I interpreting these results correctly? ![enter image description here](http://i.stack.imgur.com/k2W96.jpg)


Integrate ArcGIS 10 extension INTO ArcEngine 10

I was wondering if there is a way at all to use some of ArcGIS 10's extension into arc engine. A good example would be if we could put Arc Hydro extension into ArcEngine. Thanks and Regards, Kev


Geoprocessing Service to return Multidimensional Raster from a NetCDF file

I have tried to make this work for weeks with no results. I am trying to create a model in ArcMap that uses the Multidimension Tool "Make NetCDF Raster Layer" and return a raster to which I can apply a Time Slider with the Silverlight API once its result is published as a Geoprocessing Service (ArcGis 10.1). If I create such model and run it in ArcMap, and then publish the result, then I can successfully call the service as an ArcGISDynamicMapServiceLayer and link a Time Slider to it on my web app. But these type of NetCDF files contain more than one variable and for obvious reasons I want to be able to select any of such variables from my web app and get a different raster (with its time dimension) for each one of them. So it occurred to me that I could publish a model that gets the variable by input parameter and automatically generates the raster I need. But when I run this Geoprocessing Service and assign the resulting raster to an ArcGISDynamicMapServiceLayer within the Silverlight environment I get a Raster that I can display but it doesn't have a time dimension/extent. Any suggestions?


Converting Heatmap into Grid of Points to regenerate less accurate Heatmap?

**Question:** How do you take a heatmap generated using a GIS software (arcgis, qgis...) and convert it into a uniform grid array of points which can be used to regenerate the heatmap (although with lesser accuracy)? **Initial to final product:** **(Initial)**`Millions of Datapoints in MySQL` -> `(... some processing, maybe GIS software)` -> **(Final)**`Hundreds of Datapoints in a grid array` -> `Render density map in browser` How do I get from `Millions of Datapoints in MySQL` to `Hundreds of Datapoints in a grid array`? ![enter image description here](http://i.stack.imgur.com/uh7G1.png) **Purpose:** Transferring millions of points from database to browser where the heatmap is created will cause heavy database load and network traffic and strain the browser. So instead of transferring millions of points to the browser, it is more optimal to simplify the millions of points to 100s of points in a grid arrangement which will be easier for the browser to handle.


About spatialite views and Attribute table

I try to use views with spatial column in spatialite. I can connect to spatialite database and load the layer without problems but when I try to view data in Attribute Table I can't get eny data; all rows and field show ERROR. Data render well and information in point show correct data. Has someone get the same error?. Is this a bug? I get this results in different versions of qgis (osg4w in windows, master version in ubuntu 12.04 and qgis version included in osgeolive 6.0)


Create .ini file from folder of geotiffs

All, I have 800 geotiffs in a folder and I want to create a .ini file for each one which looks something like this: FILENAME, SCALE, CO-ORDS, FILEPATH, FILENAME, NEW.INI Is this possible? I have come across listgeo and other dos commands but I'm very new to them and don't fully understand what I'm doing! Any help would be fantastic!


Features on a vector layer to have a scalable stroke?

I am trying to make some kind of line-drawing editor over OpenStreet map using OpenLayers. I am able to draw points, connect them into lines, and it all looks good, but if I unzoom, stroke width is the same as on previous zoom (instead of being smaller). And if I unzoom al the way up to 0, line width (stroke) is still the same. Now, I made this work the way I want it using context on Style, but I don't like the way it works... **QUESTIONS:** Is there some kind of setting to make all lines scalable when I am changing zoom (adapt stroke width based on current zoom level)? Can I set stroke width in meters or millimeters?


WFS in Openlayers

I am new in Openlayers and web services in general, but until now I have managed to create a WMS (published by ArcGis to a server provided by uni) and connect it with Openlayers. Projection etc works properly but I don't know how to reach our WFS (e.g. GetFeatureInfo). I need it for applications like highlighing features from a search function, or mouse sensitive events. Any idea?                  function init() {              var options = {             projection: new OpenLayers.Projection("EPSG:3857"),             units: "m",             maxResolution: "auto",             numZoomLevels: 22,             maxExtent: new OpenLayers.Bounds(-3339584.723798, -30240971.958386,                                                    6679169.447596, 30240971.958386)         };              map = new OpenLayers.Map('map', options);              var wms = new OpenLayers.Layer.WMS(                 "WMS", "http://mikro.bv.tu-berlin.de/arcgis/services/student_grp1/campus_prj/MapServer/WMSServer?",                       {layers: '1,2,3,4,5,6,7', version:'1.3.0', crs: 'EPSG:3857', transparent:true, isBaseLayer: true});              var gsat = new OpenLayers.Layer.Google(                 "Google Satellite", {type: google.maps.MapTypeId.SATELLITE, numZoomLevels: 22}             );                   map.addLayer(gsat);         map.addLayer(wms);              map.addControl(new OpenLayers.Control.LayerSwitcher());              map.setCenter(new OpenLayers.LonLat(13.326169, 52.512134).transform(             new OpenLayers.Projection("EPSG:4326"),             map.getProjectionObject()), 16);         }


How to automate creation of Network Turn Features from line segments?

I have a road network which I will add Turn features in. From the road network, I have created a model that cuts out the line segments where the turn features will be located. My problem is how to make a turn features of these line segments and get them to connect to the road network. I know how to draw in new Turn features, but there are too many turn features to draw here. There are approximately 28000 Turn features which should be included. Does anyone have a model, Python script or a solution on how to do this?


How do I draw transparent polygons with ArcObjects?

How do I draw transparent polygons in ArcObjects? I mean is it possible to set alpha channel?


How do I query two columns in CartoDB?

I'm making a simple map with locations of daycare centers plotted. I have two filters, one that shows ages and another that shows different types of centers. I can filter one one or the other, but not both. http://www.datanarratives.org/daycarefinder2014/ For example, how do I filter the map to show only Corporate sites that serve 0-2 years? currently the query for one column is like this: query = "select * from table_04apr2014 where age_range like "+ "'%"+agerange+"%'"; thanks, Russell


QGIS - unable to change projections

I am relatively new to QGIS (version! 2.0.1) and having trouble changing projections. No matter what I choose the view is the same. For example, in the attached screen shot I have chosen Alaska Albers Equal Area Conic (102006), confirmed by both Project->Properties and Layer->Properties. Obviously this is not conic. I have "on the fly" transformation checked.   ![enter image description here](http://i.stack.imgur.com/4wOkf.jpg)


QGIS v2. Convert longitude/latitude to UTM projection-Zone 51J - Southern hemisphere

Could somebody please let me know in QGIS version 2.0.1 How do I convert Longitude/latitude default setting to UTM projection. I am bringing in waypoints from a GPS device which is set to the above specifications ie UTM projection/Zone 51J/Southern Hemisphere BUT when I bring the waypoints into QGIS version 2.0.1 it displays files as longitude/latitude. Can I change settings somewhere???


Generating Heatmap from PostGIS

I have GIS data in a PostGIS data base and would like to generate a density map and display them on a Leaflet/Google Maps. **Question:** What is the recommended/typical method for doing so, without transferring ALL (millions) the data points within the map's viewpoint to the Leaflet/Gmaps map? No user intervention (ie. Import data into ArcGIS to generate the map) should be required unless automation is possible via CLI etc. Currently using Postgresql/PostGIS as the spatial database and Leaflet on the browser. ![enter image description here](http://i.stack.imgur.com/UsAI1.jpg)


Searching for LANDSAT for the state of New Mexico

I am looking for a website that allows me to download free LANDSAT for all of the State of New Mexico. I need them to perform my work on RUSLE and need LANDSAT for c factor. Does anyone suggest of a good website ? The one I have download is the GLCF: Earth Science Data Interface from the University of Maryland. I have some LANDSAT 2006 that covers the southern new mexico. Anyone have a suggest? Thank you.


How to show labels for all polygons in a layer, even with 'NULL' values?

I have a polygon layer which contain information on property name, number of trees within the polygon, average height, and min- and max height values. My problem is, I want to label each polygon with property name, number of trees, etc. I got that part to work, the labels looks the way I want them. But, I have a number of properties which doesn't contain any trees. When making labels, the properties without tree doesn't get labelled at all? I would like labels on the properties without trees to show just the names of the properties. Is this possible in QGIS 2.2?


Real-world example of Affine Transform?

From the Wikipedia article: > In geometry, an affine transformation or affine map or an affinity (from the > Latin, affinis, "connected with") between two vector spaces (strictly > speaking, two affine spaces) consists of a linear transformation followed by > a translation. Can anyone give a real-world example of when and how this is used in GIS?


gdal2tiles misalignment

I have a map image that I have reprojected from OSGB36 to googleMaps projection (EPSG:900913). When I run gdal2tiles on the reprojected map, the results are not alligned with the google maps images (its not just out by a little bit but by 10's of miles). If I run it through MapTiler (from maptiler.org) it is aligned fine. MapTiler asks for an SRS which I dont specify when using gdal2tiles. So I'm thinking I've missied out a stage? Also when I run gdalinfo on the warped file, the coords of the corners seem wrong. E.g. for the bottom-left corner the latitude is 51.143906, but it should be 50.955887 for google maps. I'm usign gdal16 installed by OSGeo4W on Windows7 64-bit. Warped file here.. https://docs.google.com/leaf?id=0B93lksnTC7_cNzIzZWQ0MDYtMTY5Yy00NjY0LThiMjktZjc2YzA3MmU5NjI4 gdalinfo on warped file...               C:\OSGeo4W\apps\gdal-16\bin>gdalinfo e:buckland_WARPED.tiff     Driver: GTiff/GeoTIFF     Files: e:buckland_WARPED.tiff     Size is 611, 419     Coordinate System is:     PROJCS["Google Maps Global Mercator",         GEOGCS["WGS 84",             DATUM["WGS_1984",                 SPHEROID["WGS 84",6378137,298.2572235630016,                     AUTHORITY["EPSG","7030"]],                 AUTHORITY["EPSG","6326"]],             PRIMEM["Greenwich",0],             UNIT["degree",0.0174532925199433],             AUTHORITY["EPSG","4326"]],         PROJECTION["Mercator_1SP"],         PARAMETER["central_meridian",0],         PARAMETER["scale_factor",1],         PARAMETER["false_easting",0],         PARAMETER["false_northing",0],         UNIT["metre",1,             AUTHORITY["EPSG","9001"]]]     Origin = (-474051.292871501410000,6617009.987366309400000)     Pixel Size = (8.392224865731517,-8.392224865731517)     Metadata:       AREA_OR_POINT=Area     Image Structure Metadata:       INTERLEAVE=PIXEL     Corner Coordinates:     Upper Left  ( -474051.293, 6617009.987) (  4d15'30.51"W, 51d 9'49.57"N)     Lower Left  ( -474051.293, 6613493.645) (  4d15'30.51"W, 51d 8'38.06"N)     Upper Right ( -468923.643, 6617009.987) (  4d12'44.69"W, 51d 9'49.57"N)     Lower Right ( -468923.643, 6613493.645) (  4d12'44.69"W, 51d 8'38.06"N)     Center      ( -471487.468, 6615251.816) (  4d14'7.60"W, 51d 9'13.82"N)     Band 1 Block=611x3 Type=Byte, ColorInterp=Red       Mask Flags: PER_DATASET ALPHA     Band 2 Block=611x3 Type=Byte, ColorInterp=Green       Mask Flags: PER_DATASET ALPHA     Band 3 Block=611x3 Type=Byte, ColorInterp=Blue       Mask Flags: PER_DATASET ALPHA     Band 4 Block=611x3 Type=Byte, ColorInterp=Alpha      The sequence of commands I run are... Georeference the OSGB PNG images...               gdal_translate -a_srs EPSG:27700      -gcp 0 400 241538.5 119812      -gcp 600 0 244713.5 121928.66666667      -gcp 0 0 241538.5 121928.66666667      -gcp 600 400 244713.5 11981     bucklands1.png bucklands1.tiff      Warp into googleMaps projection (EPSG:900913) ...               gdalwarp -s_srs EPSG:27700 -t_srs EPSG:900913 -of GTiff     bucklands1.tiff bucklands1_warped.tiff      Tile (make into googleMap 256x256 tiles) ...               gdal2tiles bucklands1_warped.tiff gmTiles      It works if I by-pass the gdalwarp stage and make google tiles directly from the OSGB36 images. But the image quality is poor as the interpolation is not so good.


Annotation class empty after export

I need to use one annotation layer for different purposes (change positions, erase, add...) I need the old one as well so I wanted to export it and work on the new one. But every time either I use export or import and the same or a different database it ends with a annotation class with the same amount of rows as the old one but all the attributes are empty - with Null values. Neither copy is working for me because of different spatial reference. Am I doing anything wrong? Thanks for any advice.


How to calculate difference in altitude along lines using GRASS?

Using SRTM altitude information and OpenStreetmap roads, I want to calculate altitude differences (sum of meters uphill and downhill separated = two values) per road element. What would be the fastest way to achieve this?


gdal_grid with CSV file and VRT "No point geometry found on layer"

Given the following `.vrt` file which I manually created:               <OGRVRTDataSource>         <OGRVRTLayer name="DGM5_BE">             <SrcDataSource>DGM5_BE.txt</SrcDataSource>             <SrcLayer>DGM5_BE</SrcLayer>             <LayerSRS>EPSG:25833</LayerSRS>             <GeometryType>wkbPoint</GeometryType>             <GeometryField encoding="PointFromColumns" x="x" y="y" z="d"/>         </OGRVRTLayer>     </OGRVRTDataSource>      and the associated `DGM5_BE.txt` \- here are the first lines:               x;y;d     397200;5837250;59,15     397205;5837250;59,04     397200;5837245;59,03     397205;5837245;58,94     397195;5837240;58,93     397200;5837240;58,9     397205;5837240;58,86     397210;5837240;58,9     397190;5837235;58,98      I run the following command to convert the DGM5:               $ gdal_grid -of GTiff -ot Float32 -l DGM5_BE DGM5_BE.vrt DGM5_BE.tif      This fails with the following error message: > ERROR 1: Failed to open datasource `DGM5_BE.txt'.   >  No point geometry found on layer DGM5_BE, skipping.


Geoserver and PostGis output

I have a peculiar rendering of a small table in PostGis of polygones (imported from a shape file) from Geoserver (layer preview with OpenLayers) ![Default view when clicking on the layer preview from GeoServer admin](http://i.stack.imgur.com/0rMks.png) ![Zoomed in](http://i.stack.imgur.com/Df81H.png) The object are just cloned ... Would you give me a clue on what is going on ? Here is the output of the same table using QGis ![enter image description here](http://i.stack.imgur.com/hm5GZ.png)


What expressions for QGIS field-calculator?

I do not understand what language I have to use in field-calculator and labels on QGIS: SQL or Python? And where I can find the possible script/expressions to use? in the image you can see the options for expressions in QGIS 1.8 italian version Thanks ![Expressions in Italian version](http://i.stack.imgur.com/0LrmH.png)


Hawths tools grid labelling

I want to label the grid cells which I create with Hawths Tools in Arcgis 9.3 horizontally instead of vertically. To explain a little more: The program labels the grid cells like this as default:               2 5 8          1 4 7          0 3 6      I want to do this:               6 7 8          3 4 5          0 1 2      Is this possible?


ArcPad checkout/in process, only selected features

![enter image description here](http://i.stack.imgur.com/PjbpC.jpg)I am working on developing a python toolbox to automate the steps required for checking data out and back into a file geodatabase. My question is what is the best way to limit the features checked out to only those selected as in the image below, while using the python command line and ArcPad Data Management tools instead of the ArcPad data manager? You can see from the image that only a subset of the feature layers are selected and in the Data Manager the "Only get selected features" checkbox makes it easy. This is important because I want to limit the areas of use and reduce the file size as one of the feature classes is a large parcel map.


Finding the best locations for bee hives within a specified area (QGIS)

I would like to find fixed positions for bee hives within an orchard to ensure complete pollination of the trees. Is there a way to do this in QGIS? Example: The orchard area is 2 hectares (I have a polygon dataset representing the orchard). 10 bee hives are required to pollinate the area. How would I go about calculating the best positions for the the bee hives to ensure complete bee coverage of the orchards in QGIS?


AttributeError: Error in getting tool information when using TableToTable tool

I am trying to use the arcpy.TableToTable_conversion tool in my python script, but seem to be getting the following error on the line               arcpy.TableToTable_conversion("FINAL_NLPG", myTempWorkspace,outputTable)      The full traceback is > Traceback (most recent call last): File "", line 1, in File "c:\Program > Files\ArcGIS\Desktop10.0\arcpy\arcpy\conversion.py", line 1463, in > TableToTable raise e AttributeError: Error in getting tool information The variable "FINAL_NLPG" is a table view of a join which contains approximately 999 records (the full table is 4.5 million records). Any ideas on what might be causing the exception? EDIT* _*_ *               for file in list_files:         if file.startswith("Type_15"):             arcpy.CopyRows_management(myDataSource + os.sep + file, r"in_memory\t15") #Row created to get a OID in table             arcpy.MakeTableView_management(r"in_memory\t15","T15_view")         if file.startswith("Type_21"):                 arcpy.CopyRows_management(myDataSource + os.sep + file, r"in_memory\t21")#Row created to get a OID in table                 arcpy.MakeTableView_management(r"in_memory\t21","T21_view")         if file.startswith("Type_24"):             arcpy.CopyRows_management(myDataSource + os.sep + file, r"in_memory\t24")#Row created to get a OID in table             arcpy.MakeTableView_management(r"in_memory\t24","T24_view")              #Join Table 15 with  Table 24 based on USRN     arcpy.AddJoin_management("T24_view", "USRN", "T15_view", "USRN", "KEEP_COMMON")          #Join Table 21 with  Table 24 based on UPRN     arcpy.AddJoin_management("T24_view", "t24.UPRN", "T21_view", "UPRN", "KEEP_COMMON")          arcpy.MakeTableView_management("T24_view","FINAL_NLPG","OBJECTID < 1000","") ## <1000 to see if the code works     arcpy.TableToTable_conversion("FINAL_NLPG", myTempWorkspace,outputTable) # FAILS HERE     arcpy.TableToTable_conversion("FINAL_NLPG", "in_memory",outputTable) #saving to in_memory --- SAME PROBLEM      My source files are CSV's which is the reason i am having to copyrows in_memory to get OID field, as from what i read i cannot do a join on a table that does not have an OID field.


Is it possible to rotate the *canvas* in QGIS

Can the canvas be rotated so north is pointing in some other direction than defined by the projection? This question answers with respect to the composer, but not the canvas. There is a related 5 year old entry in the bug tracking database that's closed as unnecessary. Is that the current status, or is there a way to rotate the canvas in the newer versions? Creating a new projection is really not the answer


Google Maps MarkerClusterer - Remove all clusters

So, I have a PostGreSQL DB with 317 datapoints - all spatially enabled through PostGIS. I have queried this using PHP as GeoJSON and overlaid it on Google Maps (using a converting routine). I have also used the MarkerClusterer extension available in google Maps api to cluster all the markers. Now, I want to remove all the clusters from the map, to display other data. How do I do this? My markers are stored in an array called `markers = [];` and the marker clusterer is called like this `markerCluster = new MarkerClusterer(map, markers);`. I'm not able to find the right function to do this. MarkerClusterer link - http://google-maps-utility- library-v3.googlecode.com/svn/trunk/markerclusterer/docs/examples.html


SUM Area irregular polygons per grid cell

I have a shapefile of irregular polygons and a GRID (both as raster and polygon grid). How can I count the AREA SUM of irregular polygons per grid cell? Can use ArcGIS, QGIS or R. (Application: Nation rasterized into GRID. Question: How much area of what type of protected area in each raster cell?) Thank you, Florian


Why does Save as "Rendered Image" change the raster styling?

Rasters exported from QGIS (via Save As > Rendered Image) do not retain original styling. See attached. Any thought on how to prevent this error? The top image is exported from QGIS as a .bmp, the bottom is a screen grab from tilemill. Thanks. ![DesiredStyling](http://i.stack.imgur.com/nkqI2.png)![ReturnedStyling](http://i.stack.imgur.com/yi3sN.png)


geodjango slowness and debugging

I'm using geodjango + postgres to display polygons from tigerline on a map. Pretty simple stuff so far. My issue is that when I use the GPolygon object: django.contrib.gis.maps.google.GPolygon there is a considerable slowdown. (see below for the code I'm using)               locations = Location.objects.filter(mpoly__contains=point)     polygons = []     for location in locations :         for poly in location.mpoly :             gpoly = GPolygon(poly, \                 stroke_color = location.location_type.stroke_color,\                 stroke_weight = location.location_type.stroke_weight,                 stroke_opacity  = location.location_type.stroke_opacity,\                 fill_color = location.location_type.fill_color,\                 fill_opacity = location.location_type.fill_opacity)             gpoly.location = location.id             #raise Exception(gpoly)             polygons.append(gpoly)     # Google Map Abstraction     #raise Exception(len(polygons))     the_map = GoogleMap(polygons=polygons)        * all of my location's mpoly are MultiPolygons   * there are only 84 polygons total when I `raise Exception(len(polygons))`   * this tiny block of code is incurring a 10 sec load time on localhost w/ 4gig ram and an i5 proc... I'm not resource locked Does anybody have any idea what GPolygon is doing? Is GPolygon not ideal for production? is it just for prototyping? # EDIT I'm now setting up my GPolygon like so:               gpoly = GPolygon(poly.simplify(float(get_tolerance(poly.num_points))), \         stroke_color = location.location_type.stroke_color,\         stroke_weight = location.location_type.stroke_weight,         stroke_opacity  = location.location_type.stroke_opacity,\         fill_color = location.location_type.fill_color,\         fill_opacity = location.location_type.fill_opacity)      using the function:               def get_tolerance(num_points) :         """figure out a good tolerance"""         tolerance = 0         if num_points <= 500:             tolerance = 0         elif num_points <= 750:              tolerance = .001         elif num_points <= 1000:              tolerance = .002         elif num_points > 2000:              tolerance = .007              return tolerance      which sets a tolerance for the simplify geos function based on the total number of points (I noticed that for things like florida where the keys(islands) are separate polygons that the ones with fewer points broke with a high tolerance, while the big main landmass polygons are too huge without simplifying to a large degree. This has made my program a magnitude faster BUT I still think there is tons of room for improvement. Which leads me to my newest questions:   * Is there a better way to guess acceptable tolerances?   * What other possible speed gains could I explore? # UPDATE Something i did was pass all of the polygons to the view as geojson objects and use JS to build the polygon objects which is way faster than `django.contrib.gis.maps.google.GPolygon`. Server side python:               @csrf_exempt     def get_location_polygons(request):         """Returns a civic location name from a geodetic point"""         response_data = {'ack':None,'data':None,'messages':[]}         if request.method == 'POST':             #try :             # Get the location             location = Location.objects.get(pk=request.POST['location_id'])                  # Build the polygons             response_data['ack']            = True             response_data['messages'] = _(u'OK')                         response_data['data']           = {                 'stroke_color'      : location.location_type.stroke_color,                 'stroke_weight'     : location.location_type.stroke_weight,                 'stroke_opacity'    : location.location_type.stroke_opacity,                 'fill_color'            : location.location_type.fill_color,                 'fill_opacity'      : location.location_type.fill_opacity,                 'polygons'              : location.mpoly.geojson,                 'title'                     : location.title             }             #except :             #   # Fetch failed             #   response_data['ack']            = False             #   response_data['messages'] = [_(u'Polygon for location could not be fetched.')]         else:             response_data['ack']            = False             response_data['messages'] = [_(u'HTTP Method must be POST')]              return HttpResponse(json.dumps(response_data), mimetype="application/json")      Client side JS:               poly = JSON.parse(data.data['polygons'])     var paths = coord_to_paths(poly.coordinates, bucket, location_id);     polygons[bucket][location_id] = new google.maps.Polygon({          paths                   : paths,          strokeColor     : data.data.stroke_color,          strokeOpacity   : data.data.stroke_opacity,          strokeWeight    : data.data.stroke_weight,          fillColor           : data.data.fill_color,          fillOpacity     : data.data.fill_opacity     });     function coord_to_paths(coords, bucket, location_id)     {         var paths = [];          poly_bounds[bucket][location_id] = new google.maps.LatLngBounds();         for (var i = 0; i < coords.length; i++)         {              for (var j = 0; j < coords[i].length; j++)             {                  var path = [];                  for (var k = 0; k < coords[i][j].length; k++)                 {                      var ll = new google.maps.LatLng(coords[i][j][k][1], coords[i][j][k][0]);                     poly_bounds[bucket][location_id].extend(ll);                     path.push(ll);                  }                  paths.push(path);              }          }              return paths;            }


Packing Polygons within polygon

I have a Boolean raster. In the grey areas of the raster I would like to fit a given size polygon within a contiguous extent. ![](http://i.stack.imgur.com/bphCe.jpg) ![](http://i.stack.imgur.com/QroD3.jpg) Basically, I have an irregular polygon, and i would like to "fit" a known polygon within the extent of the irregular polygon as many times as possible. Direction of the polygon does not matter, and it could be a square. I would like for it to fit graphically, but if it just attached a number to the polygon (# that fit) that would work as well. Using Arcgis 10.


ArcMap: Not scaling and/or rotating when exporting a map

I am writing a console application using ArcGIS (engine or desktop). I'm trying to rotate and scale a map based on a polygon, and I'm not having any luck at all. With some tinkering, I can usually do one or the other but not both. Anybody have any suggestions? I feel as though I've tried every variation in terms of rotating the map and adjusting the scale either using the Imap interface, or the IActiveView interface.                   Private Sub Zoom2AndExportJpgs(mapDocument As IMapDocument, imagePath As String)         'Get the relevant strip maps for the route         Dim map As IMap = mapDocument.Map(0) '(assumed that there is only one map in the mxd)         Dim pageLayout As IPageLayout = mapDocument.PageLayout         Dim pageAV As IActiveView = pageLayout         Dim mapAV As IActiveView = map         Try             'get a list of strip map objects... EF object containing a list of the 4 corners of a polygon             Dim stripmaps As List(Of MRLAStripMapExtent) = getStripMaps()             Dim filename As String = ""                  'get all the associated stripmaps for the route  for each scale             If Not stripmaps Is Nothing Then                 For i = 0 To stripmaps.Count - 1                     Dim pgon As IPolygon = geometryHelper.CreatePGON(stripmaps(i).RectLowerLeftX, stripmaps(i).RectLowerLeftY, _                                                                                stripmaps(i).RectLowerRightX, stripmaps(i).RectLowerRightY, _                                                                                stripmaps(i).RectUpperLeftX, stripmaps(i).RectUpperLeftY, _                                                                                stripmaps(i).RectUpperRightX, stripmaps(i).RectUpperRightY)                     filename = imagePath & stripmaps(i).ZoomScale & stripmaps(i).PageNumber & ".jpg"                     CreateJpgFile(filename, mapAV, pageAV, pgon, stripmaps(i).ANGLE, stripmaps(i).ZoomScale)                      Next i             End If              Catch ex As Exception             publishError.PublishError(publishError.ErrorSeverity.majorStopRouteProcessing, ex)         End Try          End Sub          Private Sub CreateJpgFile(ByVal sFilename As String, ByVal pAV As ESRI.ArcGIS.Carto.IActiveView, _                               ByVal pPageActiveView As ESRI.ArcGIS.Carto.IActiveView, _                               ByVal pgon As IPolygon,                               rotationAngle As Double, _                               mapScale As Double)              Dim pExport As ESRI.ArcGIS.Output.IExport         pExport = New ESRI.ArcGIS.Output.ExportJPEG              pAV.Extent = pgon.Envelope         pAV.ScreenDisplay.DisplayTransformation.ScaleRatio = mapScale         pAV.ScreenDisplay.DisplayTransformation.Rotation = rotationAngle '0         pAV.Refresh()              'Export Image....         pExport.ExportFileName = sFilename         pExport.Resolution = 96         Dim exportRECT As ESRI.ArcGIS.esriSystem.tagRECT         exportRECT = pPageActiveView.ExportFrame         Dim pPixelBoundsEnv As ESRI.ArcGIS.Geometry.IEnvelope         pPixelBoundsEnv = New ESRI.ArcGIS.Geometry.Envelope         pPixelBoundsEnv.PutCoords(exportRECT.left, exportRECT.bottom, exportRECT.right, exportRECT.top)         pExport.PixelBounds = pPixelBoundsEnv         Dim hDC As Integer         hDC = pExport.StartExporting         pPageActiveView.Output(hDC, pExport.Resolution, exportRECT, Nothing, Nothing)              'Finish writing the export file and cleanup any intermediate files.         pExport.FinishExporting()         pExport.Cleanup()     End Sub


how do I get the "outer mantle" of a polygon shape file? (without joining all the polygons)

I am interested in finding all the vertices of all polygons which are not on the inside the most outer polygoin that can be formed in a shape file: Here is how I get all the vertices:               def __init__(self,shapeFilePath):         driver = ogr.GetDriverByName('ESRI Shapefile')         self.LandUses = []         self.Codes = [] #Store Categories         self.NPolygons = 1 # number of polygons in layer         self.dataSource = driver.Open(shapeFilePath, 0)         self.layer = self.dataSource.GetLayer()         self.NPolygons = self.layer.GetFeatureCount()         self.Boundaries = [""]*self.NPolygons   # store vertices of each polygon               for polygon in range(self.NPolygons):             area = self.layer.GetFeature(polygon)             Name = area.GetField(0)             Kategorie = area.GetField(1)             self.LandUses.append(Name)             self.Codes.append(Kategorie)             geometry = area.GetGeometryRef()             boundary_raw = str(geometry.GetBoundary())             #remove tail and head             boundary = boundary_raw[12:-1]             boundary = boundary.split(',')             #print boundary             #lenboundary = len(boundary)             #convert each coordinate from string to float             for x, point in enumerate(boundary):                 boundary[x] = point.split()             boundingvertices=np.asarray(boundary, dtype=np.float64)             self.Boundaries[polygon] = boundingvertices      But now I am stuck with a lot of vertices, and I don't know how to get the "mantle", here is a picture displaying what I need: ![A Sample layer showing multiple polygons](http://i.stack.imgur.com/cn3v3.png) Before I go hacking my own solution, I'd like to know if the GDAL Gods have been kind and made something like this already. Thanks a bunch! Oz UPDATE: Found something call convex hull ... not sure, but testing...   UPDATE #2: Of course one could just join all the polygons ...


Python method for finding a substring within a string

I converted a KML to a feature class and no longer have access to the symbology set in the original KML. I'm trying to re-create this by creating a new field that stores identifying information useful in creating the layer symbology. There are three different 'keywords' in the original attribute table that would be useful in a control structure that determines the appropriate symbology type. I need to search the string for these keywords, but I'm having trouble. **The sample code below is just to get the control structure working -- I know I need to use an update cursor to change / add field addtributes.** Here is my code:               # Import ESRI Python module     import arcpy          # Declare variables used in this script     #featureClass = r'C:\arbitraryLocationOnDisk'     oldField = 'FolderPath'     newField = 'HabitatType' # Restricted by domain: HabitatType                                 #  1. Critical Habitat                                 #  2. Corridors and Key Habitat Areas                                 #  3. Global IBA's          rows = arcpy.SearchCursor(featureClass)         for row in rows:             fieldValue = row.getValue(oldField)                  if fieldValue.find('Global'):                 print 'Global IBA'             elif fieldValue.find('Corridors'):                 print 'Corridors and Key Habbitat Areas'             elif fieldValue.find('Critical'):                 print 'Critical Habitat'             else:                 print 'Unrecognized habitat type: ' + fieldValue             del fieldValue     except:         arcpy.GetMessages()     finally:         del rows      **The problem I'm experiencing is that after every single row, I'm getting 'Global IBA' despite the fact that not every row contains the substring 'Global'.**


ESRI.style file not loading on citrix

We have a distributed ArcMap application on a citrix farm. We've come across a strange problem where the ESRI.style doesn't load. If you create a session, you can then go through the style manager and load the ESRI.style file, which is there, and it's fine. However, if you shut down, the next time you start, the same problem exists. There's no real logic to it. Has anyone come across this before? I have edited this for a bit of clarity, and now I am thinking with my mouth, but I am starting to think if the user is setting the style back in the citrix session, that is why it is not being saved, so it actually needs to be done on the instances on the Citrix farm, if that makes any sense?


Use Arcgis.com map package as a web map?

In Arcmap 10 there is a menu item to create a map package and upload to Arcgis Online ( _File > Create Map Package > upload to..._ ). That works fairly smoothly, if a tad slow sometimes. However once placed in system it seems the only way to access the map is to download the map package. What we really want to do is create the map in Arcmap Desktop, upload to Arcgis Online, and then embed that map in a website. If we take exactly the same data and create the map on the website, upload the feature classes individually, apply styling and symbology using the website tools, share, and so on. The resulting map can be opened in a) Arcgis.com map viewer, b) ArcExplorer, and c) Arcmap Desktop. In the "My Content" page a map created from Arcmap Desktop is listed as a "Map Package", and a map created entirely using the website is a "Web Map" (what we want). Am I missing something or is this really the way it's supposed to work? If so it's a terrific duplication of effort.


GIS-based reporting and maintenance tool

## Background Conceptually, I am looking for a tool, or suite of software tools that can be readily integrated to help browse data using a GIS-based map (such as Google Maps). The proposed architecture resembles, but is not limited to, the following: ![](http://i.imgur.com/5uMNf.png) The technologies shown above are not fixed. For example, if OpenGEO can eliminate many of the components while adding others that are not listed (such as authentication and authorization), that would be most helpful. Essentially, the architecture boils down to:               Map -> Filter sites -> Select sites -> CRUD      And:               Map -> Filter sites -> Select sites -> Summary Reports      The following sections describes these two problems in more detail, using a hypothetical (broad-brushstroke) example. ## Problem - CRUD In the first screen, the user is prompted to filter by some arbitrary criteria (team names, regions, skills, equipment, and more) and select some sites: ![](http://i.imgur.com/e6ERc.png) The sites that match the filtered options are shown on the map and the user is then presented with a number of options that can be used to edit data: ![](http://i.imgur.com/UVZ8n.png) If the user chooses Personnel, the system provides a CRUD screen: ![](http://i.imgur.com/c6TIl.png) The CRUD screens can be fairly complex, having simple code tables to drive them, such as: ![](http://i.imgur.com/ZajxE.png) ## Problem - Report The second part of the problem is very similar to the first, but instead of visiting CRUD screens, the user can choose to generate reports: ![](http://i.imgur.com/iWSEn.png) Note that the user has already selected the sites for reporting. If the user selects the equipment option, a report is generated with summary data: ![](http://i.imgur.com/wYjQa.png) ## Question What off-the-shelf software tool(s) can provide most (if not all) of these features? Note: The interaction need not be exactly as shown, but the main use cases must be possible. ### Use Case 1 - Populate Database   1. Define regions on a map.   2. Put sites [building locations] on a map.   3. Insert data (for each site). ### Use Case 2 - Selection   1. System shows a map.   2. User filters by region and other criteria.   3. User selects sites.   4. System provides options (maintenance or reports). ### Use Case 3 - Maintenance   1. User selects maintenance.   2. System presents complex CRUD.   3. User can add, edit, or delete data. ### Use Case 4 - Reports   1. User selects report.   2. User selects type of report to generate.   3. System generates summary report.


IFSAR bad stripping in some spotting areas

I have a co-worker that was working on do some analysis on IFSAR and he clips them to quads. He said that there are 6 quads that came up bad stripping. Is there a way around to clean it up the bad stripping? I explained to him that there are possibility that are 2 reasons for that is the that airplane it flew may have shift the bad stripping or the area that may have artifacts. Thanks


ESRI File Geodatabase - Trying to use CURRENT TIME in Definition Query

Is it me, or are the date functions in the file geodatabase a total nightmare. Anyway, I am trying to set up a fairly simple definition query that contains a subquery with a date comparison. My definition query looks like this:               "OBJECTID" IN (SELECT "assetid" from dummydata WHERE "restoretime" < CURRENT_TIME)      According the ESRI SQL Reference, the current time function is defined as CURRENT TIME (no underscore) but that breaks the definition query altogether. With the underscore, I dont get any errors, but the selection set is always null. Every row in dummydata has a restoretime value set which is definitely older than the current time. What am I doing wrong here? FYI - ArcMap 10 SP4 UPDATE: Some sample rows from the dummydata table               OID     assetid     outagetime               restoretime     1            1      5/10/2012 3:06:59 PM     5/10/2012 3:07:04 PM     2            2      5/10/2012 3:06:59 PM     5/10/2012 3:09:14 PM


Looking for QGIS Presentation info

I'm preparing a presentation of QGIS to release of the brazilian QGIS user guide. Thus, I would like insert some information about QGIS in global scale. Something like Tim's qgis-for-humanity presentation, but with updated information. I'm very pleasure if you have something in this direction to send me.


Adding Record to Related Table using JavaScript API

I looked and didn't find this question so hopefully it isn't a repeat. I am new to the JavaScript API and just started creating a web application where the user will enter maintenance records for a street light. The street lights are shown as points on the map, and the maintenance table is a related table that in joined to the street light based on the street ID. When the user clicks the street light, a pop up currently appears with information of the street light. I also have a button (that currently does nothing) and that the user will hopefully be able to select to bring up a window to enter a new maintenance record for that street light. However, I am not sure how to precede with this. Doing some looking, I have seen there is a EDITOR widget, but that seems to be for adding features that have geometries. However, my records will not have geometries. Thanks for any help, and please ask any questions if my question was not clear enough.


How to write FIDs of points within each polygon to polygon field?

I have two feature classes one with points one with polygons (in ArcGis 10.2). Now, I want to write into a String Field of the polygon layer a list of all the Point-FIDs that are within each polygon (often more than one, which is why join doesn't help). I was hoping that there is a possibility using Field Calculator and somehow concatenate the FIDs. But I don't know how to access the other feature class within the calculation code - is that possible? Also a Python code would be appreciated or anything else...


Creating noise maps using ArcGIS for Desktop or Open Source Desktop GIS?

In a previous role I helped create Noise Maps for Northern England. The predicted noise levels was done using the IMMI package (which I can recommend) and the cartographic output was done in ArcMap. There are also other packages such as LimaArc which have tighter integration with ArcMap. ![enter image description here](http://i.stack.imgur.com/8ldr9.jpg) I want to take on a personal project to try and create noise maps for large urban areas in Australia. I am interested in both mapping noise from traffic (roads, trams, rail), maybe having a stab at aircraft noise and also looking at how the noise from level crossing bells can be heard by surrounding residents. As its for self development purposes, I have no budget for buying dedicated software like LimaArc or IMMI. I was wondering **if anyone in the GIS-SE community has found a way to create noise maps in a similar approach to how IMMI/LimaArc does?** \--EDIT-- I had a play with the noise module for OrbisGIS (user16714 answer and comments below), but had some problems getting it to work - looks like it has a lot of potential but still has to be installed against a beta version and not entirely sure how well it will handle larger datasets. (Will post back if I get further with this). Ideally I really want to do this all in ArcGIS or a more established open source package (QGIS, Grass, SAGA, etc) Have seen some papers that mention tools to do this in ArcGIS, but cant source any scripts/tools as of yet. **Has anyone seen any scripts (python) or free extensions where this can be achieved directly in ArcGIS?**


Shapefile of points to grid

I am looking for a method/prog/library(java) to interpolate points from a shapefile to a grid (file). I have seen arcgis can do that but i am looking for something free. More specific: i have shapefiles(256 or more files) with points, those points have a value of temperature. Now i want to make a file with the values of a grid converted out of this points. The interpolation method is not very important for this project. The grid would be something of 10x10. I would like to do this in java and iterate over the files and convert them to grids. I presume there is a java library that can do this.


ArcGIS Server GP Service: How to create a txt file or rename a dbf to txt in the "%SCRATCHWORKSPACE%"

My end goal is to get an excel (I'll probably just settle for .csv) file loaded from a silverlight app into my "%SCRATCHWORKSPACE%" for my gp service. I will be linear referencing the data onto a polyline. I have silverlight reading the csv file's contents and packing it into a string to send over to ArcGIS Server. Then I want to write this data to a csv file in the "%SCRATCHWORKSPACE%". But I don't seem to be able to use any standard python code to hit the "%SCRATCHWORKSPACE%". Any thoughts or critiques?


How to programmatically convert arbitrary XML data to shapefile?

**EDIT:** Based on the answers below I decided to do some programming. I'll be using GEOtools for this, a java lib: http://www.geotools.org/ I have the following XML:               <shapes xmlns="http://www.meteogroup-maritime.com/spos/GISLayer"          name="Load line zones" transparency="50" onland="false">           <shape id="0" description="SUMMER ZONE" color="#FFFFC90E">        <polygon>         <location lat="35" lon="-180"/>            ....         <location lat="-33" lon="-170"/>         <location lat="-47" lon="-180"/>        </polygon>             <label lat="29" lon="-45" text="SUMMER ZONE" />        <label lat="-30" lon="-153" text="SUMMER ZONE" />      </shape>            ...          </shapes>      I want to turn this data into a shapefile, preferably by using existing software, although I don't mind scripting. How can I do this?


Converting Tab to Shp Using OGR2OGR with Python on linux

First i downloaded http://svn.osgeo.org/gdal/trunk/gdal/swig/python/samples/ogr2ogr.py and i am importing this. How can i get ogr2ogr to run in my script? nothing seems to be working and i not sure how to continue problem solving.               #!/usr/bin/env python         import ogr2ogr     import sys          if __name__=="__main__":     ogr2ogr.main('-f', "Mapinfo File", '/home/firstuser/birmingham/Wood.tab', "/home/firstuser/birmingham/Wood.shp")      With this i get main() takes at most 3 arguments (4 given) and when i do .               if __name__=="__main__":     ogr2ogr.main('-f', "Mapinfo File", '/home/firstuser/birmingham/Wood.tab')      i get               Usage: ogr2ogr [--help-general] [-skipfailures] [-append] [-update] [-gt n]                [-select field_list] [-where restricted_where]                [-progress] [-sql <sql statement>]                [-spat xmin ymin xmax ymax] [-preserve_fid] [-fid FID]                [-a_srs srs_def] [-t_srs srs_def] [-s_srs srs_def]                [-f format_name] [-overwrite] [[-dsco NAME=VALUE] ...]                [-simplify tolerance]                [-fieldTypeToString All|(type1[,type2]*)] [-explodecollections]                dst_datasource_name src_datasource_name                [-lco NAME=VALUE] [-nln name] [-nlt type] [-dim 2|3] [layer [layer ...]]           -f format_name: output file format name, possible values are:      -f "ESRI Shapefile"      -f "MapInfo File"      -f "TIGER"      -f "S57"      -f "DGN"      -f "Memory"      -f "BNA"      -f "CSV"      -f "GML"      -f "GPX"      -f "KML"      -f "GeoJSON"      -f "Interlis 1"      -f "Interlis 2"      -f "GMT"      -f "SQLite"      -f "ODBC"      -f "MSSQLSpatial"      -f "PostgreSQL"      -f "MySQL"      -f "PCIDSK"      -f "DXF"      -f "Geoconcept"      -f "GeoRSS"      -f "GPSTrackMaker"      -f "PGDump"      -f "GPSBabel"      -append: Append to existing layer instead of creating new if it exists       -overwrite: delete the output layer and recreate it empty       -update: Open existing output datasource in update mode       -progress: Display progress on terminal. Only works if input layers have the "fast      feature count" capability       -select field_list: Comma-delimited list of fields from input layer to                      copy to the new layer (defaults to all)       -where restricted_where: Attribute query (like SQL WHERE)       -sql statement: Execute given SQL statement and save result.       -skipfailures: skip features or layers that fail to convert       -gt n: group n features per transaction (default 200)       -spat xmin ymin xmax ymax: spatial query extents       -simplify tolerance: distance tolerance for simplification.       -dsco NAME=VALUE: Dataset creation option (format specific)       -lco  NAME=VALUE: Layer creation option (format specific)       -nln name: Assign an alternate name to the new layer       -nlt type: Force a geometry type for new layer.  One of NONE, GEOMETRY,       POINT, LINESTRING, POLYGON, GEOMETRYCOLLECTION, MULTIPOINT,       MULTIPOLYGON, or MULTILINESTRING.  Add "25D" for 3D layers.       Default is type of source layer.       -dim dimension: Force the coordinate dimension to the specified value.       -fieldTypeToString type1,...: Converts fields of specified types to       fields of type string in the new layer. Valid types are :       Integer, Real, String, Date, Time, DateTime, Binary, IntegerList, RealList,       StringList. Special value All can be used to convert all fields to strings.       -a_srs srs_def: Assign an output SRS       -t_srs srs_def: Reproject/transform to this SRS on output       -s_srs srs_def: Override source SRS            Srs_def can be a full WKT definition (hard to escape properly),       or a well known definition (ie. EPSG:4326) or a file with a WKT       definition.      Many thanks


How to represent the time(weekly/monthly) variationof a polygon map using one image?

I have a base map made up of three hundred polygons, each polygon get lots attribute values(For example, each week/month get a value). But I want to draw only one picture(due to page limitation) to represent the variation info.   Actually, I have tested two methods, one is layers, one is "subplot"(MATLAB).   **1\. Every monthly attribute can be draw as a layer, so the picture contains 12 layer. But the result is not clear for some areas, some polygon was covered by others.   2\. Draw subplot, a page maybe can contain 12 subplot images, but 52(week number of a year) is too much for one picture.**   Maybe I can use both two method with my monthly value, but none for weekly value. So my question is:   **Is there any other method for visual representation.** This is my first question on gis.stackexchange.com. So if any question or mistake, I'll fix it quickly. I need your help. Thanks a lot. * * * I'm sorry I can't paste my own data due to secrecy agreement, here is another sample in the ArcScene using ArcGIS sample data.( Only three layers was used in sample case, but my own data has 12 or 52 layers. I want to show all the layers using less even only one picture.)![SAMPLE PIC](http://i.stack.imgur.com/zG9Xu.jpg) PS: I don't know if there is any better solution except above two method.   Need your help. Thanks again.


Creating 3D lines from 3D points

Can you tell me the procedure in ArcGIS 9.3 to create 3D lines which connect the 3D points using the elevation of the points. For example, if pointA has 20 elevation and pointB has 30, then the line would connect pointA to pointB vertically such that one end point of the line would have 20 elevation and the other would have 30. Or, i would like to know how to create a 3D line directly without using the points, where i can define the x,y,z of the end points.


how to get json from describe feature type

i m using geoserver 2.1.3 i want to get the fields of layer from database http://[localhost]/geoserver/wfs?request=describeFeatureType&typename=topp:states this reurns me output in xml format how can i get it in json


What dissolve tool in QGIS allows me to summarize statistics for multiple attributes?

Is there a tool or plugin in QGIS that resembles ArcGIS 10's Dissolve tool? I'm trying to dissolve several polygons (parks) around the boundaries of another layer of polygons (cities), while performing various calculations for multiple attribute fields (like summing their total area, doing a count of features, etc). I looked into an earlier question (Batch Dissolve Polygons based on Attributes in QGIS or FWTools) where ftools was recommended, but ftools doesn't allow you to specify the way you would like to summarize statistics for multiple attribute fields. Is there one tool that allows me to summarize statistics for multiple attributes, like the ArcGIS Dissolve tool?


Fail to get heatmap from MULTIPOINT column of Spatialite layer in QGIS?

I got a heatmap from a POINT column of spatialite layer. But, when I made another heatmap from MULTIPOINT column, it was blank. What is the possible reason of this problem?


Making Map with Color Ramp Using SQL Database Intergration?

This could be a trivial question, but I've been kind of stuck on it for awhile. I'm trying to construct multiple maps that reflect aggregated data showing overall risk by county in a SQL Database (using Microsoft SQL 2012). Each entry in my data set reflects an insurance contract with a risk score associated with a FIPS county code. I would like to use the AddJoin tool to join to an associated shape layer on FIPS county codes. The resulting map would show each county's risk with an associated color ramp depending on the risk level. EDIT: I've taken RyanDalton's advice and created a seperate table that joins my data to a \ GIS database with shape entries on matching FIPS codes using MSSQL Server. I was able to connect to my specific database and make a new query layer useing ArcPy. The only problem I'm having is creating a color ramp based on the entries in my table (i.e. create a color ramp that shows differences between counties on values of Overall Risk Score). The below image shows what I am trying to do with ArcPy, as well as the resulting map on the right (shows overall risk for an earthquake in the US). ![enter image description here](http://i.stack.imgur.com/cDiWD.png) Below is a rough sample of my code which doesn't output a map with a color ramp:`                           import os, arcpy                 from arcpy import env                      # Declare Directories                 workingDir  = r'C:\Users\I55316\Documents\DQScore\ArcPy_Analysis'                 layerDir    = workingDir + r'\Layer_USNat'                 outputDir   = workingDir + r'\Output'                 dbDir       = workingDir + r'\DB'                 sdeFile     = 'DQ.sde'                      # Declare Database Server  Connection specifications                 databaseType        = r'SQL_SERVER'                 dataBaseInstance    = r'pmfldt43\sql2012'                 systemAuthType      = 'OPERATING_SYSTEM_AUTH'                           # Declare Query Layer Specifications                 PerilType               = 'EQ'                 layerName               = 'AllNationalCounty_EQ'                 query                   = 'SELECT * FROM dq.dbo.AllNational_EQ_GIS'                 oid_fields              = 'CNTY_FIPS'                 shape_type              = 'POLYGON'                 srid                    = '4326'                 spatial_reference       = arcpy.SpatialReference('WGS 1984 UTM Zone 12N')                           # Create Database connection via .sde file                 if os.path.isfile(dbDir+ '\\'+ sdeFile):                   os.remove(dbDir+ '\\'+ sdeFile)                 arcpy.CreateDatabaseConnection_management(dbDir,                                                         sdeFile,                                                         databaseType,                                                         dataBaseInstance,                                                         systemAuthType)                      arcpy.env.workspace = workingDir+'\\'+sdeFile                           arcpy.MakeQueryLayer_management(dbDir+'\\'+sdeFile,                                               layerName,                                               query,                                               oid_fields,                                               shape_type,                                               srid,                                               spatial_reference)                           # Declare map document                 mxd = arcpy.mapping.MapDocument(workingDir+r'\NationalDQScoring_EQ.mxd')                 mxd.author = "Krishna Soni"                           # Add Layer                 #lyrCounties    = arcpy.mapping.Layer(layerDir + r'\UnitedStates_Counties_TS2.0.0.lyr')                 lyrFaultLines  = arcpy.mapping.Layer(layerDir + r'\UnitedStates_FaultLines_TS2.0.0.lyr')                      # Define data frame                      df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]                      # Add Layers                 arcpy.mapping.AddLayer(df,lyrFaultLines)                      # Add graduated Colors                 for lyr in arcpy.mapping.ListLayers(mxd):                   if lyr.symbologyType == 'GRADUATED_COLORS':                       lyr.symbology.valueField = 'Overall_Risk_Avg'                       lyr.symbology.numClassed = 10      `


Wind turbine placement optimization and loss on surrounding house value

I am doing a geostatistical placement optimization study on where would be the optimal placement of a wind turbine in a Danish region. One of the variables taken into account is the cost on the value of the surrounding houses, which of course decreases with increasing distance. I have here a conceptual problem, and I would like to ask if anyone who has done or knows of such type of study could help me:   1. Assumed the turbine will be dismantled and removed on the 20th year, how would the cost of the installation of the turbine on the house value be calculated, considering the loss of rent (therefore through computing a 20 years annuity) or calculating it substracting the loss of value at t20 (adjusted to inflation and discounted for the social discount rate) - the loss of value at t0?   2. How would you calculate the cost of never removing the wind turbine? It is a very specific question, I hope someone can help.


Are there another way/tool as GDAL/ERDAS-API to convert a raster to ECW?

I am looking for a tool to convert raster (TIF, JPG) to ECW. I found this two year old question/answer How to convert orthophotomap to .ecw file? The answer is to use GDAL with an ERDAS SDK. I checked the current free versions of ERDAS SDK: The free version of ERDAS SDK is still read-only. Is there meanwhile another way/tool as GDAL/ERDAS-API to convert a raster to ECW? (I prefer a free program. If it is not free, information about the approximate cost is helpful.)


How to get LatLng array from geoJSON Layer in Leaflet?

i need to hand the latlng coordinates from my phpPostGIS-served geoJSONLayer as an array over to a new added HeatMap Layer. L.geoJSON has an build-in option: coordsToLatLng( coords )" and a static method for that: coordsToLatLngs( coords, levelsDeep?, reverse? ). I don´t get any errors, but the heat map does´t show up. If i build a new L.heatLayer(coord).addTo(map); outside the function, it works… Does anyone have an idea? This is what i have so far:                   $.getJSON("postgis_geojson.php?geotable=shops&geomfield=the_geom", function(data) {                  L.geoJson(data, {                 pointToLayer: function (feature, latlng) {                     return L.circleMarker(latlng, geojsonMarkerOptions);                      },                  onEachFeature: function (feature, layer) {                      popupOptions = {maxWidth: 200};                     layer.bindPopup(feature.properties.popupContent);                 },                 coordsToLatLng: function (coords) {                 return new L.heatLayer(coords);                 }                  }).addTo(map);             });


Join Standalone Tables from ArcGIS Server in Javascript API

I am trying to find a way to execute the equivalent of the following query with the ArcGIS JavaScript API (I made field and table names generic):               SELECT a.field1, a.field2      FROM table1 a, table2 b      WHERE b.id1 = '00016' AND b.id2 = a.id      However, `table1` and `table2` are from two different standalone tables in ArcGIS server (two different URLs). Is there any way to handle this sort of scenario when you have two different service URLs (`/MapServer/1` and `/MapServer/2`)?


GDAL Clipping (hack)

I am trying to use the python script from http://www.sparkgeo.com/labs/2010/07/07/gdal-clipping-hack/ to clip a raster based on many shapefiles. The script is using a mysql database an i would like to use it on a directory of shapefiles. I am not a programmer so I'am not sure how to make this work.


Removing "(optional)" from parameter description in Python script tool dialog?

I am using ArcGIS 10.2 and create a script tool in toolbox for attribute search on a layer, all the searching criteria is not compulsory, and user can combine multiple search criteria. But in the window all parameter together with (optional), I want to know whether there is a way to remove the (optional), the picture is attached. ![enter image description here](http://i.stack.imgur.com/NtwjA.jpg)


UK Building co-ordinates web service

Within the UK, do any commercial web services offer building level geocoding to a coordinate? If so what level of accuracy is available?


Why is tiff different in epsg 3857 and epsg 900913 in gdal

When I transform tiff from 4326 to 3857 and from 4326 to 900913 in gdal, I get different result(when display in Qgis) eventhough these two projections(3857 and 900913) should be the same. What is problem for that? Image shows differance. Brighter(white) layer is from epsg 4326 to 3857 and darker(black) layer is from epsg 4326 to 900913. I know it's not a real standard, but in gdal gdalsrsinfo -e epsg:900913 and gdalsrsinfo -e epsg:3857 are same,I mean both have same proj.4. So I don't understand, why are layers differently displayed in Qgis. ![enter image description here](http://i.stack.imgur.com/hlESc.jpg)


SLD - Is it possible to create a Rule that stylise only the first and last point of a Line?

I've read the SLD doc, but I can't find any clue on how to create an SLD file to add a graphic symboliser on the first and last point of a line. Does someone know how to do that ? Thanks.


ArcGIS python itertools.combinations

There is following sample code combination 5C2. I want to create all combinations 5C1 , 5C3 , 5C4 and 5C5.               list = [ 0,1,2,3,4 ]     5C1 means (0),(1),(2),(3),(4),(5)     5C2 means (0,1),(0,2),(0,3),..(1,2),(1,3),(1,4)..,(2,3),(2,4)     5C3 means (0,1,2),(0,1,3),(0,1,4),(0,1,5)..(1,2,3),(1,2,4)     5C4 means (0,1,2,3),(0,1,2,4),(0,1,2,5)..(1,2,3,4),(1,2,3,5)     5C5 means (0,1,2,3,4)      Please let me know your advice and comments.               import arcpy     import itertools          arcpy.env.workspace = r"C:\path\to\workspace"          base_shapefile = "some_shapefile.shp"          oid_field = arcpy.Describe(base_shapefile).OIDFieldName     feature_count = int(arcpy.GetCount_management(base_shapefile).getOutput(0))          for (i, j) in itertools.combinations(range(feature_count), 2):         arcpy.Select_analysis(base_shapefile , "combination_%i_%i.shp" % (i, j), '"%s" in (%i, %i)' % (oid_field, i, j))