Call function inside dojo.ready

I have code ArcGIS Javascript like this:               <script type="text/javascript">           require(["dojo/ready",           "dgrid/OnDemandGrid",           "dgrid/Selection",           "dojo/store/Memory",            "dojo/_base/array",           "dojo/dom-style",           "dijit/registry",           "esri/map",            "esri/dijit/Popup",           "esri/dijit/PopupTemplate",           "esri/layers/FeatureLayer",           "dojo/dom-class",           "dojo/dom-construct",           "dojo/on",            "esri/InfoTemplate",           "esri/symbols/SimpleLineSymbol",           "esri/symbols/SimpleFillSymbol",           "esri/tasks/QueryTask",           "esri/tasks/query",           "dojo/_base/declare",            "dojo/number",            "dojo/on",           "dojox/charting/Chart",           "esri/renderers/UniqueValueRenderer",           "dojo/parser",           "dojo/_base/Color",            "dijit/layout/BorderContainer",           "dijit/layout/ContentPane"           ], function (             ready,             Grid,              Selection,              Memory,              array,             domStyle,             registry,             Map,             Popup,             PopupTemplate,              FeatureLayer,             domClass,             domConstruct,             on,              InfoTemplate,             SimpleLineSymbol,             SimpleFillSymbol,             QueryTask,             Query,             declare,              dojoNum,              on,             Chart,              UniqueValueRenderer,             parser           ) {             ready(function() {                    parser.parse();                    var popup = Popup({                 titleInBody: false               },domConstruct.create("div"));                    // create the dgrid               window.grid = new (declare([Grid, Selection]))({                 // use Infinity so that all data is available in the grid                 bufferRows: Infinity,                 columns: {                   "FID": "FID",                   "PROV": "PROV"                 }               }, "grid");               // add a click listener on the ID column               grid.on(".field-id:click", selectState);                    var initialExtent = new esri.geometry.Extent({"xmin":89.971,"ymin":-12.472,"xmax":144.301,"ymax":9.511,"spatialReference":{"wkid":4326}});               map = new esri.Map("map", { extent: initialExtent,infoWindow: popup});                    //var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServer");               var basemap2 = new esri.layers.ArcGISDynamicMapServiceLayer("http://localhost:6080/arcgis/rest/services/BaseMap/Peta_Dasar_Indonesia_Colors/MapServer",{"opacity":0.4});               map.addLayer(basemap2);               //map.addLayer(basemap);                         domClass.add(window.map.infoWindow.domNode, "myTheme");                 var template = new PopupTemplate({                 title: "Data Luas Lahan Sawah {PROV}",                 description: "of starters from {PROV} finished",               });                    window.statesUrl = "http://localhost:6080/arcgis/rest/services/BaseMap/Peta_Dasar_Indonesia_Colors/MapServer/8";               window.outFields = ["FID","PROV"];                    var fl = new FeatureLayer(window.statesUrl, {                 id: "stat",                 mode: 1, // ONDEMAND, could also use FeatureLayer.MODE_ONDEMAND                 infoTemplate:template,                 outFields: window.outFields               });                    fl.on("load", function() {                 fl.maxScale = 0; // show the states layer at all scales                 fl.setSelectionSymbol(new SimpleFillSymbol().setOutline(null).setColor("#AEC7E3"));               });                    fl.on("click", selectGrid);                    // change cursor to indicate features are click-able               fl.on("mouse-over", function() {                 map.setMapCursor("pointer");               });               fl.on("mouse-out", function() {                 map.setMapCursor("default");               });                         map.addLayer(fl);                    map.on("load",                  function addFeatureLayer() {                   var defaultSymbol = new SimpleFillSymbol().setStyle(SimpleFillSymbol.STYLE_NULL);                   defaultSymbol.outline.setStyle(SimpleLineSymbol.STYLE_NULL);                        //create renderer                   var renderer = new UniqueValueRenderer(defaultSymbol, "PROV");                        //add symbol for each possible value                   renderer.addValue("Banten", new SimpleFillSymbol().setColor("#00FA1D"));                   renderer.addValue("Dki Jakarta", new SimpleFillSymbol().setColor("#FA0000"));                   renderer.addValue("Jawa Barat", new SimpleFillSymbol().setColor("#FAFA00"));                   renderer.addValue("Jawa Tengah", new SimpleFillSymbol().setColor("#00FA1D"));                   renderer.addValue("Daerah Istimewa Yogyakarta", new SimpleFillSymbol().setColor("#FAFA00"));                   renderer.addValue("Jawa Timur", new SimpleFillSymbol().setColor("#FAFA00"));                   var template = new PopupTemplate({                     title: "Data {PROV}",                     description: "Data Luas Lahan Sawah {PROV}",                   });                   var featureLayer = new FeatureLayer("http://localhost:6080/arcgis/rest/services/BaseMap/Peta_Dasar_Indonesia_Colors/MapServer/8", {                     mode: 1, // ONDEMAND, could also use FeatureLayer.MODE_ONDEMAND                     infoTemplate:template,                     outFields: window.outFields                   });                        featureLayer.setRenderer(renderer);                   map.addLayer(featureLayer);                 } ,                 function( evt ){                   // show the border container now that the dijits                    // are rendered and the map has loaded                   domStyle.set(registry.byId("container").domNode, "visibility", "visible");                   populateGrid(Memory); // pass a reference to the MemoryStore constructor               });                    function populateGrid(Memory) {                 var qt = new QueryTask(window.statesUrl);                 var query = new Query();                 query.where = "1=1";                 query.returnGeometry = false;                 query.outFields = window.outFields;                 qt.execute(query, function(results) {                   var data = array.map(results.features, function(feature) {                     return {                       // property names used here match those used when creating the dgrid                       "FID": feature.attributes[window.outFields[0]],                       "PROV": feature.attributes[window.outFields[1]]                     }                   });                   var memStore = new Memory({ data: data });                   window.grid.set("store", memStore);                 });               }               // fires when a row in the dgrid is clicked               function selectState(e) {                 // select the feature                 var fl = map.getLayer("stat");                 var query = new Query();                 query.objectIds = [parseInt(e.target.innerHTML)];                 fl.selectFeatures(query, FeatureLayer.SELECTION_NEW, function(result) {                   if ( result.length ) {                     // re-center the map to the selected feature                     window.map.centerAt(result[0].geometry.getExtent().getCenter());                   } else {                     console.log("Feature Layer query returned no features... ", result);                   }                 });               }                    // fires when a feature on the map is clicked               function selectGrid(e) {                 var profinsi = e.graphic.attributes.PROV;                 var id = e.graphic.attributes.FID;                 // select the feature that was clicked                 var query = new Query();                 query.objectIds = [id];                 var states = map.getLayer("stat");                 states.selectFeatures(query, FeatureLayer.SELECTION_NEW);                 // select the corresponding row in the grid                 // and make sure it is in view                 grid.clearSelection();                 grid.select(id);               }                    function test(){                 alert("alert");               }             });         });     </script>      I want call function inside dojo.ready function. For example, I want call function test() with onclick with this:               <input type="submit" value="Submit" onclick="test();">      but still not work.   Can anybody help me explain how to call function inside dojo.ready?


Using a bounding polygon, instead of a bounding box

I've got a large set of LAT/LON coordinates. Up until now, when I needed to select out those that fell within a certain region, I'd just create a bounding box using some MINx, MAXx, MINy, MAXy values and try to get it as close as possible to the area I was interested in. I'd like to get more precise by using more than 4 points as the extent of my search area, in this specific case, 14 points. I'll probably be using Python or SQL for this, so the specific syntax on any solution isn't that important, I'm just interested in the formula for figuring this one out.


How to implement pgRouting in a web GIS based on MapServer?

I have 3d lines in PostGIS database (representing hiking trails). I'm using phpPgAdmin administration tool. I want to use Dijkstra method for finding shortest way. I inserted all needed columns to execute this function, for example:                   SELECT * FROM shortest_path('        SELECT gid AS id,               start_id::int4 AS source,               end_id::int4 AS target,               cost_length::float8 AS cost        FROM network',     1,     135,     false,     false)      I have .html file and .map file. I alredy have some functions and layers installed in my web application (like layer for shaded relief map). Also, I already have defined layer for 3d hiking trails from PostGIS database and it is shown on the web map by checkbox. I never worked with pgRouting and MapServer before and I need help how to implement this function in my web application. I need detailed answer on **how to implement it in my .map file and .html file**. I need to enable users to choose one starting node (I will name them, but I don't know if I need to name it all?) from the combobox I want to define in my .html file, and one end node, also from the combobox, and then enable showing shortest path, or maybe list of nodes where they need to go for shortest path from start point to end point. Don't give me links like [1]: http://users.qgis.org/planet/user/4/tag/pgrouting/ because it doesn't give me an explanation about working with MapServer and pgRouting. It is very important and emergency, because it is about my graduation thesis. Thank you! * * * This is error when I'm trying to open my application:               writeLog(): Unable to access file. mslog.log msDrawMap(): Image handling error.      Failed to draw layer named 'routing'. msPostGISLayerWhichShapes(): Query error.      Error (ERROR: syntax error at or near "SELECT" LINE 1: ...) as geom,"gid" from      (SELECT * FROM shortest_path(SELECT the... ^ ) executing query:      select encode(ST_AsBinary(ST_Force_2D("the_geom"),'NDR'),'hex') as geom,"gid" from      (SELECT * FROM shortest_path(SELECT the_geom as the_geom, gid AS id, %start_id%::int4      AS source, %end_id%::int4 AS target, cost_length::float8 AS cost FROM network, 1, 135,      false, false)) AS foo where the_geom && GeomFromText('POLYGON((561819.89148581          5072537.66277129,561819.89148581 5093307.66277129,589524.782971619      5093307.66277129,589524.782971619 5072537.66277129,561819.89148581      5072537.66277129))',4326)


gdalbuildvrt error when mosaicking SRTM data with different NoData values

I'm attempting to mosaic together 9 SRTM tiles downloaded from CGIAR to produce a DEM of Borneo. I'm using:               gdalbuildvrt Borneo.vrt BorneoSRTM/*.tif      where BorneoSRTM contains the 9 tif files to be combined. The command runs without error, however the resulting DEM looks like the below image and all the elevations are less than 13m (some of the input files have elevations close to 4000 m). ![enter image description here](http://i.stack.imgur.com/FnfeU.png) Clearly there's a problem with the tile corresponding to the big white square (5-10N, 110-115E). Looking at the original tif files and I've noticed that NoData is 255 for the problem tile and -32768 for all others. I tried changing NoData to -32768 using:               gdal_translate -a_nodata -32768  srtm_59_11.tif  out.tif      but this didn't solve the problem. Calling gdalinfo on the problem tile gives:               Driver: GTiff/GeoTIFF     Files: srtm_59_11.tif            srtm_59_11.tfw     Size is 6001, 6001     Coordinate System is:     GEOGCS["WGS 84",         DATUM["WGS_1984",             SPHEROID["WGS 84",6378137,298.257223563,                 AUTHORITY["EPSG","7030"]],             AUTHORITY["EPSG","6326"]],         PRIMEM["Greenwich",0],         UNIT["degree",0.0174532925199433],         AUTHORITY["EPSG","4326"]]     Origin = (109.999583817610983,10.000416763514124)     Pixel Size = (0.000833333333333,-0.000833333333333)     Metadata:       AREA_OR_POINT=Area     Image Structure Metadata:       INTERLEAVE=BAND     Corner Coordinates:     Upper Left  ( 109.9995838,  10.0004168)      Lower Left  ( 109.9995838,   4.9995834)      Upper Right ( 115.0004172,  10.0004168)      Lower Right ( 115.0004172,   4.9995834)      Center      ( 112.5000005,   7.5000001)      Band 1 Block=6001x1 Type=Int16, ColorInterp=Gray       NoData Value=255      And, calling it on another tile gives:               Driver: GTiff/GeoTIFF     Files: srtm_59_12.tif            srtm_59_12.tfw     Size is 6001, 6001     Coordinate System is:     GEOGCS["WGS 84",         DATUM["WGS_1984",             SPHEROID["WGS 84",6378137,298.257223563,                 AUTHORITY["EPSG","7030"]],             AUTHORITY["EPSG","6326"]],         PRIMEM["Greenwich",0],         UNIT["degree",0.0174532925199433],         AUTHORITY["EPSG","4326"]]     Origin = (109.999583817610983,5.000416642442191)     Pixel Size = (0.000833333333333,-0.000833333333333)     Metadata:       AREA_OR_POINT=Area     Image Structure Metadata:       INTERLEAVE=BAND     Corner Coordinates:     Upper Left  ( 109.9995838,   5.0004166)      Lower Left  ( 109.9995838,  -0.0004167)      Upper Right ( 115.0004172,   5.0004166)      Lower Right ( 115.0004172,  -0.0004167)      Center      ( 112.5000005,   2.5000000)      Band 1 Block=6001x1 Type=Int16, ColorInterp=Gray       NoData Value=-32768      When I call gdalbuildvrt without this problem tile, everything works fine. I realize that this tile only includes a tiny piece of Borneo, but if possible I'd like to figure out a way to include it. Any help would be appreciated.


How to use Patch in Geoserver

I have got a patch which supports Nvarchar and Nchar types when we need to publish sql server table to Geoserver. But I dont know, How to use this patch OR where i put this patch so that it can work with Geoserver ? Can anybody explain, how i use this patch with Geoserver?


How to generate discrete areas from multiple, overlapping features?

I have a point dataset that I want to append some information from a polygon to. My polygon shapefile contains over 500 features. Whilst each of these features represents individual areas they are not discrete in their extent. For example, (see highly sophisticated Paint mock up below) a point (point 1) in Figure A may actually overlay all three zones (Point 1, Figure B). A spatial join or query will then result in an incorrect zone being appended. ![Simple overview of the problem](http://i.stack.imgur.com/jBWQt.jpg) What I’m wanting is a dataset like that shown in Figure C i.e. discrete polygons that do not overlap. I have tried splitting my original polygon by an attribute/location and unioning these ~500 shapefiles together but to no avail. Namely, the Union tool would like to do this process two shapefiles at a time (I ideally wanted to point the tool at a folder containing the split shapefiles and union them all together). This should be a really easy problem to solve but I want to avoid doing this manually (i.e. through the Editor 'Clip' tool). **Does anyone have any ideas?**


Why does Add Field to Layer File give "ERROR 000840: The value is not a Feature Layer"?

I'm trying to add a field to a layer file, but it always gives an error. What I did was making a closest facility layer and save the result as a layer and after that I tried to add a field, but then it gives an error. It says it cannot add a field if it isn't a raster layer, ... I tried to avoid this by making a shapefile (manually) and this can work, but is there a method to do this in Python? So convert a route from the closest facility layer to a shapefile using Python? It always says: ExecuteError: Failed to execute. Parameters are not valid.   ERROR 000840: The value is not a Feature Layer. Thanks! Regards


ESRI GDB Support in GDAL / ogr2ogr on Mac OS X 10.8

How do you incorporate support for ESRI's fgdb format into GDAL / ogr2ogr on Mac OS X 10.8?


SQL Server STpointfromText comes from PHP into javascript as garbage

Sorry for the sloppy title. Here's the scenario - I have a table in `SQL Server 2008 R2` It has a geographyColumn, created thusly:               add geographyColumn as geography::STPointFromText('POINT('+convert(varchar(20),x_coord)+'          '+convert(varchar(20),y_coord)+')',4326)      When I viewed it in the table, it looks fine:               POINT (-116.477654 33.764695)      I have some javascript, and a PHP script, to grab points from said table. I can get any text field without a problem. But I want to get the X,Y vales from the geography column. Instead of a nicely formed "X,Y" or even a long string of numbers, I get this mess:               ����zU���f�C@      My php is the following:               <?php $q=$_GET["q"];      $serverName = "ServerIP";      $connectionInfo = array( "Database"=>"geo_spat2", "UID"=>"u", "PWD"=>"p");      $con = sqlsrv_connect($serverName, $connectionInfo);      if (!$con){         die( print_r( sqlsrv_errors(), true));      };      $sql="SELECT * FROM EMPTY_REPS WHERE Division_label = '".$q."'";      $result = sqlsrv_query($con, $sql);      while($row = sqlsrv_fetch_array($result)) {        echo $row['geographyColumn'] . ", ";      }      sqlsrv_close($con);      ?>      Am I missing something simple? Thanks, Evan


Export to new projection in QGIS 1.7

Suppose I have layers A and B. I don't know their projections but by the looks of the map I know they are not the same. In QGIS 1.6 I would use one of my favorite features:               Vector> Data Management Tools> Export to New Projection      What was nice about that feature is that you could export B to A's projection by selecting "choose projection from existing layer". Hence you need not know A or B's projection. In QGIS 1.7 the `Data management Tools` menu is much reduced and the `Export to New Projection` is missing. Yes, I can do projections on the fly, and I can do `save as`. The former is not useful if I want to convert B's projection to A's. The latter does not give option to set projection from open layer. I have tried to find different ways to access the `Export to New Projection` dialog without success. Any tips?


How to dissolve adjacent parcels by same owner but include those parcels located across the street with the same owner?

In trying to determine the total contiguous stream length per landowner, I dissolved parcels by parcel owner name attribute and intersected these dissolved parcels with streams. However, dissolving by parcel owner doesn't include parcels located across the street (right-of-way) when 'Create multipart features' is unchecked since they don't share common edges; and when I do check 'Create multipart features', it creates the desired result across the street but also includes piecemealed parcels per owner that are spread out in space which are not considered contiguous. I was even thinking of modeling this somehow in Spatial Analyst. I'm using ArcGIS 10.1 with a basic license. Any ideas of how to achieve the desired result?


Using GDAL and Python to replace the Spatial Analyst TabulateArea method

Has anyone tried to phase out the use of ESRI's Spatial Analyst extension by replacing it with GDAL in Python? I have a script that only uses the TabulateArea and Statistics analysis but not much else from SA. Would be great to take ESRI out of the picture there and not have to pay for the SA extension. Anybody have any luck with this?


ToolBar icon images missing

very early build ~ zip file I am getting blank outputs for button images in a custom toolbar. Although the button information populates the dockable toolbar, they lack respective icons [see Fig.1] Thanks for any help or clues! Much of the following code was referenced from Add toolbar via Python               def initGui(self):         # Add toolbar              self.toolbar = self.iface.addToolBar("Graphic Groundwater")         self.toolbar.setObjectName("Graphic Groundwater")              # Create actions         self.getDEM = QAction(QIcon(":/plugins/GraphicGroundwater/icons/getDEM.png"),                                QCoreApplication.translate("Groundwater Modeling", "Get DEM Map"),                                self.iface.mainWindow())         self.getTopo = QAction(QIcon(":/plugins/GraphicGroundwater/icons/getTopo.png"),                                QCoreApplication.translate("Groundwater Modeling", "Get Topo Map"),                                self.iface.mainWindow())         self.addBase = QAction(QIcon(":/plugins/GraphicGroundwater/icons/addBase.png"),                                QCoreApplication.translate("Groundwater Modeling", "Add Base Area"),                                self.iface.mainWindow())         self.addNewBase = QAction(QIcon(":/plugins/GraphicGroundwater/icons/addNewBase.png"),                                QCoreApplication.translate("Groundwater Modeling", "Add New Base Area"),                                self.iface.mainWindow())         self.addRiver = QAction(QIcon(":/plugins/GraphicGroundwater/icons/addRiver.png"),                                QCoreApplication.translate("Groundwater Modeling", "Add River"),                                self.iface.mainWindow())         self.addStress = QAction(QIcon(":/plugins/GraphicGroundwater/icons/addStress.png"),                                QCoreApplication.translate("Groundwater Modeling", "Add Stress"),                                self.iface.mainWindow())         self.addGrid = QAction(QIcon(":/plugins/GraphicGroundwater/icons/addGrid.png"),                                QCoreApplication.translate("Groundwater Modeling", "Add Grid"),                                self.iface.mainWindow())         self.refreshGrid = QAction(QIcon(":/plugins/GraphicGroundwater/icons/refreshGrid.png"),                                QCoreApplication.translate("Groundwater Modeling", "Refresh Attributes"),                                self.iface.mainWindow())         self.runModel = QAction(QIcon(":/plugins/GraphicGroundwater/icons/runModel.png"),                                QCoreApplication.translate("Groundwater Modeling", "Run Model"),                                self.iface.mainWindow())              # Connect action signals to slots         self.getDEM.triggered.connect(self.run)         self.getTopo.triggered.connect(self.run)         self.addBase.triggered.connect(self.run)         self.addNewBase.triggered.connect(self.run)         self.addRiver.triggered.connect(self.run)         self.addStress.triggered.connect(self.run)         self.addGrid.triggered.connect(self.run)         self.refreshGrid.triggered.connect(self.run)         self.runModel.triggered.connect(self.run)              # Add actions to the toolbar         self.toolbar.addAction(self.getDEM)         self.toolbar.addAction(self.getTopo)         self.toolbar.addAction(self.addBase)         self.toolbar.addAction(self.addNewBase)         self.toolbar.addAction(self.addRiver)         self.toolbar.addAction(self.addStress)         self.toolbar.addAction(self.addGrid)         self.toolbar.addAction(self.refreshGrid)         self.toolbar.addAction(self.runModel)          def unload(self):         # remove toolbar on plugin unload         del self.toolbar      [Fig.1] ![blank toolbar](http://i.stack.imgur.com/FhzpS.png) The associated resource_rc file might also be of some diagnosis assistance...               <qresource prefix=":/plugins/graphicgroundwater/" >         <file>GraphicGroundwater.png</file>         <file>getDEM.png</file>         <file>getTopo.png</file>         <file>addBase.png</file>         <file>addNewBase.png</file>         <file>addRiver.png</file>         <file>addStress.png</file>         <file>addGrid.png</file>         <file>refreshGrid.png</file>         <file>runModel.png</file>     </qresource>


Why is my add-in toolbar greyed out?

I installed an addIn toolbar for the U.S. Geological Survey's National Cooperative Geologic Mapping Program and I can see it, but all the tools are greyed out. Any idea why I can't see it? I am inserting a jpg of what I see. Thanks!!! ![greyedouttoolbar](http://i.stack.imgur.com/bMMgB.jpg)


Vertical Scroll CartoDB not working

I am currently developing a site using CartoDB. I have a fixed div and a table located inside the div. The div is only 300px in height, but the information goes way beyond this height. The issue I am having is when you attempt to scroll while hovering over the box, nothing happens. However, if you click in the div and use the up and down arrows on your keyboard it "scrolls" just fine. Why am I having this issue? The div is fixed directly above the bottom layer which is a map. CSS:               .holder{       position:fixed;       top:80px;       left:8px;       width:226px;       height:900px;       margin:0;       padding:7px 0 0 0;     }     .users-wrapper{       width:226px;       height:300px;       overflow-x:hidden;     }     .users{       position:relative;       display:block;       margin:0;       margin-top:30px;       padding:5px;       background:#FFF;       height:auto;       min-height:5px;       max-height:300px;       width:226px;       max-width:226px;       overflow-x:hidden!important;     }      HTML:

         //Table information located here


What parts of the ArcGIS 9.3 Geoprocessor Programming Model diagram are not relevant for ArcGIS 10?

The geoprocessor programming model was an excellent tool for python scripting using ArcGIS 9.3. There is still no equivalent diagram for ArcGIS 10 - although there is a request on the ArcGIS ideas site. A previous question on this site asked if the 9.3 diagram is good to use for ArcGIS 10. The answer was that some of it is relevant and it is best not to use it. However, I really like the diagram and would like to reference it when scripting ArcGIS 10. Therefore my specific question is: What parts of the ArcGIS 9.3 diagram are not relevant to ArcGIS 10? Correct me if I'm wrong, but from what I understand, if an equivalent diagram was made for ArcGIS 10, there would be new functions added to the diagram; the diagram would only get bigger.


PyQGIS: How to send signal if layer is currently in edit mode

I'm looking for a way to send a signal if a layer is in editing mode. I tried editingStarted(), but it wasn't working. I'd like to do something along the lines of the what I have below, but can't find it in the API (where I'm looking: http://qgis.org/api/classQgsVectorLayer.html#a476eaf6ec8f2a45e285e963bcacedcc2)               qgis.utils.iface.setActiveLayer(myLayer)     #capslock is in place of the method i'm searching     if myLayer.ISINEDITMODE() == False:         qgis.utils.iface.actionToggleEditing().trigger()


How to interactively get the coordinates of a point in QGIS

I have a shapefile with a single layer of type point. It is in the google CRS (EPSG:900913). When I use the 'Identify Feature' tool it gives me lots of information about the point clicked on, but I cant see the coordinates. Is there a way to find out the lat/lng of a point interactively?


How can I add a new field in a raster attribute table and loop through it?

I am working with an existing raster attribute table. I wonder how can I add a new field to it and then loop through the existing records to populate this new field? Of course I have done this many times for a feature class and a database table but I do not know how to do it with a raster table. I work with VBA. Any code please? Thanks.


I'm having some doubts concerning the layer mechanism. Creating a new layer (ie a new connection between a vector and a DB table), I've imported a vector (rivers) through v.in.ogr, then I've cloned the original table:               db.copy from_table=rivers to_table=rivers_clone      I've created a new connection:               v.db.connect map=rivers table=rivers_clone layer=2      At this point I supposed that the last command had created all the needed structures and fields for the new layer (2), but if I print the categories:               v.category input=rivers layer=2 option=print      no categories are displayed (while they are listed if I choose layer 1). **Question** : I thought that a new connection used the same vector categories, but it seems I was wrong. How to make the layer 2 use the same vector categories from layer 1?


How to calculate the flood volume using a LiDAR DEM and a HEC-RAS floodplain polygon

I’ve got a vexing GIS analysis problem which is conceptually fairly straightforward, but in reality more challenging to figure out…. Basically, I need to calculate the VOLUME of floodwater within a 100 year floodplai, using ArcGIS 10.0 (all extensions available). My input datasets are:   * LiDAR DEM (1m pixel or 3m pixel) of bare ground (raster)   * 100 year floodplain (output of USACE HEC-RAS analysis), Polygon Shapefile, but attribute table has no useful content. So far I have overlaid the floodplain polygons over the LiDAR raster, [using Extract by Mask tool from Spatial Analyst], so that I have the ground elevations are along the outside edge of the floodplain (think of the top of the bathtub). Key concept is that the top of the floodplain gradually falls in elevation as you move from the headwaters down through the watershed. Then, (this seems to be the impossible part) I need to figure out how I can take the elevations along the outside edge pixels of the raster floodplain (output of previous Extract by Mask) and extend them to the equivalent elevation on the other side of the floodplain, and “raise” all the pixels in between the 2 outside edges of the floodplain to the “top level” of this 100-year floodplain. Once I have this “top elevation” of the floodplain water, I should be able to use the CUT AND FILL tools in ArcGIS to simply subtract the LiDAR ground elevations from the “top floodplain elevation” and compute a volume between these two rasters. I’ve been researching this for days and have yet to find a solution. Perhaps I’m thinking of this completely wrong? I would have expected to find others who have dealt with this problem, but while there are similar problems, none appear to offer a solution. Many thanks in advance!


Lightning Data Analysis

Hi I am new to model builder in GIS. I have two shapefiles, one is a polygon shapefile of all lightning caused fire in Alaska sine 1939 (~1500 polygons) and the second is a point shapefile with all recorded lightning strike since 1986 in Alaska (~10000 points). What I want to do is create a data/attribute table that outputs the following for varying time scale (1 day through 16 weeks): 1)If the fire had a lightning strike within it on the timescale specified and latitude/longitude of strike 2)If not what is the nearest strike and its distance (point (lightning) to centroid (fire polygon)or point to nearest edge) 3)Polarity of strike 4)Multiplicity of strike The attribute table I have for the lightning data has all strike lat/long, polarity, multiplicity. This is a flow chart of the analysis I want to do: select lightning and fire that falls in specified time (I have dates of both strikes and fire) --> determine if a strike was in the fire --> if yes then put the specified value from the lightning table into the new table along with fire ID --> If no find the nearest strike to the fire and its distance to the fire --> add specified values for this strike to same table What would the basic outline for a model that performs this flow look like? Are there any alternate methods to achieve this with such a large data set? I know this is a lot but any help would be greatly appreciated. Thanks


territory analysis

I want to determine the territories in which customers to a bank has the shortest path. It can be done with desktop software packages or programming if it is needed. Does anybody has idea on how to start doing it? I want to produce a map like this http://www.esri.com/industries/banking/business/~/media/Images/Content/industries/banking/graphics/DesireLineOverlay- lg.jpg and this map only the territories are important for me.


Python GDAL: find out spikes and pits in DEM

I'm working with on a DEM (Geotiff) in Python GDAL, and I'd like to find out the spikes or pits in my terrain.   I have no idea how to proceed, does anyone have good algorithm to help me out?   Thanks,   eo


Failure to display R script result plots in QGIS

I'm trying to run R scripts (3.0.2) from QGIS (2.0.1) on Windows 7 x64. There seems to be a known bug whereby the output results do not display in the QGIS GUI, but rather just an html path ending in *.html.png. I've managed to work around this by having my script end in               jpeg("file")     plot(x,y)     dev.off()      which outputs my plot to a jpeg file which I can open in windows. Does anyone know if there's a more appropriate work around which can take place within QGIS?


Topography: How to get the x,y,z coordinates of highest or lowest point/pixel of a raster GIS?

Given a .tiff topographic raster image with mountains and deep sea, I am looking for the x,y,z specifics of the highest or lowest point. The x,y,z values being:   * altitude (z-coordinate)   * latitude (y-coordinate)   * longitude (x-coordinate) While `gdalinfo raster.tif` would give a summary of the bounding box and the highest / lowest elevation values (see my previous question here, and note comments below), I would like to find the elevation, latitude, longitude of the highest and/or lowest pixels of my raster. Would be better if these values are got as isolated output integer. I think raster processing iterating on all pixels of the raster and keeping values of the z-highest point may be a good way to go.


Google maps api + Open layers

I need to open google maps in Latitude: -30.0330600 Longitude: -51.2300000. We report that the object map or call the api?                   <!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() {           // A classe Map espera dois argumentos "map_element" que o ID do elemento HTLML geralmente uma DIV e opções de mapa {key:value}      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"),      });           //Função de inicialização - google.maps.MapTypeId.ROADMAP (the default)      var google_streets = new OpenLayers.Layer.Google(         "Google Streets",         {numZoomLevels: 20}         );                 //Adiciona as camadas ao mapa     map.addLayers([google_streets]);                //Camada de controle que vai mostrar as camadas no mapa      map.addControl(new OpenLayers.Control.LayerSwitcher({}));                center = new google.maps.LatLong(-30.0330600,-51.230000);           if(!map.getCenter(center)){      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: 50px; height: 500px;'>      </div>          </body>     </html>


Strange structures appear inside dry river in Egypt

Browsing Google maps site reveal some strange structures inside one of the dry rivers in Egypt near Quesser , what is really interesting is that those structures do not appear on Bing maps . Searching the internet does not shed light on the subject, also there are no photos present on the site. What could those structures be and why they appear on Google maps only? **Edit** If those structures have been built somewhere in between the two years window. What could those structures be? Is it possible to build structure like this in a given time span at a place like this or are there more structures like this in the world? If this structure serves as a bridge, I don't see any roads leading to it.


Embed map in a website

I am using arcgis server 10.0. I published a mxd file using arcgis manager resources. I see the web url `http://cosmic- dellt410:8399/arcgis/services/DD/MapServer` but it says get method not allowed. I noted that the wsdl get generated but not the rest api. Any idea why? How do I embed the map on my website?


Datums in compound CRSs

Is there some specific constraint regarding _vertical_ and _geodetic_ **datums** within a compound Coordinate Reference System (CRS)? E.g. if the ellipsoid model should be the same or not, or if the vertical datum can be barometric, etc. As also _engineering_ CRSs can be compound with geodetic 2D CRSs, then I don't believe there are such sort of constraints. Thanks for any comment.


From OSM to shape. Parsing problem

I'm working at OpenStreetMap project for android at the moment. I want to retrieve OSM data from my app(nodes, markers and paths) and convert it to shape file (.shp, .dbf and .shx). Later, I'll load it into ArcGIS editor. I've been investigating about it, and I have no clear idea if It's possible a direct conversion between this formats, or I have to step first on KML file and parse it in shape file. I actually don't know how to retrieve the OSM data to save a osm file for being treated. I've been looking for a library or something like that but I have no lucky. Can anyone give me a helping hand? Thanks in advance!


How to start developing with Jeppesen C-MAP?

I've just downloaded all the contents from the FTP of Jeppesen for their product called **C-MAP CM93**. I've been reading the documentation contained in the SDK folders, but I can't figure out how to start developing in C# or Java with it. Does anybody know what can I do? Where I can find a DLL? Any information on the Web? Thank you!


Can't change Data Frame display units in ArcMap 10

Last week, I went to View -> Data Frame Properties... -> General tab to change the data frame map display units from Decimal Degrees to Degrees Decimal Minutes. (the Map Units were still in Decimal Degrees, in fact it is greyed out and can't be changed) Today, I wanted to change the Display units back to Decimal Degrees, but after I click Apply and OK, the map status bar still shows coordinates in Degrees Decimal Minutes as I move my cursor around the map. I went back to Data Frame Properties and the Display units have reverted back to Degrees Decimal Minutes! Why is this happening, and what should I do? Thanks.


Relative hyperlink paths in ArcMap 10 Map Document Properties?

Is there a way to use relative paths (instead of absolute paths) in the "Hyperlink base" field in Map Document Properties for an ArcMap 10 map document? (I have "Store relative pathnames to data sources" checked, but somehow I still can't use relative pathnames in Hyperlink base)


How to read and write to .txt in layer properties, action tab?

I want to write a certain attribute to a .txt file using the action tab in the layer properties (combined with Hotlink). In the QGIS-2.2-UserGuide, on page 97, there is an example on how to do that in Linux (see image). What is the correct alteration of this for it to work in Windows? ![enter image description here](http://i.stack.imgur.com/2HEIy.jpg)


Geographic maps in ArcMap

I have OSM data in SHP format inside ArcMap 10. But in ArcMap they are stretched a lot East-West compared to what I see at www.openstreetmap.org. How can I change it in ArcMap? I am not looking for transforming the lat/long coordinates. MapInfo also shows the same SHP file like OSM do it.


Adding information from excel into ArcGIS

I am working in ArcGIS and have a excel sheet with data pertaining to properties. I want to add this data to a map in ArcGIS of which i have property boundaries as a shapefile? I have a common folio number between the two datasets. However I am a novice and all answers have been over my head. Please point me to a step by step process to inserting databases.


Export WebMap using PrintTask Failing Silverlight API

I am using a custom tool to export a webmap to PDF. The tool works successfully through ArcGIS 10.1. The problem crops up when consuming the tool through my Silverlight application using PrintTask. The tool works in an intermittent fashion i.e. sometimes it works, and sometimes it gives an error. I turned to ArcGIS Manager log and extracted the following error:               Traceback (most recent call last): File     "C:\arcgisserver\directories\arcgissystem\arcgisinput\Toolbox\ExportPDSitePlanPart.GPServer\extracted\v101\printingtoolbox\ExportPDSitePlan.py", line 48, in result = arcpy.mapping.ConvertWebMapToMapDocument(Web_Map_as_JSON, templateMxd) File "c:\program files\arcgis\server\arcpy\arcpy\mapping.py", line 234, in ConvertWebMapToMapDocument return webmap_tuple(*convertArcObjectToPythonObject(arcgisscripting._convertWebMapToMapDocument(webmap_json, template_mxd, notes_gdb, extra_conversion_options))) RuntimeError: Layer "PD Working Layer": Failed to create layer from service at http://10.58.161.70/arcgis/rest/serv...eatureServer/0. Layer "PD Working Layer": Failed to create layer from service at http://10.58.161.70/arcgis/rest/serv...eatureServer/0. Failed to execute (ExportSP). Failed to execute (ExportSP).      I can confirm that I can access the service from the same server where the tool is running. (i.e. 10.58.161.70). Can someone point me in the right direction? Thanks


Using Python script as precondition in ArcGIS ModelBuilder?

I have a model that has two preconditions, in which I need to figure out if there is a way to prioritize one precondition to 'run' prior to the second. Is anyone aware of any built-in ability to do so with Model Builder or that can suggest a work around? For instance, if I try to 'link' one precondition to another, I get the error "Can only connect a variable to a process", this is because my 'output' has a precondition that a python script needs to be run against it first, and then that output has the second precondition executed (but only once the original output has been altered by the Python script). ![enter image description here](http://i.stack.imgur.com/kfw3O.jpg)


Incomplete Data - Missing line segments from Oracle data

I have setup GeoServer 2.5.2 on Windows. Everything was going smoothly until I actually had to display my geometry data from an Oracle Database Table. Some lines are rendered but some are not rendered. The issue seems to be based on the type of lines (curves, etc). This issue does not happen if exporting from oracle to SqLite or Global Mapper. In that case, all lines are kept as in the original data from Oracle. The issue seems to be most likely with the oracle plugin (geoserver-2.5.2-oracle-plugin.zip). Has anyone else ran into this issue and if so, how did you manage to render everything coming from Oracle in GeoServer?


GRASS: populating attribute table with specific values

I have a vector map that includes 100 points. These points were created using `v.extract` to randomly sample a larger map of 10k points. As such, the 'cat' values range from 1 to more than 10k. What I would like to do is to update the attribute table by rescaling these values to 1 to 100. Here's what I've experienced. If I use               v.category input=pts100 output=foo option=del     v.category input=foo output=pts100 option=add --o      Then when the 'cat' values _appear_ rescaled when I print them with               v.category input=pts100 option=print      However, if I look at the dbtable with               db.select pts100      the 'cat' values have not changed (presumably because it is the key column). So I'm thinking I will need to add a new column using `v.db.addcol`, but I don't know how to specify the range of value to populate the new column. From what I can tell, I have to specify a single value. Ideas?


Joining table to shapefile with pyQGIS

Joining shapefiles is a relatively straightforward proess in QGIS using 'add vector join' in the layer properties menu. I can add a csv file as a vector layer, as well as a shapefile, and join the two using a common field. I would like to do a similar join using pyQGIS, however I can't seem to find any documentation on how to go about this. Is this possible to do programmatically using pyQGIS with 'add vector join' or the older 'Join by Attributes'? Or, alternately, might there be any other Python modules that might be able to merge a csv with a shapefile before loading as a map layer with pyQGIS?


How to correct the "Windows Activation Period has Expired" message on an Esri Amazon AMI?

I'm only getting this error with instances that were spun up with Esri AMIs. And I did find one post on the AWS forums (with no resolution) regarding this issue. Does anyone know what the troubleshooting/correction steps are for this issue? ~~I have not started any troubleshooting steps yet.~~   1. Restarted instance ( **No effect** ).   2. Checked KMS . ( **No KMS Issues** ).   3. Turned off firewall, modified C:\Program Files\Amazon\Ec2ConfigService\Settings\config.xml by setting `Ec2WindowsActivate` to `Enabled`.   4. Restarted Ec2Config service.   5. Success!    6. Turned firewall back on. ~~on but I still need to test the KMS...I probably still need to open up a port.~~   7. Firewall is back on and no issues. EDIT: AWS Forum Link: https://forums.aws.amazon.com/thread.jspa?threadID=119200 ![enter image description here](http://i.stack.imgur.com/SICQo.png)


QGIS 1.8 tries to use UTM in spite of geo projection file

I'm wrestling with a problem that I am sure I've created for myself, but cannot resolve.   I received a set of shapefiles that were expressed with UTM, and I want them to use lat/lon. QGIS will do the translation, of course, but there are hundreds of files and I didn't want to do this manually.   So I obtained the code for converting the UTM (N, Zone 14) to lat/lon and re- wrote the .shp files, taking care to change the bounding box values in the main header, the bounding box values in the record headers, and all the point values (these are polygons).   I replaced the .prj file with this, which reflects the constants I used in the conversion:               GEOGCS["GCS_North_American_1983",   DATUM["D_North_American_1983",    SPHEROID["GRS_1980",6378137,298.257222101]],    PRIMEM["Greenwich",0],    UNIT["Degree",0.0174532925199433]]      Yet QGIS treats the file as if it's UTM -- it displays nothing on the screen, and the cursor position is expressed as easting/northing. If I look at the layer properties, in the Metadata tab it shows this:               Extents:     In layer spatial reference system units : xMin,yMin 677384.09,4068257.57 : xMax,yMax   732884.09,4351757.57     Layer Spatial Reference System:     +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs      Am I correct that there appears to be dissonance between the min/max units and the projection? I cannot find anything that is telling QGIS to display this using UTM, but obviously,   I'm overlooking something.   GlobalMapper displays the file without complaint. Any thoughts on what I'm overlooking? Thanks.


How do I get and install the latest version of QGIS in Ubuntu?

I'd like to get the latest 64-bit dev build of QGIS on my Ubuntu setup. How exactly do I go about it? I assume it's some kind of arcane terminal command...


Different results given by PostGIS and MySQL?

I'm developing a spatial database of administrative areas. I started out with PostGIS, but as MySQL is being used in our other projects, I thought I would at least try to create a spatial-enabled MySQL database. However, spatial queries give me different results than PostGIS does. Let's say I have a query like this `SELECT nazev FROM orp as o, kraje as k WHERE Intersects(o.geom,k.geom) AND Within(Centroid(o.geom),k.geom) AND k.nazev = 'Nazev'`. It should return a list of administrative areas within a county with defined name (nazev). Instead, it gives me expected areas + areas that touch boundary of a county, but are not contained by this county. When I run the same query with PostGIS, I get the correct results. Have anyone ever faced this issue? I am using a national CRS (EPSG:102067) and have tried also with EPSG:4326 with same result. Isn't the implementation of the OGC spec the same as in PostGIS? Thanks for any hint.


WFS-T: changes not saved on an OpenLayers map

I have written a script allowing to display a few WMS and WFS layers and I want to make my 2 WFS layers editable. I have all my controls and can draw / modify / drag / delete my features but, on one of my layers, the changes are not saved, despite the saveStrategy set to "auto: true". I give my code here. The layer **adresspt_wfs** works fine, and the layer **bygg_ovr_wfs** can't save my new edits. If anyone has an idea?               var map;     var wmsurl = "http://localhost:8080/geoserver/wms";     var wfsurl = "http://localhost:8080/geoserver/wfs";     var projection = new OpenLayers.Projection("EPSG:900913");     var displayProjection = new OpenLayers.Projection("EPSG:4326");          function init() {       var bounds = new OpenLayers.Bounds(         1450000, 7490000, 1490000, 7510000);            var format = 'image/png';            var options = {         projection: projection,         displayProjection: displayProjection,         maxExtent: bounds,         units: 'm'       };            map = new OpenLayers.Map('map',options);            // All the base layers:            var osm = new OpenLayers.Layer.OSM('OpenStreetMap','',       { zoomOffset: 11, resolutions: [76.4370282714844,38.2185141357422,19.1092570678711,9.55462853393555,4.77731426696777,2.38865713348389,1.19432856674194] });            var gphys = new OpenLayers.Layer.Google(       "Google Physical",       {'sphericalMercator': true, minZoomLevel: 11, maxZoomLevel: 17, type: G_PHYSICAL_MAP});            var gstr = new OpenLayers.Layer.Google(       "Google Streets",       {'sphericalMercator': true, minZoomLevel: 11, maxZoomLevel: 17});            var ghyb = new OpenLayers.Layer.Google(       "Google Hybrid",       {'sphericalMercator': true, minZoomLevel: 11, maxZoomLevel: 17, type: G_HYBRID_MAP});            var gsat = new OpenLayers.Layer.Google(       "Google Satellite",       {'sphericalMercator': true, minZoomLevel: 11, maxZoomLevel: 17, type: G_SATELLITE_MAP});            var dem = new OpenLayers.Layer.WMS(       "ASTER Gdem", wmsurl,       { layers: 'ASTGTM2_N55E013_dem',           format: format,           srs:'EPSG:4326',           transparent:'false'       },       {isBaseLayer: true });            var nobase = new OpenLayers.Layer.WMS(       "No base map", wmsurl,       { layers: 'luma_project:background',         srs: 'EPSG:4326',         transparent: 'true'       },       {isBaseLayer: true, maxExtent: bounds, maxResolution: 'auto'});            // All the non-base layers (WMS):            var transportation = new OpenLayers.Layer.WMS(         "Lund transportation network", wmsurl,         { layers: 'lu_transportation',           format: format,           srs:'EPSG:4326',           transparent:'true',           zoomOffset: 11,         },         {isBaseLayer: false, visibility: true});            var adresspt = new OpenLayers.Layer.WMS(         "Adress points", wmsurl,         { layers: 'adresspt',           format: format,           srs:'EPSG:4326',           transparent:'true',           zoomOffset: 11         },         {isBaseLayer: false, visibility: false});            var bygg_ovr = new OpenLayers.Layer.WMS(         "Buildings", wmsurl,         { layers: 'bygg_ovr',           format: format,           srs:'EPSG:4326',           transparent:'true',           zoomOffset: 11         },         {isBaseLayer: false, visibility: false});            // All the non-base layers (WFS):            var styles = new OpenLayers.StyleMap({         "default": new OpenLayers.Style({         fillColor: '#ee9900'         }),         "select": new OpenLayers.Style({         fillColor: 'red'         })       });            var saveStrategy = new OpenLayers.Strategy.Save({auto:true});            var bygg_ovr_wfs = new OpenLayers.Layer.Vector("Buildings (edition)", {         stylemap: styles,         visibility: false,         strategies: [           new OpenLayers.Strategy.BBOX(),            saveStrategy           ],         protocol: new OpenLayers.Protocol.WFS({           url: wfsurl,           featurePrefix:"luma_project",           featureType: "bygg_ovr",           featureNS: "http://localhost:8080/luma_project",           srsName: "EPSG:900913",           geometryName: "the_geom",           version: "1.1.0"         })       });            var adresspt_wfs = new OpenLayers.Layer.Vector("Adress points (edition)", {         visibility: false,         strategies: [           new OpenLayers.Strategy.BBOX(),            saveStrategy           ],         protocol: new OpenLayers.Protocol.WFS({           url: wfsurl,           featurePrefix:"luma_project",           featureType: "adresspt",           featureNS: "http://localhost:8080/luma_project",           srsName: "EPSG:900913",           geometryName: "the_geom",           version: "1.1.0"         })       });            // Identification and edition of layers            // Edition            editControls = {         building_draw: new OpenLayers.Control.DrawFeature(bygg_ovr_wfs, OpenLayers.Handler.Polygon),         building_drag: new OpenLayers.Control.DragFeature(bygg_ovr_wfs),         building_modify: new OpenLayers.Control.ModifyFeature(bygg_ovr_wfs),         building_delete: new DeleteFeature(bygg_ovr_wfs, {title: 'Delete building'}),         building_click: new OpenLayers.Control.WMSGetFeatureInfo({             url: wmsurl,              title: 'Identify features by clicking',             layers: [bygg_ovr]         }),         building_hover: new OpenLayers.Control.WMSGetFeatureInfo({             url: wmsurl,              title: 'Identify features by hover',             layers: [bygg_ovr],             hover: true,             // defining a custom format options here             formatOptions: {                 typeName: 'bygg_ovr',                  featureNS: 'http://localhost:8080/luma_project'             }         }),         adresspt_draw: new OpenLayers.Control.DrawFeature(adresspt_wfs, OpenLayers.Handler.Point),         adresspt_drag: new OpenLayers.Control.DragFeature(adresspt_wfs),         adresspt_delete: new DeleteFeature(adresspt_wfs, {title: 'Delete adress point'}),         adresspt_click: new OpenLayers.Control.WMSGetFeatureInfo({             url: wmsurl,              title: 'Identify features by clicking',             layers: [adresspt]         }),         adresspt_hover: new OpenLayers.Control.WMSGetFeatureInfo({             url: wmsurl,              title: 'Identify features by hover',             layers: [adresspt],             hover: true,             // defining a custom format options here             formatOptions: {                 typeName: 'adresspt',                  featureNS: 'http://localhost:8080/luma_project'             }         })       };            for(var i in editControls) {         map.addControl(editControls[i]);         editControls[i].events.register("getfeatureinfo", this, showInfo);       }             // Add the layers on the map            map.addLayers([osm,gphys,gstr,ghyb,gsat,dem,nobase,transportation,bygg_ovr,bygg_ovr_wfs,adresspt,adresspt_wfs]);                 // Add the controls on the map            map.addControl(new OpenLayers.Control.Navigation());       map.addControl(new OpenLayers.Control.LayerSwitcher());       map.addControl(new OpenLayers.Control.OverviewMap());       map.addControl(new OpenLayers.Control.Scale($('scale')));             map.addControl(new OpenLayers.Control.MousePosition({element: $('location')}));                  map.zoomToExtent(bounds);               } // End of init()          function showInfo(evt) {            $('responseText').innerHTML = evt.text;     } // End of showInfo()               function toggleControlEdit(element) {       for(key in editControls) {         var control = editControls[key];         if(element.value == key && element.checked) {           control.activate();         }          else {           control.deactivate();         }       }     } // End of toogleControlEdit()          // This control has been found here:     // http://www.peterrobins.co.uk/it/oledit.html          DeleteFeature = OpenLayers.Class(OpenLayers.Control, {      initialize: function(layer, options) {         OpenLayers.Control.prototype.initialize.apply(this, [options]);         this.layer = layer;         this.handler = new OpenLayers.Handler.Feature(             this, layer, {click: this.clickFeature}         );     },     clickFeature: function(feature) {         // if feature doesn't have a fid, destroy it         if(feature.fid == undefined) {             this.layer.destroyFeatures([feature]);         } else {             feature.state = OpenLayers.State.DELETE;             this.layer.events.triggerEvent("afterfeaturemodified", {feature: feature});             feature.renderIntent = "select";             this.layer.drawFeature(feature);         }     },     setMap: function(map) {         this.handler.setMap(map);         OpenLayers.Control.prototype.setMap.apply(this, arguments);     },     CLASS_NAME: "OpenLayers.Control.DeleteFeature"     }) // End of DeleteFeature      Thanks in advance!


How to create a custom projection of PRS92 and UTM 51N for the Philippines?

> **Possible Duplicate:**   >  How to define new custom projections in QGIS? How do I create a customized CRS parameter in quantum GIS? I'm try to create a projection of PRS92 and UTM 51N. This projection is for the philippines. Thanks!


Sensitivity of Garmin eTrex 30

I have a very good experience with Garmin eTrex Legend HCx - here and here they write that HCx has a very sensitive chip, that works in forest, deep valleys and in cities - and I can only confirm - **with HCx I was able to get my position in plane!** **How sensitive is eTrex 30, related to HCx? Have you been able to catch satellites in room / plane / in a narrow street?** eTrex 30 doesn't say to be that sensitive at garmin website. (Could HCx then be more precise/usable in these conditions despite eTrex 30 supporting GLONASS?)


How do I change my title of app?

We have a map with streets as basemap. We have been trying unsuccessfully, for the last two days to change the basemap to tiled layer with no success at all. I am posting a snippet because script is long. Please let me know if you need additional script. On the surface, it looks simple but it has been extremely challenging. Your generous help is greatly appreciated in advance.


Finding percent landcover types with points or polylines

I'm using ArcMap 10.1. I had an orthophoto of an old study site. I traced two polygon shapefiles from this photo- one of "fields" and one of "forest". I made a point shapefile of the sampling points, and a polyline shapefile of all possible paths between the sample points. If a butterfly were to fly from one sample point to another (assuming linear flight along the polylines), I am looking to determine; a) what percent of that flight distance was through field, b) what percent of that flight distance was through forest and c) how many times that individual had to cross a forest/field edge. I haven't used GIS since my intro class many years ago, and I can't even figure out the correct vocabulary to search for the answer myself. Any and all help is greatly appreciated! Even if you don't know how to do this, suggestions of what to search for are equally appreciated!


measuring adjacency between polygons

I am working with some land ownership data. I would like to identify parcels the have small adjacency between other parcels. In a nutshell I want to identify where there is a small overlap between sections. In the example below you can see where one section overlaps another by a small amount of about 15 meters. In most situations this value of overlap is zero. ![enter image description here](http://i.stack.imgur.com/3p0Zy.jpg) Any suggestions how I can detect these situations? I am on arc 10.2 with Spatial Analyst.


pyproj, proj4 doesn't return same coordinates after inverse conversion

I'm trying to interpolate between coordinates, as a step in that process I convert latlong to UTM so I can work in metric. I don't get the expected latlong when converting back, reproduced below:               >>> import pyproj     >>> pyproj.__version__     '1.9.2'     >>> p = pyproj.Proj("+proj=utm +zone=33 +north +ellps=WGS84 +datum=WGS84 +units=m +no_defs")     >>> p(58.4, 15.6)     (5579373.890337878, 2328887.997220567)     >>> p(*p(58.4, 15.6), inverse=True) # Should return (58.4, 15.6)     (58.284316956873305, 15.63501250163002)      Is there a good explanation for this? How do I do what I want without this issue?


Updating filter values and update map

I'm developing an ExtJS3.4-GeoExt1-OpenLayers2.12 GIS application. For basic functionality I need to filter layers to get specific data from a Geoserver WFS layer. Filter is done through the variable myVar as a filter value as it follows: First Filter:               customFilter = new OpenLayers.Filter.Logical({        filters: [            new OpenLayers.Filter.Comparison({                type: OpenLayers.Filter.Comparison.EQUAL_TO,                   property: 'myCode',                   value: myVar            })         ]      });      Then the WFS Layer:               wfsLayer = new OpenLayers.Layer.Vector("LayerName", {           protocol: new OpenLayers.Protocol.WFS({                url: "http://localhost:8080/geoserver/wfs",            featureType: "LayerName",            featureNS: "http://localhost:8080/project",            featurePrefix: "schema",            geometryName: "the_geom",            outputFormat: "json",            readFormat: new OpenLayers.Format.GeoJSON(),            srsName: 'EPSG:25831',            defaultFilter: customFilter         }),         strategies: [new OpenLayers.Strategy.Fixed(),             myStrategy         ]     });      And add it to the map:               map.addLayer(wfsLayer);      This works with a pre-set myVar variable before running the app. My idea is that when myVar is changed dinamicaly in my app (this is done), wfs layer updates its filter value too so map data is updated. I've tried refreshing layer as myLayer.refresh() when myVar has been changed on my app but it still takes the initial myVar value so data in the map does not change. Anyone knows?


Create circles around a point on a map measuring the radius in hours

Disclaimer: I am not experienced in GIS and hope this question fits in this category. I was wondering whether it is somehow possible to create a circle* around a city, using Google Maps or the like, whilst the circle is not measured in miles (or other distance measure) but in hours of driving. The background is the following: I am looking for an ideal location to live if I have to commute between two different places. Ideally one place should be within a ~15 minute range and the other place in a ~45 minute range. I can't find an intersection manually. If there is an automated way how to do this, I could experiment with my parameters to find the ideal place. Any ideas? *Obviously it won't result in a circle.


WFS filter for Point in polygon (PIP) query

I am trying to construct a wfs request. I want to determine if a certain point is within a polygon. The point coordinates I want to send via the WFS request. The polygon is saved as a layer on my geoserver. How does a WFS request like this look like. My request looks like this, but I am getting an error:               http://myserver.com:8080/geoserver/mapicture/ows?service=WFS&version=2.0.0&request=GetFeature&typeName=mystore:dk_ger_nowater&cql_filter=INTERSECT(geom,%20POINT%20(55.689972%10.239258      The error says:               error on line 4 at column 160: xmlParseCharRef: invalid xmlChar value 16


Interpreting Moran's I results

I have a sample of data taken from regions of a country! i want to test if there are any spatial autocorrelation on my data using Moran Indice test. the null hypothesis: is that there is no spatial autocorrelation here a sample of my data: ![sample data for my variable with locations coordinates](http://i.stack.imgur.com/Xl9np.png) i used this steps to calculate it on r: library(RODBC) > setwd('e:/r/moran') > > channel <- odbcConnectExcel('moran.xls') > > data <- sqlFetch(channel, 'wilaya') > > inf.dists <- as.matrix(dist(cbind(lon=data$Lon, lat=data$Lat))) > > inf.dists.inv <- 1/inf.dists > > diag(inf.dists.inv) <- 0 > > library(ape) > > Moran.I(data$year2009, inf.dists.inv) and i got these results: $observed -0.02229578 $expected -0.02702703 $sd 0.03455708 $p.value 0.8911011 the $observed ~= $expected and they are negative! does that mean there is a little dispersion! but we cannot reject the null hypothesis, so there is no spatial autocoorelation between the regions! the problem is that i'm not sure about my interpretation ? and i want to know if the method i used for calculating the weight matrix for moran.I function is right?


Automatically create polygons from top right and bottom left coordinates?

I have a CSV file with hundreds of records. Each record contains 2 matching coordinates, 1) top right corner of a rectangle, 2) bottom left corner of a rectangle.               Polygon ID, Lat 1,       Lat 2,       Long 1,       Long 2               1,          27o 28' 28", 27o 33' 30", 86o 06' 04",  86o 15' 00"      Is there a method which I can use to automate the creation of these polygons? I anticipate there being a few steps.


UTFGrid from raster source

Is it possible to make utfgrids from a raster source (e.g. GeoTIFF)? I am trying to get utfgrids from a .tif with mapnik.xml and TileStache but it seems not to be working. As a workaround I am polygonizing the tif to a shape which works well but is not very efficient. Has anyone experince with this question? Maybe with other tileservers? This would be an example for the TileMill generated mapnik.xml I am working with:               <?xml version="1.0" encoding="utf-8"?>     <!DOCTYPE Map[]>     <Map srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over" maximum-extent="-20037508.34,-20037508.34,20037508.34,20037508.34">          <Parameters>       <Parameter name="bounds">5,43,18,50</Parameter>       <Parameter name="center">16.7693,48.4365,9</Parameter>       <Parameter name="format">png8</Parameter>       <Parameter name="minzoom">0</Parameter>       <Parameter name="maxzoom">15</Parameter>       <Parameter name="scale">1</Parameter>       <Parameter name="metatile">2</Parameter>       <Parameter name="id"><![CDATA[test]]></Parameter>       <Parameter name="_updated">1409125380000</Parameter>       <Parameter name="name"><![CDATA[tmp2m_2_grid]]></Parameter>       <Parameter name="tilejson"><![CDATA[2.0.0]]></Parameter>       <Parameter name="scheme"><![CDATA[xyz]]></Parameter>     </Parameters>               <Style name="utf_grid" filter-mode="first">       <Rule>         <RasterSymbolizer opacity="1" scaling="near"/>       </Rule>     </Style>     <Layer name="utf_grid"       srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over">         <StyleName>utf_grid</StyleName>         <Datasource>            <Parameter name="file"><![CDATA[/path/to/test.tif]]></Parameter>            <Parameter name="band"><![CDATA[1]]></Parameter>            <Parameter name="type"><![CDATA[gdal]]></Parameter>         </Datasource>       </Layer>          </Map>


Can you use ArcObjects in an MVC service at v10.1

I'm slighlty confused with the changes at 10.1 and understand this version no longer supports DCOM or remote arcobjects. Can you use ArcObjects in a webservice (in my case a .NET MVC 4 service) that is deployed on the ArcGIS Server host (so not remote) and uses ArcObjects to perform editing on a gdb featureclass? Or is the only way to go through the SOE framework? If you can use ArcObjects in the .NET MVC service are there any ramifications of doing so over using an SOE?


ArcGIS10 VBA requires library references

I just upgraded from ArcGIS 9.2 to 10.0, and I'm trying to create some tools using VBA. It doesn't recognize any of the ArcObjects Classes, Interfaces, or Constants unless the reference includes its library name. For example:               Dim pMxDoc as IMxDocument     Set pMxDoc = ThisDocument      doesn't work, but               Dim pMxDoc As esriArcMapUI.IMxDocument     Set pMxDoc = Project.ThisDocument      does. Does anyone know how to fix this? (FYI I have no admin capabilities on this computer.)


Polygon creation (Clockwise rotation or not)

According to "ESRI Shapefile Technical Description An ESRI White Paper—July 1998", Vertices for a single, ringed polygon are, therefore,always in clockwise order. Otherwise,"Dirty" polygons occur when the rings that define holes in the polygon also go clockwise, which causes overlapping interiors. In my understanding, you can create donuts polygon with "avoid intersection of new polygons" is checked on snapping option, even if both polygon(inner and outer) are created clockwise roated. It has not necessary to care about clockwise rotation when you create polygon in QGIS. Is this a right understanding?? Any advice are welcome!


How to compute and fill One-way field in a street shapefile according spacial position

I think it is something complicate, but I hope someone could bring up any idea about. I'm using ArcGIS10, and I have a "One-way roads" shapefile with a One-way field with Y/N. But **I need to create a new Field for this layer containing F or T if** :   * **F :** The final point of the line is Northern and Western than the origin of the line.   * **T :** The final point of the line is Southern and Eastern than the origin of the line.  An example,![Example](http://i.stack.imgur.com/p9vAR.png) Another Example: ![Example2](http://i.stack.imgur.com/qi1AL.png) Thanks for your time,


Geometry valid in PostGIS turns out to be not valid in Oracle

Geometry is in PostgreSQL database. It is valid. Geometry is exported as GML and then inserted into Oracle database. Then function SDO_UTIL.RECTIFY_GEOMETRY(geometry, tolerance) is called, which reports geometry as being not valid. More exactly, function               sdo_geom.validate_geometry_with_context(geometry, tolerance)       gives error               13367 [Element <1>] [Ring <1>].      I understand that Oracle uses tolerance, which means that Oracle sees some points as being same, which will cause errors. Using different tolerance makes errors go away. However changing tolerance is not an option, because I need application to work with the given tolerance. What should I do with geometries in PostGIS to ensure that they will be valid in Oracle after importing to Oracle? (provided I know the tolerance that will be used in Oracle beforehand). Examples:               select sdo_geom.validate_geometry_with_context(SDO_UTIL.FROM_GMLGEOMETRY('<gml:Polygon xmlns:gml="http://www.opengis.net/gml" srsName="EPSG:3301"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>564588.6,6438154.86 564592.9,6438149.4 564595.88,6438139.8 564604.32,6438069.13 564602,6438066.15 564595.38,6438064 564594.06,6438060.03 564593.56,6438047.95 564591.74,6438043.64 564573.37,6438036.69 564555.16,6438032.56 564549.87,6438033.55 564547.55,6438037.69 564546.23,6438043.98 564544.24,6438046.95 564540.1,6438047.78 564534.48,6438047.62 564531.83,6438046.13 564531.5,6438042.49 564533.65,6438024.45 564537.62,6438009.39 564540.44,6438003.43 564543.41,6438002.1 564546.89,6438001.44 564591.08,6438005.25 564604.32,6438006.24 564609.62,6438005.41 564609.85,6438005.02 564609.86,6438004.96 564611.6,6438002.1 564613.26,6437992.84 564616.9,6437964.04 564617.73,6437958.74 564616.9,6437952.12 564614.06,6437948.97 564582.31,6437943.02 564500.38,6437928.29 564433.52,6437916.54 564333.64,6437898.53 564243.69,6437883.77 564217.87,6437877.64 564209.59,6437878.47 564201.81,6437885.09 564197.51,6437893.53 564193.37,6437904.95 564184.27,6437928.45 564171.69,6437951.46 564164.24,6437960.73 564157.13,6437974.46 564142.56,6437999.79 564127.67,6438030.24 564126.18,6438036.69 564128,6438040.83 564131.47,6438043.31 564136.61,6438043.15 564145.54,6438041.33 564153.65,6438041.66 564175.83,6438043.81 564193.87,6438046.29 564277.45,6438055.89 564300.12,6438061.85 564342.49,6438075.26 564452.88,6438112.66 564509.65,6438131.36 564521.73,6438131.86 564526.2,6438127.89 564528.35,6438117.96 564531.33,6438113.16 564535.47,6438112.49 564549.37,6438116.3 564555.5,6438121.6 564559.63,6438134.34 564564.6,6438141.62 564571.72,6438142.78 564575.52,6438144.93 564578.17,6438150.89 564582.64,6438154.86 564588.6,6438154.86</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs><gml:innerBoundaryIs><gml:LinearRing><gml:coordinates>564609.86,6438004.96 564609.58,6438005.41 564605.53,6438006.05 564607.18,6438005.22 564609.91,6438004.57 564609.86,6438004.96</gml:coordinates></gml:LinearRing></gml:innerBoundaryIs><gml:innerBoundaryIs><gml:LinearRing><gml:coordinates>564607.18,6438005.22 564606.51,6438005.37 564609.03,6438004.27 564607.18,6438005.22</gml:coordinates></gml:LinearRing></gml:innerBoundaryIs><gml:innerBoundaryIs><gml:LinearRing><gml:coordinates>564584.79,6438130.2 564579.49,6438131.2 564576.18,6438131.03 564571.88,6438129.04 564572.21,6438125.4 564575.52,6438124.25 564578.17,6438123.25 564580.32,6438122.59 564583.63,6438122.59 564585.29,6438124.08 564586.45,6438127.06 564584.79,6438130.2</gml:coordinates></gml:LinearRing></gml:innerBoundaryIs><gml:innerBoundaryIs><gml:LinearRing><gml:coordinates>564574.49,6438043.78 564573.81,6438043.92 564565.46,6438041.86 564565.87,6438040.02 564566.08,6438038.24 564566.56,6438038.17 564574.91,6438040.22 564574.91,6438040.43 564574.49,6438043.78</gml:coordinates></gml:LinearRing></gml:innerBoundaryIs><gml:innerBoundaryIs><gml:LinearRing><gml:coordinates>564418.96,6437980.92 564414.32,6437981.75 564410.02,6437980.92 564404.72,6437979.1 564401.41,6437974.96 564400.25,6437970.49 564402.57,6437968.01 564405.55,6437966.02 564411.18,6437963.87 564415.65,6437963.54 564419.62,6437964.7 564422.43,6437968.01 564424.09,6437972.15 564422.93,6437977.28 564418.96,6437980.92</gml:coordinates></gml:LinearRing></gml:innerBoundaryIs></gml:Polygon>'), 0.005) from dual;               select SDO_UTIL.RECTIFY_GEOMETRY(SDO_UTIL.FROM_GMLGEOMETRY('<gml:Polygon xmlns:gml="http://www.opengis.net/gml" srsName="EPSG:3301"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>564588.6,6438154.86 564592.9,6438149.4 564595.88,6438139.8 564604.32,6438069.13 564602,6438066.15 564595.38,6438064 564594.06,6438060.03 564593.56,6438047.95 564591.74,6438043.64 564573.37,6438036.69 564555.16,6438032.56 564549.87,6438033.55 564547.55,6438037.69 564546.23,6438043.98 564544.24,6438046.95 564540.1,6438047.78 564534.48,6438047.62 564531.83,6438046.13 564531.5,6438042.49 564533.65,6438024.45 564537.62,6438009.39 564540.44,6438003.43 564543.41,6438002.1 564546.89,6438001.44 564591.08,6438005.25 564604.32,6438006.24 564609.62,6438005.41 564609.85,6438005.02 564609.86,6438004.96 564611.6,6438002.1 564613.26,6437992.84 564616.9,6437964.04 564617.73,6437958.74 564616.9,6437952.12 564614.06,6437948.97 564582.31,6437943.02 564500.38,6437928.29 564433.52,6437916.54 564333.64,6437898.53 564243.69,6437883.77 564217.87,6437877.64 564209.59,6437878.47 564201.81,6437885.09 564197.51,6437893.53 564193.37,6437904.95 564184.27,6437928.45 564171.69,6437951.46 564164.24,6437960.73 564157.13,6437974.46 564142.56,6437999.79 564127.67,6438030.24 564126.18,6438036.69 564128,6438040.83 564131.47,6438043.31 564136.61,6438043.15 564145.54,6438041.33 564153.65,6438041.66 564175.83,6438043.81 564193.87,6438046.29 564277.45,6438055.89 564300.12,6438061.85 564342.49,6438075.26 564452.88,6438112.66 564509.65,6438131.36 564521.73,6438131.86 564526.2,6438127.89 564528.35,6438117.96 564531.33,6438113.16 564535.47,6438112.49 564549.37,6438116.3 564555.5,6438121.6 564559.63,6438134.34 564564.6,6438141.62 564571.72,6438142.78 564575.52,6438144.93 564578.17,6438150.89 564582.64,6438154.86 564588.6,6438154.86</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs><gml:innerBoundaryIs><gml:LinearRing><gml:coordinates>564609.86,6438004.96 564609.58,6438005.41 564605.53,6438006.05 564607.18,6438005.22 564609.91,6438004.57 564609.86,6438004.96</gml:coordinates></gml:LinearRing></gml:innerBoundaryIs><gml:innerBoundaryIs><gml:LinearRing><gml:coordinates>564607.18,6438005.22 564606.51,6438005.37 564609.03,6438004.27 564607.18,6438005.22</gml:coordinates></gml:LinearRing></gml:innerBoundaryIs><gml:innerBoundaryIs><gml:LinearRing><gml:coordinates>564584.79,6438130.2 564579.49,6438131.2 564576.18,6438131.03 564571.88,6438129.04 564572.21,6438125.4 564575.52,6438124.25 564578.17,6438123.25 564580.32,6438122.59 564583.63,6438122.59 564585.29,6438124.08 564586.45,6438127.06 564584.79,6438130.2</gml:coordinates></gml:LinearRing></gml:innerBoundaryIs><gml:innerBoundaryIs><gml:LinearRing><gml:coordinates>564574.49,6438043.78 564573.81,6438043.92 564565.46,6438041.86 564565.87,6438040.02 564566.08,6438038.24 564566.56,6438038.17 564574.91,6438040.22 564574.91,6438040.43 564574.49,6438043.78</gml:coordinates></gml:LinearRing></gml:innerBoundaryIs><gml:innerBoundaryIs><gml:LinearRing><gml:coordinates>564418.96,6437980.92 564414.32,6437981.75 564410.02,6437980.92 564404.72,6437979.1 564401.41,6437974.96 564400.25,6437970.49 564402.57,6437968.01 564405.55,6437966.02 564411.18,6437963.87 564415.65,6437963.54 564419.62,6437964.7 564422.43,6437968.01 564424.09,6437972.15 564422.93,6437977.28 564418.96,6437980.92</gml:coordinates></gml:LinearRing></gml:innerBoundaryIs></gml:Polygon>'), 0.005) from dual;      EDIT: Added error message shown by Oracle.


What is the ruler accuracy in Google Earth Pro?

I use Google Earth Pro (7.1) on a daily basis to assess the acreage of US agricultural fields using the GE ruler. What is the accuracy we can expect from Google Earth Pro for surface calculation? (the fields don't always have simple shapes and are sometimes in remote areas) I found a few threads that partially cover this topic. But I didn't find any clear answer. Thank you


How to create polygons in ArcMap 10.0 using lat/long data from SQL Server 2008 database?

Forgive me if this is very basic, as I'm new to GIS work (though I've been a programmer for 10 years) and so I'm not really sure how to approach this, but here goes... Can I take a table with xmin/xmin ymin/ymax coordinates and use it to create a bunch of polygons in ArcMap 10.0? I have a connection set up to SQL Server 2008 wherein there is a table that has several pieces of information regarding various maps that our team keeps track of. Here's what I'm working with: Said table contains the lat/long data in the form of xmin/xmax ymin/ymax, in addition to several other attributes - gmap_id, author, year, scale, etc. My boss asked me if I could create a connection to our SQL Server, use that information to create polygons on a map of the US, and set up a little attribute window with the other information (author, gmap_id, scale, etc) for each polygon. I've got the first part covered, I think, thanks to this question. I set up the Data Query and pulled the columns that I initially wanted from SQLServer. That gave me a table like so: I had a screen cap but the image won't post due to my rep < 10, so the table looks like:               gmapId, scale, usgsIdF, xmin, xmax, ymin, ymax     18015, 250000, 13139, -121.891, -123.071, 43, 45.5     18016, 125000, 13140, -117, -118.936, 34.25, 35.624     ...      And I now have the data listed as a Source under the Table of Contents window. How can I now translate that information into a bunch of squares on the map? And then can I use that to set up an attribute table? I have a lot of python experience, so if that is the way to go I can do it. I am also good with SQL Server 2008, though I have not used it's spatial capabilities yet. So if there is a solution to be had involving TSQL I can also go that route. I'm just scratching around trying to figure a good way to start.


How to get raster corner coordinates using Python GDAL bindings?

Is there a way to get the corner coordinates (in degrees lat/long) from a raster file using gdal's Python bindings? A few searches online have convinced me that there is not, so I have developed a work around by parsing the gdalinfo output, it's somewhat basic but I thought it might save some time for people who might be less comfortable with python. It also only works if gdalinfo contains the geographic coordinates along with the corner coordinates, which I don't believe is always the case. Here's my workaround, does anyone have any better solutions? gdalinfo on an appropriate raster results in something like this midway through the output:               Corner Coordinates:     Upper Left  (  -18449.521, -256913.934) (137d 7'21.93"E,  4d20'3.46"S)     Lower Left  (  -18449.521, -345509.683) (137d 7'19.32"E,  5d49'44.25"S)     Upper Right (   18407.241, -256913.934) (137d44'46.82"E,  4d20'3.46"S)     Lower Right (   18407.241, -345509.683) (137d44'49.42"E,  5d49'44.25"S)     Center      (     -21.140, -301211.809) (137d26'4.37"E,  5d 4'53.85"S)      This code will work on files who's gdalinfo look like that. I believe sometimes the coordinates will be in degrees and decimals, rather than degrees, minutes and seconds; it ought to be trivial to adjust the code for that situation.               import numpy as np     import subprocess          def GetCornerCoordinates(FileName):         GdalInfo = subprocess.check_output('gdalinfo {}'.format(FileName), shell=True)         GdalInfo = GdalInfo.split('/n') # Creates a line by line list.         CornerLats, CornerLons = np.zeros(5), np.zeros(5)         GotUL, GotUR, GotLL, GotLR, GotC = False, False, False, False, False         for line in GdalInfo:             if line[:10] == 'Upper Left':                 CornerLats[0], CornerLons[0] = GetLatLon(line)                 GotUL = True             if line[:10] == 'Lower Left':                 CornerLats[1], CornerLons[1] = GetLatLon(line)                 GotLL = True             if line[:11] == 'Upper Right':                 CornerLats[2], CornerLons[2] = GetLatLon(line)                 GotUR = True             if line[:11] == 'Lower Right':                 CornerLats[3], CornerLons[3] = GetLatLon(line)                 GotLR = True             if line[:6] == 'Center':                 CornerLats[4], CornerLons[4] = GetLatLon(line)                 GotC = True             if GotUL and GotUR and GotLL and GotLR and GotC:                 break         return CornerLats, CornerLons           def GetLatLon(line):         coords = line.split(') (')[1]         coords = coords[:-1]         LonStr, LatStr = coords.split(',')         # Longitude         LonStr = LonStr.split('d')    # Get the degrees, and the rest         LonD = int(LonStr[0])         LonStr = LonStr[1].split('\'')# Get the arc-m, and the rest         LonM = int(LonStr[0])         LonStr = LonStr[1].split('"') # Get the arc-s, and the rest         LonS = float(LonStr[0])         Lon = LonD + LonM/60. + LonS/3600.         if LonStr[1] in ['W', 'w']:             Lon = -1*Lon         # Same for Latitude         LatStr = LatStr.split('d')         LatD = int(LatStr[0])         LatStr = LatStr[1].split('\'')         LatM = int(LatStr[0])         LatStr = LatStr[1].split('"')         LatS = float(LatStr[0])         Lat = LatD + LatM/60. + LatS/3600.         if LatStr[1] in ['S', 's']:             Lat = -1*Lat         return Lat, Lon          FileName = Image.cub     # Mine's an ISIS3 cube file.     CornerLats, CornerLons = GetCornerCoordinates(FileName)     # UpperLeft, LowerLeft, UpperRight, LowerRight, Centre     print CornerLats     print CornerLons      And that gives me:               [-4.33429444 -5.82895833 -4.33429444 -5.82895833 -5.081625  ]      [ 137.12275833  137.12203333  137.74633889  137.74706111  137.43454722]


Adding a new field in ArcMap from data of an existing field

I want to create a new field with years data. There is an existing field with the timestamp YYYYMMDDHHMM. But I just want the years from that field to the new field. That way I can display just the years when I create a graph. IS there anyone that can explain the code to do this. I am not a programmer and need the scripts or python code explained as if I were a 5-year old. Thank you.


ArcPy / ArcMap 10.2: How to report data to user?

I'm developing an arcpy addin with ArcMap 10.2 that outputs a feature layer based on user input. How can I display attributes from this layer in a MessageBox or other reporting mechanism? I don't want to enable data driven pages, so dynamic tables don't seem to be an option. I'm sure there's an easy solution out there. Ideas? Thanks! Katie


QGIS python plugin: PyQGIS for spatial join

For a QGIS 2.0 and 2.2 Python plugin, I am trying to update one layer's field attribute with another layer's field attribute based on geometry function QgsGeometry.within(). My first layer is a point layer, the second layer is a buffer of a vector polyline layer containing azimuth measurements. I would like to update the point layer to include azimuth information of the buffer polygon it is within (essentially a spatial join). It is to automatize the process described here: How to horizontally align irregularly shaped point symbol to vector layer in QGIS?. Currently, I'm not getting an error, but nothing is happening either.               rotateBUFF = my buffer polygon layer     pointLayer = my point layer to obtain azimuth data          rotate_IDX = rotateBUFF.fieldNameIndex('bearing')     point_IDX = pointLayer.fieldNameIndex('bearing')     rotate_pr = rotateBUFF.dataProvider()     point_pr = pointLayer.dataProvider()     rotate_caps = rotate_pr.capabilities()     point_caps = point_pr.capabilities()     pointFeatures = pointLayer.getFeatures()     rotateFeatures = rotateBUFF.getFeatures()          for rotatefeat in rotateFeatures:         for pointfeat in pointFeatures:             if pointfeat.geometry().within(rotatefeat.geometry()):                 pointID = pointfeat.id()                 if point_caps & QgsVectorDataProvider.ChangeAttributeValues:                     bearing = rotatefeat.attributes()[rotate_IDX]                     attrs = {point_IDX : bearing}                     point_pr.changeAttributesValues({pointID : attrs})


postgis st_linemerge based on attribute

I have a postgis table full of very small line segments. I would like to merge them according to an attribute in another field. update line_table set the_geom = ST_LineMerge(the_geom); but how do I do this according to the attribute so that all the small segments with name="west" are joined, and those with name="north" are all joined etc? Thanks for any help, Robert


Creating a model to run a complex query

I'm just a rookie when it comes to creating models in ArcGIS. I have two shapefiles from which I need to calculate an AVG and a MAX erosion rate for individual properties. The two shapefiles are: Coastal_Properties & Coastal_Change Coastal_Properties has a Property ID (PID), and Coastal_Change has a Rate of erosion in metres per year (RChngMYr). I'd like to retrieve an **Average and a Max RChngMYr for each individual PID** in the data-set. I have no problem running this query using SQL select in MapInfo, but am unsure how to go about it in ArcGIS. It will be better in the long run to create a model in Arc as Property boundaries are dynamic, and it would be terrible to have to run the query in MapInfo everyday. I'd like to create a Geoprocess service from this model and use it in a web application where it would return a phrase such as "The Max erosion rate for PID 12345 is 3.1 m/yr". Any help is appreciated! Thanks in advance


ToolValidator not doing anything

I have created a simple script tool which has a single parameter of type "String". I have written the tool validation to disable the input field (simply trying to learn tool validation). The validator code is as follows:               class ToolValidator:            def __init__(self):         import arcpy         self.params = arcpy.GetParameterInfo()            def initializeParameters(self):         self.params[0].Enabled = 0         return            def updateParameters(self):         return            def updateMessages(self):         return      Unfortunately, when I open the tool, the field is not disabled (as I expect it should be). Any ideas what I'm missing? SOLUTION: In case it's not clear in the threads below. The solution to the issue was to change Enabled to enabled, which is a case change between ArcGIS 9.3 and 10.0. This capitalization works correctly both in the initializeParameters method and the updateMessages method.


Python Script that calls the Voronoi Polygons Function?

I've been looking to see if there was a way to call Voronoi Polygons function found in Vector/Geometry Tools, directly from the code but I have not found one. Does this currently exist? Is there a way to call these functions within python coding?


How to flash a JSAPI map graphic only when contained in map extent

Using ESRI JSAPI 3.7 I'm flashing a graphic that works fine when the graphic is located within the bounds of the map extent (is visible). However, when you move the map so the graphic is located out of the map extent and try to flash, it throws the following error: "0x800a139e - JavaScript runtime error: lang.hitch: scope["setStroke"] is null (scope="[object Window]")". Here's the function I'm using. Can someone suggest maybe a way to flash only if the graphic is located onscreen? Thanks in advance!               function animateGraphic(graphicFlash) {                                               setTimeout(lang.partial(function (animateMe) {                            var shape = animateMe.getDojoShape();                            fx.animateStroke({                                shape: shape,                                duration: 500,                                color: { start: "yellow", end: [0,255,255] },                                width: { start: 25, end: 15 }                            }).play();                        }, graphicFlash), 100);                    }


Creating clumps of cells in a raster from seeds of 1 cell (in ArcGIS)

I need a process similar to that described in JPD's question: Creating randomly shaped clumps of cells in a raster from seeds of 1 cell/pixel? I have a raster with semi-randomly dispersed "seed" cells with values ranging from 1 to 19. I would prefer a function possible in ModelBuilder of ArcGIS, as this will be added to an already existing model.


How does QGIS Topology Checker check the topology of SHP and OSM files?

1. Can anybody make me clear if .shp & .osm (OpenStreetMap Data) are holding topological data/relations or not.    2. if .shp files are not holding then how qgis plugin topology checker checks for the topology of these files.


Pyshp 1.2 example from documentation fails

I must be doing something really stupid because I am trying to run an example straight from the PyShp (shapefile.py) 1.2 documentation with the only change being the input shapefile and it is failing. Note that it is 32bit Python 2.6 on Server 2008 R2 64bit. The code:               import shapefile     e = shapefile.Editor(shapefile="F:/data/IntermediateWorkspace/5day_pgn.shp")     e.poly(parts=[[[5.1,5],[9.9,5],[9.9,1],[7.5,3],[5.1,1]]])     e.record("Appended","Polygon")     e.save('F:/data/IntermediateWorkspace/5day_pgn')      The error: > Traceback (most recent call last): File "F:\scripts\shapetest.py", line 2, > in e = > shapefile.Editor(shapefile="F:/data/IntermediateWorkspace/5day_pgn.shp") > File "C:\Python26\ArcGIS10.0\lib\shapefile.py", line 1048, in **init** > self.records = r.records() File "C:\Python26\ArcGIS10.0\lib\shapefile.py", > line 520, in records self.__dbfHeader() File > "C:\Python26\ArcGIS10.0\lib\shapefile.py", line 443, in __dbfHeader > fieldDesc = list(unpack("<11sc4xBB14x", dbf.read(32))) error: unpack > requires a string argument of length 32 Thanks for any help!!


old project on new PC: bad allocation when opening

Just got a new laptop (windows7). When opening a qgis project (shape layers on server), I get an error window "bad allocation. Project was made in Wroclaw, new PC has Lisboa. any suggestions?


Filling a Polygon with Lines in ArcGIS

i am trying to fill a polygon with lines and calculate total distance of these lines. http://i.stack.imgur.com/KxdqN.png like this example. but i have different distances between these lines like 1 meter, 2 meter, 3 meter.. so i need to take this as an array from client side, calculate length for each of these parameters and return a json response, should i use arcgis modal as a geoprocessing service? or Server object extensions? edit: actually i want to do this operation Filling a polygon with lines using Postgis in ArcGIS but not sure how


Prediction of coastal change

I have vector data in coastal change for two separate years, like 1950 and 2000. I want to use GIS to create a "Prediction of coastal change" in 50 years, 2050. How do I figure out what is the shape of the new coast line?


GRASS 6.4.3 Crashes on Startup; libintl-8.dll cited

I recently installed QGIS 2. I used the advanced OSGeo4W installer that I downloaded from the QGIS download page. GRASS is included in the stack. When I attempt to open GRASS, I receive the following error message: "The procedure entry point libintl_setlocale could not be located in the dynamic link library libintl-8.dll." I checked the WinGRASS errors page on the GRASS wiki and did not discover any precedent for this problem either there or by a Google search. My operating system is Windows Vista. I've installed all recommended packages as outlined on the GRASS wiki. Has anyone else encountered this problem? And how might I go about resolving it? Here's a running list of **potential solutions that have not corrected the problem**. I'll update as I get the time to try them:   1. Run Microsoft .NET cleanup utility and reinstall .NET 3.5.    2. Run system file checker from command prompt (>sfc /scannow). Thanks!


While reconciling a child version with the parent version, in a dataset containing Geometric network, the following error was noticed. Error during reconcile: "The version could not be reconciled. Invalid network element id : Field is not editable " We work on ArcGIS 10.1 . Tried to repair the Geometric network and do the reconcile , but to same effect. What is the core issue behind the error and what is the workaround. Experts pls advice.


Where can I find information about the development history of QGIS?

I know very little about early versions of `QGIS` (far far away from now..) and i'm feeling curious :-) I am looking for various information about the past of QGIS, including:   * Do you know in what year the software was created?    * By whom? (Was it a single person or a group? Do you have some names? Nationality?)


Custom Overpass Query in QGIS 2.0

QGIS 2.0 uses overpass to query osm data. I want to make customized queries like only buildings or only roads or both. And i only want the geometry so i'll go for skel mode in overpass. I may also need to set the timeout options for large data. How can i make these custom queries from qgis?


Problem with Georeferencer not scaling TIFcorrectly

I am trying to use QGIS and the Georeferencer to digitize paper maps but I am unable to get the raster to rotate afte I pick my control points. Below is a brief outline of the steps I used to transform my raster.   1. Added two control points and picked corresponding points in map canvas.   2. The transformation type is set to Helmert   3. Resampling method: Cubic   4. Compression: Deflate   5. Specified Output file name   6. Checked "Load in Qgis...", then Ok   7. Then clicked run button. The attached image is the results in QGIS. ![enter image description here](http://i.stack.imgur.com/VRbMo.png) The image should be much smaller