Converting geographic coordinate system in R

I have points in geographic coordinate system and I wanted to convert them to swiss grid (CH1903+). Sample data:                id       lon      lat       2 7.173500 45.86880       3 7.172540 45.86887       4 7.171636 45.86924       5 7.180180 45.87158       6 7.178070 45.87014       7 7.177229 45.86923         8 7.175240 45.86808       9 7.181409 45.87177       10 7.179299 45.87020      Respected Results:               id       E              N           2     2579408.2431  1079721.1499     3     2579333.7158  1079729.1852     4     2579263.6502  1079770.1125     5     2579928.0358  1080028.4605     6     2579763.6471  1079868.9218     7     2579698.0756  1079767.9762     8     2579543.1019  1079640.6512     9     2580023.6226  1080049.2672     10    2579859.1889  1079875.2740


Using the ArcGIS Local Routing Tool . . geoprocessing in the runtime

When I create a model in ArcGIS using the Network Analyst Tools, I am able to create Locations and make the Route Layer and Solve. However, I need to be able to add barriers as well as locations, before solving for the Route. Is there a way to do this? Thanks! Renee


How to stack rasters for ecological analysis?

The attached image shows two different forest openings. Each opening has the following layers associated with it:   1. Point shapefile 1 = A red X which represent a large "legacy" tree in the gap   2. Point shapefile 2 = White points that indicate sapling locations   3. Raster Layer = A kernel density estimate of the magnitude per unit area of point shapefile 2 I am interested in creating a graphic that _visually_ depicts the average magnitude per unit area between the two rasters. Each raster has a different spatial extent. My thoughts were to "stack" the rasters based on the location of point shapefile 1 (i.e. the legacy tree) and perform the analysis using raster algebra (e.g. Float("Raster1" + "Raster2")/2). I should point out that the full dataset will have ~ 30 forest openings. **How can I stack these rasters so that they are centered on the legacy tree in order to perform the raster algebra?** ![enter image description here](http://i.stack.imgur.com/BwJRb.jpg) **Edit** : As @Alexandre pointed out, the solution was to georeference the rasters based on X. ![enter image description here](http://i.stack.imgur.com/Ws1PC.jpg)


How to configure tools in GeoExplorer composer?

I'm running GeoExplorer within the opengeo suite sdk, how do I override the tools configuration in composer.html ? It's only when i edit Composer.js that tools are configured the way I want. For instance, the Add Layers(+) button should not display the Upload layers menu. any changes I make in composer.html are ignored! probably this has to do with object oriented javascript which I havent fully grasped. My aim is to reorganise menus in the composer and include custom tools. Will appreciate any responses/tips. My current composer.html http://pastebin.com/HY5caSWe Thanks, Allan


Contour tool in ArcGIS 10.1 giving syntax errors

I am trying to run the contour tool on a raster in 10.1 and get the following error messages? Does anyone know if this is a bug and is there a work around? > ERROR 010328: Syntax error at or near symbol SPACE. > > ERROR 010267: Syntax error in parsing grid expression. Failed to execute > (Contour).


OS X Mavericks: accessing GDAL from Terminal issue

I successfully installed QGIS on my iMac with OS X 10.9.1 Mavericks using the installers provided by Kyngchaos. However, I'm having troubles accessing GDAL / ogr from terminal. It's giving me the following error message: -bash: ogr2ogr: command not found Does anybody have an idea of how to resolve this? Thank you, Ralf


Convert a SpatialPolygonsDataFrame to raster using rasterize function

I'm trying to convert my map (a SpatialPolygonsDataFrame) into a raster, using rasterize function, here is a bug that I don't understand...               > class(parcel) # this is my map     [1] "SpatialPolygonsDataFrame"          > attr(,"package")     [1] "sp"          > head(parcel)     AREAHA RECNO      AREA AREASQKM        OS_06 GRD_CAT_06     0 0.0519     0  519.1941        0 chemin prive        way     1 0.0127     1  127.0963        0 chemin prive        way     2 0.0596     2  596.2204        0 chemin prive        way     3 0.0248     3  248.0452        0    route D90        way     4 0.0375     4  375.0141        0 route privee        way     5 0.1260     5 1260.3941        0 chemin prive        way          > dim(parcel)     [1] 20069     6          > object.size(parcel)     88090144 bytes          > r <- raster(ncol=4001, nrow=4001)     > extent(r) <- extent(parcel)     > parcel_ras<-rasterize(parcel, r, "GRD_CAT_06", CRS("+init=epsg:27572"))     Erreur dans data.frame(ID = as.integer(putvals), value = lvs) :    arguments imply differing number of rows: 20069, 13      I just don't understand this comment : what is "putvals" ? There are 20069 polygons in my map, so what is "13" ? I can't reproduce a smaller example of my map, so here are my data : http://dl.free.fr/fxdT2oczB


Is it possible to show migration arrows on Leaflet map?

I need to develop Leaflet map which will show the whole world. Also, I need to draw some arrows which will show paths of migrations in the world. The important thing to say that those arrows need to be curved. Do you have some advice how can that be shown on the map in Leaflet API? My ideas: Is it possible to show some direction arrows with RaphaelJS? I see that Leaflet has Raphael plugin so we can add Raphael object on the map. Is it possible to draw a polygon which will be arrow shape and overlay it on the map?


Adding icon in particular places using ArcGIS and show data based on the location

I am very new to ArcGIS. Currently I am working on a project where I have to show positions of some sensors(placed in fixed locations) which are frequently(every 30 minutes) sending data to a server. I also need to show the data (2/3 values, like: temperature, PH lavel and so on) in map when anybody click to the icon of the sensor or it will automatically show the updated data table. I have basically almost no idea about ArcGIS. So it would be better if anybody give some step by step instruction or any way so that I can accomplish the task. Thanks


How can I build a network from a latitude, longitude points? I have some points(latitude and longitude) and i wish to build my network based on this points.


Use OpenStreetMap in Basemapgallery - Manually

I dont know how to add the OpenStreetMap to the basemapgallery. I want to do this manually because when i use ShowARCGIS basemaps:true i get too many basemaps i dont use. Here's my code:                       function createBasemapGallery() {             //add the basemap gallery, in this case we'll display maps from ArcGIS.com including bing maps             var basemapGallery = new esri.dijit.BasemapGallery({             showArcGISBasemaps: false,             bingMapsKey: 'BingKey',              map: map  }, "basemapGallery");              var basemapRoad = new esri.dijit.Basemap({ layers: [new esri.dijit.BasemapLayer({ type: "BingMapsRoad" })], id: "bmRoad", title: "Bing Maps Wegen", thumbnailUrl:"images/basemap_streets.jpg"              });      basemapGallery.add(basemapRoad);           var basemapAerial = new esri.dijit.Basemap({ layers: [new esri.dijit.BasemapLayer({ type: "BingMapsAerial" })], id: "bmAerial", title: "Bing Maps Luchtbeelden", thumbnailUrl:"images/basemap_imagery.jpg"              });      basemapGallery.add(basemapAerial);           var basemapHybrid = new esri.dijit.Basemap({ layers: [new esri.dijit.BasemapLayer({ type: "BingMapsHybrid" })], id: "bmHybrid", title: "Bing Maps Hybride", thumbnailUrl:"images/basemap_imagery_with_labels.png"              });           basemapGallery.add(basemapHybrid);                        var layer5 = new esri.dijit.BasemapLayer({ url:"http://server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer" }); var basemap5 = new esri.dijit.Basemap({ layers:[layer5], title:"Lichtgrijs Canvas", thumbnailUrl:"images/light_gray.png" });      basemapGallery.add(basemap5);              var layer6 = new esri.dijit.BasemapLayer({ url:"http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer" }); var basemap6 = new esri.dijit.Basemap({ layers:[layer6], title:"Topografisch", thumbnailUrl:"images/basemap_topographic.jpg" });      basemapGallery.add(basemap6);              basemapGallery.startup();                   dojo.connect(basemapGallery, "onError", function(msg) {alert(msg)});              }


Where can I download the exercise data for The Free Quantum GIS Training Manual? The pdf of the manual just mentions the sources of the data, but doesn't give any links.


Modifying tables based on title (MapInfo)

I have a query regarding the Mapbasic feature of MapInfo, I want to change the line style of an item depending on name (e.g if the .tab name contains the world group). I think I can work this out with a few bits of syntax help. So for example if I change one tab this appears in the MapBasic window               Set Window 376609128 Front     Set Map Window 376609128  Layer 10 Display Global    Global Line (2,2,16711680)    Arrows On      Would I need to write a statement similar to if contains "xx" then do that? I have a very basic knowledge of scripts syntax but is my basic understanding correct, would this be the way to do it? Thanks, Alan


QGIS over WatchGuard Mobile VPN with SSL

something quite strange occured today. I connected to my office through WatchGuard Mobile VPN with SSL enabled. I got loads of errors about SSL certificates, WMS errors (there were WMS layers in the QGIS project file) and eventually, QGIS 2.01 crashed. I got some colleagues to connect via VPN from one of our other offices and the same happend. QGIS is installed on my work laptop and this happens when I try to open figures on our network servers via VPN. When I am in the office, with the same laptop and same QGIS installation, and I try to open the same file, these errors do not occur. Therefore the problem is somewhere in the VPN connection. Why would QGIS fall over the VPN connection? Thanks Antonio


Leaflet: how to draw curved lines?

So, I'm trying to draw curved lines in my application which is based on a Leaflet map. As far as I know Leaflet does not support drawing curved lines at the moment, so my question is really more about how to best get some curved line funtionality in there. The problem is made more difficult because my code will have to be IE-8 compatible, which means that pure SVG is no solution. (Leaflet actually does a fall-back to VML if it detects that no SVG support is present...) So one possibility would be to myself write some leaflet extension code based on SVG _with its own fallback_ to VML. This would be a hell of a lot of work. :/ Does anyone have a better proposition?


locating latitude-longitude point in a piste-map with matrix transforms

I am trying to plot points of a particular latitude longitude on this image of a Swiss mountainous landscape. ![http://skimap.org/data/989/60/1218033025.jpg](http://i.stack.imgur.com/cNkdm.jpg) What I am doing is I have some 54 known location-points plotted on this image (not visible in the linked image), which is a piste map, and is therefore an artist's impression of the landscape. I found out the latitude-longitudes and also height above sea level for these 54 known points. I opened my piste map in the GIMP, and plotted the 54 points, while at the same time reading their co-ordinates in points, in the piste-map. So, I have x-y coordinates (lat- long) and z coordinate (height above sea level) for all those 54 points (so its a 3d co-ordinate system that I have), and I also have X-Y coordinates of those places in my piste-map (a 2d co-ordinate system), and I assume a Z=1 for all those points. To locate a particular lat-long on my piste-map(I have the coordinates for this place, i.e. the lat-long but not elevation), I need to calculate their X-Y on the piste-map. My approach is, that I calculate distances between this point which is to be located and those 54 known points , and then I sort them in ascending order. The first two points in this order will be the nearest points to the one which we want to locate. Now, I find my 3rd known point, and for that, I loop over the rest of the points, to get the nearest possible point such that this point forms a triangle with the first two closest points with the point which is to be located falling inside the formed triangle. Now, I have three known points forming a triangle say triangle ABC. For these known points, I have a triangle A'B'C' in the piste map, and the point to be located lies in the latter. I figure out the transform matrix which when multiplied with the 3X3 matrix of the three known points(in this 3X3 matrix, each row corresponds to a point, with the column values x,y and z in the 3d scape) results in a 3X3 matrix of those points in the piste-map. I multiply this transform matrix calculated with a new 3X3 matrix for three points, the first one being the point to be located, and the remaining two are the last two known points in the first 3X3 matrix. This way, the first two elements of my resulting matrix are the X and Y values for the point to be located, and I proceed ahead to draw the point on the piste-map. Is this approach correct with respect to the way I am using the transform matrix? Thanks! I would really appreciate if any alternative approaches are suggested as well!


Future of ArcGIS Mobile

I'm not sure we can get a straight answer from ESRI on this question at his point because there is so much uncertainty with Microsoft in this area right now but "What is the future of ArcGIS Mobile for Windows?". The concern is the diminishing future of Windows Mobile 6.x, which is probably the main platform ArcGIS mobile is designed for. When Microsoft recently announced they are changing the name of Windows Mobile to Windows Embedded Handheld, they have said a new version of this will be released in second half of 2011 and will utilize the latest development tools such as Visual Studio 2010 and Silverlight/XNA. They did say there is a clear migration path for 6.x apps but that sounds pretty vague to me. That said, along with the fact you currently need Visual Studio 2008 and WinForms for ArcGIS Mobile development, I don't see it sticking around too much longer. I see ESRI efforts going more toward the iPhone, Android, Blackberry, and WP7 API's. Maybe the WP7 API will be the future for the new Windows Embedded Handheld OS? Any thoughts, predictions?


map with Pacific in center

I would like to create a basemap with the Pacific centered. I have found this threat But it doesn't make sense to me. The last option looks the easiest. When I have loaded the map with all the countries and I choose the option 'Set project CRS from layer' (before or after shifting the map), nothing happens. When I choose "zoom to layer extent", I get the whole world again with Africa in its center. I tried the first solution as well, but what is meant with "Load NE world boundaries into QGIS" (how do you do that) ? If anybody could help ... or does anybody has a shapefile of the world with Pacific centered ? Many thanks.


Make QGIS interface darker in Ubuntu

Is there a way to make the interface of QGIS 2.0 darker in Ubuntu. I would prefer a darker theme closer to the Ubuntu Ambience style. Or is there a way to create personal themes?


How to install ArcGIS License Manager 9.3 silently?

Is there a way to install ArcGIS License Manager 9.3 silently (by using only command line)? (in windows environment xp/7).


Unable to expand projected co-ordinate system folder in ArcMap 10.1

On trying to re-project any raster from GCS to any PCS, in the "Spatial Reference Properties" window, my "Projected Co-ordinate Systems" folder is not expanding. Where as the GSC folder is expanding. Even I tried to clear the spatial property of the layer and tried to set it to the desired PCS, there also its not expanding. After restarting ArcMap, before clicking on the ArcToolBox, if I go to layer properties, there it expands. Once I clicled on ArcToolBox, it doesn;t expand either from Layer properties or from Project Raster Tool. I have attached the the image of my window. If at all any one can guide me a solution. Please.. please.. please... I'm stuck almost since last 3 months. Thanks ![Without opening ArcToolBox, From Layer Properties](http://i.stack.imgur.com/7xzcf.jpg)![After opening ArcToolBox, from Project Raster tool](http://i.stack.imgur.com/31QlP.jpg)


How to compose WFS GetFeature link from WMS capabilities definition?

This publication of geoinformation provides download links for `GetCapabilities` documents via WMS. The platform also runs a WFS service as can been seen here. I wonder if it is possbile to compose a **download link** for ShapeFiles/GML or another format which can be converted ... from the given WMS information. I managed to display the street tree information in QGIS and could load details for individual features. However, this is pixel data and I would like to download **vector data** if possible. The second GetCapabilities document defines layers named `pflanzstandorte2011` and `pflanzstandorte_aktuell`. It would be nice if these were accessible via the platform's WFS API.


Subsurface data in Google Earth

Are there any known hacks to get subsurface data into Google Earth? Sub-ocean-surface works with the release of Google Ocean, but you cannot go below the sea floor. The other major limitations of Google Earth (no vertical data, single placemark balloon) have hacks to get around them (thin buildings, custom icons). I'm hoping someone has a subsurface hack. **Edit** : Possible approaches might be   * Find the default image and replace it with a transparent PNG   * Capture the network requests to download tiles and respond with transparent PNGs   * Convince GE to set the Level of Detail (LOD) for the primary layer to some negative or infinite value. On OS X, I think the following folder/code looks promising:               cd Google Earth.app/Contents/MacOS/shaders     $ ls atmosphere_ground_sun_off*     atmosphere_ground_sun_off.arbfp1     atmosphere_ground_sun_off.asd     atmosphere_ground_sun_off.ps_2_0     atmosphere_ground_sun_off.arbvp1     atmosphere_ground_sun_off.cfg     atmosphere_ground_sun_off.vs_2_0      Those files appear to contain assembly code instructions to the graphics card, and there is mention of "groundTexture", "groundRayleighMap", and other possible hack-able things.


Migrating Defense Solutions objects from ArcGIS 9.3.1 to 10.0 gives Unable to cast COM object error?

I've got an ArcGIS Engine application that uses the IMADtedLayer interface to access VPF DTED catalog layers and adds them to a map. The code ran fine under v9.3.1. I just updated to v10, and now I get: Unable to cast COM object of type 'ESRI.ArcGIS.DefenseSolutions.MADtedLayerClass' to interface type 'ESRI.ArcGIS.DefenseSolutions.IMADtedLayer'. ... No such interface supported Here's the relevant C# code:               // geodbFWS is the IFeatureWorkspace object that contains the catalog     // sCatName is the catalog name (string)     ITable catTable = geodbFWS.OpenTable(sCatName);          if (catTable != null)     {         IMADtedLayer aMADted = new MADtedLayerClass();         bool bSetup = aMADted.Setup(catTable);     }      The error occurs on the "bool bsetup" line. I've tried substituting new MADtedLayer(); for new MADtedLayerClass(); - with the same result. I've also uninstalled all ArcGIS components, cleaned out the registry and re-installed. I get the same error. I'm using MSVisualStudio 2010, and the intellisense recognizes the IMADtedLayer interface, the MADtedLayerClass, and the .Setup method - as well as the fact that it should return a boolean. I'm running the Windows 7 Professional Operating System. Has anyone else encountered this problem? Any insights will be greatly appreciated!


New python GIS Programmer : Fundamentals of the Python Language for ArcGIS

I am new to programming and I'm trying to learn "Fundamentals of the Python Language for ArcGIS" and then I've been trying to compile an example code but python GUI keeps throwing throwing this error **"Subprocess startup error"** IDLE's subprocess didnt make connection. either IDLE cant start a subprocess or personal firewall software is blocking the connection. **and the second error message** Socket error: No connection could be made because the target machine actively refused it now I use avast anvirus and I have checked cant seem to find how it may have been blocking the process so I thought maybe someone can help out. Thanks


How to make a custom ToolbarControl Item in ArcEngine?

I would like to create a custom toolbar item in ArcEngine. I add items like this ((AxToolbarControl)toolbarControl).AddItem( myCustomItem ) I need to know how to create a custom item in ArcEngine 10. I'm using C# and VS2010. Thanks.


When is it safe to use ObjectIDs as keys in a relationship class?

I've always avoided using ObjectIDs when defining relationship classes. It is my understanding that some actions on a geodatabase will re-set objectIDs (like import/export). However I do see a lot of people using them. Am I just being paranoid, or are there cases when it is safe to use ObjectIDs when defining a relationship class?


How to add a Database Server in Catalog?

I have ArcSDE on an Oracle database and I want to add a database server connection to ArcCatalog, I've seen several sites but they don't say what I have to write down. Let me explain: From the tree at the left I have several options, from hard drives, database connections to database servers and gis servers. When I right clic the Database servers option and choose add database server I get a dialog box asking me for a Database Server, so, what is what I have to write there? I've tried with:   * servername\user   * servername\oracle11g   * servername\ESRI_sde Thanks. And SDE Administration


v.dissolve (and other scripts) not in GRASS path

I see that I have the v.dissolve module in my grass64/scripts dir, but it is not found in my path from the GRASS command line. I have the GRASS_ADDON_PATH environment variable set: GRASS_ADDON_PATH=/usr/local/grass-6.4.1/scripts/ And the module itself is located in: /usr/local/grass-6.4.1/scripts/v.dissolve What am I missing? Thanks, Roger


Obtaining a contour as a single polygon in ArcGIS?

I have a DEM that I want to retrieve a single contour polygon from at a given elevation. I can use the Contour tool to obtain a series of polylines at a given elevation by setting the contour interval to a point where only one contour is produced (e.g. 9999m) at the base contour interval (e.g. 105m). What I want is a polygon representing the specified elevation, which happens to be the average water surface elevation of a river. You can see an example of my data in the image below. Any thoughts on how I can accomplish this? The polyline contours run up to the edge of the DEM and then break off, so there is no continuous line which surrounds the whole river. The second image is essentially what I would like to be output. You can see that I'll also have to solve the problem of islands within the river channel. I am attempting to automate/model this task so ArcObjects are fine. ![Contour1](http://i.stack.imgur.com/gS0hG.png) ![Contour2](http://i.stack.imgur.com/Qr8Qx.png)


Speed of various raster data formats

I'm having trouble locating any discussion or comparative benchmarking of different raster file formats (e.g., for use in data analysis in R). Does anybody have any insight into why particular formats may be faster or slower? Or should the differences be minimal? Specifically, I'm interested in if converting a raster (e.g., a GEOTIFF file) to a different format (e.g, a netCDF) is ever worthwhile for the purpose of speeding read/write and other operations. Thanks in advance! Best, George


How to set up a Revision Control for ESRI File Geodatabase?

I'm interested in doing revision control (Mercurial) on some file geodatabases. Does anyone have an idea of which files are important (need to be saved) and which can be ignored? Note that I'm not interested in ESRI database versioning. These are essentially empty (no data), and I want to make sure they are in sync with code changes. For example, if I add a new feature to the database, I add some things in code that uses that feature. If I want to go back to an old revision of the code, I want the database that matches. I don't even need to be able to compare versions, just get back to a particular one if needed. Some of the files include: gdb, timestamp, *.freelist, *.gdbindexes, *.gdbtable, *.gdbtablx, *.spx, *.atx


How can I find points inside a polygon in ArcGIS server?

I have a feature class of points. My client wants to draw a polygon on the map to select the subset of points inside the drawn polygon. Is there any tools in ArcGIS API, which I can use it for this purpose? if there is a sample for ArcGIS API for Flex, that would be great.


ModelBuilder Output Creates .lock file and Cannot Overwrite When Ran a Second Time

I am having trouble overwriting an output shapefile from ModelBuilder. The model works great when ran the first time, but I get an ' **000210 : Cannot create output .** ' error if I re-run the model. The error states 'The output cannot be created. Potential reasons include data locking, an incorrect path, and limited access rights..' I've noticed that there is a .lock file associated with the shapefile so I assume this is my problem. I've checked the overwrite outputs of geoprocessing options checkbox in the geoprocessing options. My model is very simple, I am just using a multivalue iteration to buffer a line segment at different buffer widths and then clipping to a polygon. I am using the inline variable subsitution based off of the buffer value for my output shapefile name. Anybody know how to fix this? or possible work arounds? I am using ArcMap 10.2


How to merge hundreds of vector layers and sum attributes in QGIS?

I'm still at a fairly beginner level with QGIS and I've been banging my head against the wall trying to figure this out, so I would like to turn here for the internetz help. I am trying to construct a map of mean daily rainfall in Africa over the past ten years. I have access to shapefiles for daily rainfall (with identical columns in the attribute table) and I would like to sum up each day for an entire year period. Then, I want to take the mean of the last ten years and create one shapefile. So far, I've been working with only two specific days with the thought being that if I can combine two, I can combine 365. I've tried Vector>Data Management Tools>Merge shapefiles to one, but this just creates one larger shapefile and doesn't sum up overlapping areas. I've also tried Vector>Data Management Tools>Join attributes by location, which gets closer to what I want, but only keeps the geometry of the target vector layer and loses that of the other. Detailed guidance would be sincerely appreciated. Please let me know if any of this isn't clear. Also, let me know if there may be a quicker way to go about creating a shapefile of the ten year average other than what I've proposed. Below are a couple pics: Project with two layers to merge (I added the continent outline for a bit of context) ![enter image description here](http://i.stack.imgur.com/qEBZk.jpg) Sample of layer attribute table (I only need to sum the values from the "Contour" column--this is daily rainfall in mm) ![enter image description here](http://i.stack.imgur.com/ClchQ.jpg)


How do I query for geometry inside the Arctic Circle?

I have a large PostGIS database of lat/lon points. How can I query for any points that lie above the Arctic Circle?


Problem with loading GeoJSON file in OpenLayers generated by PHP

I'm trying to read some geo-data from PostGIS database using PHP, creating a GeoJSON file and showing it on a base map using OpenLayers. The PHP code works just fine. The generated data in GeoJSON format is valid (I checked it with jsonlint). When I load the page, the developer tools shows no errors, but also doesn't load any data on the map. I have just started learning OpenLayers and don't know much about it but saw some examples for this and tried to do the same. Am I doing something wrong in the Openlayers code? The code is:               var map = new OpenLayers.Map({         div: "map",         layers: [             new OpenLayers.Layer.WMS(                 "WMS", "http://vmap0.tiles.osgeo.org/wms/vmap0",                 {layers: "basic"}             ),             new OpenLayers.Layer.Vector("GJ", {                 strategies: [new OpenLayers.Strategy.Fixed()],                 protocol: new OpenLayers.Protocol.HTTP({                     url: "gj/DB2GeoJson.php",                     format: new OpenLayers.Format.GeoJSON({                         extractStyles: true,                          extractAttributes: true,                         maxDepth: 2                     })                 })             })         ],         center: new OpenLayers.LonLat(-112.169, 36.099),         zoom: 11     });      and the GeoJson file generated is:               {     "type": "FeatureCollection",     "features": [{         "type": "feature",         "id": "97",         "geometry": null,         "properties": {             "popn_total": ["97"],             "boroname": ["Staten Island"]         }     }, {         "type": "feature",         "id": "66",         "geometry": null,         "properties": {             "popn_total": ["66"],             "boroname": ["Staten Island"]         }     }, {         "geometry": ["{\"type\":\"MultiPolygon\",\"coordinates\":[[[[578620.717363209,4495974.81786636],[578535.357633272,4495915.80999248],[578524.626146389,4495908.44992811],[578475.151658836,4495981.94016235],[578550.53822566,4496033.27562186],[578571.6880873,4496047.75223892],[578620.717363209,4495974.81786636]]]]}"]     }]      }


Sextante plugin

I'm looking for the sextant plug-in which is supposed to be showing in Plugin Manager under Manage and Install plugins. I currently have 30 plugins installed and enabled in QGIS 2.0 and 121 more showing as available so repository access looks ok. However cannot see sextant in here although have missed the obvious before. Not sure if other settings are ok. Running Windows 7. It has been suggested a reinstall using OSGeo4W Advance mode would possibly sort this. Help appreciated. Thanks UPDATE: So Sextante is called Processing in QGIS 2.0. Is the Processing toolbox a separate standalone within QGIS and not directly related to the base QGIS Vector / Raster, etc tools?


Get folder structure in code from arcgis/rest/services

I have never worked with maps before, and I got assigned on this project with ArcGIS. Noone to ask, cause noone has worked here either so I am turning to you guys. I have to create a tree of checkboxes, and clicking them turns the visibility of the clicked tile on or off. I have managed to find some methods, `ArcGISTiledMapServiceLayer` and `ArcGISDynamicMapServiceLayer`. but they don't help me because I cannot give them a link like: `http://sampleserver3.arcgisonline.com/ArcGIS/rest/services`. but what I need is to take all the folder names from there, ![enter image description here](http://i.stack.imgur.com/5Zi25.png) make them the parents in the tree, then get the services that interest me (in this case there are 3 names in the first folder, don't know which one would be a tile) ![enter image description here](http://i.stack.imgur.com/mlArE.jpg) and put them as leaves in the tree. An example of the behavior I need to reproduce is this: ![enter image description here](http://i.stack.imgur.com/qjYjj.jpg) in the link I pasted, go to `BloomfieldHillsMichigan` ,then `BloomfieldHillsMichigan/Parcels`, click on `ArcGIS.com Map` from the "View In:" secition, then the "Details" tab, then "Content". And there is the checkbox I need to reproduce, and the text is "Parcels". And all of this has to be in a tree structure, with all the folders we had in the folder section. Is there a way I could accomplish this? Thanks


how to choose stratified random sample on multispectral image

I'd like to choose random samples from multispectral image according to each Land Cover image. The multiband image has 70 bands representing land surface temperature data from MODIS. Land cover image has 9 classes. I need 50 sample (pixel) values of each land cover type which extracted from each band of multispectral image. How can I choose these random samples in ARCGIS, ERDAS and EVI? ENVI can be used to choose random samples on multiband image as ROI. But statistic output of ROI gave me the descriptive statistics of mean of all sample. What I want is the mean value of each separate samples of each land cover types in each bands. Thanks in advance


Calculating surface and lines in 3D projection in R

For my internship research I am trying to compare the surfacearea and length of geometric shapes and lines in one coordinate system to another. I have a SpatialPolygonDataFrame in the European equal area projection ETRS-LAEA and I have a function that can calculate the surfacearea and the length of all polygons. I can transform it to another projection and calculate the surfaceareas and the lengths of all polygons in that projection. My next step would be to calculate the surfacearea and the length of the polygons in ETRS89(x,y,z). Since this is a 3D projection the functions I am using for the 2D projections are not working. Are there functions for 3D projections? I can not find them online. I am hoping there has been some smart guy with a similar problem and already fixed it. I am expecting this is not the case and that it is (for me) impossible in R.


How to access input parameters (layer name,field name) in rest SOE?

I want to access input parameters in my SOE(Server object extension) code which I am writing in arcobjects using C#. I have constructed the complete URL(including layername id and field name) for calling SOE in my silverlight web application. I want to know that how to get these input parameters to use in code. As I am beginner in SOE(Server object extension) development I need a direction for developing SOE. Please help me out to move further as I am badly stuck with this issue.


Unable to load 'nviz' through GRASS

I am using QGIS 2.0.1-Dufouron on Windows 7. When I try to load nviz via GRASS, I get the message "Module nviz not found". Weirdly enough, I can load it via the toolbox and be able to 'run' it (it reaches 100%). But afterwards, nothing happens. **Problem:** I merely want to rotate and play around with the view points of layers. This is all for aesthetic purposes, don't want to do anything technical (not yet anyway). I have read posts on people suggesting to install the plugin SEXTANTE which may solve the issue, however it doesn't show up on my list of plugins (maybe I don't have the correct URL?). I am considering trying ArcMap if I have to but would rather do it in QGIS. Any suggestions please?


How can I translate a GML definition of SRS to a usual format (e.g. WKT or PROJ.4)?

From GDAL 1.9.0 a new utility is available: **_gdalsrsinfo_**. Although it can yield an XML (GML-based) definition from a source equivalent format or file, it seems that it can only _read_ `usual GDAL/OGR forms (complete WKT, PROJ.4, EPSG:n or a file containing the SRS)`, so no GML definitions. Indeed:               $ gdalsrsinfo -o xml '+proj=longlat +a=3396190 +b=3396190 +no_defs'     <gml:GeographicCRS...      but:               $ gdalsrsinfo -o wkt '<gml:GeographicCRS...</gml:GeographicCRS>'     ERROR 1: ERROR - failed to load SRS definition from <gml:GeographicCRS...      Any of you is aware of a way I could make this translation? This question is somehow linked to: Can GeoTools parse GML CRS definitions?


Click a marker icon to open a pop-up, using OpenLayers

# Background Looking to create a pop-up that performs an Ajax request when the user clicks a marker on an OpenLayers map. The markers, however, have different icons. The following is working code that can be used to accomplish the desired task:               var sites new OpenLayers.Layer.Markers( 'Sites' );     map.addLayer( sites );     addSiteMarkers( sites );          function addMarker( layer, lat, lng, img ) {       var size   = new OpenLayers.Size( 32, 37 );       var offset = new OpenLayers.Pixel( -(size.w/2), -size.h );       var icon   = new OpenLayers.Icon( 'img/marker/' + img, size, offset );       var marker = new OpenLayers.Marker( getLocation( lat, lng ), icon );            layer.addMarker( marker );            marker.events.register( 'click', layer, clickMarker );     }          function clickMarker() {       alert( 'click' );            // Pop-up code will go here...     }          function addSiteMarkers( sites ) {       addMarker( sites, -113.3017895, 49.1939798, 'store.png' );       addMarker( sites, -113.3072538, 49.2013626, 'building.png' );     }      The above code adds two markers (of hundreds) each having a different icon (from a set of fifty different icons). Each click will display a pop-up and each pop-up will have information that is retrieved from a database (using a jQuery ajax call). # Problem I suspect this is a terribly inefficient way to use OpenLayers and map markers for opening pop-ups when a user clicks an icon. # Question How do you use OpenLayers to present a variety of different markers that when clicked display a pop-up (with content dependent on the actual marker that was clicked)? ## Update #1 Most of the examples show how to use a Vector layer, rather than a Marker layer, to handle click events. Using a Vector layer makes making markers more mind-boggling. # Related   * http://dev.openlayers.org/releases/OpenLayers-2.11/examples/marker-shadow.html   * http://stackoverflow.com/questions/7702945/adding-popup-info-in-openlayers   * http://stackoverflow.com/questions/9895951/how-to-display-multiple-markers-with-individual-framecloud-popups-in-openlayers   * http://stackoverflow.com/questions/6026420/openlayers-vector-features-instead-of-markers   * http://dev.openlayers.org/docs/files/OpenLayers/Control/SelectFeature-js.html   * http://docs.openlayers.org/library/overlays.html   * http://dev.openlayers.org/docs/files/OpenLayers/Popup-js.html   * http://dev.openlayers.org/docs/files/OpenLayers/Marker-js.html Thank you!


Implementing custom (Vincenty/Haversine formula) functions for MySQL vs Using PostGIS?

I currently am using MySQL for all of my relational data. I have hit a crossroads with geo calculations. Since, MySQL does not have good support for spatial functions, I am contemplating on using Postgres's PostGIS extention. But, for this I will have top run 2 DB servers (MySQL and Postgres) as I do not want to move away from _InnoDb_ (for all the **goods** that it offers). >   * Does implementing the functions cause any performance issues(lag)? >   * Is the trouble worth it or should I move ahead with PostGIS? >   * Is moving the whole DB from MySQL to Postgres any good (Although I am > not exactly considering this)? > > * * * > >   * Also, is implementing Haversine or Vincenty better? I do understand that > Vincenty formula provides much better accuracy. But is there too much cost > on CPU? > >


What does maps.nokia.com use?

The maps on maps.nokia.com are pretty amazing. I assume they're generating their own tiles but, does anyone know about the infrastructure behind site: the tile server used? and their JavaScript Library?


QGIS Grid Division/Grid Product etc. results are wrong projection

I have several raster grids, all 4320 columns, 2160 rows in WGS 84 projection. They are loaded from ESRI ascii files. When I use the Processing Toolbox to carry out arithmetical transformations on the grids (e.g. multiply one by another, divide one by another) the resulting grid is correct, but offset from the original projection by some number of pixels. The layer purports to be in WGS 84, but clearly isn't. Currently I am working round the problem by using the raster package in R, but it seems to me that the QGIS functions are broken (unless I am missing something obvious). Any suggestions gratefully received.


Can I use google api or google maps in web application developed with arcgis api or esri technology?

I need to know that is it possible to use google map (as a basemap) and its GIS functionalities(like find/search features) in my web application developed with arcgis api for silverlight/javascript. Also I dont want to use arcgis server. I want to use open source GIS technology.


displaying combined data values in ArcMap

I got some data in an attributes table and I would like to know how I can combine them in order to get an unique value in the map. For instance,   * Attribute: Type   * Value: Street Those values I want to represent in the following format: **Type / Street** Thank you in advance.


How to calculate the intersection of 2 Circles?

I'm trying to figure out how to mathematically derive the common points of two intersecting circles on earth's surface given a center Lat/Lon and a radius for each point. Ex. Given:   * Lat/Lon (37.673442, -90.234036) Radius 107.5 NM   * Lat/Lon (36.109997, -90.953669) Radius 145 NM I should find two intersection points with one of them being (36.948, -088.158). It would be trivially easy to solve this on a flat plane but I don't have any experience solving equations on an imperfect sphere such as the earth' surface. Any help would be appreciated!


How to sort a field according to value range?

I have to check an attribute table field (MY ID NO) of polygon feature against a tiff image of parcel map where fields are written as 12-58,65,87,2565-89999,58648. Example: Parcel map tiff(image) contains plot no (MY ID NO in poly feature's attribute table) against each plot, each tiff has a corner box that describe the plot numbers included in this tiff map. Now I have to check is all the opposite plot no (collected from tiff image file, and also mentioned in the corner-box describing included plot no) is populated in the MY ID NO field. Now I want a field calculator script (I think it is easy and better way to check, suggestions also preferred) to populate "Sorted Range" field. **I need only "Sorted Range" field**. My table as below: ![Portion of Attribute Table](http://i.stack.imgur.com/jd9RZ.png)


What is the best quick way to populate a field (in ArcGIS 10)? (for rare language/font e.g. Guzrati numerals)

* I have polygons generated from shapefile (esri) format    * I have a tiff image of plot/parcel map(this tiff has plot id scribed in somewhat consecutive in manner) of that polygon feature. I would like to fill the `plot number` field by juxtaposing(placing two abreast) the polygon and image file. I am using Arc GIS 10; what is the best way to do this? Example: I have following tiff map, where from a polyline-shapefile has been produced by arc-scan, thereafter a polygon feature has been made from it. ![My dummy tiff image](http://i.stack.imgur.com/wAvHS.png) Now i want to populate "Plot No" field of polygon feature from above tiff image. But now "see-and-fill" method taking much more time (since 1700+ polygon/plot is many). Under this circumstances i seek the best and quick (some what automated) way to populate "Plot No" field. N.B. Plot No in the map is shown English Numerals, but in case of me these numbers are font that parochial (even abbey software does not support this font. e.g. Guzrati "╜") Thanks in advance


Openlayers Measure Line and Area at the same time from the same button

I have been using separate buttons to measure lines and areas in my Openlayers maps (as per the Openlayers examples) but would ideally like to get the output for both length and area at the same time. The ideal solution would be to have a solid line for the line measurements and a dashed line connecting the start and end point to symbolize the polygon. Then simply output the two answers to a div on the website. As a bonus, store each line length in an array that can be output to a menu as well. My question is two fold, is it possible, and does anyone have / know of an example? I've searched long and hard and can't find an attractive solution to this. Thanks for your help,


Calling rest services from WCF service

I have a question. I have an AddIn that allows spatial query using map service. I have logic that connects to map service on the client side. I am looking into the possibility of moving this logic to a WCF service so that I could use the same logic for more than one application. I am not sure if I could use rest service from WCF service, based on my search it seems like this is not an option. Is SOAP service is only way to go or if there is a way to use rest service. Appreciate any feedback. Thanks Jay


Split a polygon based on density of points in ArcGIS 10.1

I have two layers:   1. Polygon layer representing administrative boundaries   2. Polygon layer representing topography (i.e. a map) In some of the administrative areas, the buildings (shown in the map) are grouped in one area while the rest of the area is something else. I would like to split the administrative area into two, one containing all the buildings and another containing no buildings. See diagram. ![Example of how the administrative areas should be cut](http://i.stack.imgur.com/OmnkV.png) I created a union between my two layers and then dissolved to create a third layer which identified the "building/not building" for each administrative area, this is close to what I want except that it doesn't create a single cut, but creates a complex shape that wraps around each building and go along roads etc. I have a few thousand polygons like this so I would like to be able to cut them automatically.


Migrating Feature Datasets from ArcSDE to postgis

I am currently planning the migration of a database from ArcSDE/ Arcmap to postgis / Qgis. The data is stored in raster catalogues and feature datasets. Is there an equivalent to feature datasets supported by postgis or do I need to group the layers by adding a prefix corresponding to the current feature dataset.


Are GIS Analyst salaries going to always be so low?

I regularly see GIS Analyst job postings (often in very expensive cities) asking for a plethora of experience paying in the $40k - 60k a year range, many are even below $40k or $30k. Considering the amount of patience it takes to deal with Esri software and all of the work-arounds one must routinely implement GIS professionals are being severely underpaid. Are the majority of GIS Analysts independently wealthy and just do GIS for fun? I do not see any other logical reason for the low pay reality GIS Analysts are in. Has there ever been an attempt to create a GIS Union?


Unable to save to in Geojson format with the correct projection

I have a shape file (Polygon) in Qgis that I wish to save in Geojson in order to display it with the mapbox javascript api. Original projection is in POSGAR 97 My issue is that it does not reproject when I set projection to WGS84. Even if in the T.O.C I set the projection to WGS84 and **Save As**. Even if I uncheck the on the fly re-projection. This is how coordinate looks like:               "coordinates": [ [ [ 324345.0, -3579435.0 ]      It should looks like:               "coordinates": [ [ [ -32.43450, -35.794350 ]      Curious think is if I **Save As** in KML, it works and the point of the polygon looks like:               <coordinates>-64.866399861691903,-32.338025763844477...


Using the feature class name to populate a field in the features attribute table

I'm trying to duplicate the model shown in Use Feature Class "Name" from Iterate Feature Classes to Calculate Field with Model Builder 10.1 I have over 700 feature classes in a gdb and I need to use the name of the feature class to populate a new field within the feature class. I tried to duplicate the model above and I cant figure it out. Can someone help? What is The Feature Type Parameter?


Categorized style hiding map

I am having an issue with the style properties of my map. I imported the US Zip Code Tabulation Area map from a government website, and in a separate excel file I have a list of people connected to various zip codes. My original problem was QGIS was removing the leading zeros from my CSV file, which caused a lot of zip codes to appear blank. I created a .csvt file to declare the zip code column as a string, and this worked and allowed me to keep the leading zeros. However, now when I join this data to the zip code map, and then try to style based off of the 'name' category, the map disappears. I checked the attribute table, and all the names are correctly assigned to the various zip codes, but the map disappears anyway. The map previously worked before I added the .csvt file but obviously with the missing areas due to leading zero issues. I am not sure why the map is disappearing after adding the .csvt file. I've included images to show how everything appears to be correct in the properties and attribute table, but the map just won't show up. Here is the album where I show my process and the error.


ArcEngine 10 Editor:  Split/Rotate/Cut Features toolbar?

I am currently looking for the _Split/Rotate/Cut/Reshape_ tools in the toolbar control provided by ESRI, however according to ArcGIS Engine commands page there isn't one. Is it called something else or does it only exist in ArcEditor?


Drawing Day and Night on a Google Map

I'm looking to plot day/night on a Google map, for an arbitrary point in time. I'm familiar with generating map tiles; I'm just looking for an algorithm to tell me whether a particular point on the globe is currently in daylight or darkness, or to otherwise plot the curve of the day/night interface onto the map. I've done some searching, but it's possible I don't even know enough about the problem domain here to know what terms to search for! Any ideas? Doesn't have to be perfect -- basically, I'm comparing Flickr geolocation data of sunrise and sunset photos (and their "date taken" timestamps) with reality, and this is to help me visualise it.


How do I randomly alter a raster map of habitat types?

I have a raster of habitat types for a specific area in Scotland. I need to create future habitat scenarios with changes in habitat to assess the population viability of a bird species. For example, in the future there might be 10% more forestry in the area. I would like to alter the current map by randomly adding the forestry in blocks of a certain size. I am, so far, thinking along the lines of selecting random points from a raster which identifies areas where the forestry could occur and growing the correct sized blocks using some sort of cellular automata. Does this seem like the best way of going about this? Is there a better method? If this is the best way available, how could I do this in, preferably, R? (I am currently looking at the rpoints function in "spatstat" along with the CellularAutomata package) I also have access to GRASS, QGis and ArcMap 10 if there are simpler ways in any of them. Thanks.


How to import ESRI grid into Matlab

I have some ESRI grid data that I would like to import into Matlab. As a typical ESRI grid data I have the two folders with the *.adf files and *.dat, _.nit and_.dat files. I would like to know how can I import the information stored in those files into Matlab. Tank you all!


How to select features with NULL attributes in QGIS?

I need to identify which features have null attributes in the attribute table of a shapefile. When i try [field]= 'NULL' it selects the features with value=0 (see picture)![enter image description here](http://i.stack.imgur.com/gI8vo.png) Suggestions?


Invalid filter when using MapServer as a WFS

I'm trying to use Openlayers and Mapserver to display a shapefile. My HTML file is as follows:                           <title>OpenLayers Example</title>

                       This loads a google-map base map, and should overlay a shapefile over all of England. When the page loads the coordinates of the bounding box of the map are sent to MapServer. I can see that it is sending just the lon/lat values. In my mapfile, I have the projection of the data defined as follows, in both the intro part, and also in the layer:                PROJECTION         "init=epsg:27700"      END      However, the response from the server gives me an error `WFS server error. Invalid or Unsupported FILTER in GetFeature`, and I don't know whether it is due to an incorrect bounding box, or whether I have a mistake with my query using `PropertyName`. From searching online this appears to have been a bug, but I don't know whether it is still a problem or not.               <?xml version="1.0" encoding="ISO-8859-1"?>     <ows:ExceptionReport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"      xmlns:ows="http://www.opengis.net/ows" version="1.1.0" language="en-US"      xsi:schemaLocation="http://www.opengis.net/ows http://schemas.opengis.net/ows/1.0.0/owsExceptionReport.xsd">       <ows:Exception exceptionCode="InvalidParameterValue" locator="filter">         <ows:ExceptionText>msWFSGetFeature(): WFS server error. Invalid or Unsupported FILTER in      GetFeature : <         Filter ogc="http://www.opengis.net/ogc">       <BBOX>         <Envelope gml="http://www.opengis.net/gml" srsName="EPSG:4326">           <lowerCorner>-55.50109375 43.134977942511</lowerCorner>           <upperCorner>55.24109375 59.593781185019</upperCorner>         </Envelope>       </BBOX>     </Filter>     </ows:ExceptionText>       </ows:Exception>     </ows:ExceptionReport>      What do I need to do to fix this? Should I make sure that I am passing a bounding box in `epsg:27700` coordinates? Or can Mapserver accept lon/lat and project them into the required coordinate system? * * * I have asked another question on the same topic recently, but I had a different problem then!


How do I find the average distance within a polygon to a point?

For my purposes, I can assume a homogeneous distribution of points within the polygon. What I want to find is the average distance from points within a polygon to a specified point. I don't know where to start and have found similar info online but nothing exact. Ideally, I would like to do this for an entire Thiessen polygon layer. I have many polygons and a layer with one point in each polygon, and within each of those I would like to find the average distance to the point. If you are confused by my question, here's an example: Within a country, what is the average distance one must travel to reach the Capitol? It can be assumed that people are evenly distributed throughout the country.


How can I geocode to a shape instead of a coordinate?

**Geocoding to a shape instead of a point** The project I'm currently working on is Find-A-Record. We are geocoding genealogical record collections and storing them in a spatial index (browse our blog if you want to know more). Searches are based on a shape. We return collections which intersect or are contained within the search area. During the early states of development, we used geonames to geocode collections to a point. This works well for collections which are associated with lower administrative levels such as cities, towns, and villages. However it really breaks down when you get the county, state, and country level. The 1940 US Census is associated with the United States and would be assigned a point in Northern Kansas. Any queries within the US that aren't near that point won't return the 1940 US Census. To solve this we need to geocode collections with a shape instead of a point. **OSM** OpenStreetMaps has the data we need, but it's extremely difficult to extract. The administrative hierarchy is not explicitly stored. Nominatim is used to solve this problem for OSM a Nominatim search only returns features. So a query for Knighton on Teme returns two bus stops but not the administrative boundary relation. The Overpass API looked promising but it can't do fuzzy string matches. Overpass can only do exact or regex matches. We could use Overpass if there was an easy way to standardize place names. In other words, if OSM provided a way for us to standardize "Knighton on Teme, Worcestershire, England" to "Knighton on Teme CP, Malvern Hills, Worcestershire, West Midlands, England, United Kingdom" according to the OSM hierarchy then fuzzy string matching wouldn't be necessary. **Summary** What we need is a service which allows us to perform fuzzy string searches for a place (or administrative level) and retrieve it's boundaries. We recognize that it will be difficult to obtain boundary data for the entire world. Thankfully we probably won't need to anytime soon. We only need data for areas of the world where genealogical records exist and genealogists do research. It's looking like we will need to build our own service which indexes OSM in such a way that enables us to query for administrative boundaries. But we would really prefer not to. Is there any other way we can retrieve this data with existing services?


Error getting spatial reference as string in arcpy

I am trying to get the string associated with a spatial reference to print into an xml using arcpy and xml.cElementTree. Using the snippet:               ...     spatial_ref = arcpy.GetParameterAsText(3)     ...     Prj = et.SubElement(spaceref, "Prj")     space = arcpy.SpatialReference(spatial_ref)     Prj.text = arcpy.SpatialReference.exportToString(space)     ...      Using essentially the same method, I am able to get the string to print with IDLE by pointing directly to a projection (.prj) file, e.g.: > > u"GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]];-400 > -400 1000000000;-100000 10000;-100000 > 10000;8.98315284119522E-09;0.001;0.001;IsHighPrecision" but Arc returns this error when I try to run my script: > Traceback (most recent call last): File "\DEFOE\Proc Storage\ORTHO\Arc > Custom Tools\ImportUltracam.py", line 99, in space = > arcpy.SpatialReference(spatial_ref) File "c:\program files > (x86)\arcgis\desktop10.2\arcpy\arcpy\arcobjects\mixins.py", line 927, in > **init** self._arc_object.createFromFile(item) RuntimeError: ERROR 999999: > Error executing function. Is there a way to input a spatial reference with Arc and return the string to be printed into the xml? **Update** Playing with IDLE, I tried with an EPSG code and was able to do exactly what I wanted:               >>> epsg = arcpy.SpatialReference(32618)     >>> print epsg     <geoprocessing spatial reference object object at 0x000000000C7D0710>     >>> arcpy.SpatialReference.exportToString(epsg)     u"PROJCS['WGS_1984_UTM_Zone_18N',GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Transverse_Mercator'],PARAMETER['False_Easting',500000.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',-75.0],PARAMETER['Scale_Factor',0.9996],PARAMETER['Latitude_Of_Origin',0.0],UNIT['Meter',1.0]];-5120900 -9998100 10000;-100000 10000;-100000 10000;0.001;0.001;0.001;IsHighPrecision"      So I tried with an EPSG code in the script:               spatial_ref = "32618"     Prj = et.SubElement(spaceref, "Prj")     space = arcpy.SpatialReference(spatial_ref)     Prj.text = arcpy.SpatialReference.exportToString(space)      And I get the same error.


How to handle QGIS 2.2 Data Defined Label Position on PostGIS Layer Null Defaulting to 0?

I just upgraded to qgis 2.2 from 2.0. In 2.2 there was a minor change to data defined label positioning at least when used with postgis layers. In Version 2.2 the labeling engine appears to be treating null values in labelX and labelY as 0 instead of null. It is also doing this in the feature form, but not when I view the Attribute table. The result of this is that when I have data defined label positioning turned on and I save a feature without moving the label the label is rendered at 0,0 instead of at the feature centroid. In postgis I have my label coordinates defined as real and qgis is treating them as a double float4. After looking at another thread I loaded the same label coordinates as first a String, and second as an Integer. My labels behaved properly when I had the coordinates defined as strings. Is there any way to fix this problem by changing a setting within qgis? My options currently appear to be either changing all of my label data types to strings or writing trigger functions to populate my label position fields with the centroid of each polygon. Is there another strategy that I can use to address this bug? Thank You.


Site Selection using Spatial Analyst

How can I select a recreation site location based on the criterion that it should AT LEAST be 500 m from a river (shapefile) and AT MOST 15000 m from the same river using Spatial Analyst Extension? -Umair


What is ArcGIS 10 definition query to select max value from table?

I want to select max date from may layer by below query in my Web GIS but I cannot.               (SELECT MAX( GregorianDate ) FROM DrillingProgress WHERE Crew = 'c-Chabock')


How do I get around license error when creating custom tool?

I created a custom geoprocessing function tool according to this link . . http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/Building_a_custom_geoprocessing_function_tool/00010000049w000000/ I went through the following instructions in order to create a custom tool in a toolbox, but got the error "You do not have the necessary license to execute the selected tool" when attempting to run the custom tool . . . 1) Register the DLL (in the Debug folder) with ESRIRegAsm utility. ESRIRegAsm.exe is located at, ~:\Program Files\Common Files\ArcGIS\bin folder. Use this example . . . Do the following to register the assembly: Desktop—ESRIRegAsm /p:desktop "C:\Test\MyAssembly.dll"                          Engine—ESRIRegAsm /p:engine "C:\Test\MyAssembly.dll"      2) Create a custom toolbox in a folder or a geodatabase. ArcGIS for Desktop users have the option to add the tool to a custom toolbox manually in ArcCatalog, ArcMap, or ArcGlobe. Right-click a custom toolbox, choose Add, click Tool, expand my function factory, select my tool, and click OK. The tool is added to the custom toolbox.


Ubuntu Raring - Openlayers Plugin 1.8 or 1.9 Master

Relative newbie to Ubuntu and QGIS. Many questions are posted relating to the Openlayers plugin. It works fine in windows but I cannot get it to work or even appear in either 1.8 or 1.9. The "fetch python plugins" option is missing from the menu. I've tried the temporary fix for 1.9, also no go. I've used Synaptic packet manager, the wiki and sources.list and every other tip. It does not work. I can install, uninstall, purge, clear the source.list, remove entries from Synaptic, re-install from software centre, etc etc but nothing works. Thanks in advance, JH


OpenLayers create marker (feature with icon) from WKT

I have a point object WKT. Like this: `POINT (25.04568 48.221548)`. Also I have an icon in my project folder. My goal is to show on a map **an icon** that represents a feature. Can it be just a normal OpenLayers feature (if yes, then how can I define that it should represent and icon) or do I need to create an OpenLayers marker (somehow create `LonLat` from WKT)?


How can I get the vertical profile of my trail?

I am creating some online maps for trails and I'm trying to figure out how to turn my lat/long data into vertical profiles roughly like the following. I'm not so concerned about the markers/labels, though the x/y axes would be nice to have. ![enter image description here](http://i.stack.imgur.com/guA6I.jpg) So far I have just been building out a prototype using Leaflet.js - soon I expect to do a full overhaul, possibly using Drupal as a framework/CMS. So the door is wide open as far as implementation goes - it would just need to be something I can do programatically from a web server.


Is there any learning material available for GE Smallworld?

I have been searching for any kind of tutorial or getting started kind of material for GE Smallworld. From there website, I couldn't find anything relevant. May be I am missing or overlooking sometging there. Also is there any demo or trial version available for the same to explore? It is surprising that there is no tag for Smallworld yet at GIS SE!


Calculating distance to a feature from a reference line

I have multiple shapefiles, each containing a coastline for a specific year. I want to calculate the perpendicular distance to the shoreline from a fixed vertical reference line. Please recommend me the best tool (in ArcGIS-Desktop) to find out the perpendicular distance from each point (or a definite number of multiple points) on the reference line to the shoreline shapefile. I have included a screenshot to describe what I am planning to achieve. I am hoping to be able to create 1 custom point per 100m on the reference line and then calculate the distance to the shoreline from these points. ![Measuring distance from Reference line to Shoreline](http://i.stack.imgur.com/eUS52.png)


how to add a raw input to a SQL string?

I have this py script for selecting one point. _# Within selected features, select only those points of a chosen value_   arcpy.SelectLayerByAttribute_management("Stations", "NEW_SELECTION", ' "OID" = 465 ') That works but every time I want to select a new station then I have to change the station number in the SQL statement. How can I select a new station as a raw input instead of editing the script every time?


osm2po vertices table, what does ref_count stands for?

i am using osm2po to import osm file, into postgres/gis. after de commenting in osm2po config file:               #postp.2.class = de.cm.osm2po.plugins.PgVertexWriter      i get a nice vertices table, with turn restrictions. i also get a ref_count column for each vertex id. i am trying to understand what it stands for. initially i thought its how many times this vertex exist in the table, but quickly i discovered its untrue. i will appreciate any help/insights as to ref_count column and its meaning. specifically, i am trying to understand, given a target vertex, how many options for turning i have. (how many vertex and which are accessible via this vertex) example: if im on vertex id 111, -> can access vertex id 112 and 113 i thought ref_count might help with that. (just the number of possible vertex's will be useful for me, and yes i can count it easily myself, but im curious about ref_count) thanks for your help!


Copy text to clipboard with MapBasic

I think the title says it all - is it possible to programmatically copy/paste some text to/from the windows clipboard using MapBasic? I have found this discussion but it only discusses copying and as it's two years and 1.5 versions ago I'm wondering if there's a better/more native option.


How to creat a graph from a Field values (VBA_ArcObjects)

I have a combobox that shows all fields of a shapefile. I want to get these values programmatically in a label--Count, Minimum, Maximum, Sum, Mean, Standard Deviation--and populate a graph of the selectable fields in the combobox. All that in the same form. Please could anyone help me :(


Why is this line split in two?

Even though this is a single line, it is stored as a two-part polyline. I can split it and rejoin at the break, but whatever I do it won't join the two into one line. (This is most obvious if you turn on labels.) What's going on here? http://pastelink.me/dl/a8ca3e


Mapserver can't write in /var/www/mapserver/log/

I'm executing Mapserver 5.6.4 under Apache2 in a Ubuntu 10.04 machine. I'm having problems writing log file. In the mapfile, I have:               CONFIG  "MS_ERRORFILE" "/var/www/mapserver/log/mylogfile.log"     DEBUG   5      Any request I make gets the same answer msSetErrorFile(): General error message. Failed to open MS_ERRORFILE /var/www/mapserver/log/mylogfile.log If I change the path to /tmp/mylogfile.log it works, but then I have a similar problem with SLD: msHTTPExecuteRequests(): HTTP request error. HTTP: request failed with curl error code 7 (Failed connect to mymachine:80; Operation now in progress) for http://mymachine/sld/polygon_simplepolygon.sld msSLDApplySLDURL: WMS server error. Could not open SLD http://mymachine/sld/polygon_simplepolygon.sld and save it in temporary file /var/www/mapfiles/4df0f886_22dd_0.sld.xml. Please make sure that the sld url is valid and that imagepath and imageurl are set properly in the map file IMAGEPATH and IMAGEURL are properly set in Mapfile (a writable directory and a correct url). The log directory belongs to www-data, and the SLD directory too, and www-data has write permission in both directories. I made a test executing, with the www-data user, a python script that creates a file in those directories and it works. Why mapserv process can't do it? Even when I change the permissions of log directory or SLD directory to 777, mapserv can't write on them, but it can it /tmp. Why? Many thanks in advance, and best regards,


looking for free shapefiles, communications and water infrastructures

im looking for communications layers shp format, covering all middle east. anything free? thanks also im looking for water bodies, rivers, anything related to water in the same area. any suggestions? thanks


Creating and serving pdf files from ArcGIS server 10.0

I am tasked with sending map data from the Flex client to an MXD then to serve that as a PDF to the client and/or a server side location. Creating the PDF isn't an issue, however, I am having trouble finding a resource to let you now how to serve it to the client. Does anyone have any experience of this? Thanks in advance.


How to get index number of list item using Python?

this gives me a list of all 55 layers in my mxd               import arcpy      mxd = arcpy.mapping.MapDocument("CURRENT")      df = arcpy.mapping.ListDataFrames(mxd, "Layer")[0]      for lyr in arcpy.mapping.ListLayers(mxd, "*", df):         print lyr.name      What I want to do is get the index number of a specific layer. For example, I want to look for the layer named 'Water' and I want the script to tell me "Water' is at position 50, so I know to look for it at the bottom on the TOC. How can I do this?


Openlayers map WMS stretched by latitude

I am working on a small javascript application for displaying map with WMS layers from 2 servers. The problem is, that image is stretched by latitude, it is wider, as it should be. This is is how it is working now: http://postimg.org/image/pxk8lfnnd/ and this is how it should be, and how it Google maps displaying: http://postimg.org/image/al321lg6l/ This is javascript code:               var map = new OpenLayers.Map("map");     var ol_wms = new OpenLayers.Layer.WMS(     "NP Podyjí WMS",         "http://mapy.nppodyji.cz/cgi-bin/mapserv.exe?map=f:/mapserv/projects/map/nppodyji_wms.map",     {        layers: "nppodyji_wms,hranice_npt,hranice_np,cyklo_CR",        transparent: "true",       format: "image/png"     },     { isBaseLayer: false, visibility: true }      );          var ol_cz = new OpenLayers.Layer.WMS(     "Česká republika",     "http://geoportal.gov.cz/ArcGIS/services/CENIA/cenia_arccr/MapServer/WMSServer",     {layers: "0,3,4,6,7,10,12,13,14,15,16,17,19,20,21,22,23,24"}     );          map.addLayers([ol_cz, ol_wms]);     map.addControl(new OpenLayers.Control.LayerSwitcher());     map.zoomToMaxExtent();          setTimeout(function() {     var fromProjection = new OpenLayers.Projection("EPSG:102067");   // Transform from WGS  1984     var toProjection   = new OpenLayers.Projection("EPSG:900913"); // to Spherical Mercator Projection      var position       = new OpenLayers.LonLat(15.8186 + (15.9626 - 15.8186) / 2,48.8027 + (48.8866 - 48.8027) / 2 ).transform( fromProjection, toProjection);       map.setCenter(position, 13);         }, 100);      I tried many map.projection and map.displayProjection changes, but I'm not really sure, if it's projection problem. It is only an example of bigger application, which take points from database and displays them dynamicaly. Displaying is correct; problem is, that client don't want it in different shape Projection should be EPSG:102067, in HTML I have also included proj4js.js. Thanks a lot for any help! EDIT: I've solved only half of the problem: Without any display settings, it is displayed like this: http://postimg.org/image/czs81gzwj/ When I used:               var ol_cz = new OpenLayers.Layer.WMS(         "Czech",         "http://geoportal.gov.cz/ArcGIS/services/CENIA/cenia_t_podklad/MapServer/WMSServer",     {layers: "blablabla"},         { projection: new OpenLayers.Projection('EPSG:3857')}      );      it looks like this: http://postimg.org/image/vm8rkxgoz/ so exactly what I want! However problem is with another WMS server. When I was trying to change projection, or displayProjection in:                   var ol_wms = new OpenLayers.Layer.WMS(         "NP Podyji WMS",         "http://mapy.nppodyji.cz/cgi-bin/mapserv.exe?map=f:/mapserv/projects/map/nppodyji_wms.map",         {             layers: "nppodyji_wms,hranice_npt,hranice_np,cyklo_CR",             transparent: "true",             format: "image/png"         },         { isBaseLayer: false, visibility: true } ,         { projection: new OpenLayers.Projection('EPSG:XXX'),         displayProjection: new OpenLayers.Projection("EPSG:XXX")     }              );      It has basicly no efect :/. I was trying several projections in "projection" attribute, also in displayProjection, but only visible output was http://postimg.org/image/yv0oe22tf/ (note the pink square on the bottom). So it get some parameters, but they are wrong, or maybe he server is wrong, I'm not really sure. The 2nd wms did not fit in the baselayer (1st WMS)


Issues when importing line shapefiles into NetworkX

Note that although I am using Python Console from within QGIS for this, I don't think it's a QGIS issue. Below is the difference of how NetworkX is dealing with 2 line layers created by the same source and of the same geographic area: **Layer 1 behaviour:**               >>> import networkx as nx     >>> import matplotlib.pyplot as plt     >>> lyr_1 = nx.read_shp(str(iface.activeLayer().source()))     >>> lyr_1.nodes()[:10]     [(-66.9813, 46.988354), (-66.927948, 45.855299), (-66.019929, 45.902869), (-64.862855, 46.686669), (-65.678366, 47.000052), (-67.335783, 47.350849), (-64.903621, 46.102999), (-66.525846, 46.049331), (-64.834094, 46.105918), (-64.780438, 46.095201)]          >>> lyr_1.edges()[:10]     [((-66.9813, 46.988354), (-66.973318, 46.982436)), ((-66.927948, 45.855299), (-66.929311, 45.855625)), ((-66.927948, 45.855299), (-66.92766, 45.857282)), ((-66.019929, 45.902869), (-66.017847, 45.902763)), ((-64.862855, 46.686669), (-64.861357, 46.688359)), ((-64.862855, 46.686669), (-64.861859, 46.685471)), ((-65.678366, 47.000052), (-65.67414, 47.00105)), ((-67.335783, 47.350849), (-67.335363, 47.353686)), ((-67.335783, 47.350849), (-67.326822, 47.349927)), ((-64.903621, 46.102999), (-64.903472, 46.103577))]          >>> route = nx.shortest_path(lyr_1, lyr_1.nodes()[1], lyr_1.nodes()[10])          >>> route_length = nx.shortest_path_length(lyr_1, lyr_1.nodes()[1], lyr_1.nodes()[10])     >>> route_length     158          >>> route_graph = nx.subgraph(lyr_1, route)      >>> nx.draw(route_graph)     >>> plt.show()      The following is the result: ![enter image description here](http://i.stack.imgur.com/quRWM.png) **Layer 2 behaviour:**               >>> lyr_2 = nx.read_shp(str(iface.activeLayer().source()))     >>> lyr_2.nodes()     []          >>> lyr_2.edges()     []          >>> nx.draw(lyr_2)     >>> plt.show()      No plot is shown of the second layer. I am confused to this problem as both layers were created by the same source. **Question:** Why isn't NetworkX reading my second layer properly?


Pie-Chart Coordinates in QGIS

I have a map of a region and I am plotting pie-charts (as diagrams) over every country in that region in QGIS (1.9.0). I also need to connect those pie- charts with lines (which I am creating in the Mapping Toolbox of MATLAB as a separate shape-file). Can you please tell me if there is a way of knowing in advance what coordinates of a country QGIS shows its pie-chart at? Also, can I capture those coordinates automatically (even before the pie-charts are drawn) just as I would normally do using the Coordinate Capture plugin? That way, I can create the lines from one point to another before even plotting the pie- charts. Thank you.