title: Is it a good idea to migrate to OpenLayers 3 now

text: I wonder if OpenLayers 3 is trustable enough to start migrate application to it now. Is the difference between versions 2 and 3 are too much important that the old code wont works? Are the major improvements of OpenLayers 3 is tested enough like 3D?


title: Incremental "auto save" in ArcMap edit session

text: Is there any way to add automatic incremental saving to ArcMap 10.1 editing sessions? I found this script for 9.x but it doesn't seem to work with the newer versions. I'm looking for a script or add on. I'm more concerned with saving edits rather than saving the mxd itself. Frequent crashes have ruined my morning too often. I'm aware that this is similar to this question, but not exactly the same in my opinion. Thank you.


title: Use Java to automate the service creation and display up to date data on the map

text: Our team is using ESRI ArcGIS and our requirement is 1.To create a web application in JAVA with a map displaying various data from DB. 2.The data gets updated periodically in the DB and the map should display it as and when the data is ready in DB. 3.Numerous fields of the DB should be selectable on the map on a demand basis. Right now we are creating a mxd file and publishing it as service and showing it on the ArcGIS for Dexktop. So I am pretty unsure if I should use the ArcGIs for Java SDK for all of my above requirements or go with ArcGIs for Javascript API. Please let me know the best possible way to acheive this.


title: QGIS Crashes when I try and overwrite a shapefile using QgsVectorFileWriter.writeAsVectorFormat (QGIS 1.8, MacOS 10.7.5)

text: I'm somewhat new to this, and working on a plugin. My plugin will create a points memory layer, which is then written out as a shape file using QgsVectorFileWriter.writeAsVectorFormat. self.writer = QgsVectorFileWriter.writeAsVectorFormat(self.csmlayer, self.shapeMapFile, "UTF-8", None, "ESRI Shapefile") The user will add features (and their attributes) using the plugin, and can save the file again at any time from the plugin. At the end of the session, the user saves the final version, closes the plugin, and deletes the layers from QGIS. Then, if the user restarts the plugin, reloads the saved shapefile, adds some more features using the plugin, then tries to save this edited file to the same shapefile name, QGIS crashes - it just goes down, with no error message. I saw references to not being able to overwrite a shapefile, in which case I can do something else there; or I may need to handle the addition of the new features/attributes in a different way for the existing shapefile. Any help appreciated. Also, the fact that QGIS just crashes with no error message is worrying... Top part of stack trace attached:               Process:         QGIS [56853]     Path:            /Applications/QGIS.app/Contents/MacOS/QGIS     Identifier:      org.qgis.qgis     Version:         1.8.0 (1.8.0 [])     Code Type:       X86-64 (Native)     Parent Process:  launchd [232]          Date/Time:       2013-05-29 18:25:32.828 +0100     OS Version:      Mac OS X 10.7.5 (11G63)     Report Version:  9          Interval Since Last Report:          4344573 sec     Crashes Since Last Report:           42     Per-App Interval Since Last Report:  924721 sec     Per-App Crashes Since Last Report:   19     Anonymous UUID:                      D60F5ED8-1776-4299-B102-D99C0EDBE0D0          Crashed Thread:  0  Dispatch queue: com.apple.main-thread          Exception Type:  EXC_BAD_ACCESS (SIGSEGV)     Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000008          VM Regions Near 0x8:     -->          __TEXT                 0000000100000000-0000000100510000 [ 5184K] r-x/rwx SM=COW  /Applications/QGIS.app/Contents/MacOS/QGIS          Application Specific Information:     Performing @selector(qtDispatcherToQAction:) from sender NSMenuItem 0x114374f10     objc[56853]: garbage collection is OFF          Thread 0 Crashed:: Dispatch queue: com.apple.main-thread     0   org.gdal.gdal                   0x0000000102b7985d OGR_Fld_GetType + 4     1   libogrprovider.so               0x0000000110716104 QgsOgrProvider::addFeature(QgsFeature&) + 762     2   libogrprovider.so               0x0000000110716775 QgsOgrProvider::addFeatures(QList<QgsFeature>&) + 111     3   org.qgis.qgis_core              0x0000000103e643df QgsVectorLayer::commitChanges() + 5129     4   org.qgis.qgis                   0x000000010002ca4f QgisApp::toggleEditing(QgsMapLayer*, bool) + 1583     5   org.qgis.qgis                   0x000000010002dd21 QgisApp::removeLayer() + 233     6   org.qgis.qgis                   0x00000001002488d7 QgisApp::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) + 2315     7   QtCore                          0x0000000104a6222e QMetaObject::activate(QObject*, QMetaObject const*, int, void**) + 1566     8   QtGui                           0x0000000104cfb2c1 QAction::triggered(bool) + 49     9   QtGui                           0x0000000104cfc654 QAction::activate(QAction::ActionEvent) + 180     10  QtGui                           0x0000000104caef0a -[QCocoaMenuLoader qtDispatcherToQAction:] + 106     11  com.apple.CoreFoundation        0x00007fff912a170d -[NSObject performSelector:withObject:] + 61     12  com.apple.AppKit                0x00007fff8cd778ca -[NSApplication sendAction:to:from:] + 139     13  com.apple.AppKit                0x00007fff8ce647ff -[NSMenuItem _corePerformAction] + 399     14  com.apple.AppKit                0x00007fff8ce64536 -[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] + 125     15  com.apple.AppKit                0x00007fff8cde20d4 -[NSMenu performKeyEquivalent:] + 281     16  com.apple.AppKit                0x00007fff8cde0d25 -[NSApplication _handleKeyEquivalent:] + 526     17  com.apple.AppKit                0x00007fff8ccd9e86 -[NSApplication sendEvent:] + 4282     18  QtGui                           0x0000000104cafb24 -[QNSApplication sendEvent:] + 84     19  com.apple.AppKit                0x00007fff8cc70a0e -[NSApplication run] + 555     20  QtGui                           0x0000000104cba900 QEventDispatcherMac::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 1824     21  QtCore                          0x0000000104a49094 QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 68     22  QtCore                          0x0000000104a49444 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 324     23  QtCore                          0x0000000104a4bb2c QCoreApplication::exec() + 188     24  org.qgis.qgis                   0x000000010000996b main + 10523     25  org.qgis.qgis                   0x0000000100006c04 start + 52          Thread 1:: Dispatch queue: com.apple.libdispatch-manager     0   libsystem_kernel.dylib          0x00007fff9464b7e6 kevent + 10     1   libdispatch.dylib               0x00007fff8b44f786 _dispatch_mgr_invoke + 923     2   libdispatch.dylib               0x00007fff8b44e316 _dispatch_mgr_thread + 54          Thread 2:     0   libsystem_kernel.dylib          0x00007fff9464adf2 __select + 10     1   QtCore                          0x0000000104a1d6b0 QProcessManager::run() + 96     2   QtCore                          0x00000001049355ba QThreadPrivate::start(void*) + 298     3   libsystem_c.dylib               0x00007fff9492b8bf _pthread_start + 335     4   libsystem_c.dylib               0x00007fff9492eb75 thread_start + 13          Thread 3:: com.apple.CFSocket.private     0   libsystem_kernel.dylib          0x00007fff9464adf2 __select + 10     1   com.apple.CoreFoundation        0x00007fff9128fc8b __CFSocketManager + 1355     2   libsystem_c.dylib               0x00007fff9492b8bf _pthread_start + 335     3   libsystem_c.dylib               0x00007fff9492eb75 thread_start + 13          Thread 4:     0   libsystem_kernel.dylib          0x00007fff9464abca __psynch_cvwait + 10     1   libsystem_c.dylib               0x00007fff9492f274 _pthread_cond_wait + 840     2   QtWebKit                        0x00000001015b0855 WTF::TCMalloc_PageHeap::scavengerThread() + 117     3   QtWebKit                        0x00000001015b0ae9 WTF::TCMalloc_PageHeap::runScavengerThread(void*) + 9     4   libsystem_c.dylib               0x00007fff9492b8bf _pthread_start + 335     5   libsystem_c.dylib               0x00007fff9492eb75 thread_start + 13          Thread 5:     0   libsystem_kernel.dylib          0x00007fff9464adf2 __select + 10     1   QtCore                          0x0000000104a7adc5 qt_safe_select(int, fd_set*, fd_set*, fd_set*, timeval const*) + 389     2   QtCore                          0x0000000104a7f0a3 QEventDispatcherUNIXPrivate::doSelect(QFlags<QEventLoop::ProcessEventsFlag>, timeval*) + 435     3   QtCore                          0x0000000104a7f572 QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 178     4   QtCore                          0x0000000104a49094 QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 68     5   QtCore                          0x0000000104a49444 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 324     6   QtCore                          0x0000000104931f08 QThread::exec() + 312     7   QtCore                          0x00000001049355ba QThreadPrivate::start(void*) + 298     8   libsystem_c.dylib               0x00007fff9492b8bf _pthread_start + 335     9   libsystem_c.dylib               0x00007fff9492eb75 thread_start + 13          Thread 6:     0   libsystem_kernel.dylib          0x00007fff9464adf2 __select + 10     1   QtCore                          0x0000000104a7adc5 qt_safe_select(int, fd_set*, fd_set*, fd_set*, timeval const*) + 389     2   QtCore                          0x0000000104a7f0a3 QEventDispatcherUNIXPrivate::doSelect(QFlags<QEventLoop::ProcessEventsFlag>, timeval*) + 435     3   QtCore                          0x0000000104a7f572 QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 178     4   QtCore                          0x0000000104a49094 QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 68     5   QtCore                          0x0000000104a49444 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 324     6   QtCore                          0x0000000104931f08 QThread::exec() + 312     7   QtCore                          0x00000001049355ba QThreadPrivate::start(void*) + 298     8   libsystem_c.dylib               0x00007fff9492b8bf _pthread_start + 335     9   libsystem_c.dylib               0x00007fff9492eb75 thread_start + 13          Thread 7:     0   libsystem_kernel.dylib          0x00007fff9464adf2 __select + 10     1   QtCore                          0x0000000104a7adc5 qt_safe_select(int, fd_set*, fd_set*, fd_set*, timeval const*) + 389     2   QtCore                          0x0000000104a7f0a3 QEventDispatcherUNIXPrivate::doSelect(QFlags<QEventLoop::ProcessEventsFlag>, timeval*) + 435     3   QtCore                          0x0000000104a7f572 QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 178     4   QtCore                          0x0000000104a49094 QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 68     5   QtCore                          0x0000000104a49444 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 324     6   QtCore                          0x0000000104931f08 QThread::exec() + 312     7   QtCore                          0x00000001049355ba QThreadPrivate::start(void*) + 298     8   libsystem_c.dylib               0x00007fff9492b8bf _pthread_start + 335     9   libsystem_c.dylib               0x00007fff9492eb75 thread_start + 13          Thread 8:     0   libsystem_kernel.dylib          0x00007fff9464b192 __workq_kernreturn + 10     1   libsystem_c.dylib               0x00007fff9492d594 _pthread_wqthread + 758     2   libsystem_c.dylib               0x00007fff9492eb85 start_wqthread + 13          Thread 9:     0   libsystem_kernel.dylib          0x00007fff9464b192 __workq_kernreturn + 10     1   libsystem_c.dylib               0x00007fff9492d594 _pthread_wqthread + 758     2   libsystem_c.dylib               0x00007fff9492eb85 start_wqthread + 13          Thread 0 crashed with X86 Thread State (64-bit):       rax: 0x0000000000000000  rbx: 0x0000000114356980  rcx: 0x0000000000003200  rdx: 0x00007fff5fbfe3a4       rdi: 0x0000000000000000  rsi: 0x0000320000003200  rbp: 0x00007fff5fbfe530  rsp: 0x00007fff5fbfe530        r8: 0x00007fff5fbfe3ac   r9: 0x00007fff5fbfe3a8  r10: 0x0000000000000481  r11: 0x0000000000000246       r12: 0xffffffffffffffff  r13: 0x0000000117272230  r14: 0x0000000119af6d40  r15: 0x0000000119a09828       rip: 0x0000000102b7985d  rfl: 0x0000000000010246  cr2: 0x0000000000000008


title: Batch visualization of raster (grid) files

text: I have about 100 raster (grid) files (in the "ascii grid" format) of drought index. All cover the same area of interest but at different times of year. I need to create images from the grids with exactly same color scheme: index>100 - dark red, index 50-99 - red, index 25-49 orange, index 10-25 yellow, index 0 - 10 white. I tried to do this in SAGA GIS, but SAGA GIS always automatically generates the color scheme by dividing the full range of values in equal intervals. Is there any free GIS that you would recommend for doing this type of task? (I have some small experience with bat file or python scripting..)


title: QGIS Web Client Setup mapserv error

text: I have my web map up and running and am now trying to clean up a few recurring errors in the qgis-web-client-error.log. The error in question is:               [error] [client 123.456.789.1] script not found or unable to start: /home/blank/qgis-web-client/cgi-bin/mapserv, referer: http://blank.com/qgiswebclient.html?map=/home/blank/qgis-web-client/projects/gf_utm.qgs&format=image/png&visibleLayers=paddocks,image,wheat_yield,allendale_cntr      When I look in GlobalOperations.js there is a line in Overview setting that I have not modified:               var overviewLayer = new OpenLayers.Layer.WMS("Pixelkarte",     "/cgi-bin/mapserv?map=/path-to-map/.map",     {layers:"pk_kombiniert",format:"image/jpeg"},     {buffer:0,singleTile:true,transitionEffect:"resize"});      But I am not sure what path to put in here. Is it to qgis_mapserv.fcgi? I do notice that my overview map does not work. Thanks.


title: ArcServer 10.1- Get Original Document location (mxd) from published web service using python

text: I need to extract the document location of a published web service. Is there any way this can be accomplished in python? I know where the maps are sitting on the server, and i know the name of the service and what mxd file they're based on, but i need to accomplish this programatically. Thanks for your help!!


title: Geocoding Australian postcodes - MapInfo

text: How do I plot suburbs/location onto a map? I have a list of suburb postcode and their names in Excel. What is the process to plot them onto a Map? I'm in Australia. I use MapInfo Professional 10.1. Thanks heaps!


title: Copy multiple features in feature class, update field value based on number copied

text: I have created a field which will indicate the records I want to alter. What I want to do is then cycle through these records, each will contain sum values in a field.Based on the sum I want to copy the feature a certain number of times. For example if the sum is 107 I want to copy it 11 times with resulting copied features having 10 records with a sum of 10 and 1 record with the remainder of 7 in the sum field. I'm not sure if that makes sense so I'll, I'll be starting with something like:               Feature SUM_FIELD     A       107     B       38      I would like to end with something like:               Feature SUMFIELD     A       10     A       10     A       10     A       10     A       10     A       10     A       10     A       10     A       10     A       7     B       10     B       10     B       10     B       8      Thanks for any insight you can provide.


title: Error while using osmosis

text: I was trying to filter openstreet map data using osmosis. I used the following               osmosis --read-xml city.osm --tf accept-ways highway=* --used-node --write-xml highways.osm      But while i run this command in osmosis with osm file "city.osm" it throws run time exception `SEVERE: Thread for task 1-read-xml failed org.openstreetmap.osmosis.core.OsmosisRuntimeException: Cannot represent 2169105896 as an integer. at org.openstreetmap.osmosis.core.util.LongAsInt.longToInt(LongAsInt.java:33)` What could be the problem? I updated osmosis to 0.43.1 version and it shows runtime exception                   SEVERE: Thread for task 1-read-xml failed         org.openstreetmap.osmosis.core.OsmosisRuntimeException: The entity timestamp attribute is missing.     at org.openstreetmap.osmosis.core.domain.common.UnparsedTimestampContainer<init>(UnparsedTimestampContainer.java:34)


title: Vector layers without geometry in QGIS?

text: Using QGIS, I have set up a couple of automated layer additions via the toolbar. After adding geometry in each respective layer (point, lineString, polygon) and saving changes to the layers, the added forms are non-present in the layers upon restart and reopening of files. Additionally, to actually get 'run3' to pass and the layer to be added, the button has to be pressed twice to proceed through my `if statements`. Which I don't clearly understand. Please take error and non-Pythonic ways in the following code as a product of my novice skillset.                   # run add base     def run3(self):         if FindDirectory._destination is 0:             projectDirectory = bool(QgsProject.instance().readPath(''))             if projectDirectory:                 projectDirectory = QgsProject.instance().readPath("./")                 FindDirectory._destination = str(projectDirectory)             else:                 iface.messageBar().pushMessage("Error", "Please select a central folder location to save your base layer to!", level=QgsMessageBar.CRITICAL, duration=3)         elif FindDirectory._destination is not 0:             if GetMaps._TOPOcrs is 0:                 canvas = bool(self.iface.mapCanvas())                 if canvas:                     canvas = self.iface.mapCanvas()                     mapRenderer = canvas.mapRenderer()                     srs = mapRenderer.destinationCrs()                     GetMaps._TOPOcrs = str(srs.authid())                 else:                     iface.messageBar().pushMessage("Error", "Please select a topographic map for your simulation!", level=QgsMessageBar.CRITICAL, duration=3)             elif GetMaps._TOPOcrs is not 0:                 crs = str(GetMaps._TOPOcrs)                 Base =  QgsVectorLayer('Polygon?crs=' + GetMaps._TOPOcrs + '&field=BOTTOM:string(6)&field=TOP:string(6)&field=K:string(8)&field=Porosity:string(6)&field=Recharge:string(8)&field=IHead:string(5)&field=IBound:string(3)&index=yes', "Base", "memory")                 QgsMapLayerRegistry.instance().addMapLayers([Base])                 pr = Base.dataProvider()                 BaseFeat = FindDirectory._destination+"\Base.shp"                 writer = QgsVectorFileWriter(BaseFeat, "CP1250", pr.fields(), QGis.WKBPolygon, pr.crs(), "ESRI Shapefile" )                 iface.setActiveLayer(Base)


title: How does ArcGIS compute the distance between two points with a non-equidistant projection?

text: This is a follow-up question to my previous one, _Can you suggest some well- written introductory texts about coordinate system projections?_ * * * Let's assume I'm working with the CH1903 map projection, which for all I know is conformal, but not equidistant. Meaning, angles (shape) have been preserved, but not areas, distances, or scale. (At least these have not been preserved _exactly_ ). So far so good. I'm wondering what kind of calculation ArcGIS performs when I now want to calculate the distance between two points. In ArcObjects, I could use the `IProximityOperator` interface as follows:               IPoint a = ...,            b = ...;          double distance = ((IProximityOperator)a).ReturnDistance(b);      **Question:** When I'm working with a reference system that does not accurately preserve distances, what would ArcGIS do when I query it for the distance between two points (as shown above)?   * Does it simply do some Pythagorean maths (a2 + b2 = c2) to get the distance, meaning the returned distance will only be as accurate as the projection allows?   * Or will it do something more complicated, like some form of re-projection, to get a more accurate distance? ( **The same question, but more generally:** Once that geometries have been projected, does ArcGIS perform all calculations simply in Euclidean space, or does the used map projection still influence calculations of distances, angles, areas, etc.?)


title: Good websites for map-lovers?

text: Do you know some good websites for map-lovers? I often visit strange-maps, cool-maps, makingmaps and hipkiss.org. Do you know others?


title: z-index issue with infowindow

text: I currently have a map where my map div covers 60% of the page and 40% is a fixed Infowindow. My problem happens with cartodb css and its z-index of `div.cartodb-infowindow`. Currently my information will not show in the fix div, however the html elements are there when I click on a point and if I manually go into the debugger and un-check the cartodb-infowindow, the information will show up. So in my styles sheet I added .cartodb-infowindow and tried setting the z-index to a higher number than my side panel but no luck. I have tried a lower number and even setting the z-index to none. However I cannot override the cartodb css on z-index. (I have also tried using !important as well) Any suggestions would be greatly appreciated.


title: ArcGIS Circle Buffer

text: I am stuck, trying to draw a simple circle buffer using ArcGIS. Here is how I set up my base map:               dojo.require("esri.map");     dojo.require("esri.tasks.servicearea");     dojo.require("dijit.dijit");     dojo.require("dijit.layout.BorderContainer");     dojo.require("dijit.layout.ContentPane");     dojo.require("esri/layers/FeatureLayer");     dojo.require("esri/symbols/SimpleMarkerSymbol");          var mapLayers = new Array();     var map;     var GL = null;          function setMap() {         function init() {             require(                 [                     "esri/map",                     "dojo/dom-construct",                     "dojo/domReady!",                     "esri/tasks/GeometryService"                 ],                 function                  (                     Map,                     domConstruct                 ) {                     map = Map("map-canvas",                     {                         //infoWindow: popup                     });                     map.setZoom(1);                     coreFunctions();                 });              }         dojo.ready(init);         dojo.connect(map, "onClick", doBuffer);     }          function coreFunctions() {         try {             addLayersToMap();         }         catch (err) {             console.log(err);         }     }     function addLayersToData() {         var layer = new esri.layers.ArcGISTiledMapServiceLayer("https://www.onemap.sg/ArcGIS/rest/services/BASEMAP/MapServer");         mapLayers.push(layer);         var layer2 = new esri.layers.ArcGISTiledMapServiceLayer("http://www.onemap.sg/ArcGIS/rest/services/LOT_VIEW/MapServer");         mapLayers.push(layer2);         layer2.hide();     }          function addLayersToMap() {         addLayersToData();         for (var a = 0; a < mapLayers.length; a++) {             map.addLayer(mapLayers[a]);         }         map.setZoom(1);     }      And the codes where I try to draw a circle buffer when certain point on map is clicked:               function doBuffer(evt) {     gsvc = new GeometryService("http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer");          esriConfig.defaults.io.proxyUrl = "/proxy";     esriConfig.defaults.io.alwaysUseProxy = false;     map.graphics.clear();     var params = new esri.tasks.BufferParameters();     params.geometries = [ evt.mapPoint ];          //buffer in linear units such as meters, km, miles etc.     params.distances = [ 5, 10 ];     params.unit = esri.tasks.GeometryService.UNIT_KILOMETER;     params.outSpatialReference = map.spatialReference;          gsvc.buffer(params, showBuffer);     }          function showBuffer(geometries) {         var symbol = new esri.symbol.SimpleFillSymbol(           esri.symbol.SimpleFillSymbol.STYLE_SOLID,           new esri.symbol.SimpleLineSymbol(             esri.symbol.SimpleLineSymbol.STYLE_SOLID,             new dojo.Color([0, 0, 255, 0.65]), 2           ),           new dojo.Color([0, 0, 255, 0.35])         );         dojo.forEach(geometries, function (geometry) {             var graphic = new esri.Graphic(geometry, symbol);             map.graphics.add(graphic);         });     }      But it keeps telling me this error message: `esri.config.defaults.io.proxyUrl is not set`. I solved this by adding these two lines of codes:               esriConfig.defaults.io.proxyUrl = "/proxy";     esriConfig.defaults.io.alwaysUseProxy = false;      However, another problem occured which is `Uncaught ReferenceError: GeometryService is not defined`. I have no idea why is it so. **EDIT** After including this: `dojo.require("esri.tasks.geometry");` And changed my setMap() to:               function setMap() {     function init() {         ...     }     dojo.ready(init);     gsvc = new GeometryService("http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer");     dojo.connect(map, "onClick", doBuffer);     }      The previous problem is solved but then another problem occured:               esri.config.defaults.io.proxyUrl is not set. init.js:1660      XMLHttpRequest cannot load tasks.arcgisonline.com/ArcGIS/rest/info?f=json. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'localhost:2363' is therefore not allowed access.


title: QGIS on Mac WKT import problem

text: QGIS 1.8.0 Mac OSX 10.6.8 These problems seem to be specific to Mac, as two Windows users don't have the problem. Import a file as a vector:   TEST.CSV               id;wkt       1;"POLYGON((10 10,20 20,20 30,20 10))"       ...        The features import with correct values, individual points can be edited, and the layer saved as a shape file. But, no feature can be selected that was imported this way, so they can't be moved. New features added manually to the same layer can be selected and moved normally. Probably related, only wkt-created features fully contained within the view are shown, wkt-features that have even a small bit outside the view vanish entirely. However, features added manually to the layer behave normally by showing the portion in the view. Layer editing capabilities are normal (full). Has anyone suggestions as to a workaround for this? I'm hoping to migrate a dozen maps with 10,000 or so features from an old package that only exports true CSV:   x1,y1   x2,y2   ...   I can script-edit this format to the above WKT, or similar text format. I don't have an app for .dbf so haven't been able to look there for any difference between WKT imports and QGIS-created features.


title: How to do regression analysis between two variables using ArcGIS

text: I have a temperature image (interpolated from climatic point data) and NDVI data at the monthly interval. I need to do correlation analysis between temp and NDVI. Is it impossible to do this using ArcGIS. If so, can you tell me how to do it. It'll help me a lot. Many thanks


title: Rendering layer in ArcMap using ArcObjects and Python?

text: I succesfully wrote a script to render a Uniquevaluerenderer in a layer in ArcMAP using symbols from 4 parameters (values) read from the attribute table of the layer. I used ArcObjects and VBA, but with VBA support being discontinued in ArcGIS 10 I now want to convert this script using Python. Can anyone suggest some pointers or sample code.


title: How to import HDF (L1G) files into ArcGIS for Desktop?

text: I have downloaded satellite imagery from GLCF website, it has downloaded with .L1G file extension, I am not able to open this file in ArcGIS as well in Erdas, so please let me know how to open this.


title: What are the standards to implement scale bar?

text: I am working on .osm data files, and now i want to implement scale bar for available data. logically i have created the scale pixel is to geo location. I want to know whether there is any standard to display this scale bar. Any help is appreciable. Thanks,


title: GIS storage format for better performance - Android device

text: We have developed an android application which loads different eco-zones and does geo-fencing based on current GPS location. We have converted a shapefile to KML, then to JSON format, for loading in the Android app. The zones had 1000+ vertexes, so performance was an issue. I then tried splitting the polygons, this deforms zone boundaries. Is there a better approach to this, while respecting zone boundaries, in which the performance could be improved? I.e. less vertices using some other algorithm? or a better GIS data format ?


title: How do I map data by zip code?

text: I have a set of data that corresponds to zip code, and I'd like to turn that into a map. From what I've gathered thus far, zip code shapefiles are difficult to find and work with due to the fact that they're not polygonal. However, I found an old version of the US Census's 5-Digit zip code tabulation areas on the Census website that I think will do the trick. I'm currently using Magic Maps in an attempt to do keep this mapping process as non-technical as possible, and I was able to import map the outlines of the zip codes quite easily. However, when it comes to incorporating my data into this map, I'm a little lost. I was able to plot the points in the appropriate location on the map (very simple copy/paste process thanks to Magic Maps). However, the data shows up as a point on the map, and I'd like it to fill the entire zip code instead. See here for an example. I'm new to GIS and shapefiles and dbfs and whatnot, so correct me if I'm wrong, but I'm guessing this is due to the fact that the zip code "tag" in my csv data isn't connected in any way to the dbf file, so it's not actually connected to the contour that shows up on the map. As a result, the software just places a point on the map that's more or less in the center of the zip code, which is in no way connected to the shapefile that I downloaded from the Census website. Is this correct? And if so, is there a way that I can add my data to the dbf file? Or, is there a better way of going about all of this?


title: Importing .shp to postgreSQL

text: I want to import a shp file to postgreSQL. First I create sql file and then run PostgreSQL. To create sql file, I run this command in windows cmd:               shp2pgsql -s 4326 worldCountries.shp worldcountries postgres > worldcountries.sql      and then run:               psql -d postgres -U postgres -p 4321 -f worldcountries.sql      but result is: > psql: worldcountries.sql: 21: ERROR: function addGeometrycolumn(unknown, > unknown, unknown, unknown,unknown, integer) does not exist


When I'm serving up maps and UtfGrids with tileStache I would like to also include some metadata with the layers so that my leaflet application can understand the context of the layer. For example: category, data, title, etc. What is the best way to handle metadata with TileStache?


title: SPOT 2-5 convert DN to TOA using QGIS

text: I'm new to QGIS and I would like to convert SPOT(2-5) images from DN to TOA. How do I go about doing this? I've an idea of how to do it for Landsat images however I'm not sure about SPOT.


title: Getting 2147483647 and -2147483647 as min and max output for point to raster, polygon to raster, and feature to raster tools

text: No matter which feature to raster tool I use (feature to raster, point to raster, or polygon to raster), I am getting a raster output whose min and max values are 2147483647 and -2147483647, respectively. Researching the issue came up with nothing much except a Wikipedia article mentioning that this is "the maximum value for a 32-bit signed integer in computing." I was relieved to discover that the number does, in fact, have some rational meaning, albeit one that doesn't make much sense to me... I am attempting to convert evenly spaced (500 ft) points (and/or 500 ft vector grid) of elevation values to a raster. I'm not interested in interpolation. I simply want the raster grid to reflect the vector grid. There are 6718 records, whose values, in increments of 100, range from 800 to 1600. The field type is a short integer with a precision of 4. I want to give an output cell size of 500 feet. ![enter image description here](http://i.stack.imgur.com/1jf68.jpg)


title: Generating points from chainage and offset

text: I have a polyline layer and an external csv containing road sign data. The csv has unique ID of the polyline, chainage along each unique segment and an offset. I have access to ArcGIS, MapInfo and QGIS, is there any way I can generate point data from this data?


title: Contextual menu items works only once (axTocControl)

text: I am developping a VB.net application with MapControl and TOCcontrol ArcObjects controls. I have added a contextual menu with two commands that work fine. The problem is that when I select the same option more than once, the first time works fine but the second time it doesn't work. If I change to the second command and return back to the first, it works fine again. Any ideas?


title: Entity handle from Visio

text: I have successfully imported the polygons from a Visio diagram via dxf into QGIS by using the "space" shape in Visio (a normal rectangular shape comes through as polylines, not as a polygon). Very happy with that. However, QGIS does not bring through the entity handles or ID reference numbers that I have assigned to the shapes in Visio but has instead created what looks like it's own fairly random reference numbers. It does however bring through the layer name, a text field (e.g. SOLID/ANSI32) so it is bringing some data through but perhaps only on a layer level? What I have had to do is to show the labels of the polygons in QGIS and then manually link them to the correct Visio shapes and create a csv reference file with the associated data values. This is working fine but I was wondering if it is possible to bring through the entity handles of the shapes into QGIS or am I stuck with the manual linking process? It's going to be painful on say 100 shapes so any help would be appreciated. Any ideas, inside or outside the box? PS I am a newbe so please go gently...


title: How to create a transparent box in the map layout?

text: Is there a way to create a transparent box in the ArcGIS layout view similar to the one in the screenshot? I have tried without success adding a transparent box by inserting a neatline, adding a new dataframe and adding a polygon with the draw tools. The only way I can envision doing this is by adding a shapefile to the layout and specifying transparency, although this approach seems awfully convoluted. ![enter image description here](http://i.stack.imgur.com/MlJ0w.jpg)


title: Optimize PDF using Python

text: Is there a way to optimize a PDF using Python? I am exporting hundreds of .mxds - that works fine with a loop. But the file size of each is large. Right now my option is to manually open each and save as optimized. I would like to run this process monthly, so I need a better solution than that. or... I see that there are several free programs that say they will do this in a batch file. Is there one that anyone would recommend? Thank you


title: Add Layer by attribut selection in QGIS SQLITE and make it viewable

text: I create a SQLite Database from an .osm.pbf and tried to create new layers from attribute selection using the QGIS DB-manager SQL-Window:               `CREATE TABLE Siedlungen AS SELECT * FROM points WHERE (place = "town") OR (place = "village") OR (place = "hamlet");`      Afterwards I add a row to the geometry_columns table:               `INSERT INTO geometry_columns (f_table_name, f_geometry_column, geometry_type, coord_dimension, srid, spatial_index_enabled) VALUES ('siedlungen','geometry',1,2,4326,1); `      If I add this Layer using “add SpatiaLite Layer” QGIS dosn't report any errors and I can take a look to the attribute table, where everything looks nice, but I can’t see the features. What am I doing wrong?


title: Develop custom toolbox for ArcGIS in Java- How to get developer kit Eclipse plugin

text: I'm omw to create a custom geoprocessing toolbox for ArcGIS (ArcMap). I've read ressources and documentation for days now, but I still wasn't able to get the needed Eclipse Plugin referenced here: http://resources.esri.com/help/9.3/arcgisengine/java/doc/b0836d0d-a1af-49cd- ab18-3cc7476f5701.htm The folder %ARCGISHOME%/java/tools is missing, as well as the other one, mentioned here: Having trouble setting up Eclipse for ArcGIS 10.0 Java development I'm on the ArcGIS 10.2 for Desktop (License: Adbanced (ArcInfo) Single Use) I got from my university. Any help or hint is highly appreciated!


title: What to do if PostGIS gives error that "geometry requires more points"?

text: I have a .TAB file. I convert it to ESRI(shp)-->sql and insert it into database. Using PostGIS when I want to convert the data into ESRI file, it shows an error: > geometry requires more points and it didn't generate .prj file... So how should I handle this problem i.e. what should I do to make the geometry valid?


title: How to compare spatial patterns (crime cases vs population)?

text: I am looking for a way to statistically compare two spatial patterns in shape polygon data (not point pattern analysis). Let's say I have a city map divided in neighborhoods (barrios), in shape polygon form. For each barrio I have the information of crime occurances (cases) in a given year and also of number of people living in the area. What I would like to do is to compare the spatial pattern of the crime cases and spatial pattern of population, so to have a formal check of if the clustering of crimes isn't only following the clustering of population. Is there any such way to test that? Both a measure of how much those patterns are correlated or a inference test of the correlation (to test the null hypothesis) would be very welcome. Graphical assessment does not help me here, as I will be doing such testing for many different data and need to tabulate. Anyone know how to do this? I usually use R, ArcGIS or GeoDa, but I am open to other possibilities.


title: Is There a Way to Emulate the Identity Tool in ArcGIS?

text: I work at several different companies each with different license levels of ArcGIS. I got used to using the Identity tool at a company which had access to the ArcGIS Desktop Advanced license. However, after switching to another company with only the Standard license, where the Identity tool is not available, I'd like to build a model or script which has the same functionality. Is there a workflow which will give me the same results as the Identity tool in the Standard license? I'd like to stay away from third party tools. I wish to incorporate this into a python script, or ModelBuilder model.


title: Iteration based positioning on Matlab - retrieving coordinates between iterations

text: This is my first question on SE so let me know if I'm not asking my question in the right place. So basically, I have an algorithm which uses UMTS measurement events for positioning estimation, which I'm in the process of programming in Matlab. Specifically, I take as an input, among other things, the LL coordinates of the first estimation. The first step is computing τk(i) = || yNB(i) -yk || / c (where yk is the position). I use the haversine formula to find the distance between yNB and yk. Eventually, I get to the last step which is a minimizing a cost function:               ρk =|| {rk (1,2) − dk (1,2)             rk (1,3) − dk (1,3)             . . .             rk (i,j) − dk (i,j)} ||      where dk (i,j) = || yNB(i) - yk || - || yNB(j) - yk || Then, the new estimation of yk is used on the next iteration to compute a better value for τk and so on. So my question is, how do I "retrieve" yk to use on the next iteration? Because by calculating the distance at the first step I "lose" the position ( i use a function like: Distance=Haversine(lat1,long1,lat2,long2)). Plus, what's the best way to program the cost function minimization in Matlab? Does anyone have an idea of how I can make this work? Thank you! **EDIT:** I was told that my "minimizing a cost function" problem might be actually an RLS problem: if find a way to convert to an (X,Y) system instead of (LAT,LONG), I'll have a system of equations as follows:               ρk =|| {rk (1,2) − dk (1,2)                 rk (1,3) − dk (1,3)                 . . .                 rk (i,j) − dk (i,j)} ||      where:               rk(i,j) = c (TOTD, k (i) - TOTD, k (j) - TRTD(i,j))     dk (i,j) = || yNB(i) - yk || - || yNB(j) - yk ||      With the objective of minimizing k. Right? I have values for c (velocity), TOTD and TRTD (time differences), and yNB=[XYNB YYNB] (position), so all I'm missing is the position vector yk=[X Y]... Since || P1 - P2 || is sqrt((x1-xo)^2 + (y1-y0)^2), by either: A: linearizing the equations as a Taylor series and then applying linear RLS B: applying nonlinear RLS I should be able to retrieve the values yNB=[XYNB YYNB], right? How can I program it (either via A or B)? PS: I'm working with distances never bigger than 10km, and I'm not taking altitude into account (2D level)


title: Is there an effective limit to the geoprocessing task Geocode Addresses?

text: The issue I face has the following background: We are geocoding an immense directory of records. It is something in excess of 100 million addresses. I have split the addresses up into as small a geographic reason as I feel is feasible, states. Even so, a single state can have in excess of 5 million records to geocode. The arcpy script I composed will loop through each state's addresses and run the proper geocoding process with the appropriate locator. The problem: Sometimes it takes 36 hours, sometimes it takes only 20, but the script will stop with an error I have never seen before (this is from the XML log file):   `ERROR 001143: Background server threw an excecption.`   * If the script is run in ArcCatalog or Arcmap's Python window, it will show a red error message `Runtime error <class 'arcgisscripting.ExecuteError'>: ERROR 001143: Background server threw an excecption.`   * If the script is run in IDLE, it will simply cease processing without an error and restart the shell (with the typical `=====RESTART=====` heading). I know this arcpy script works with smaller datasets, as I have been using it for months now. What might be the cause of this error? Do I need to split up my address listings into smaller amounts for them to geocode reliably? EDIT: I tracked down the Event Viewer Logs per @D.E. Wright and this is what I found listed under the most recent failure               Faulting application name: pythonw.exe, version: 0.0.0.0, time stamp: 0x4ba3e4e2     Faulting module name: Geocoding.dll, version: 10.0.1.2800, time stamp: 0x4cbcbb71     Exception code: 0xc0000005     Fault offset: 0x000be1f3     Faulting process id: 0x%9     Faulting application start time: 0x%10     Faulting application path: %11     Faulting module path: %12     Report Id: %13      Not exactly illuminating...


title: Point to Raster Issues

text: I am having some trouble with something fairly simple.. I am creating a 3D subsoil model for display in arcscene - i can get it displayed nicely as points but in order for the model to be easier to read i need it to be displayed as a raster. Every point in my shapefile has an assigned lithology in the form of a number, a z-value, and x and y values. My plan was to build a raster from this shapefile to display in arcmap, using the lithology field as the main display. I however cant seem to work out how to convert it to a raster without losing all of the data! I have tried every combination of raster options i can think of! And i only ever come up with a raster with a value of either 0 or 3, or just some random numbers!! There must be a way because i've seen it before - and i assume it is fairly simple! I just want to keep the z-values and the lithology values! In the end i hope to have a 3D subsoil model displayed in arcscene - with different colours of the lithology at the different depths!!


title: OpenGeo Jetty server caching HTML files

text: I have installed GeoServer as part of the OpenGeo package. I am trying to create my own application but I am having problems. At first I couldn't save over my html files. Using Notepad2 I can now overwrite my files but the changes do not appear when looking with a browser. I am guessing this is because the files are being cached somewhere on the server (not in the browser - I've checked that). This could make sense for a live project but is very frustrating for development. Is there some way to bypass the cache? Also - and this might sound a little dumb - GeoServer is the component that's serving up the HTML files, right? It's the only server in the bundle but the only information I can find about it is about serving up geographical data (which is obviously its main feature).


title: How to identify polylines with multiple end/starting points?

text: I'm looking for a way to programmatically identify polyline features which do not represent a 'simple' line from A to B but instead have several starting and/or end points. These are called complex network edges when working with geometric networks. Why am I asking this? Because I have a geometric network with a feature class that is defined as only having simple network edges. But it somehow occurred that there are some 'bad' (i.e. complex) edges in there as well and I need to sort them out. Checking if the interface IComplexEdgeFeature is implemented doesn't work on the feature objects because by definition all features within that class are simple edges.


title: GIS newbie, How to georeference a jpeg metro map using OSS?

text: I have a metro map in jpeg format and I want to georeference it. My goal is to find GPS location of the metro stops and visualize them on google maps. Probably, the first step is to overlay the map over google maps area of interest to find the correct bounding box values. I was wondering, does anybody know a tool (web-based or standalone) for this. Thanks, -A


title: Offline usage of OpenStreetMap or alternatives

text: I'm planning to implement an offline map solution for windows phone using open street maps. To achieve this, would I need to download complete OSM database first and than use it? Or is possible to fetch it on-demand and store it locally? If OSM is not the best solution what else could be used to have an offline maps application? Offline data would be required only for about 3-5 cities, not more than that.


title: Can you successfully migrate arcgis 10.0 mxd to 10.1 or are there steps to follow?

text: I have upgraded from 10.0 to arcgis 10.1. I am trying to open an 10.0 mxd file in 10.1 and it appears to have lost any additions I had made to the table plus its' x and y coordinates. Can you successfully migrate arcgis 10.0 mxd to 10.1 or is there a number of steps to follow? Thanks,


title: MySQL Select rows where line strings are within a bounding box

text: I have a MySQL DB with some spatial data stored in a table after being input via ogr2ogr from a shapefile. The structure is similar to the following:   * OGR_FID int   * SHAPE geometry (all line strings)   * More fields containing descriptive data I would like to be able to use this data as a layer within leafletjs. I am currently doing this by selecting all rows and rendering them as a layer within leaflet. The data set will grow very soon though and will go way beyond being able to use this approach. I would like to be able to query the DB for all rows for which the linestring stored in the SHAPE field lies within a set bounding box. IE thetop left and bottom right corners of the layer currently displayed in leaflet. I've been looking round for a while but can't figure out the type of query I'd need to use to accomplish this. Any help greatly appreciated.


title: Pyproj: converting WGS84 to Robinson

text: I have a WGS84 coordinate pair `(37.7749295, -122.4194155)`. I have an image that is a Robinson Map Projection of the world. I'm trying to write a python script to locate my WGS84 coordinate on my Robinson Map. As an essential step in this, I'm trying to use `pyproj`, the python-adaption of `Proj4`, to convert my WGS84 coordinate to a Robinson coordinate. Unfortunately I am new to Proj4, and somewhat confused by the documentation. I hope that someone can help me out.


title: Need Advice - Displaying very large amounts of data on Leaflet js from database

text: I'm researching the best way to display a very large weather dataset (850mb +/-) for folks to use on their mobile and desktop devices. This huge dataset (1 point every 12km across the USA) that I'd like to show on a leftlet map will be using OpenStreet map layers. This database will be updated daily if not hourly with fresh data. I'm looking for thoughts on what type of database to use, how to best display (speed) this data and any other advice you professionals have to share. There will be around 12 layers users could switch on an off. I have been looking into GeoServer for example, and think that might be a good route. I am not interested in using Google fusion tables and would like to run this on my own server as the data is already produced locally. Also, the data is currently available is in the NetCDF format. Looks like GeoServer can use this.


title: Naming directories in python?

text: Why is it that when I label my directories this way:               arcpy.env.overwriteOutput = True     arcpy.env.workspace = "C:\\Users\\Documents\\ArcGIS\\Testing"     arcpy.env.scratchWorkspace = "C:\\Users\Documents\\ArcGIS\\Testing"     scratch = "C:\\Users\Documents\\ArcGIS\\Testing"     space = "C:\\Users\\Documents\\ArcGIS" #General Directory     workspace = "C:\\Users\\Documents\\ArcGIS\\Textfiles" #Where the final product is saved     folder = "C:\\Users\\Documents\\ArcGIS\\AQS\\site_coordinates\\" #Location of the the site data     textfile_place = "C:\\Users\\Documents\\ArcGIS\\Textfiles\\pollution.txt" #Final Textfile     data = "C:\\Users\\Documents\\ArcGIS\\Textfiles\\data.txt" #Location of data      it reads all of my data, but when I try to clean it up and make it more transferable across computers like this:               arcpy.env.overwriteOutput = True     arcpy.env.workspace = "C:\\Users\\Documents\\ArcGIS\\Testing"     arcpy.env.scratchWorkspace = "C:\\Users\\Documents\\ArcGIS\\Testing"     space = "C:\\Users\\Documents\\ArcGIS"     scratch = space + "\\Testing"     workspace = space + "\\Textfiles"     textfile_place = workspace + "\\pollution.txt"     data = workspace + "data.txt"     folder = space + "\\AQS\\site_coordinates\\"      it doesn't work and says the files don't exist? I've been trying to look on the web but can't find a solution to the problem. Thanks!


title: Adding Field To feature class using ArcObjects and C#?

text: I want to add a new field to my featureclass.My code for that is:                       public IMxDocument mxDoc;             public IMap map;             IFieldEdit2 field = new FieldClass() as IFieldEdit2;             field.Name_2 = "Parcel_Way";             field.Type_2 = esriFieldType.esriFieldTypeString;             field.Length_2 = 50;             field.DefaultValue_2 = "Parcel";             IFeatureLayer2 flayer=map.Layer[cmboxLayer2.SelectedIndex] as IFeatureLayer2;             IFeatureClass featureclass = flayer.FeatureClass;                  try             {                 featureclass.AddField(field);             }             catch (Exception ex)             {                 System.Windows.Forms.MessageBox.Show(ex.Message, ex.Source);                 throw;             }      Program return this error : ![enter image description here](http://i.stack.imgur.com/kF4FI.png) What do i neglecting ? Regards,


title: Displaying dynamic text from layer other than index on Data Driven Pages?

text: For a map project I am working on with Data Driven Pages, I'd like to create a dynamic text using information from a different layer than my index layer. Is this possible?   Any add ins or extensions available to make this happen?


title: Global composite of radar data available?

text: Iowa State offers an exceptional NEXRAD composite image as GeoTIFF for the entire continental US at a reasonable resolution. Is there a comparable GeoTIFF composite updated semi-regularly available for the entire world, or at least other major continental areas?


title: Tablet or smart phone GPS vs "real" GPS

text: I've been reading a lot today about android and iphone devices being used for spatial data collection in the field and it sure seems to be that single purpose devices such as the extremely popular Garmin eTrex are a dead end. Why buy something with a tiny screen, no ability to add custom data collection interfaces, cost-plus base maps, and no picture taking when you can get all that and more for free or very cheap with a tablet/phone? As near as I can tell so far the only real advantages a real GPS has over these other devices are ruggedness and extended battery life. Unless maybe accuracy? How does the accuracy of a GPS-enabled smart phone or tablet compare with a consumer grade "real" GPS? What about when off-grid? What about cold- start time-to-lock?


title: How to refresh a Combobox Add-in in ArcGIS 10.1

text: I need to refresh the value in the combobox after an event from other tool in the same add-in (ARCGIS 10.1. Python). I've changed the value of the combobox with the code: combobox.value = val and I want to show it in the combobox but I can't refresh this combobox after give a value in other tool. Can anyone help me?


title: Multiple Maps with Styles not working in OpenLayers

text: I have created 2 maps(within 2 in a same page) along with their respective style maps. Both maps are having vector layers along with "LineString" geometry... added into them. Both style maps are having common "label" symbolizer. The issue is this that "label" symbolizer of map2 is getting added into the vector layer of map1 rather than vector layer of map2. _**Code:_** _**mainHtml.html_** _**Following are my 2 divs:_** _**Following is the function which is rendering 2 different maps in above div :_**               function createMapForDiv1()     {     boundsForPatternMapImage = new OpenLayers.Bounds();     boundsForPatternMapImage.extend(new OpenLayers.LonLat(-180,-90));     boundsForPatternMapImage.extend(new OpenLayers.LonLat(180,90));          styleForFeature1 = new OpenLayers.StyleMap({ 'default': new OpenLayers.Style(null, {     rules: [new OpenLayers.Rule({symbolizer:      {     fillColor:"red",      fillOpacity: 1,     label:  '$'+'{myLabel1}',     pointRadius: 2.5,      pointerEvents: "visiblePainted",     graphicName:"x",     backgroundGraphic: "public/images/dot_cross_select.png",     backgroundHeight:10,     backgroundWidth:10,        backgroundYOffset:-6,      backgroundXOffset:-5,      labelAlign : "rm",     labelXOffset : "24",     labelYOffset : "0"                                 }     })     }               optionsForMap1 = {              maxExtent: new OpenLayers.Bounds(-180, -90, 180, 90),     numZoomLevels: ${zoomScale},         controls: [     new OpenLayers.Control.Attribution()     ]};          map1 = new OpenLayers.Map('divForMap1', optionsForPatternMap);          vectorLayer1ForMap1= new OpenLayers.Layer.Vector("Vector Layer",{styleMap:          styleForFeature1});          map1.addLayer(vectorLayer1ForMap1);                    ***//Following bounds,styles and layers are for "map2"***            boundsForMap2 = new OpenLayers.Bounds();       boundsForMap2 .extend(new OpenLayers.LonLat(-180,-90));       boundsForMap2 .extend(new OpenLayers.LonLat(180,90));                 styleMapForMap2 = new OpenLayers.StyleMap({ 'default': new OpenLayers.Style(null, {                 rules: [                                                                  new OpenLayers.Rule({                                 symbolizer: {                                      label: '$'+'{myLabel2}',                                      strokeColor: "rgb(120,120,120)",                                       strokeWidth: 1.5,                                                         fontFamily: "Calibri",                                       fontSize: "10px",                                       fontColor: "black",                                      fontWeight: "bold",                                      labelAlign : "rm",                                      labelXOffset : "-10",                                      labelYOffset : "-10",                        }                                                          })]                          })                              });           vectorLayerForMap2= new OpenLayers.Layer.Vector("Vector Layer",{styleMap:   styleMapForMap2 });           optionsMap2 = {                              minResolution: "auto",                                minExtent: new OpenLayers.Bounds(-1, -1, 1, 1),                                maxResolution: "auto",                                  maxExtent: new OpenLayers.Bounds(-180, -90, 180, 90),                                 tileSize: new OpenLayers.Size(200,200),                                                                   controls: []                          };                          map2 = new OpenLayers.Map('divForMap2', optionsMap2);      Now problem here is this that "myLabel2" defined in "styleMapForMap2" is getting added into "vectorLayer1ForMap1" (I saw this while debugging in IE 8) and because of that "myLabel2" is not appearing there where it is suppose to be. Could anyone please help in this? Thanks


title: The correct definition of ESRI geodatabase

text: Iet's see if i can explain my question correctly. As the title says I'm looking for an definition of the databasetype that you create in ArcCatalog, file geodatabase and personal geodatabase. The reason for this is that I'm looking for a list which types of databases that you can work directly with in ArcGIS Desktop Basic without extensions.


title: Get all polylines from a shape file (containing polylines)

text: I have a `*.shp` file which contains only polyline features. How can I iterate over all the point features. Given ESRI Polyline example only uses already defined points to make polylines. But I want to iterate over all the polylines found on a shape file. How can I do this using arcpy?


title: Given 2 LINESTRINGs with common point, how to extract common point?

text: I have 2 LINESTRING geometries. I know both share a common point. Using PostGIS for Postgres, what is the cleanest way to extract the common point? Example with illustration: ![http://postgis.refractions.net/docs/images/st_touches05.png](http://i.stack.imgur.com/36T9T.png) How do I extract the intersection of the green and blue line, assuming the points at the crossing are equal?


title: How would I modify GPS tracker to accept two nmea inputs and gpsmarker to include a heading vector?

text: I use QGIS on a research vessel and wonder whether I could modify the QGIS 1.8.0 gpsinformation widget. I want to achieve two things. 1. Change the GPS marker to a boat shape which points in the direction of heading recieved as NMEA HDT sentence. 2. Add another marker from a second position feed which represents a towed underwater vehicle position. The underwater position is reported via a USBL modem which gives slant range and bearing to the target. Thanks if you can help, Pete


title: How to calculate difference between bounds in Google Maps?

text: Is it possible, after "bounds_changed" event, to get polygon coordinates covering the difference between new bounds and previous bounds? Any idea how to do it? Any help would be greatly appreciated.


title: gdalwarp in a bash shell for loop

text: I would like mask several images in bash shell, `gdalwarp` works for me as a simple single line command:               gdalwarp -cutline mask.shp -cwhere 'kepnev="a.tif"' -crop_to_cutline a.tif a_masked.tif       ..but it dosen't work with for loop:               for kep in *.tif;do         gdalwarp -cutline mask.shp -cwhere 'kepnev="$kep"' -crop_to_cutline $kep ${kep/.tif}_masked.tif;done      Please help. What am I doing wrong?


title: Can i assign a list or array to IRowBuffer Row without Row.set_Value()?

text: Is it possible to assign a list or array to IRowBuffer Row? I have something like the following: I have a fields (list) with values and i have to fill a Row with that values.               public void fillRow(IRowBuffer Row)      {       for (int i=0;i < fields.length;i++)         {           Row.set_Value(i, fields[i].toString()         }      }      Is there no way where i can just assign the fields to Row, without looping. What if my fields has like 500 elements and i have to loop 100x500? I know that Row has 2 requiredFields (ID, SHAPE) Edit: **Nobody working with ArcObjects?**


title: USGS Earthquake GPS Metadata: Buffer Zones & Python

text: I'm making a python web crawler that gets USGS earthquake GPS data, and I'm wondering how I should process the latitude longitude pairs to see if it falls within a specified radius of a specified GPS location. What is the mathematical model---pseudocode really---that needs to be used for this problem? ![enter image description here](http://i.stack.imgur.com/vAqXX.png)


title: Using USGS_Raster_Conversion_Scripts.zip to convert ArcGrid files to GeoTiff

text: I know the GeoTiff export option is no longer available in the http://viewer.nationalmap.gov/viewer/# so will have to convert it from ArcGrid source files instead. I am following the readme and how to folder files inside of the usgs_raster_conversion_scripts.zip However, I am having trouble getting the python script or GDAL to work in the conversion process. I have already installed GDAL in my program files, using gdal-110-1600-x64-core, and have put the ArcGIS files inside the USGS_Raster_Conversion_Scripts.zip into an empty folder I created under the c drive entitled python 27, and then inside of that "ArcGIS10.1". I then dragged the folder in which i have the arcgrid file into the ArcGIS_Convert_All_ADF_2_GeoTIFF windows batch file, but I get an error command not recognizing it and therefore cannot convert it into geotiff. I also get an error if i simply click the arcgis_convert_all_adf_GeoTiff.bat file on its own as seen attached in this email. Sorry for my lack of understanding, I am not a programmer but an artist, I'm sure I have made a problem installing the python part and integrating it correctly into the newly installed GDAL in my computer. The instructions were clear with everything except on how to acquire python program to install it right into the C drive, and because of my guesswork decided to create a new folder to name it by instead. I was trying to follow this pre requisite given in the installation instructions, Pre-Requisites:               ESRI ArcGIS 10 or ArcGIS 10.1 - The python code needs to be able to import arcpy in order to function appropriately. The call to python is in C:\Python26\ArcGIS10.0 or C:\Python27\ArcGIS10.1 or in the PATH environment variable.          OR          The gdal_translate.exe is in the PATH environment variable, or is in C:\Program Files\GDAL\. Steps to install GDAL are demonstrated here.      Perhaps you could explain to me what I did wrong somewhere down the line or show an easier way to convert arcgrid or IMG files into GeoTiff. I need the Geotiff to work for Terragen. Regards.


title: TOC hidden in single screen mode

text: I routinely use a two-monitor setup with my portable Precision workstation. When I'm in laptop only mode, my Table of Contents may appear briefly as a shadow on the extreme margin of the screen, then it disappears and I am unable to view it or the catalog windows. I'm using ArcMap 10.0 and Windows 7.0


title: Download data via a ftp server using polygon features

text: The attached script loops through the features of a polygon featureclass and uses that attribute information to download particular files via a ftp server. The script works great for downloading files as long as all of the files on the ftp server are contained within one folder (example). Now, I need to download imagery via a ftp server with a different file structure (example) where files are contained within multiple folders. How can I tweak the code so that the following actions occur?:   1. Use polygon features to identify the necessary file to download (completed)   2. Access the correct folder and download the imagery I suspect that I need to utilize the os.path module, however, I cannot seem to put the pieces together. * * *               # Download data via a ftp server          import arcpy, ftplib, os, socket          HOST = 'ftp.agrc.utah.gov'     DIRN = '/Imagery/NAIP2011_4-band/'     #FILE = ''     # Defined later in for loop     workspace = r'F:\my\workspace'  # This is where the downloads go     quads = r'F:\path\to\polygon\shapefile' # Used to define which files to download          # Get current working directory     print 'The current working directory is %s' % os.getcwd()          # Change the current working directory to a download folder     os.chdir(workspace)     print 'The workspace has been changed to %s' % workspace           try:         f = ftplib.FTP(HOST)     except (socket.error, socket.gaierror), e:         print 'ERROR: cannot reach "%s"' % HOST     print '*** Connected to host "%s"' % HOST          try:              f.login()     except ftplib.error_perm:         print 'Error: cannot login anonymously'         f.quit()     print '*** Logged in as "anonymous"'          try:         f.cwd(DIRN)     except ftplib.error_perm:         print 'ERROR: cannot CD to "%s"' % DIRN         f.quit()     print '*** Changed to "%s" folder' % DIRN          # Use search cursor to loop through download polygons,     # get the name of the required file and use that name to download file on ftp site     with arcpy.da.SearchCursor(quads, ("TILE_NAME", "QUADID")) as cursor:         for row in cursor:             print row[0]             FILE = row[0] + ".tif"             name = row[1]                  try:                 f.retrbinary('RETR %s' % FILE, open(FILE, 'wb').write)                 arcpy.Rename_management(os.path.join(workspace, FILE), os.path.join(workspace, name + ".tif"))             except ftplib.error_perm:                 print 'ERROR: cannot read file "%s"' % FILE                 os.unlink(FILE)             else:                 print '*** Downloaded "%s" to CWD' % FILE     f.quit()


title: How to create switch the layers option using geoserver?

text:
I did create some maps with three layers using layer groups with the help of some tutorials but i dint get the switching options like others. How to get that + mark locates in the right top corner of the map and those switching options?? any corrections in the coding or do i have to do anything in the geoserver to get that option??               <?xml version="1.0" encoding="UTF-8"?>     <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">                           <title>OpenLayers map preview</title>                          <link rel="stylesheet" type="text/css" href="http://localhost:8080/geoserver/openlayers/theme/default/style.css"/>

                         WMS version:                         <select id="wmsVersionSelector" onchange="setWMSVersion(value)">                             <option value="1.1.1">1.1.1</option>                             <option value="1.3.0">1.3.0</option>                         </select>

                         Tiling:                         <select id="tilingModeSelector" onchange="setTileMode(value)">                             <option value="untiled">Single tile</option>                             <option value="tiled">Tiled</option>                         </select>

                         Transition effect:                         <select id="transitionEffectSelector" onchange="setTransitionMode(value)">                             <option value="">None</option>                             <option value="resize">Resize</option>                         </select>

                         Antialias:                         <select id="antialiasSelector" onchange="setAntialiasMode(value)">                             <option value="full">Full</option>                             <option value="text">Text only</option>                             <option value="none">Disabled</option>                         </select>

                         Format:                         <select id="imageFormatSelector" onchange="setImageFormat(value)">                             <option value="image/png">PNG 24bit</option>                             <option value="image/png8">PNG 8bit</option>                             <option value="image/gif">GIF</option>                             <option id="jpeg" value="image/jpeg">JPEG</option>                         </select>

                         Styles:                         <select id="imageFormatSelector" onchange="setStyle(value)">                             <option value="">Default</option>                         </select>

                         Width/Height:                         <select id="widthSelector" onchange="setWidth(value)">                             <option value="auto">Auto</option>                             <option value="600">600</option>                             <option value="750">750</option>                             <option value="950">950</option>                             <option value="1000">1000</option>                             <option value="1200">1200</option>                             <option value="1400">1400</option>                             <option value="1600">1600</option>                             <option value="1900">1900</option>                         </select>                         <select id="heigthSelector" onchange="setHeight(value)">                             <option value="auto">Auto</option>                             <option value="300">300</option>                             <option value="400">400</option>                             <option value="500">500</option>                             <option value="600">600</option>                             <option value="700">700</option>                             <option value="800">800</option>                             <option value="900">900</option>                             <option value="1000">1000</option>                         </select>

                         Filter:                         <select id="filterType">                             <option value="cql">CQL</option>                             <option value="ogc">OGC</option>                             <option value="fid">FeatureID</option>                         </select>                         <input type="text" size="80" id="filter"/>

location

                 Click on the map to get feature info


title: How to Determine to world map size in pixel given this data?

text: How to Determine the world map size in pixels given this data? Map size of a particular area say, for example: Makati city, Philippines with bounds: Top-Right: **121.0281, 14.56497** Bottom-Left: **121.0144, 14.54637** Image size: width="4095px" height="4095px" Scale: at zoom level 17 | 1:4,000 Now my question is... how can I know the size of the world map in pixels using these available data? I'm still new to geographic information systems.... so please if possible make it understandable for a novice like me... :)


title: How do simple statistics based on polygons?

text: Hi I have a shapefile from a city. I divided this shapefile into polygons (squares, majority). I would like to perform simple statistics in each square in a easy way, because it is almost impossible to do it by hand. Can someone help me? I have basic knowledge of scripting. I have ArcGIS 10. * * * 1st edit: I have a shapefile of points. Each point is a well, each well have some informations (exemple: depth). I want to have statistics for each square. I want to know how many wells I have in each squares, what is the mean of the depth and so on Thanks


title: GPS positional, and quality data collection using QGIS

text: I was wondering if it was possible to record the position along with some of the quality control data in a table when using the GPS information functions to collect some mapping data. I would like to populate a mapping table with the attribute data of the event that I am mapping along with the latitude, longitude, altitude, time, PDOP, and any other fields available from the GPS at the time the shot was recorded. I have searched high and low for ideas on this within QGIS, and found nothing of assistance.


title: ogr / osr for node.js / javascript

text: I use a python module I created that does tests for point in polygon. It uses the python osgei/ogr and osr modules. Specifically, I use the following elements of these modules:               osr.SpatialReference() (with ImportFromEPSG4326 and InputFromEPSG3857)     osr.CoordinateTransformation()     ogr.Geometry() (with ogr.wkbLinearRing, ogr.wkbPoint and ogr.wkbPolygon)      The software using these osr/ogr capabilities needs to be translated to be a node.js module. Is anyone aware of an existing node.js osr/ogr 'wrapper' (or for generic javascript)?


title: unique value rendering in C# code behind

text: I have the following code in my xml file where i specify the uniquevalue rendering as shown below: `                   <FeatureLayerExtension>           <WhereString>             (ZONE ='A)' or (ZONE ='V')            </WhereString>           <OutFields>            ZONE            </OutFields>           <UniqueValueRenderer>             <SimpleFillSymbol  Color="White" Fill="Green" Width="1.5" FieldValue ="V" />             <SimpleFillSymbol  Color="White" Fill="Yellow" Width="1.5" FieldValue ="A" />           </UniqueValueRenderer>              </FeatureLayerExtension>                </Layer>`      By using serialization , i am trying to use the properties above in the .cs page as follows:               for (int i = 0; i <= 1; i++)                 {                     UniqueValueInfo info = new UniqueValueInfo();                          if (projectMap.FeatureLayerConfig.UniqueValueRenderer.SimpleFillSymbol != null)                     {                              var fill = GlobalConfigs.ColorToStringDic[projectMap.FeatureLayerConfig.UniqueValueRenderer.SimpleFillSymbol.Fill];                         var borderBrush = GlobalConfigs.ColorToStringDic[projectMap.FeatureLayerConfig.UniqueValueRenderer.SimpleFillSymbol.Color];                         var borderThickness = projectMap.FeatureLayerConfig.UniqueValueRenderer.SimpleFillSymbol.Width;                         var fillSymbol = new SimpleFillSymbol() { Fill = new SolidColorBrush(fill), BorderBrush = new SolidColorBrush(borderBrush), BorderThickness = borderThickness };                                   info.Value = projectMap.FeatureLayerConfig.UniqueValueRenderer.SimpleFillSymbol.FieldValue;                         info.Symbol = fillSymbol;                         renderer.Infos.Add(info);                          }      But when i am trying to do this only the first renderer value which is V repeats twice instead of 'V' and 'A' in the table of contents symbology.


title: Error inserting GeoJSON in PostGIS

text: I know there is a similar question but I am getting a different error and none of those answers have helped.   I am trying the following query (the GeoJSON itself is from the PostGIS website.               INSERT INTO layer_radar (id, geom)     VALUES     (         '3bf24920-225b-11e4-8c21-0800200c9a66',         ST_GeomFromGeoJSON('{"type":"Point","coordinates":[-48.23456,20.12345]}')     )      The error I am receiving is               ERROR:  (null) (at offset 0)          ********** Error **********          ERROR: (null) (at offset 0)     SQL state: XX000      Has anyone seen anything like this before? I can't get the simplest example to work.


title: all-in-one gis packages for windows 8.1?

text: Is there an all-in-one installer that allows having all open-source gis apps installed in windows 8.1? with all apps I mean for instance postgresql, postgis, mapserver, qgis, grass. I have cygwin installed, but I've read that it's way better to install these apps in windows. In case I need to query my psql db located in my postgresql windows installation from cygwin (ie. shell terminal), could that be possible?


title: Using search and update cursors for random number generation

text: I am having some trouble getting a searchcursor to return a value for each record. The purpose of my code is to scan through a list of records in a field (FieldA) and based on those values populate a second field (FieldB) with a random number between 1 and the value in FieldA. FieldA contains numeric values which vary depending on their association. My code is as follows:               CursorA = arcpy.SearchCursor(FC)     for row in cursorA:         rowcount =(row.getValue("FieldA"))         row = cursorA.next()         cursorB = arcpy.UpdateCursor(FC, "FieldB")          for rowB in cursorB:             rowB[0] = randint(1, rowcount)             cursorB.updateRow(rowB)      When I run the code it appears as though the searchcursor locates the value of the last record in FieldA and uses that value as the highest value in the random sequence. I could be wrong on this however, and it could be related to improper coding on my part. Any insight is greatly appreciated.


title: Add simple image layers to MapBox / Leaflet?

text: Is there an easy way to add simple image layers (with no, or very limited, GIS data) to Mapbox and/or Leaflet? Google maps seems to have the ability to add custom layers, simply by attaching the SW and NE corners to points on the image to points on the map I thought that MapBox or Leaflet would have similar functionality, but I'm struggling so far. I (presumptuously?) assumed that TileMill might allow me to import a non-GIS labelled image and drag and drop it to the correct position - much as you might align two Photoshop layers. However, I seem to only be able to import GIS datasourced layers, the closest of which to my needs seems to be GeoTIFF.


title: SQL 2012 shortestlineto method

text: I am trying to find the nearest centerline segment to an address point. I was hoping that I would be able to use the ShortestLineTo method, but it is not working. I have tested with Microsoft's examples and they work. I am unable to get the method to work. Here is Microsoft's Example: DECLARE @Shape1 geometry = 'POLYGON ((-20 -30, -3 -26, 14 -28, 20 -40, -20 -30))' DECLARE @Shape2 geometry = 'POLYGON ((-18 -20, 0 -10, 4 -12, 10 -20, 2 -22, -18 -20))' SELECT @Shape1 UNION ALL SELECT @Shape2 UNION ALL SELECT @Shape1.ShortestLineTo(@Shape2).STBuffer(.25) GO My Sample: Select l.ADDRESSPOINT_TAX.shape from l.ADDRESSPOINT_TAX where OBJECTID = '1' union all select l.CADCENTERLINE.SHAPE from l.CADCENTERLINE where OBJECTID = '1' union all select l.ADDRESSPOINT_TAX.Shape.ShortestLineTo(l.CADCENTERLINE.SHAPE) This is the error that I am getting back. Remote function reference 'l.ADDRESSPOINT_TAX.Shape.ShortestLineTo' is not allowed, and the column name 'l' could not be found or is ambiguous. Msg 4121, Level 16, State 1, Line 1 Cannot find either column "ADDRESSPOINT_TAX" or the user-defined function or aggregate "ADDRESSPOINT_TAX.Shape.ShortestLineTo", or the name is ambiguous. Thanks!


title: How to get the public transportation in Osm2po?

text: I'm developing a app guiding users to their destnation by public transportation.I need to use Osm2po to transfer osm data to sql, which including public transportation data.So how can i achieve it? Do i need to redevelop Osm2po? If need, how to do? THX!


title: Percentages of web using mapping softwares

text: How accurate are the online mapping assessments on trends.builtwith.com? http://trends.builtwith.com/mapping ![online mapping pie chart](http://i.stack.imgur.com/AXRWU.png) Can ArcGIS really be only .33% ? If so, what does this say about ArcGIS. Also why aren't QGIS Server, GeoServer, or MapServer listed ?


title: How to change value of an individual pixel using arcpy?

text: I want to change the value of an individual pixel in a raster using arcpy. The code I wrote for changing the value is below, but it changes all of pixels in my raster. How can I set an individual pixel in my code?               import arcpy     import numpy     raster = arcpy.Raster(r"C:\test.jpg")     array = arcpy.RasterToNumPyArray(raster)     (height, width)=array.shape     for row in range(0,1):         for col in range(0,1):                  newarray = array * 2.0                  newraster  = arcpy.NumPyArrayToRaster(newarray)             newraster.save(r"C:\export.gdb\t")      Thanks


title: Shp2pgsql - exec() not allowed on external server

text: Me and my collegue are using the shp2pgsql and psql commands in php code (a Drupal module to be precise). We put these commands in a php variable and use the exec() command to execute them. This works very well but now we have to use these operations on an external server which doesn't support the exec() command. Is there any workaround or solution for this matter? Thanks in advance.


title: Comparing Features in Python

text: What I am trying to do is, compare attributes in a shapefile to another updated version of that same shapefile just in a different folder. Right now I am just using the Compare Feature tool, which works okay, its just a rather long process when you have 3000 shapefiles to compare. Instead of one file at a time, let it run through each of their respective folders and compare features that way. I currently have code that will iterate through a folder, and I have the code that compares. Im just not sure how to put the two codes together. Is there a better way? ArcGIS Desktop 10.2.1, Python 2.7.5 First code snippet               import arcpy      try:      # Set local variables              base_features = r"C:\Users\usr\Desktop\basepoints 2013\01001_points.shp"              test_features = r"C:\Users\usr\Desktop\Testpoints apr2014\01001_points.shp"         sort_field = "APN"         compare_type = "GEOMETRY_ONLY"         ignore_option = ""         xy_tolerance = ".00000001 METERS"         m_tolerance=".001"         z_tolerance=".001"         attribute_tolerance = "#"         omit_field = "FID;Shape;PARCEL_ID;STATE_CODE;CNTY_CODE;APN2;OWNER;ADDR;CITY;STATE;ZIP;PLUS;STD_ADDR;STD_CITY;STD_STATE;STD_ZIP;STD_PLUS;TYPE_CODE;LONGITUDE;LATITUDE;CENSUS_TR;BLOCK_NBR;LOT_NBR;RANGE;TOWNSHIP;SECTION;QRT_SECT;FZ_COM_PNL;LAND_USE;CNTY_USE1;CNTY_USE2;M_HOME_IND;ZONING;PROP_IND;MUNI_NAME;MUNI_CODE;SUB_TR_NUM;SUB_PLT_BK;SUB_PLT_PG;SUB_NAME;FRONT_FT;DEPTH_FT;LAND_ACRES;LAND_SQ_FT;LOT_AREA;UBLD_SQ_FT;BLD_SQ_IND;FRPLCE_TYP;FRPLCE_NBR;FRPLCE_IND;PKG_SQ_FT;BSMT_SQ_FT;ADJ_SQ_FT;GR_SQ_FT;GF_SQ_FT;LIV_SQ_FT;BLD_SQ_FT;YR_BLT;EFF_YR_BLT;BEDROOMS;ROOMS;BATHS_CAL;BATHS;FULL_BATHS;HALF_BATHS;QTR1_BATHS;QTR3_BATHS;BATH_FIX;AIR_COND;BSMT_FNSH;BLD_CODE;BLD_IMP_CD;CONDITION;CONSTR_TYP;EXT_WALLS;FOUNDATION;FLOOR;FRAME;GARAGE;HEATING;PKG_SPACES;PKG_TYP;POOL;POOL_CD;QUALITY;ROOF_COVER;ROOF_TYP;STORY_CD;STORY_NBR;BLD_VIEW;LOC_INF;BLD_UNITS;STYLE;UNITS_NBR;ENERGY_USE;FUEL;SEWER;WATER"         continue_compare = "CONTINUE_COMPARE"         compare_file = r"C:\Users\usr\Desktop\compare_parcel_baja.txt"                        compare_result=arcpy.FeatureCompare_management(base_features, test_features, sort_field, compare_type, ignore_option, xy_tolerance, m_tolerance, z_tolerance, attribute_tolerance, omit_field, continue_compare, compare_file)         print  compare_result.getOutput(1)         print arcpy.GetMessages()     except:         print arcpy.GetMessages()      Second code snippet               ##======== iterating code ==============     import os.path          topdir= r"X:\CoreData_Jan15_2013\ParcelPoint\Data\points"          exten='.shp'          def step(ext,dirname,names):         ext=ext.lower()              for name in names:             if name.lower().endswith(ext):                 print(os.path.join(dirname,name))          os.path.walk(topdir,step,exten)


title: polygon color changes automatically when zooming map

text: I have implemented a google map using V3 js API. I am drawing about 500 zip code polygons inside the map. The colouring of the zip code polygons depends upon certain conditions which is working fine. Like I am assigning distinct colours to a set of zipcodes. But the problem is when I am zooming in the map some of the zipcode polygon colours getc changed. How can we fix it. Image links: http://imm.io/13kuK - at normal zoom level. http://imm.io/13kvN - when zoomed in For ex: I am pulling 30 zipcodes from my DB. I am dividing those 30 zipcodes into 5 regions(say depending upon highest sales to lowest sales). Each region will be marked by a particular color.Thus in this case 30 polygons will be plotted with 5 regions so as having 5 different colors. Now when I am zooming up the map there is no change in the grouping, but some of the polygon(may be 3-4) colors overlap to other polygons. If number 3 region has color "Yellow" in normal map, when I zoom in the map some of the polygons of region 3 get overlapped by "Red" color. Where as "Red" color belongs to region 1 zip code polygons.


title: merging layer stored in PostGIS

text: I have a bunch of layers stored in PostGIS that I want to merge. I have spent quite some time investigating various approaches but I ket tripping over getting the GIDs to update properly. In the end the only way that I found that worked was to:   1. load the layers into QGIS from PostGIS and then save them as shape files in a temp dir.   2. remove the layers from QGIS and reload them from the shape files.    3. delete the GID attribute from the layers and save the shape files again.    4. then use Vector->data managment->merge shape files to create a merged shape file   5. finally use SPIT to get the merged file back into PostGIS The purpose of this 'question' is two fold, firstly to document something at works and secondly to ask if there is a better way of doing it. Things that I discovered on this journey:   * you can not paste features into a PostGIS layer because these don't get the appropriate magic in the GID field to allocate a new number from the sequence. (this is arguably a bug in QGIS ??)   * Splitting feature in a PostGIS layer works as it should and the new feature picks up a GID when the layer is saved.


title: In what format WMSgetFeatureinfo return data?

text: In what format WMSgetFeatureInfo return data ? and how get particular data from html table using openlayers ........ thanks for any help...


title: efficiently slicing tiles with gdal C API

text: Im working a project using the gdal C api(in a block of objective-c) to slice TMS style png tiles. The code currently works, but I'm running into some trouble optimizing to run fast enough for use on mobile devices. The target resolution for the tiles ranges from near the same res as the source images, to 1/5th the res of the source images. My current strategy: Open the source data(currently testing with BSB):   * Get the transform, using GDALGetGeoTransform, and get the inverse transform   * get coordinate transformers from dataset coordinates to lat/lon   * store all that for when tiles are needed When a tile is needed:   * Determine the pixel coordinates of the source data that is needed, taking into account a clip line for the data that is not at the edge of the source image.   * Create a new VRT              VRTDatasetH vrtDS = VRTCreate(tileSize, tileSize);     int nBands = GDALGetRasterCount(dataset);     for(int j=0; j < nBands; j++) {       GDALRasterBandH sourceBand = GDALGetRasterBand(dataset, j+1);       GDALAddBand(vrtDS, GDALGetRasterDataType(sourceBand), NULL);       GDALRasterBandH newBand = GDALGetRasterBand(vrtDS, j+1);       GDALSetRasterColorInterpretation(newBand, GDALGetRasterColorInterpretation(sourceBand));       if(GDALGetRasterColorInterpretation(sourceBand) == GCI_PaletteIndex) {         GDALSetRasterColorTable(newBand, GDALGetRasterColorTable(sourceBand));       }     }        * Copy data to the VRT:               for(int j=0; j < nBands; j++) {         GDALRasterBandH sourceBand = GDALGetRasterBand(dataset, j+1);         VRTSourcedRasterBandH destBand = (VRTSourcedRasterBandH)GDALGetRasterBand(vrtDS, j+1);         VRTAddSimpleSource(destBand,                    sourceBand,                    sourceDataRegion.origin.x,                    sourceDataRegion.origin.y,                    sourceDataRegion.size.width,                    sourceDataRegion.size.height,                    destDataRegion.origin.x,                    destDataRegion.origin.y,                    destDataRegion.size.width,                    destDataRegion.size.height,                    "NEAREST",                    VRT_NODATA_UNSET                    );       }        * Create a copy the VRT slice as PNG              GDALDriverH pngDriver = GDALGetDriverByName("PNG");     GDALDatasetH pngCopy = GDALCreateCopy(pngDriver, destinationPath, datasetToWrite, false, NULL, NULL, NULL);     GDALClose(pngCopy);      Currently GDALCreateCopy is using 70% of the total CPU time I've tried reusing the same VRT, but did not see a significant speed increase from that. That is also not an ideal solution because some of the tiles do not have source data to cover the complete tile. Is there a more CPU efficient way to do this? Techniques i've thought about but have not yet implemented:   * Creating a VRT of the whole dataset warped to the target CRS using GDALAutoCreateWarpedVRT then slicing tiles from that. This could be faster, but from my experience with gdal so far, my guess is that this would be approximately the same speed.   * Write the image out to a GeoTiff in the target CRS, then slice the GeoTiff.   * Dumping the whole image to PNG, then doing the slicing with core-graphics. My guess is that this would use a lot more memory, because some of the my source images are 15000px*15000px Any suggestions for optimizing this would be greatly appreciated. ![Current cpu use](http://i.stack.imgur.com/tzzi5.png)


title: How to register geometries using OpenLayers and GeoServer in PostGIS?

text: I put a Editing Toolbar on my page using Google Maps Api as base layer. I want to register lines and points in PostGIS. But I want to know how I can get the longitude and latitude of gemotria (line or point) to register on OpenLayers and PostGIS using Geoserver? I would like to see an example of how to do this and how best to do, I thought about using WFS.               <!DOCTYPE html>     <html lang='en'>     <head>      <meta charset='utf-8' />      <title>My OpenLayers Map</title>      <script type='text/javascript' src='OpenLayers.js'></script>           <!-- Chamada a Api Google Maps -->      <script src="http://maps.google.com/maps/api/js?sensor=false&v=3.2"></script>           <script type='text/javascript'>           //Variável map      var map;           //Função a ser chamada para criar o mapa na leitura da página      function init() {           //Gera o mapa usando a projeção de Google Mercator que é padrão das APIS de terceiros nesse exemplo usadas como BaseLayer      map = new OpenLayers.Map('map_element',{         maxExtent: new OpenLayers.Bounds(             -128 * 156543.0339,             -128 * 156543.0339,             128 * 156543.0339,             128 * 156543.0339),         maxResolution: 156543.0339,         units: 'm',         projection: new OpenLayers.Projection('EPSG:900913'),         displayProjection: new OpenLayers.Projection("EPSG:4326"),           });           //Criar a layer Google Streets      var google_streets = new OpenLayers.Layer.Google(         "Google Streets",         {numZoomLevels: 20}         );           //Criar OSM Layer Streets      var osm_layer = new OpenLayers.Layer.OSM(         'OpenStreetMap Layer'         );           //Adiciona a camada EDITAVEL ao mapa      var vLayer = new OpenLayers.Layer.Vector('Editable');          //Adiciona as camadas ao mapa     map.addLayers([google_streets,osm_layer,vLayer]);               //Adiciona o Editing ToolBar      map.addControl(new OpenLayers.Control.EditingToolbar(vLayer));          //Centraliza em POA      var point = new OpenLayers.LonLat(-51.22,-30.08); point.transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()); map.setCenter(point, 12);               //Verifica se o mapa tem um ponto central e o extende a sua extensão máxima      if(!map.getCenter()){      map.zoomToMaxExtent();           }      }           </script>     </head>          <body onload='init();'> <!-- Chama a função js init() -->           <!--Elemento HTML onde o mapa é exibido -->      <div id='map_element' style='width: 1000px; height: 900px;'>      </div>          </body>     </html>


title: using GDAL/OGR (faster)

text: Eventually, I was able to get the GDAL installed and compiled correctly using Visual C++ 2010. I even tested some of its methods on some geo-referenced raster files, and it looks like that all is working fine. However, I am interested in running GDAL with some sort of hardware acceleration? Does anyone know if there is any support for GDAL with some acceleration libraries (e.g. CUDA/OepnCL, or maybe even with using OpenGL for the sake of GPGPU, or SIMD)?


title: Calculate polygon area inside extent

text: We're using ArcMap 10.0 sp5, creating a tool in c# using the ArcObjects sdk. Is there a built in function or simple set of steps that calculates the area of each feature of a polygon layer within a specific extent? What we want to do is calculate the area inside a set of bounds for each of the polygon layer’s features that reside within those bounds (defined by minimum and maximum X and Y). This process would be repeated multiple times, as we traverse a grid. Ideally, the function would also return the area not occupied by any features. For example, consider this polygon layer in which there are 3 polygons (red, blue, and geen): ![three polygons. one red, one green, and one blue](http://i.stack.imgur.com/zBO9H.png) If we imagine splitting that layer into a grid: ![same three polygons, with a gridded overlay](http://i.stack.imgur.com/yI3Gj.png) Looking exclusively at one cell of the grid: ![grid with one cell highlighted, arrow indicating a second image which is a close-up view of the cell. The cell contains pieces from all the red and green polygons, as well as the entire blue polygon. There is space not occupied by any of the polygons. The polygons do not overlap.](http://i.stack.imgur.com/DT5rl.png) We would like to get a measurement of the area that each feature occupies within that cell, along with a measurement of the “empty” area of the cell. The measurements could be in actual area (square feet, square meters, etc.) or merely a percentage of the area of the grid cell (as shown below). ![close up of grid cell, showing percentages on each polygon piece and a percentage on the empty space. Red is 35 percent, green is 11 percent, blue is 10 percent, and the empty space is 44 percent](http://i.stack.imgur.com/EQhNV.png) _Note: these percents are for demonstration purposes only and are not necessarily to scale._ We'd also like to keep in mind the case of overlapping polygons. Consider this alternate polygon layer in which the blue polygon resides entirely within the red polygon: ![close up of grid cell, this time with the blue polygon completely inside the piece of the red polygon. The image shows percentages on each polygon piece and a percentage on the empty space. Red is 35 percent, green is 11 percent, blue is 10 percent, but the empty space is now 54 percent](http://i.stack.imgur.com/EZtKo.png) In this case, the sum of the area covered by each polygon would be greater than the area covered by the grid cell. As shown in the illustration above, red and blue both occupy the same percentage area as in the first example, but their areas are not distinct. In this case we would need to receive the values adding up to 110%, or a new set of percentages along the lines of:   * Red = 31.8181818%   * Green = 10%   * Blue = 9.0909091%   * Empty = 49.0909091% We could either calculate the percentage as a fraction of the total polygon areas (including the "empty" polygon) or as a fraction of the grid cell area. If a function exists that performs the calculations described above, we would need to know exactly what the result of that calculation gives us. Our current thought is to follow the workflow below, but we wanted to see if anyone had better ideas.   1. Create a fishnet of the desired cell size and extent (to handle multiple grid cells at a time)   2. Union the fishnet with the polygon feature class   3. Calculate the area of all resultant features   4. Traverse the resultant features (by grid cell) to read the area of each unioned feature manually. (In this case, features without an FID from the original polygon layer would be the area not occupied by any features)    5. Sum the area of all features in the cell   6. Compute the percentage for each feature based on the calculated sum from 5.


title: Code for SelectionChange Event on Comboboxes in VB.Net

text: I am programming 3 combo boxes so that each one feeds off the information from the previous combobox. For example, in the first box they would select a year, then the second combobox would provide specific events for that year and then the third combobox would provide specific maps that are available based on the the first two answers. I know the process is written in the Sub Change() location but I am stuck on how to relate them to each other. Can anyone possibly provide me some sample code for this procedure. Or maybe a website where I can go to learn how to write this kind of code. Any help would be great!!