Aggregating a raster to fit a polygon grid

I am working at the scale of 10 square km grid cells for the UK, and have a polygon layer of the Ordnance Survey 10k grid cells in ArcGIS. I have another layer of the human footprint index, also for the entire UK, that I am using to stratify my data. However, the resolution of this human footprint index is much greater than that of the 10k grid cells, so I want to aggregate the cells, such that I have a human footprint index value for each 10 sqkm cell. When I try to do this, however, the squares and grid do not line up - as can be seen in the pictures. They are in the same projection. Is there any way to aggregate a layer to the confines of a polygon grid? Any help would be very much appreciated! Images here: ![Before aggregation](http://i.stack.imgur.com/KOH9C.png)   ![After aggregation](http://i.stack.imgur.com/WsC15.png)


How to get SAGA working with QGIS Sextante?

I just created my account on this forum to find an answer to a stupid (?) problem I can't deal with.   First, let's precise I just (some months ago) learned on my own what GIS was, and gave it a try using QGIS. I'm working on Windows XP. I apologize in advance for my not so good English, and my poor skills (and maybe bad vocabulary) in GIS and kriging. My problem is: I need to use kriging to interpolate punctual data from a vector layer (points); this layer is created by me from fieldwork measurements and is in .shp format (try.shp).   I had a look on the internet and saw there were 2 possibilities : use SDA4PP plugin, or Sextante toolbox with SAGA. I wasn't able to have any of them working.   Apparently, SAGA is much easier, thus I would prefer to work with SAGA. What I have done so far: I downloaded the last version of QGIS via OSGeo4W (all packages selected).   I downloaded SAGA 2.0.8 from Sourceforge.net (version *_bin_msw_win32), activated it Sextante toolbox, entered the right folder path (which contains spaces) in Sextante configuration. When I want to perform ordinary kriging, I select the layer, the attribute (which is "id"), ask for a variance grid, target grid is "[0] user defined" (no other choice), I choose an exponentiel variogram model, no block kriging and no logarithmique transformation, and let the default values for the other parameters (especially, grid and variance rasters are saved to temporary files). Then I click "OK" and get this message error:               Could not layer: C:\DOCUME~1\user\LOCALS~1\Temp\sextante\sagaordinarykriging6fd1782d35df....tif. Check the Sextante log to look for errors.      Here is the error log :               Could not load model watersheds.model     ALGORITHM:ftools:export/addgeometrycolumns      and the algorithm log :               sextante.runalg("saga:ordinarykriging","C:/Documents and Settings/user/Bureau/Kriging/try.shp","id",True,0,1,False,100,False,0,10,100,1,0.1,1,0.5,1000,4,20,1,True,"-55.4887564869,-55.4887477484,-8.61474380806e-07,4.59453003047e-06",None,None)      Any idea of the reason why it doesn't work?   Thanks. * * * I tried to uninstall-reinstall OSGeo4W using the advanced options. I selected SAGA as a package when reinstalling, but SAGA was not really installed: the tar.gz was downloaded and that's all. I unzipped it, and then I had to enter manually the path, which I chose to be without spaces (C:\OSGeo4W\saga, after having cut-pasted the SAGA unzipped folder at this very place). And ... same as before ... Same error, same behaviour, all the same. Any clue ? -- Edit: The installation worked well, no errors. I precise I removed all the files concerning SAGA and QGIS before reinstalling (with Add/Remove Programs and Search). * * * It worked ! I really can't explain why, but it worked. Until now, I was working on a self-made point shapefile, with random points with "id" within the range 0-150. Recently I used a file containing real data from fieldwork, and it worked. I did exactly as for the first file, no clue why it suddenly worked. One more thing. When using SAGA software, I can choose to select a variogram or not; it seems I can't select a variogram using SAGA via the Sextante toolbox, even if I want to. Why ? Is there a way to select a variogram using SAGA via the Sextante toolbox ? Besides, I guess it's always better to select a variogram (I'm a beginner in kriging). What do you think ? Cheers


How to compute area for polygons in an EPSG:4326 shapefile?

I have a shapefile covering the whole globe, in EPSG:4326 (geodetic WGS84). I would need to compute the polygons areas in a metric such as km2. How can I do that in QGIS or with gdal/ogr and having a good precision?


Stop rounding values in Qgis attribute table

I am calculating the areas of my polygons in Qgis using $area and everything works fine until I click on "save". All my values are rounded to an integer. I tired setting the output field type to decimal but still see the same problem? Any solution to that? I am using Qgis 1.8


What does `findCloseEdges` do in osm2po?

I have something like this:               int[] edges = graph.findCloseEdges(lat, lon, 1); // returns only one element     RoutingResultSegment rrs = graph.lookupSegment(edges[0]);     LatLon[] latlons = rrs.getLatLons()      For the red dot in the image (with `lat`/`lon`), array `latlons` contains the blue points. I would instead expect "close edge" to be a segment of the A3/E70 road. Here is the image (I don't have enough reputation to post images apparently). What is the third integer argument in `findCloseGraph` and what does this method return? I need to do simple "snap to road".


GeoJSON in Leaflet

I'm just starting to work with leaflet and have a basic question about showing a geoJSON file. First, I found this excellent article with example code: http://bl.ocks.org/lxbarth/4019660 However I have a more basic/beginner question, in that example the set the JSON file through this url: http://polymaps.appspot.com/county/{z}/{x}/{y}.json However, the file I converted (from shapefile to geojson using quantum gis) is just a .geojson extension. I'm clearly missing something here, perhaps a way to convert the geojson file into a tile format? Can someone elaborate as to how I'm supposed to do this or what my missing step is? Do I need to be hosting the geoJSON file on a server in order to do this? If my file is called polygons.geojson, how would I go about using it in the above reference code? Thanks!


Google base layer opacity change in OpenLayers 2.13

I have recently swapped from using OpenLayers 2.12 to 2.13.1 as it fixes a bug. However in 2.12 I was using a base layer opacity of 0.7 to 'knock back' the map so that the vector layers stood out more, but this doesn't work in 2.13. In 2.13 OpenLayers the base layer opacity on a Google map is applied to all layers, so this trick doesn't work. I believe this is because 2.13 changes how Google base layers are handled (see release notes). Anyone have a suggested work round that will work in OpenLayers 2.13.1? i.e. I want to make the map layer more transparent/less contrast while keeping the vector layers at full contrast so they stand out. Also I am testing with Google but may go with a different map provider in the final application, due to licencing costs, so a generic answer for any base map type would be helpful. Thanks in advance for your help.


How do I find location of minimum value within a buffer (around a point)

1. I have a digital elevation model (DEM) with a point location defined.    2. I want to locate the lowest height values at a set distance from this point.    3. I envisaged creating a buffer around the point and then locating the lowest height values; firstly is this the best way of achieving this, if not can you recommend another option ?    4. If it is the best way, once the buffer is created around the point, how do I extract DEM cells with the lowest height values? I dont want to know what their values are, I want to be able to identify the cells and know where the cells are.  Thanks for any assistance you can provide.


Where can I find GIS data to test GIS coordinate operations?

I am trying to find some data that can be used to test GIS coordinate operations from one CRS to another CRS. So far all I have found is the Gold Data set and also various example points in the EPSG G7-2. The gold data is OK for testing some projections from WGE and the few points in the G7-2 document are good for testing individual operations. What I need now though are some points that can test implicit as well as explicit concatenated coordidnate operations such as EPSG:4277 to EPSG:4230 for example, which I had found a sample for in http://www.epsg.org/Exchange/1065.pdf. There has to be a good source out there with more than one point and CRSs using multiple datums. Fly, Google monkeys, fly! **EDIT:** I also found something called GIGS


How to create an oriented buffer using arcpy?

I would like to create an oriented buffer for every polygon in my shapefile using arcpy. By oriented I mean that I have two angles a1 and a2 that constraint the direction of the buffer. This is represented in the graph below: ![enter image description here](http://i.stack.imgur.com/tjCrb.jpg) Any ideas?


How to create heatmap (concentration of points) in QGIS?

There was already a question about it in 2010, where the answer was basically "use QGIS Heatmap plugin". I've also read on QGIS webpage that it is now "implemented as a native C++ plugin" My question is probably stupid, but I haven't found the answer: what is the best way to generate a heatmap from a list of observations, in QGIS?


How to determine the longest line segment within a polygon that passes through its centroid?

A PhD student approached me recently asking how one would determine the longest straight line that passes through the centroid of a polygon, the output being a polyline rather than just a table of numbers. The polyline would be within the polygon starting at the edge at one end, passing through the centroid, and then end at the opposite edge. Does anyone know how to calculate this? I'm surprised (but I guess I'm showing my ignorance) that this is not some interface in ArcObjects. I would have posted an image to explain what I am asking (I hope it is clear) but as a newbie to this site I was not allowed to upload images! The polygon represents the crater edge of a volcano with no islands so the polygon can have an irregular shape.


Problems with spatial autocorrelation in Geographically Weighted Regression (GWR) analysis

I have conducted an **Ordinary Least Squares** (OLS) and **Geographically Weighted Regression** (GWR) analysis in ArcGIS where I have tried to predict biodiversity patterns in an area. When I examine the results with **Spatial Autocorrelation** the residuals tends to be clustered with a fairly high Z-value. The result from the GWR, however, tends to be the expected when I visualize it. How do I handle the clustering? What problems does it creates, IS there any problems?


Make selected polygon a different color without covering everything

Working in ArcGIS 9.3 I'm selecting polygons by attributes and trying to have the selection show up as a light yellow. I set the selection color to the light yellow and it's the 'lowest/last' layer but it covers all of the other layers. Is there a way to change it? Thanks!


Why does only one of the following queries throw an error?

There are 2 SQL queries:               SELECT wkb_geometry FROM building_polygon WHERE ST_Contains(wkb_geometry, ST_GeomFromText('POINT (29.4 60.1)'));     SELECT wkb_geometry FROM building_polygon WHERE ST_Contains(wkb_geometry, ST_GeomFromText('POINT (30.32670 59.92843)'));      The first query works fine but returns 0 rows. But the second query throws an error `Operation on mixed SRID geometries`. It is not problem to point SRID for second query but it is not clear for me why the first query doesn't returns the same error. Is it expected behavior?


What's the purpose of wms_metadata.xml and admin.sld?

I've installed QGIS Server and it works fine. But in /usr/lib/cgi-bin/ folder I've found 2 additional files - `wms_metadata.xml` and `admin.sld`. What is the purpose of these file? I've never used them.


How to perform repetitive tasks in QGIS?

I am trying to do a treatment on many feature files, so I would like to automate it. In fact, I have one shapefile with the spatial distribution of some species, and one with vegetation type. I would like to select (by attribute) one species in the Species Shapefile, then to select (by locality) all vegetation areas which intersect with their distribution area. Finally, I would like to have a shapefile with, as name, the species name, and with attributes and forms of the frequented vegetation types. And I would like to repeat this for all species (more than 100), and if possible do this in an easy manner (so it could be done by another person). I have already tried this task using Sextante plugin, but I can't have the species name as a shapefile name at the end. Can someone suggest a method for this?


How to declare folder name as global?

I have asked similar question at stackoverflow but posting here as well since it involves ArcGIS and python Add-In. Following code shows first step where i have to declare output folder as global so that later outputs can be saved in it as well. Right now I am getting an error at output folder string r'optfile/ras1'. Any help how to correctly store files in output folder and declare it as global would be appreciative.               import arcpy     import os     import pythonaddins          from datetime import datetime          now = datetime.now()     month = now.month     year = now.year          optfile = "C:/temp/"+str(year)+"_"+str(month)          class DrawRectangle(object):     """Implementation for rectangle_addin.tool (Tool)"""         def __init__(self):             self.enabled = True             self.cursor = 1             self.shape = 'Rectangle'             os.makedirs(optfile)                  def onRectangle(self, rectangle_geometry):         """Occurs when the rectangle is drawn and the mouse button is released.         The rectangle is a extent object."""              extent = rectangle_geometry         arcpy.Clip_management(r'D:/test',                                "%f %f %f %f" % (extent.XMin, extent.YMin, extent.XMax, extent.YMax),                                r'optfile/ras1', "#", "#", "NONE")         arcpy.RefreshActiveView()


How to calculate orientation of line segments using open source GIS?

I'd like to calculate the orientation of line segments relative to north direction using open source tools. Which tools or functions would you recommend?


How to calculate polygon length and width using open source GIS?

How can I calculate the length and with of polygons using open source tools? By "polygon length" I mean the length of the longest line within the polygon (update: to be correct, I just need the longest line within the polygon's convex hull) and the width as the longest measure perpendicular to the length measurement. **Update:** I'm trying to create a non-axis aligned minimum bounding rectangle for a polygon. The length of this minimum bounding rectangle would be the polygon's diameter.


How to write a script that will automatically draw lines from one point to multiple destination points? (ArcMap 9.3)

I need to create lines from an airport to numerous destination locations. The destinations change often, so drawing them manually becomes tedious. I want to create a script that will draw them automatically. Does anyone know how to do this? I've written a number of scripts for ArcGIS 10 using arcpy, but nothing for 9.3. If you could point me in the right direction that would be great.


How to improve speed of rendering polygons from Postgis in Leaflet?

I want to improve speed of rendering polygons in my Leaflet map. Polygons are stored in Postgis, and are rendered with select query with bbox. I wonder can I cache somehow those polygons? I read about Tilestache a bit, but I'm still not sure if that would help in speed performance. Also, one of my problems is that I need to relate postgis tables with non- spatial tables in my postgresql. So, some of the attributes I need to show in the popup are in some other non-spatial tables in Postgresql. Just to be more clear, that map is already developed and all works but I want to improve speed of polygons rendering. Can you give me some advices?


How to transform shp file into raster file in Quantum GIS?

I'd like to transform a shape file into raster file in Quantum GIS... and the opposite way back also (raster to shp). Can you help me?


MapServer MapCache WMS

I just installed mapserver and mapcache on a Debian server. I struggled to put those two to work :D. Now when I call this url (by the way I don't know if it's the good one) //myserver/cgi- bin/mapserv/service/wms?map=/opt/basemaps/osm- google.map&mode=browse&template=openlayers, I get the map pat it is just a single image ! no tiles. If the map appears this means my mapcache works fine ? Is there anything i missed.               ./mapserv -v     MapServer version 6.5-dev OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WFS_SERVER SUPPORTS=WCS_SERVER SUPPORTS=FASTCGI SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE      Thank you Reagards


unionize intersections of merged polygons

[Updated quesion] I am using the following code to merged polygons from shapefiles for the purpose of calculating the surface area;               library(maptools)     library(rgdal)     library(rgeos)          #enter slots, e.g. area     shp_list[[3]]@polygons[[1]]@area          setwd("~/type1/speciesX1/")     # Select species     species <- 'speciesX1'     print(species)          # List shapefile-dirs for that species      shp_dir <- list.files(path=species, pattern="*.shp", full.names = TRUE, recursive = TRUE,   include.dirs = FALSE)          # Read all the shapefiles and place them in a list     shp_list <- lapply(shp_dir, function(x) {readOGR(dsn=x, layer=ogrListLayers(x), verbose=T)})          # Check how many shapefiles have been loaded     number_of_loaded_shapefiles <- length(shp_list)     print(paste("Number of loaded shapefiles: ", number_of_loaded_shapefiles))          # Set the number of fields to 3, i.e. name, id, mrgid and set id and iso_3digit to id if present     set.seed(1234)     for(i in seq_along(shp_list)){     # EEZ       if('objectid' %in% colnames(shp_list[[i]]@data)==T){        shp_list[[i]]@data <- subset(shp_list[[i]]@data, select=-c(objectid, country, sovereign, remarks, sov_id, eez_id, iso_3digit, date_chang  ,area_m2, longitude ,latitude))        shp_list[[i]]@data['id']<-paste0(shp_list[[i]]@data$id,shp_list[[i]]@data$iso_3digit)        colnames(shp_list[[i]]@data)[colnames(shp_list[[i]]@data) == 'eez'] <- 'name'       }else{     # IHO + EEZ (e.g. Mexican part of the North Pacific Ocean, 25569)         if('iho_id' %in% colnames(shp_list[[i]]@data)==T){          shp_list[[i]]@data<-subset(shp_list[[i]]@data, select=-c(objectid_1, iho_sea, iho_id, iho_mrgid, country, sovereign, sov_id, eez, eez_mrgid, longitude, latitude, area_m2))          colnames(shp_list[[i]]@data)[colnames(shp_list[[i]]@data) == 'marregion'] <- 'name'          colnames(shp_list[[i]]@data)[colnames(shp_list[[i]]@data) == 'eez_id'] <- 'id'          shp_list[[i]]@data['id']<-paste0(shp_list[[i]]@data$id, paste0(sprintf("%1s", sample(LETTERS,1)),sprintf("%1s", sample(LETTERS,1))))          shp_list[[i]]@data <- shp_list[[i]]@data[,c(1,3,2)]         }else{     # MEOW (ecoregion, e.g. Bahamian 21980)           if('eco_code' %in% colnames(shp_list[[i]]@data)==T){            shp_list[[i]]@data<-subset(shp_list[[i]]@data, select=-c(lat, long, placetype))            colnames(shp_list[[i]]@data)[colnames(shp_list[[i]]@data) == 'ecoregion'] <- 'name'            colnames(shp_list[[i]]@data)[colnames(shp_list[[i]]@data) == 'eco_code'] <- 'id'            shp_list[[i]]@data['id']<-paste0(shp_list[[i]]@data$id, paste0(sprintf("%1s", sample(LETTERS,1)),sprintf("%1s", sample(LETTERS,1))))            shp_list[[i]]@data <- shp_list[[i]]@data[,c(2,1,3)]                }         }       }     }          # See the row names (IDs)     lapply(shp_list, function(x) row.names(x@data))          # Generate unique id string on the fly     set.seed(1234)     shp_list <- lapply(shp_list, function(x) {     new.id <- paste0(x@data$id, sprintf("%03d", round(runif(1, 1, 999)),0))     spChFIDs(x, new.id)     })          # Print mrgids     for(i in seq_along(shp_list)){       print(shp_list[[i]]@data$mrgid)     }          # Merge the SPDF      merged_shp_list <- do.call("rbind", shp_list)          # Some of the polygons (areas) are the same in the two original SPDFs.     # Check the attribute data     attribute_data_in_merged_shp_list <- merged_shp_list@data          # E.g. Alboran sea (mrgid=3324) is present in both. Make a spatial union based on a common ID-value (mrgid)     union_polygons <- unionSpatialPolygons(merged_shp_list, IDs=merged_shp_list@data$mrgid)          # Check how many polygons are present in the original merge        number_of_polygons_before_merge <- nrow(merged_shp_list)     print(paste('Number of polygons before merge: ', number_of_polygons_before_merge))          # How many polygons are present after merge     number_of_polygons_after_merge <- length(union_polygons)     print(paste('Number of polygons after merge: ', number_of_polygons_after_merge))          # unionSpatialPolygons returns a SpatialPolygons object, but we want to retain the original attribute data as well. Get only the unique rows from the original attribute data     attribute_data <- unique(merged_shp_list@data)          # Row names (IDs) need to match the IDs in union_polygons     rownames(attribute_data) <- attribute_data$mrgid          # Create a new SPDF     final_shp_list <- SpatialPolygonsDataFrame(Sr=union_polygons, data=attribute_data)          # Checks     number_of_merged_polygons_final <- nrow(final_shp_list)     print(paste('Number of merged polygons: ', number_of_merged_polygons_final))          # Calculate area     area <- gArea(SpatialPolygons(final_shp_list@polygons))     print(paste('Area (',species,')',':',area))          # Plot marged polygons     final_shp_plot <- spplot(final_shp_list, "mrgid", colorkey=F, fill='cyan')     print(final_shp_plot)      The shapefiles I'm using are from Marineregions.org In some cases, the merged polygons might overlap, depending on what type of shapefile have been used (e.g. EEZ, IHO, MEOW). I want to calculate the surface area of the merged polygons, but figured that as it currently is the calculated area includes potential intersections, so I wonder how to unionize these from a set of merged polygons. I've looked into the `rgeos package; gUnion, gIntersection, gDifference etc` but these functions only works on a pair. I'm new to this so please bare with me. Below are links to two shapefiles (choose shapefile in the Download drop- menu). For the code, place the files in `~/type1/speciesX1/` and name e.g. the folders 1 and 2 and the files within correspondingly. Sorry, for this part. **Example Data**   * Comoran part of the Mozambique Channel   * Mozambique Channel Comoran part of the Mozambique Channel is part of Mozambique Channel, thus we can see if the intersection is calculated twice for the merged polygon. **Output of Example Data** Plot of the merged polygons ![Plot of merged polygons](http://i.stack.imgur.com/Z3mNf.jpg) **Test**               area      125.6221 (as its calculated from above code)          # Area of the two polygons     A1 <- gArea(SpatialPolygons(shp_list[[1]]@polygons))     A2 <- gArea(SpatialPolygons(shp_list[[2]]@polygons))          A1     6.807844     A2     118.8142          # Area of the union     u <- gUnion(shp_list[[1]], shp_list[[2]])     uA <- gArea(SpatialPolygons(u@polygons))          uA     118.8142          # Area of the intersection     i <- gIntersection(shp_list[[1]],shp_list[[2]])     iA <- gArea(SpatialPolygons(i@polygons))          iA     6.807844 (same as A1)          uA + iA     125.6221 (same as calculated by the above code)      So the area calculated by the code does in fact include the intersection twice, i.e. no union is created, since the `unionSpatialPolygons` function creates unions based on `IDs`. Is there any function e.g. like `gUnion` (or how can I use gUnion?) for multiple (>2) spgeom objects, which I can use and add to my workflow after creating unions based on IDs? Any pointers would be highly appreciated. (If anything is unclear, please tell me so I can modify the question)


Symbolize layer and group names in TOC?

I regularly have quite large mxd projects, with lots of feature layers referenced in Table of Contents (TOC). For simplicity I group them together. The problem is that I can't see the difference between a feature layer or a group (or a group of groups). It is not only me using these documents, and it would be really useful to be able to colorize the name of groups and/or feature layers or have any other way of separate them from each other (other than having to press the +). At the very least I'd like to have one color for groups and another for feature layers, but being able to choose freely would be a big improvement. Then I can have blue for water related stuff, red for administrative, green for... you get the picture. Is there any such functionality in Arcmap? Or has anyone made a neat add-in that could do this? ![TOC](http://i.stack.imgur.com/zo19L.png) _Arcgis 10.1 on Windows 7_


Label halos in OpenLayers

I would like to add halos on my labels on an Openlayers map. I have tried adding the following to my code but no halos display.               labelHaloColor: "#FFFFFF",     labelHaloWidth: "2",      I got that from here: http://trac.osgeo.org/openlayers/ticket/2965 Do I need to use a newer version of OpenLayers to get this working? I am currently using the dev version.


Polygons for postcodes in Spain

Is there a source (free or paid) for polygons of border coordinates for spanish postcodes? Google show this borders in google maps, but doesn't provide them.


Toggle Layers from Multiple Services

I'm trying to adapt my code so that I can create a layer list of all layers in multiple services. I'd like them to be able to be turned on/off. My current code builds a dynamic layer list from one service, however, I've recently been asked to add another service to the app and append the layers to the same div. I've found this question from a while back and am running into the same issue the OP described, where I can toggle one service off, ONCE, but never back on, and I can't toggle the second service at all. The code I have modified is below. Can anybody notice any glaring mistakes or things that I might be missing? I've attempted to contact the OP in the post I linked, but thought this might help get a fresh look.                     dojo.require("esri.map");                 var layer, parcellayer, map, visible = [];             var startExtent            function init() {                  //Set the initial map extent                   startExtent = new esri.geometry.Extent({               "xmin": -9199621.530456403,                   "ymin": 3365235.5214724857,                   "xmax": -9077475.159256855,                   "ymax": 3443965.6606061114,                   "spatialReference": {                   "wkid": 102100               }           });         map = new esri.Map("map", {               extent: startExtent,               logo: false           });              var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer");         map.addLayer(basemap);                   //Use the ImageParameters to set the visible layers in the map service during ArcGISDynamicMapServiceLayer construction.         var imageParameters = new esri.layers.ImageParameters();         imageParameters.layerIds = [0,1,2,3,4];         imageParameters.layerOption = esri.layers.ImageParameters.LAYER_OPTION_SHOW;         //can also be: LAYER_OPTION_EXCLUDE, LAYER_OPTION_HIDE, LAYER_OPTION_INCLUDE              layer = new esri.layers.ArcGISDynamicMapServiceLayer("http://gisprod2/ArcGIS/rest/services/Dynamic/Zoning/MapServer", {"imageParameters":imageParameters});         map.addLayer(layer);              //Use the ImageParameters to set the visible layers in the FEMA map service during ArcGISDynamicMapServiceLayer construction.         var FEMAimageParameters = new esri.layers.ImageParameters();         FEMAimageParameters.layerIds = [0];         FEMAimageParameters.layerOption = esri.layers.ImageParameters.LAYER_OPTION_SHOW;         //can also be: LAYER_OPTION_EXCLUDE, LAYER_OPTION_HIDE, LAYER_OPTION_INCLUDE              FEMAlayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://gisprod2/arcgis/rest/services/Static/EnvironmentallySensitiveOverlayZones/MapServer", {"FEMAimageParameters":FEMAimageParameters});         map.addLayer(FEMAlayer);       }     //Sets up the ability for dynamic layers to be toggled.       function updateLayerVisibility() {         var inputs = dojo.query(".list_item"), input;         //in this application layer 2 is always on.         visible = [];         for (var i=0, il=inputs.length; i<il; i++) {           if (inputs[i].checked) {             visible.push(inputs[i].id);           }         }         //if there aren't any layers visible set the array value to = -1         if(visible.length === 0){         visible.push(-1);         }              layer.setVisibleLayers(visible);       }               //Sets up the ability for FEMA layers to be toggled.     function updateFEMALayerVisibility(){         var inputs = dojo.query(".FEMA_item"), input;         //Placing layer numbers below will enforce them to be visible.         visible = [];         for (var i = 0, il = inputs.length; i < il; i++) {             if (inputs[i].checked) {                 visible.push(inputs[i].id);             }         }         //if there aren't any layers visible set the array value to = -1         if(visible.length === 0){         visible.push(-1);         }              FEMAlayer.setVisibleLayers(visible);          }            dojo.addOnLoad(init);     </script>                          This sample loads an ArcGISDynamicMapServiceLayer and presents check boxes for only the layers that should be toggled on and off by users.
           FEMA:
         <input type='checkbox' class='FEMA_item' checked='checked' id='0' value='0' onclick='updateFEMALayerVisibility();' /> FEMA Layers

           Zoning:
         <input type='checkbox'  class='list_item' checked='checked' id='0' value=0 onclick='updateLayerVisibility();'/> Zoning Classifications


What software would be useful to create General Transit Feed Specification (GTFS)?

I am doing a project in which i am required to create GTFS. I look at transit google developer forum which provide a format to create feed but that completely have to done by hand (we have to write text files), i was looking for a software that can help in this matter.


OGIS Ole Db provider sample with read/write capability

I'm trying to determine what level of effort would be required to develop an OGIS Ole db provider for ArcGIS. There is a sample that is read-only. I would like to be able to edit featureclasses in the ole db workspace using the out-of-the-box editing tools in ArcMap. Plus, I would prefer to develop in C# instead of C++. I see that there was an effort to do this with zigGIS, but it never was completed. Does anyone know of sample code showing how to do this?


Is there a way to traverse and select all vectors connected to a starting vector?

Preferably using QGis I'd like to remove errors from a road network .shp file and was wondering if there was a away to perform a flood fill or traversal on a vector layer to select all connected vertexes from the starting vertex to do basic validation and remove unconnected roads. Thanks.


ArcGIS Calling Wrong fme.exe When Python Script Converted To An ArcGIS Script Tool

I'm using this this bit of code to execute a FME Workbench file through a Python script ...               import os     os.system("fme.exe P:\\Mapping\\Scripts\\FME\\Easements_ROW_Extract_From_CAD.fmw")      However, when I try using it as an ArcGIS script tool, ArcGIS tries to execute it using the Data Interop's fme.exe. I only have the stand alone version of FME. I tried using the full path to the fme.exe i'm trying to use, but that's not working ( the script runs without error, but nothing is produced). Any ideas on how to get this script to work, using the stand alone version of FME, as an ArcGIS script tool?


Spatio-temporal block kriging with R package gstat?

In the documentation of `sp` I saw that the `coords` argument of the `SpatialPolygons` function only accepts 2 columns. Is it not possible to create 3-dimensional polygons? I am doing spatio-temporal kriging using package `gstat` by adding time as a third spatial dimension of a `SpatialPointsDataFrame`. I would like to extend that to block kriging with polygons as blocks. Is there any way to do that?


How to restrict access to GeoServer webapp to Localhost in Tomcat 7

I am currently running Tomcat 7 on a Windows Server 2008 machine. I have GeoServer 4.2.1 installed as a `war`. What I need to do is restrict access to GeoServer Manager only to Localhost. As it currently stands you can access the Manager anywhere by going to               https://www.mydomain.com/geoserver      I would like to only give access to Geoserver Manager by means of               https://127.0.0.1/geoserver      I have updated by `context.xml` file to limit access to Tomcat Manager via localhost with this:               <Valve className="org.apache.catalina.valves.RemoteAddrValve"allow="127.0.0.1" deny=""/>      Would I do something similar? Any help is greatly appreciated.


Georeferencing PNG against Google maps with openlayers plugin

I am trying to georeference blueprints to the footprint of a building. I'm using the Google Satellite image from the plugin to do this. The blueprints are rotated about 30 degrees. When I run the georeferencer after placing GCP, the blueprints load in vertically, but the rotation doesn't occur... Why is this? I figured it would line up the GCPs properly... Thanks


Applying pixel reliability mask to time series MOD13Q1

I am working with a 23-band GEOTiff in which each band is a 16-day MVC MODIS NDVI image. The MODIS .hdfs include a "pixel reliability" image with the following values:                    [-1]: Fill/No Data-Not Processed.           [0]:  Good data      - Use with confidence           [1]:  Marginal data  - Useful, but look at other QA information           [2]:  Snow/Ice       - Target covered with snow/ice           [3]:  Cloudy         - Target not visible, covered with cloud      I want to apply a quality mask using ENVI to elimate pixels with values of -1, 2 and 3. I know how to do this for a single image using the "Build Mask" function in ENVI. If I use the 23-band NDVI.tiff file as my input and use the 23-band pixel reliability file as my mask, will this mask each NDVI image with its respective pixel reliability (i.e. January 1st NDVI will be masked with the January 1st pixel reliability mask), or will the "Build Mask" perform some other operation? If I am thinking about this in the wrong way, is there a better way to apply the quality mask to the time-series stack? Many thanks! Emily


How to Share Open Source Python Code for ArcGIS?

My company just purchased ArcGIS software. I'll be writing scripts for ArcGIS in Python. Is there a community or open source project where this code can be shared?


Python: Change SDE data source for mxds in specific folder

I've searched all the forums and help and have made progess but recently got an error that has thrown me for a loop - also some mxds are not being changed at all! What I'd like my code to do: Iterate through mxds in a specific folder, change the SDE data source in each layer within an mxd and change it to the new SDE source (we just upgraded our server). Then I'd like to either save over that mxd, or save to a new folder (whatever works!). Here's the code:               import arcpy     import os          folderPath = "G:\GIS\Services\Test"     for fileName in os.listdir (folderPath):         fullPath = os.path.join(folderPath, fileName)         if os.path.isfile(fullPath):             basename, extension = os.path.splitext(fullPath)         if extension.lower() == ".mxd":             mxd = arcpy.mapping.MapDocument(fullPath)             print "MXD: " + fileName             arcpy.env.workspace = fullPath                         mxd.replaceWorkspaces("", "NONE", r"Database Connections\Connection to gisserver.sde","SDE_WORKSPACE")                  print "successfully changed data sources"     mxd.save()     del mxd      This worked sucessfully when tested with one mxd in a folder, so i thought it would apply to a folder with more mxds, however   The error I received while attempting to iterate through the folder: > Traceback (most recent call last): File "C:/Users/lyee/Test2", line 10, in > mxd = arcpy.mapping.MapDocument(fullPath) File "C:\Program Files > (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\arcobjects\mixins.py", line 608, in > **init** assert (os.path.isfile(mxd) or (mxd.lower() == "current")), > gp.getIDMessage(89004, "Invalid MXD filename") AssertionError: Invalid MXD > filename.


Unknown gridlines on old Greenland base map!

Can anyone help me out please? I'm using an old 1:10,000 base map of Greenland for a mapping project with nice 10cm gridlines already drawn on. However it uses a coordinate system which is unfamiliar to me, it has values of 92 up to 112 on y axis and 124 to 138 on x axis, which increase by increments of 2. My mapping area is around 61 N, 45.15 W, can anyone please tell me what the grid system my map uses represents? Thanks Eleni


How to view DGN file in ArcMap?

I have a DGN file made by Workshop Paint Pro and would like to view it in ArcMap 10 so that I can create a risk map. What are the procedures I need to follow?


Why doesn't the Kernel Density Estimate function appear in AniMove plugin?

can anyone tell me why the Kernel Density Estimate function does not appear under my AniMove plugin in QGIS? I can only perform the MCP. I run Windows OS.


Adding a GIS feature to existing database entry with QGIS

I've built a database with postgreSQL with tables, which include geometry columns. When I add some data to my non-geometry columns, I can see them in QGIS when I connect to my database using postgis. Now, I want to add polygons to the existing entries with the editing tool in QGIS. That means, filling up the geometry columns in QGIS. How can I do this? I've only heard about adding whole shapefiles to the database but not to add single features to a single column. An example... I have the following table (municipality):               id smallint NOT NULL,     name varchar(50) NOT NULL,     mun_geom geometry(Polygon, 31468)      I can fill the columns id and name in postgresql when I'm connected to my database (like (1,'municipality1')). After adding municipality as a postgis layer I want to complement the entry with adding a polygon feature.


No module named PyQt4

I'm totally new to python and am getting the above message when I run my script. Can't find any basic step-by-step instructions on how to import this module. Just wondering if anyone could give me some hints? Thanks!


How to Resolve Inconsistent OpenLayers vector position Over Google map

I have an OpenLayers map with a Google base layer and an OpenLayers vector layer on which people can draw their own bounding boxes using the DrawFeature control. I have found that, as you zoom in, the vector is not plotted covering the same co-ordinates at each zoom level. Rather it seems to zoom at a different ratio to the underlying layer. Strangely, if I resize the browser window, the vector then stays at a consistent position through all the zoom levels (i.e. becoming larger or smaller but covering the same geographic range, as one would want it to), but slightly offset from the position it was initially drawn at. The remains the case even if I make the browser window full size again. See example below:   1. I draw a vector touching the Belgian border. ![first example](http://i.imgur.com/qRams1v.jpg)   2. I zoom out and the vector is now well within Germany. ![second example](http://i.imgur.com/QFTktl9.jpg)   1. I resize the browser window and the box anchors to a consistent set of co-ordinates but offset from its initial position, now overlapping the Belgian border ![third example](http://i.imgur.com/Rxu0z1r.jpg) Please note that this is not the same issue as the vectors scrolling more slowly than the map when dragging the map. The vectors seem to stick to the same area when dragged, but zooming causes them to move relative to the underlying Google layer. Is this a known issue and can anyone help resolve? In answer to the question about my initialisation of the layers, my code is as follows:               var miny=-2000000; var minx=6000000; var maxy=600000; var maxx=10003750;              // allow testing of specific renderers via "?renderer=Canvas", etc     var renderer = OpenLayers.Util.getParameters(window.location.href).renderer;     renderer = (renderer) ? [renderer] : OpenLayers.Layer.Vector.prototype.renderers;                    //define the layers needed         g_phys  =   new OpenLayers.Layer.Google("Google Physical",{type: google.maps.MapTypeId.TERRAIN, numZoomLevels:20}, {isBaseLayer:true});         g_sat   =   new OpenLayers.Layer.Google("Google Satellite",{type: google.maps.MapTypeId.SATELLITE, numZoomLevels:20},{isBaseLayer:true});         bboxes  =   new OpenLayers.Layer.Vector("Bounding Boxes", {rederers:renderer});                    //delete feature on select     bboxes.events.on({"featureselected":function(e){bboxes.removeFeatures(e.feature); erasefeature(e);}});     //refresh on visibility change     bboxes.events.on({"visibilitychanged":refreshMap});     //do stuff on modification of vector     bboxes.events.on({"afterfeaturemodified":modbox});               //create new set of option for the map     var options = {                 projection: new OpenLayers.Projection("EPSG:3857"),                 units: "m",                 maxResolution: "auto",                 maxExtent: new OpenLayers.Bounds(miny, minx, maxy, maxx),                 theme: null,                 layers: [                     //define the base layers for the map                     g_phys,                     g_sat,                     bboxes                              ]                  };               //create new map object based on "map" div     map=new OpenLayers.Map('map',options);


Model Builder - unique name segment creation

Is it possible for us to give each output of a process a unique name segment (inline name). So for example I have a process that dissolves, then eliminates and buffers a single input file. I need to save the itermediate steps into a gdb. So we have [TownNameX_slope]--Dissolve[\townDissolves.gdb\TownNameX_dissolve]--eliminate[townEliminates.gdb\TownNameX_eliminate] etc. then TownNameY etc. So in a batch process I have to keep entering TownNameX for each output type. I know in iterators you can use %n but this is for just the output of one tool. Can we extend this to all the output where %n=townnamex and then for dissolve the output is %n_Dissolve etc I guess the other option is to run it in python in a "for" loop but I would prefer to stay in model builder as the reporting is easier. This is similar to the question in ArcGIS 10 Model Builder In-line variable substitution for input data path Thanks


Mapfile + OpenLayers: accessing the database by column names (hover, onclick functionality) without using MapServer templates?

What I'm trying to accomplish: take the functionality below (see picture) and do the same without using a MapServer template (if this is even possible). I currently have a mapfile, and an openlayers file. All the data is being displayed correctly. In my mapfile, I reference a database. I call out that database by a column name so what is what's used for the label on the map. Quite simple. Now, the thing here is that I'm accessing just a standard php/html file. Not a mapserver template, like:               http://192.168.2.164/cgi-bin/mapserv.exemap=%2Ftmp%2Fnavhome%2Fnavcore%2Ftemplates3%2FAllAirports.map&mode=nquery&imgext=-180.000000+-107.943706+180.000000+107.943706&imgxy=640+384&zoom=0&qlayer=Cities&layers=world&searchmap=true&img.x=705&img.y=347      Example: 123.456.7.890/mymap.php in the browser is what I want. Not the above. Now if I wanted to accomplish this using a MapServer template (correct me if I'm wrong on my terminology), this has proven to be quite easy, because you can reference               map_body.html     map_header.html     map_footer.html      in your Mapfile. In those files you can do some javascript and whatnot, reference the columns in the DB and it works. See below for an example of this (top left is the onClick functionality when you click on a point on the map, where the mouse is is just the mouseover). **See below: this is what I want to do without the cumbersome MapServer functionality, ie sluggish navigation buttons** ![this is what I want to do JUST using a MapFile and OpenLayers, no MapServer template](http://i.imgur.com/tonZR81.png) So what I'm trying to wrap my head around is: how do you set up the database references in your .html/php file? Or, how do you reference the templates (map_body.html, map_header.html, map_footer.html) from your MapFile in your OpenLayers file?


URL Hyperlinking

I would like to have the URL from an attribute (in the attribute table) as a 'hotlink' wherein you can click on the URL and it opens the browser with the data. As it is right now, I'm having to "toggle edit" the attribute table, R-click on the feature, open form, and copy/paste the URL into a browser. I don't write python code so does anyone have a quick workaround for me? (I can paste python script). Thanks!


Delete feature from geographic database

How do I delete a selected feature from database when it is clicked on in the ArcGIS API for javascript?


Wireframe display of terrain in ArcGlobe?

I have successfully imported a terrain dataset into ArcGlobe which provides elevation values to the globe surface. Is there an easy way I can now change the symbology/display of the terrain/globe surface to a 'wireframe' style display, ideally with customisable grid spacing etc? Or would I need to drape a grid image over the terrain surface?


How to specify field name in raster to feature conversion tool or intersect tool?

**What I want to do :** input: raster file, polygon feature layer process:   1. Convert raster to polygon using `IConversionOp.RasterDataToPolygonFeatureData` Method   2. Intersect resultant polygon feature class and input feature layer using Intersect tool from my c# code. I am doing these two steps perfectly. But I need some specific field from intersected layer for next steps. So it would be helpful if I can specify field names in intersected layer. But I could not find any way to specify field names. It would be helpful if anyone can give me some idea how to specify some field names. If there is any process to take fields from one feature class and not from another feature class in intersect tool, that will also solve my problem. Or when I am converting a raster to a feature class, can I specify the value field name? Or is there any rule for value field name in the newly created feature class from the raster layer. By default the field of this value field in feature class is "GRIDCODE".


How do algorithms load pieces of maps?

If the user moves the mouse pointer to the top left corner of the screen, I want my software to auto-load the three tiles that are closest to the mouse pointer. My assumptions are that the smaller are the map tiles to be loaded, the lesser tiles I will have to load. The question is,   1. whether there is any existing logic that I can use for this loading (something people have used already, since I need a flexible way to ) and ...   2. ...a flexible way to store the loaded tiles in C++?. My app is in C++, and I'm planning to store each tile as either a class or a struct. Is there an existing way/a better way to do it? **EDIT:** Responding to Dan: I'm still in fact-finding stage, and currently only have a map with roads stored as lines, where each line is composed of a list of line segments specified by a starting lat-long and an ending lat-long. I'm open to using any tiling scheme, but in a simple way, I'm visualizing the map to be divided into a grid of small squares, so the squares/tiles close to the mouse pointer and containing road segments should be loaded into memory. My algorithm would then process the loaded tiles to find the angle of the road and to check if the road forms a junction with other roads etc. My algorithm can't afford to wait for too many loading operations from the hard-disk. The priority is knowing how to store information so that I'll have them in the RAM as quick as possible. Whether to pre-calculate the tile area and store the tiles in a database or whether to extract square portions from the map and cache them in the RAM was a decision I was trying to take when I posted this question.


how to export the entire bounding box from overpass-turbo?

I'm new to the overpass-turbo world, so sorry if the question sounds silly. What I'm trying to do is to export all the elements (peak, tracks, routes, streets.....) of a bounding box I have selected. I'm trying to do this with the wizard, but within it I have to choose specific tags and so export one element per each time, right? Thanks!


Error G_Calloc v.to.rast

Using the grass GUI I get this error message: ERROR: G_calloc: unable to allocate 2004389888 * 8 bytes of memory at raster.c:71 What can i do to remedy this?


Bearing Distance to Line tool from dBASE table only draws one line in ArcGIS 10

I am using the **Bearing Distance To Line** tool to draw geodesic lines to points defined by a bearing and distance. This is an aside, but I will then use the **Feature Vertices To Points** tool to convert the lines to points. I have a dBase file (because my Excel and CSV tables were failing for some unknown reason which may become the subject of another question) with the bearings in decimal degrees and the distances in meters. All of the X and Y points from which the lines are drawn are the same because the bearings and distances were all taken with a total station from a single datum point. So the X and Y fields of my table are the same value for each entry. The problem arises when I run the tool -- I only get a single output line drawn when there should be 113 individual lines with different bearings and distances from the same start X,Y coordinate. Has anyone encountered this issue before or have an idea how to resolve it? Does it have something to do with the start X and start Y being the same value for each table entry? It shouldn't be the case, but am I missing something? I am not running a custom Python script, just using ArcMap 10.0. I added the dBASE file from ArcCatalog and ran the Bearing Distance to Line tool with the dBASE file as my input file. I am expecting to see something similar to the top graphic in this **post**. To work around the problem of the Bearing distance to line tool, I found and used this **script** from Susan Jones which did work with a feature class created from the data in the dBASE file. However, I'd still like to be able to figure out the Bearing Distance to Line problem. Thanks! (As an aside, see my other question for a related, though more general question)


Move the cursor backward - opposite of row = rows.next()

I'd appreciate if anyone could please tell me if there is a way to go up one row in python cursor. opposite of row = rows.next() Thank you!


How to determine the date of the Bing imagery for an area?

Is it possible to determine how current the Bing imagery for a certain area is? I've checked the community blog and searched through the monthly updates, but I could not find my study area. I found posts where they mentioned updating the imagery for the whole country, but with no specifics (is it really the entire country? Or just most of it?). In the credits in `Layout View` in ArcMap 10.1, I noticed that while Microsoft Corporation is `2012`, the other credits are `2010`. Does this indicate that the imagery is from that year?


Query OSM ids by name in PostGIS

I installed PostGIS on a server and now I want to query the OSM ids referring to a name, in order to get a list of all geometries according to this name. Is there an efficient way to query this ids in PostGIS or do I have to use a tool like nominatim? I am new to OSM and PostGIS.


How to change the zoom on an embedded google mymap?

I embedded a google mymap in my website using the embed code they provide. However it is zoomed much too far out. How can I zoom it in? I added the second character (undrscore) so it would display. <_iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps/ms?ie=UTF8&hl=en&source=embed&msa=0&msid=212526618623367333770.0004a2dd56ade1cf3f7eb&ll=34.931542,-81.894879&spn=0.043299,0.140592&output=embed">   View Map Name in a larger map


How to export one shapefile per shape in shapefile?

I have road shapefile consists of Road No. Suppose i have a road network consisting of 125 roads. I need to get 125 individual shapefiles from one road network shapefile without select one by one. Is it possible to do?


Separating a shapefile into separate shapefile based upon their features using a python script

I have a shapefile of a US. I need to make an individual shapefile for all the states in the US using a python in ArcGIS. How can I do it?


Converting Categories to shapefiles

I have created 2 Categories in a feature using classification.Now how do I convert them into new shapefiles?


Satellite Imagery Providers

I'm building a web application - my requirements are:   * Must have _global satellite imagery_.   * Must have easy to use API's that are capable of geoJSON data imports, mouse and keyboard gestures, etc. To my knowledge Bing, Google and Yahoo are the only companies that supply both of these. Some support the former to an extent; perhaps not global (NASA, third party mapping solutions), and some support the latter (OSM for example)...but few support both. Are my only options Bing, Google, and Yahoo? **If so, is anyone aware of any ongoing projects (satellites) that are under construction that will eventually be launched and provide global satellite coverage under open source?**


How to learn ArcObjects (.NET, C#) for desktop applications but having only Arcmap desktop license?

How can I learn .NET and C# for desktop applications having only a desktop license? I want to upgrade myself in the development side so I'm trying to learn this stuff and I'm searching all the documentation on the Esri sites; everything is there to learn but I can't test in my machine. Is there any way to learn without licenses as a beginner to get the concepts of programming in GIS? I know that I should have Visual Studio in my computer but I couldn't find 2008 Express edition on the Microsoft website. Even if I have VS 2008 Express edition will it work for me in this case? I'm using Arcmap 10. Please treat me as a complete beginner in this topic and guide in that way.


can arcpy detect whether it's running in Desktop or Server?

I'm developing some code that I want to run both as an ArcGIS Server web service and as a standalone script. I want to be able to modify the execution slightly depending on whether it's running as an AGS web service or as a standalone python/within Desktop. Is there a way to detect this? I've done some searching but haven't found anything very satisfactory. I have seen arcpy.mapping.CreateGISServerConnectionFile, but this sets connections to a server as opposed to checking the current environment. I've also looked for information on how services are run w/in AGS (e.g., this), but I'm not really seeing anything along the lines of an arcpy.isWebService() type of function. Do I just need to check the environment (like to see if "%scratchFolder% has been set or examining something related to sys.argv)? Seems kind of an unstable solution.


Exchange Boundaries and Wire Centers in France and Germany

I am attempting to find a shapefile of wire center service areas / telephone exchanges in France and Germany. Ideally, a point file showing the location of the actual equipment, coupled with a polygon that shows each center's service area. To see an example of the what I'm talking about, this is the U.S. equivalent: http://www.navmart.com/wire_center_boundaries.php Obviously, free is best, but I open to sources who might have this available for purchase. Any and all help is appreciated!


Python select by attribute using a variable counter

I am brand new to python and trying to learn how to do some simple loops but I have hit a snag. Below is what I am working with, I am trying to select the polygon row by row, but I keep getting EOL errors and various other syntax issues as I try to troubleshoot. If I remove `""" findMe """` and replace with `""" "pgNum" = 1 """` it works fine. How can I change 1 to be x? I am using the python window within ArcGIS Thanks.               import arcpy     workSpc = (r'C:\Users\adams\Downloads\tmp')     smooth = 'MNR_89_Smooth'     grid = 'test_grid'     x = 1          if x == 1:         findMe = '"pgNum" = ' + str(x)         print findMe         arcpy.SelectLayerByAttribute_management("test_grid","NEW_SELECTION",""" findMe """)         x = x + 1         print x


Webmapping option that allows rasters?

I'm trying to create an introductory GIS course that will involve an ideally simple web mapping component. I was underwhelmed that ArcGIS online doesn't support rasters, and surprised that MangoMap and GeoCommons don't appear to either at the moment. Is anyone familiar with a webmapping site with a fairly simple UI that allows the uploading of raster data in addition to vector? Many thanks, David


Embed an ArcGIS Map in a Crystal Report

Is it possible to embed a map image inside a Crystal Report using ArcGIS 10? I have seen articles about creating reports based off of map fields, but I would like to include an image of a selected area (i.e. a specific parcel on a map). Is there a way to do this?


How to read this GRIB data

on this open FTP server (ftp://ftpdatos.aemet.es/modelos_numericos/hirlam005_peninsula/) you can find HIRLAM models from the Spanish meteorological service. The documentation in the LEEME files (in spanish) says the data files are in GRIB-1 format. Unfortunally I'm unable to read it. I use differet programs, like QGIS, and commaind line tools: wgrid, grid_ls, etc without success. Anyone can take a look and let me know how read it. Thanks in advance. === Updated === I'm new to grib and I dont understand about the codes and keys. The documentation at ftp://ftpdatos.aemet.es/modelos_numericos/hirlam005_peninsula/LEEME_DATOS.txt talks about IPAR, LTYP and LEV ids. Also it contains some description about the parameters in the files:               Variable                   || Unidad  || IPAR || LTYP || LEV      Temperatura a 2m                 K        011     105     2      Componente x del viento a 10m   m/s       033     105     10      Componente y del viento a 10m   m/s       034     105     10      Precipitación total            kg/m2      061     105     0     Humedad relativa a 2m          kg/kg      052     105     2       Can someone help me reading that data ??? === UPDATED === Thanks to all for your replies. I finally found the problem which is a bit embarrassing :) A was downloading files in ASCII mode instead BINARY. I can confirm the grib_api tool, once compiled and installed works perfectly. Example:               $ grib_ls 20120220000000_sfc_fc15     20120220000000_sfc_fc15     edition      centre       typeOfLevel  level        dataDate     stepRange    shortName    packingType  gridType          1            lemm         heightAboveGround  2            20120220     15           2t           grid_second_order_SPD1  rotated_ll       1            lemm         heightAboveGround  10           20120220     15           10u          grid_second_order_SPD1  rotated_ll       1            lemm         heightAboveGround  10           20120220     15           10v          grid_second_order_SPD1  rotated_ll       1            lemm         heightAboveGround  2            20120220     15           r            grid_second_order_SPD1  rotated_ll       1            lemm         heightAboveGround  0            20120220     0-15         unknown      grid_second_order_SPD1  rotated_ll       5 of 5 grib messages in 20120220000000_sfc_fc15          5 of 5 total grib messages in 1 files      On the other hand, I'm not able to make work gdalinfo with this GRIB files, but for the moment I don't require it. Thanks !!!


Pyqgis 2.2 : get signal on feature added : error message

For my pyqgis plugin 2.2, I try to: * * *               def logFeatureAdded(self,layerId,addfeatures):          message = str(layerId) + " has features added: "          for feature in addedFeatures:              message += str( feature.id() ) + ", "          QgsMessageLog.logMessage(message)          QApplication.beep()               layer.featureAdded.connect(self.logFeatureAdded)      * * * When I try to add a feature, this following error message appears: > TypeError : logFeaturesAdded() takes exactly 3 arguments (2 given).


Creating a Bing and Google Tile Layer for Leaflet

I want to use the Leaflet Javascript Library to display both a Google and Bing Tile Layer, though I'm unsure how to construct the url. The documentation shows an example using OSM:               var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/YOUR-API-KEY/997/256/{z}/{x}/{y}.png',     cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18});      But for some reason I can't duplicate this for either Bing or Google. Any ideas? Thanks.


towgs Definition for European Datum 1950

I am new to all things GIS so apologies for a basic questions. I am trying to specify the CRS of a climatic raster layer in R. It is an equal area projection based on Europe Equidistant Conic and the datum is D European 1950. Can anyone help me specifiy the argument in R? projection(myraster) = CRS("+proj=eqdc +ellps=???+ datum=???") Many thanks if you can help!


Updated: Openlayers Vector Layers with Google Map Base Layer (via Grid): Vectors Stick but can't get correct resolution/projection

Revamping this question instead of opening a new one. Previous issue: vector layers were not "sticking" to the map, so when you would zoom in or out the vector layers would "come out" at you. Note their lat and long didn't change, but it looked pretty tacky when zooming-as they would not stick to the map. It seemed like the only way to do this (the stick factor) was to use a WMS or Grid Layer: correct me if I am wrong. I chose Grid in this instance. Note: the "stick factor" is not an issue when the base layer is OSM or OpenLayers, only Google base layers. Here is an example demonstrating this at bottom of page: The code I currently have for this Grid is currently this:               var options = {                 resolutions: [1.40625,0.703125,0.3515625,0.17578125,0.087890625,0.0439453125],                 maxExtent: new OpenLayers.Bounds(-180, -90, 180, 90),                 //restrictedExtent: new OpenLayers.Bounds(-360, -90, 360, 90),                 numZoomLevels: 8,                 singleTile: true,                 isBaseLayer: true,                 wrapDateLine: true,                 controls: [                 new OpenLayers.Control.OverviewMap(),                 new OpenLayers.Control.Navigation(),                 new OpenLayers.Control.ScaleLine( { maxWidth: 150 })                 ],                 getURL: function() {                         var center = this.map.getCenter(),                         size = this.map.getSize();                         return [                         this.url, "&center=", center.lat, ",", center.lon,                         "&zoom=", this.map.getZoom(), "&size=", size.w, "x", size.h                         ].join("");                 }         };      Now the first thing that comes to mind is that I feel I should have an `options` variable for the map object and an `options` variable for the Grid layer (what are your thoughts on this?), as shown below:                var grid = new OpenLayers.Layer.Grid(             "Google Streets",             "http://maps.googleapis.com/maps/api/staticmap?sensor=false&maptype=roadmap",             null, options         );         map.addLayers([grid]);      The left picture below is how the resolution was before: just using a standard OpenLayers Google layer. The picture to the right is using the Grid layer and point to the Google default layer: mentioned in the code above. ![OpenLayers Google Layer, no grid layer](http://i.stack.imgur.com/CommT.png) ![bad resolution using Grid Layer and accessing Google Maps](http://i.stack.imgur.com/zprfO.png) I just posted a snippet of Africa to show the resolution issue, and as for the points (all my points are in the US, they are completely out of whack also (the left most point on the map should be on the west coast of the USA, while the right most point should be on the east coast of the USA.: ![enter image description here](http://i.stack.imgur.com/Sbm51.png) 1) **Should I create a separate options variable for the grid layer?** 2) **Is adjusting the resolution within the options the correct way to fix this?** 3) As you can see in `getURL` there is no mention of projects or transformations: **how do I account for the points showing up correctly in the USA?** As always, any and all input is appreciated.


Clustering polygons by sum of values

I would like to group polygons that (1) are contiguous and (2) when the combined values of field X >= Y. Specifically I am grouping zipcodes that are connected. a group is when 1 or more zipcodes 'population' field equals 100,000. Can someone suggest an existing ArcGIS function or python method for doing this? Many thanks in advance! ---update---- I wrote a python algorithm to group the polygons using their respective neighbors as grouping members until threshold is met. it works nicely.


QGIS (getting 2 images into kml popup for each point)

I've got a csv file with some points with attributes. 2 of the fields reference a .jpg file which are in the same folder as the csv file. Using QGIS, how do I export a kml so that the popup in Google Earth will show the jpg's associated with each point?


Data loss after compressing geodatabase in ArcSDE

I suffer sometimes from data loss after compressing ArcSDE geodatabase, this geodatabase contains versioned feature classes, so the compressing script reconciles and compress the geodatabase:               # Execute the ReconcileVersions tool.     arcpy.ReconcileVersions_management(db_path, "ALL_VERSIONS", "sde.DEFAULT", versionList, "LOCK_ACQUIRED", "NO_ABORT", "BY_OBJECT", "FAVOR_TARGET_VERSION", "POST", "DELETE_VERSION", "c:/reconcilelog.txt")          # Run the compress tool.     arcpy.Compress_management(db_path)      it seems that the main reason is a bad use of `ReconcileVersions_management`, what are the parameters recommanded ? and how i can test if data loss would happen again ? the geodatabase is based on ArcSDE 10.1 and Postgre SQL 9.0.5.


How can i create single feature fwith Combining Selected feature qgis?

I am trying to create a single Qgsfeature from the Combination of selected features in Pyqgis. Currently i create the feature using a loop over selected features and combine them 1 by 1. but this process froze qgis UI. does anyone can suggest me another idea ?


Pyqgis 2.2 : zoom to layer extent?

Regarding my plugin pyqgis 2.2, i can load a vector layer succesfully. But when i try to zoom to the layer extent it does not work. How to do in order to zoom to the layer extent? * * * Thank you very much for your replies. I have just tried your proposition.I pasted your piece of code into my plugin. But unfortunatly, when i load a vector layer. I try to zoom to the layer extent (thanks to right click -> zoom to layer extent). I have no error message but there 's no change zoom to the extent of vector layer. You can read the python.py (github plugin link) here : https://github.com/picardie-nature/clicnat-qgis/blob/master/plugin.py Any thoughts? THank you very much.


Open shape file in ArcGIS Runtime WPF SDK as Graphics/Feature layer

I googled and followed this tutorial http://www.arcgis.com/home/item.html?id=953a530ada30477d95cc69e788268bc9 and figured out how to import Shape files and Rasters into Runtime. However, it seems most of the functionality uses a FeatureLayer/GraphicLayer instead an ArcGISLocalDynamicMapServiceLayer that the sample uses. My question is if there is a way I can import the shape file as a graphics layer or if i can somehow cast my ArcGISLocalDynamicMapServiceLayer as a Graphics layer because shape file is essentially the same as a shape file. An example is i'm trying to use the FeatureDataGrid() to show the attribute table of my shapep file, but I can't since it requires a graphics layer, not an ArcGISLocalDynamicMapServiceLayer. Thanks and Regards, Kev


OpenStreetMap data at different scales

Could anyone just clear up a question regarding openstreetmap data. Are there different OSM data sets for the various set scales, or do the data get generalized on-the-fly when the map is zoomed out to a smaller scale? I understand that the many objects are hidden in smaller scales, but are there also different generalized datasets for the smaller scales as well? Thanks, Robert


How do I add a Corel Draw map as .dxf file to QGIS and how do I georeference it?

I have a vector data map of Poland, which I exported from Corel Draw. I can display the map in QGIS. At first the boundaries and subdivisions are only displayed as lines, after saving the data as shapefile, I was able to use the "Line to Polygon"-tool to convert the lines. Now I have a shapefile with multiple features. Now I want to relocate and distort it to make it fit to my basemap. As you can see in the picture, the Poland shapefile is presented close to Africa because the location is not yet defined correctly. ![poland](http://i.stack.imgur.com/1JPSO.jpg) There are now several problems:   * I tried to move the Poland shapefile in an edit session but the shapefile contains of multiple polygons and I was not able to move them together. How can I move multiple features at the same time?   * I also tried to make a single polygon by merging the multiple features in an edit session, but when doing it with the "Merge Selected Features"-tool, an error occurs and QGIS crashes.   * Therefore, I tried it with a third way by creating a new shapefile, drawing a polygon, that covers the whole Poland polygons and then cliping both shapefiles. After Cliping, the new shapefile is created and added to the table of contents, but there is nothing displayed on my map. As you can see, there may be a mistake in the previous steps but I dont know where, I already repeated every step but there is still no solution found. I suspect the problem to be in the step of converting the Corel Draw .dxf file to a shapefile or the transformation from lines to polygons. Also if you know a more effective way to get my map to its planned location and how to reference it correctly, please let me know your thoughts.


How to handle layers with different spatial references in ArcGIS Runtime SDK WPF?

I am currently writing the "Zoom to Layer" function for my application. However, the spatial references between my imported layer and my base map are different. Is there a way around this? Can I somehow project all of my shapes/graphics so that they are in the base map's spatial reference? Is my only option to remove all layers, change spatial reference, and add layers back in? It seems like ArcEngine's spatial reference had less restriction and was easier to use. Any insights? Thanks for all your help, Kev


mapnik rendering with OSM Carto style

When I want to make png tiles that look like ones in osm tile server what I need to do?   1. Do I need to import data to postGIS db somehow WITH osm Carto style or I can just import it "normally" w/o style   2. I need to convert CSS style to xml? (If the answer is yes- what is the best way to do this (I've tried with TileMill import))   3. Last step is to do the "generate_tiles.py" script I did mange to render files using OSM Bright, but it is not as good as the original osm look for my purpose. thanks in advance


Centroid of Points using postgis

In my postgres database i have a set of points(lat, long) and i created the_geom index for that. Now i have to find the centroid of these points. I Google a lot and i find that for closed objects(polygon etc) it possible to find the centroid. I am not sure how to find the centroid of points using postgis. Also i found this:               SELECT ST_AsText(ST_Centroid('MULTIPOINT ( -1 0, -1 2, -1 3, -1 4, -1 7, 0 1, 0 3, 1 1, 2 0, 6 0, 7 8, 9 8, 10 6 )'));      But i didn't get any thing from this. EDIT: My requirement is: Consider i have 5 places latlong, and i have to find which is center of this 5 places. Help me to solve this. Thanks in advance.


PostgreSQL/PostGIS - group by series of values

I need to sum up linear objects' length and to group them by intervals of several years. I have one table storing my objects like this :               - gid serial NOT NULL,      - year INTEGER,      - the_geom geometry(MULTILINESTRING) ;      I need a result like this :               period          | length     ----------------+-----------      2005 - 2014    | 18.6      1995 - 2004    | 16.1      1985 - 1994    | 7.6      1975 - 1984    | 19.0      1965 - 1974    | 28.2      1945 - 1964    | 10.2      before 1945    | 0.1       I can't find out on the Web how to perform this, except by producing each line with a different query and to use UNION ALL to merge them together, which is not so good... Many thanks for help ! wiltomap


*Leaflet* mouse wheel zoom only after click on map

I'm working with the **Leaflet JavaScript Library** and attached a (working) map to my HTML Document. It is in the middle of the page, and when I'm scrolling down with my mouse wheel and arrive at the map, it automatically zooms into the map. I want to scroll through the page without stopping at the map. Is there a way to activate the wheel zoom only after the first click on the map?


How to create Strips with GCP point distribution for raw GeoEye satellite imagery?

I have raw GeoEye satellite imagery, I just want some guidelines for creating a strip map with GCP distribution. We need to make orthorectification for raw GeoEye satellite imagery, I think it's available in ERDAS Imagine but I don't know how I can make this.


Given distances from two locations how to accurately find geographic coordinates

I am working on a research problem which requires me to calculate a geographic location accurately (with error distance of few meters), given distances from two geographic locations. For instance: ![Problem](http://oi58.tinypic.com/1pxxj4.jpg) Since the points are static I know their location already. Flipping of the triangle is avoided by adding one more known location. I have calculated the distances using great circle distance formulae.               double theta = lon1 - lon2;     double dist = Math.sin(deg2rad(lat1)) * Math.sin(deg2rad(lat2))                  + Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) * Math.cos(deg2rad(theta));     dist = Math.acos(dist);     dist = rad2deg(dist);     dist = dist * 60 * 1.1515; // in miles      How to find the coordinates of C? The correct answer is 39.98, -83.03, but I am getting 8 miles off the track. Am I doing anything wrong?


Need to get the minimum cell size of collection of rasters

I have the following model in ModelBuilder: ![Model](http://i.stack.imgur.com/F7gmy.jpg) Get Raster Properties looks like this . . . ![Get Raster Properties](http://i.stack.imgur.com/4DltR.jpg) I need to find the minimum cell size value to use as output. Any ideas on what tool I should use to replace Cell Statistics? Thanks, Renee * * * As I said above, the reason I need to get the minimum value of the cell size is because I need to create an empty output raster dataset that has compatible characteristics with the input rasters to be mosaicked together. However, I have another model that could get me around the above situation with having to create an output raster ahead of time. In the following model, I use "Mosaic to New Raster" rather than "Mosaic". This should work out well, but the output comes out crazy looking. Here is the model and the output . . . ![Mosaic To New Raster Model](http://i.stack.imgur.com/iV6CN.jpg) ![Result of Mosaic To New Raster](http://i.stack.imgur.com/VkfqU.jpg)


Strategies for serving large datasets over WFS

We are implementing WFS using geoserver for our customers to consume vector data from a hosted spatial database to their desktop GIS. They want to be able to just connect and browse the data in the same was that they would to for example an SDE connection. Some of the datasets they want to consume are very large, and contain way more features than the feature limits we want to set on the server. They may therefore not get all features downloaded, and if features are missing the user isn’t aware that they have hit the feature limit and don’t have all the features. If we just increase feature limits, performance degrades, and the client still may not get all features, unless the limit is set larger than feature count in the data. Basically we are experiencing performance and usability issues around guaranteeing that all features are downloaded for large datasets to desktop clients. We are testing with Quantum, Arc9 and 10 with Data Interoperability connection. So far we have been investigating how the caching options on the client can help. We are coming to the conclusion that caching can help, but this still doesn't guarantee all features are always downloaded. In quantum turning caching off and using scale thresholds helps, as features are requested again when the client zooms/pans if, but **only** if, the new envelope is outside the initial envelope. In Arc 9 Data Interopeability, there is no ability to turn caching off, and no ability to restrict to an envelope, so the client gets the features on the first request for the whole dataset, limited by geoserver feature limit and never re-requests during the life of the cache(24hrs), so if features are missing, they will stay missing. In Arc10 Data Interopeability, it's possible to use a live connection, which re-requests features on every pan/zoom, but as we increase feature limit on server, performance degrades. Also, for certain tasks (view attribute table, select), arc10 requests all features one by one, which is pretty much un- usable. In all cases, there are scenarios where the feature limit has been hit, features are missing, but the user isn’t aware because the client doesn’t flag this. I would like some idea how people have approached serving large datasets over WFS to desktops in a way that guarantees the client gets all the features for their view extent. Do we need to improve performance on the server and up the feature limit? What are people doing to tackle this? I would also like to try and get to a better understanding of what WFS is **for**. Is WFS even appropriate for looking at large datasets in a desktop session as users are used to doing with shapefiles or a geo-database connections? I realise this question is wide open, so any views much appreciated.


Method for identifying upstream segments

I need to add to the attribute table of a stream network layer a column that can identify all upstream segments that contribute to the segment (for each segment). My best idea at the moment is to assign all stream segments with a Strahler order of 1 a prime number. Then going downstream, I multiply the contributing upstream segments (see graphic below). From this, I think I can factorise the number into it's primes and then work out the IDs of all upstream segments. I already have a script that is capable of passing information downstream based on the Strahler stream order so this is not a problem. I just want to know what a better method would be, my method is going to generate horribly large numbers once I start processing large stream networks! As an example, in the graphic below, if i was to look at the segment with the 210 attribute, I would factorise this into primes of 2,3,5 and 7. From these primes I could work out that 6 and 35 were also upstream segements. I have access to ArcGIS basic 10.2.2 and QGiS. ![enter image description here](http://i.stack.imgur.com/mJmjn.jpg)


Unable to open QGIS after Installation

I have a Windows Vista (32 bit) computer. I tried installing and reinstalling (by uninstalling the software first) QGIS 1.8 a few time then went to version 1.7.4 and still encountering the same problem. I dont know what the problem is since I am downloading the windows version of the software. Could anyone help me with this issue?


ArcGIS 10 - Model for batch select polygons by attribute and merge them together

Is there is a way to create a ArcGIS 10 MODEL to: 1. batch select polygons from the same layer by attribute 2. merge these polygons into one 3. repeat this for all polygons shearing the same attributes example: To create a geological map with all mapping polygons merged into one big polygon of the same lithology. Cheers! M


What is the best way to construct a SQL query that returns the block name for each bus point as it travels?

I have two datasets in postgres; 1) a bunch of points that represent bus locations 2) city block polygons. Each bus has a unique ID and each block polygon has a field that has the block name in it. As the bus moves throughout the day, what is the best way to construct a SQL query that returns the block name for each bus point as it travels.


Transform coordinates from NOAA

I use data from NOAA for some analysis in R and I want to transform coordinates to EPSG:54004 or something useful. There is something what they write about their coordinates.               ...         POS: 29-34       GEOPHYSICAL-POINT-OBSERVATION latitude coordinate       The latitude coordinate of a GEOPHYSICAL-POINT-OBSERVATION where southern       hemisphere is negative.       MIN: -90000 MAX: +90000       UNITS: Angular Degrees       SCALING FACTOR: 1000       DOM: A general domain comprised of the numeric characters (0-9), a plus       sign (+), and a minus sign (-).       +99999 = Missing           POS: 35-41       GEOPHYSICAL-POINT-OBSERVATION longitude coordinate       The longitude coordinate of a GEOPHYSICAL-POINT-OBSERVATION where values west from       000000 to 179999 are signed negative.       MIN: -179999 MAX: +180000 UNITS: Angular Degrees       SCALING FACTOR: 1000       DOM: A general domain comprised of the numeric characters (0-9), a plus       sign (+), and a minus sign (-).       +999999 = Missing     ...       And my problem is, that I can't transform this coodrinates correctly. I use this R command:                   sc <- cbind(st$LAT, st$LON)         ptransform(sc/180*pi,                  '+proj=latlong +ellps=sphere',                 '+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs')      But coordinates are somehow wrong as you can see. The points should be in borders because they are meteostations from this countries. ![Map with points](http://i.stack.imgur.com/sZGci.png).


Creating a constant elevation raster with multiple attributes

Is it possible to create a raster with a constant value with multiple attributes? Such as: * * *               rowid  value  count  Name     1      630    36000  Forest     2      630    75000  Anthro     3      630    2600   River     4      630    5500   Harvested      * * * The above table would create a constant elevation but have different attributes for each cell. I have tried a reclass but it deletes the existing attributes leaving only one row.


Subset a SpatialPolygonsDataFrame by ID in R?

I've used the `gIntersect` function from the `rgeos` package to determine which polygons intersect in two SpatialPolygonsDataFrames (spdfs). The result is a logical matrix with rownames comprising the polygon IDs from sfdf #1 and colnames the polygon IDs from spdf #2. I'd like to use this matrix to subset the two original spdfs, omitting those polygons that have no overlap, before using the function `gIntersection`. I can easily convert the logical matrix into two vectors of IDs (one for each spdf) that represent those polygons with at least some overlap. My question is - can I use a vector of polygon IDs to subset a spdf? If so, will it correctly subset values in the `@data` slot? I know I can generally subset spdfs using this syntax:               spdf[spdf@data$myVariable[someVector], ]      This won't work for IDs, as they are buried much deeper inside the spdf list structure.


Populate planet with data

i have a game that described a planet and is a sphere. on the client side, the world is separated to tiles (images) and i mapped it follow by this and this, so now when the user is zooming / dragging the world he's see the right location follow by the middle-center geo coordinate and global pixel. now, on my server side, i need to put data on my planet (in other words, to draw it on the tiles i mentioned above - but it's doesn't matter for this discussion). i have array of data items with same dimensions (width/height) that should be populate on the planet. from my own understanding, i need to find the geo coordinate of each data-item and then use the function geoToGlobalPX() to get it's location against the whole 2d planet's map, and finally 'put' it on the planet. my problem is to find this geo coordinate, since i can't run over the planet from pixel(0, 0) to pixel(PLANET_SIZE, PLANET_SIZE) and each iteration grow the current-position in item-data-width because the range of location is decreasing as much you're going up/down from the equator, so on the top latitude (~85) i'll have more less data-items than on the equator. i tried to read on the articles above about meters-per-pixel but i still don't really understood how i can integrate it on my system. i hope you understood my and someone will have some advice for me. thanks. Shlomi.


What data does Esri use to create their US_RoofTop locator?

I'm creating address locators to be published on my local ArcGIS server instance and used by various applications. My server does not have access to the internet so I'm unable to use Esri's online locators. The "US_RoofTop" locator from Esri's online service is providing me with extremely accurate results in many cases. I was wondering what datasets Esri uses to build this locator? The locators that I create from TomTom's MultiNet or TIGER/Line aren't nearly as accurate.


How to add Radio Buttons to Python Script tool dialog?

I have 3 Point shapefiles for 3 species that contains the accession points of each. The user needs to specify only one species at a time. I need to write a script tool for adding the selected Point layer. How can i used the radio buttons in this case.. Important for my thesis work..               import arcpy          mxd = arcpy.mapping.MapDocument("CURRENT")     df = arcpy.mapping.ListDataFrames(mxd, "*")[0]     addLayer = arcpy.mapping.Layer(r"D:\Academic\M.E_thesis\data\acc_point.lyr")     arcpy.mapping.AddLayer(df, addLayer, "BOTTOM")      The script above is for adding just one layer.. In my case, the user needs to specify what species to be added to TOC.. So, i need 3 radio buttons. Else, a dropdown list that automaticaaly displays the names of 3 species.


How to get projected centroids in QGIS?

I am trying to get a centroid for several polygons on a global scale, in a way that it would correctly represent the common centre of all the polygons, taking Earth's curvature into account. The polygons are in the WGS 84 coordinate system. For testing purposes, I created a test shapefile with two polygons: one that encompasses Greenland, and one that encompasses the area east of Mongolia up to the sea. These areas are quite a bit to the north, and their real common centroid is supposed to be somewhere close to the North Pole. Probably around the Laptev Sea, since Greenland is a bit smaller area-wise (although you couldn't tell that from the default projection QGIS is using to display WGS 84). If I use the "Polygon centroids" built-in algorithm, the result is somewhere around St. Petersburg. That is way too south-west from where it's supposed to be. ![First polygon centroid test](http://i.stack.imgur.com/EYKgV.png) Another test created even more hilarious results. The two areas I selected that time were Alaska and the Kamchatka peninsula. The centroid should be at the very north of the Pacific ocean. But the result of "Polygon centroids" is actually in Nunavut, Canada, which is on the opposite side of where it should be. It's put there because Alaska is bigger than Kamchatka, otherwise it would be put somewhere in the Atlantic ocean. ![Second polygon centroid test](http://i.stack.imgur.com/U1d8c.png) One way of getting more correct centroids I could see is by changing the projection system, for instance, to an Azimutal Equidistant one, where the reference is somewhere close to the North Pole. However, if I do change the projection system, the polygons are still in WGS 84, and QGIS still outputs the same incorrect results if I do another pass of "Polygon centroids". And if I set the polygon layer's CRS to the projected system, the old coordinates are retained instead of being recalculated for the new projection. This is how both test cases look like when projected, and shows clearly how incorrect the results are (the centre of the image is the North Pole): ![Both tests, when viewed using a projected CRS](http://i.stack.imgur.com/KdgVo.png) So perhaps there is a way to permanently reproject the polygons to the projected CRS? Or some other way of getting correct polygon centroids?


Printing large number of Points in ArcGIS

I have bathymetric data which have thousands of points ( exactly 71 K). Now when I try to print it in a large map size in ARCMAP 10.0 , the layout view freezes and the system is hung , possibly due to a memory issue. What is the best way to do this, rather than generalizing the points ? my preferred paper size is A0. Is there a better software to do this ?


Debugger for ArcGIS Java Script API 3.x

It might be very basic question.. I am working on ArcGIS Java Script API version 3.2/3.3 and using IDE as aptana & notepad++(Currently testing all applications on Firefox and using Firebug while testing). Getting several errors while using JSAPI so is there any recommended Debugger available for ArcGIS JSAPI ? Going through resource link also so any help will be great !! thanks in advance : )


Problem with labels on export/print a map (qgis master)

As you can see on the images below, the labels on the exported map (right) are much bigger then in the original map (left). Same by pdf, image, and vector - export. ![enter image description here](http://i.stack.imgur.com/U1UjC.jpg) Whats the problem? Can I fall back in the qgis master version to the version of about 1 month ago?


Calculating the distance from each point in one layer to the nearest point in another layer

I am trying to find the average distance from several points in a layer to points in another layer. I am using ArcMap Basic - I know there is a way to do this using the Advanced version of ArcMap but was wondering if anyone knew a workaround for Basic (if it exists). Any insight would be appreciated. Thanks.


how can openlayers have mobile.css file as style

I try to make openlayers work in mobile devices, so it can go fullscreen. I cannot just put `width` and `height` to be 100%. Here is why
 //contains map, forms, images etc
//contains just map's div

//map

                   //the css     .content{         padding-left:5%;         padding-right:5%;         position: static;         margin-top:2%;         margin-bottom:2%;         width: 50%;     }          #map_element{     width:100%;      height:100%;      z-index:1;      text-align:center;     position:absolute;     }          #mapcont{     width:100%;      height:100%;      z-index:1;      text-align:center;     position:relative;     padding-bottom:60%;     padding-left:0.1%;     padding-right:0.1%;     }      To have a responsive map , its container must have a height. `content` div cannot have height, because it will not be responsive. This is why I put `mapcont`. Map is responsive , but in mobiles is very small (see image) and cannot go fullscreen, because the `width` and `height` are _already_ 100%. So I was wondering how can I use the `style.mobile.css` as a default css style? This CSS file is placed in `theme/default`. I try to load the CSS like so `<link rel="stylesheet" href="../theme/default/style.mobile.css" type="text/css">` but I see no change on my site. I found tutorials on how to overwrite the default styles, or how to create new themes. But nothing on how to use the already existing CSS. ![enter image description here](http://i.stack.imgur.com/m6WhQ.png) _**EDIT_** My apologies if this is still unclear. I was asking for details , so I can implement the rest of the code by my self. Maybe I should show what I am generally trying to do. The whole idea. This maybe help you understand better. Keep in mind what I said about mobiles, fullscreen and divs and check the following. User on _pc_ clicks "the map" in the menu and goes here (map, images, forms in the same page) ![enter image description here](http://i.stack.imgur.com/H8W8D.png) User on _mobile_ clicks "the map" in the menu and goes here (just the map, fullscreen) ![enter image description here](http://i.stack.imgur.com/FuLQ5.png) If user wants to see the images and forms clicks "back button" (right corner) and goes here (just images forms, no map) ![enter image description here](http://i.stack.imgur.com/vGwgz.png) If he wants to see the map again, clicks the "back to the map button" Thanks again for your time, your answers and your patience


How to run Layer Stack in Batch Mode with GDAL?

My goal is process fifteen Landsat-8 scenes with three bands. I need to rescale the pixel depth from 16 bit to 8 bit, stack three bands and mosaic all them. This job must be making via open source solutions. Below is my checklist with all experiments that I’ve done thus far. ![Fifteen Landsat-8 Jobs](http://i.stack.imgur.com/cc54p.jpg) This is my command list for six scenes:               gdal_merge.bat -separate -of GTiff -co TFW=YES -o LC82180762013253LGN00_RGB654.TIF LC82180762013253LGN00_B6.TIF LC82180762013253LGN00_B5.TIF LC82180762013253LGN00_B4.TIF     gdal_merge.bat -separate -of GTiff -co TFW=YES -o LC82190752013244LGN00_RGB654.TIF LC82190752013244LGN00_B6.TIF LC82190752013244LGN00_B5.TIF LC82190752013244LGN00_B4.TIF     gdal_merge.bat -separate -of GTiff -co TFW=YES -o LC82190772013244LGN00_RGB654.TIF LC82190772013244LGN00_B6.TIF LC82190772013244LGN00_B5.TIF LC82190772013244LGN00_B4.TIF     gdal_merge.bat -separate -of GTiff -co TFW=YES -o LC82200742013251LGN00_RGB654.TIF LC82200742013251LGN00_B6.TIF LC82200742013251LGN00_B5.TIF LC82200742013251LGN00_B4.TIF     gdal_merge.bat -separate -of GTiff -co TFW=YES -o LC82200752013251LGN00_RGB654.TIF LC82200752013251LGN00_B6.TIF LC82200752013251LGN00_B5.TIF LC82200752013251LGN00_B4.TIF     gdal_merge.bat -separate -of GTiff -co TFW=YES -o LC82210752013242LGN00_RGB654.TIF LC82210752013242LGN00_B6.TIF LC82210752013242LGN00_B5.TIF LC82210752013242LGN00_B4.TIF      When I run GDAL_MERGE.BAT, something strange occurs. The looping doesn’t work and the process stops after the first stacked image: ![gdal_merge.bat stops](http://i.stack.imgur.com/ps9xK.png) This is the link to Google Docs with full explanation: http://goo.gl/gP2zpD | PDF: http://goo.gl/bIwz0W Thank you, **Jorge Santos** | http://www.processamentodigital.com.br/