QGIS 1.9 Is it possible to destroy a spatial index? I am noticing that if I generate a spatial index on a set of polylines (within a plugin), split one of the lines, and then recreate the spatial index, the index values within the spatial index are doubled. For example: I have 5 lines, so the spatial index has feature 0 - 4. I split one of the lines and recreate the spatial index. The spatial index should have indices 0-5, but it has indices 0-9. Deleting the features from the spatial index does not help with the indexing issue. ## Code               class slicer:              def init(self):             '''standard stuff here'''         def activated(self):             '''standard stuff here'''             create_temp_polylines()              def create_temp_polylines(self):             self.line_layer = QgsVectorLayer('Make the layer')             self.spat_index = QgsSpatialIndex()             self.point_layer = point_layer #Grabbed by iterating over layer list             pt_prov = self.point_layer.dataProvider()             polylines = {}             for feat in self.point_layer.dataProvider():                 '''build the line geometries based on a membership attribute'''             for key, value in polyline.iteritems():                 temp_polyline = QgsFeature()                 temp_polyline.setGeometry(value)                 temp_polyline.setAttributes([attr1, attr2, ...])                 line_layer.startEditing()                 line_layer.addFeature(temp_polyline, True)                 self.spat_index.insertFeature(temp_polyline)             line_layer.commitChanges()              def split(self, cut_line):             '''logic to split a polyline'''             '''logic to update the attribute table'''             '''commit the changes to the DB'''             QgsMapLayerRegistry.instance().removeMapLayer(self.line_layer.id())             self.create_temp_polylines()      ## Spatial_Reference Checking Code               '''draw a line on screen (rubberband)'''          def get_intersect(self, rubberband):         line = rubberband.asGeometry().asPolyline()         intersections = self.spat_index.intersects(rubberband.asGeometry.boundingBox())         touches = set()         for id in intersections:         id = (id * -1) -1 #Why are they ids negative longs?         '''convert if to feature object'''         '''check touches'''         if touching:             touches.add(feature.id())


How to discretise a line into grid lines

Having a line and a grid, the aim is to _discretise_ the line into **grid lines**. In the following figure, the given line is in black, its intersections with grid lines are blue, the desired is set of segments (polyline) in **red**. Any idea or solution? ![enter image description here](http://i.stack.imgur.com/M2tZU.png) **Edit:**   Note that we know Bresenham's method. However, it does not work for our case as shown in the figures. Green cells are indeed pixels not squares based on Bresenham's method. It is not easy to generate our desired polyline (red) based on those Bresenham's green pixels. Note that the figure shown is a simplistic case. ![enter image description here](http://i.stack.imgur.com/bK128.png) **Important Update:**   We are interested in general solution which works for any grid complexity. ![enter image description here](http://i.stack.imgur.com/Dq3HI.png)


Getting value from IRow is slower while edit mode is on?

When I access a value in an `IRow` using `get_Value(index)`, it usually takes 0 to 1 ms. But when **edit mode is on** , the same operation takes 0 to 15 ms (most common values are 0 and 10 ms)! What could be the cause of this? It doesn't matter if I use a filegeodatabase or an Oracle database (with SDE). What we're using the `get_Value` for is our own ORM implementation (setting the Entity's property values to the ones within the IRow). Could there be a better way to do this?


How to adjust the difference between the coordinate from OpenStreetMap and Google Maps

I have downloaded the OSM from OpenStreeMap that came with all nodes from the map and their respective coordinates. Now I have to plot a node (latitude and longitude) on Google Maps, but all coordinates end up in different places than they should. To illustrate I'll show the node -12.92122,-38.34991 (lat,long) on OpenStreetMap and Google Maps, as you can see on screenshots: **OpenStreetMap** ![http://i.stack.imgur.com/9Ac7R.png](http://i.stack.imgur.com/ciJ1G.png) **Google Maps** ![http://i.stack.imgur.com/Szyot.png](http://i.stack.imgur.com/Bp7Zl.png) My question is how can I adjust these values.. so I can plot the node on google maps at the same place of openStreetMap. Google Earth uses WGS-84 coordinates, expressed in decimal degrees, and OSM uses WSG-84 as well.


Add data from table into feature class

I have a feature class with mostly unpopulated fields (ArcMap Standard 10.1, in an SDE database, with attachments). I exported the attribute table as a .csv file so that a co-worker without access to ArcMap could do the research. He filled out the .csv file and now I need to add the data back into the feature class. I am not having any success with "Load Objects" because it just adds all of the data to the end of the attribute table instead of joining the fields. I am not having any success with "Join" because it duplicates the fields. Merge and append require the data to be of the same type (table and table or feature class and feature class). I feel like I need a "link" tool... Does anyone know how to do this? Thanks!


What resources can you suggest for making beautiful online Maps or Mapping applications?

As a GIS developer, my design skills are rather limited. Are there any links, books or resources, that you would suggest to make my online maps more pleasing and beautiful?


What are the "must read" academic articles every GIS professional should read?

There was a related question a while back that dealt with the top GIS blogs, but I'm also very interested in "academic" sources of GIS information. I'm currently updating my repository of information and am also considering some new journal subscriptions. Every professional field has some big names and big articles. Who are the big names and what articles should everyone be aware of in GIS/cartography/remote sensing? I'm looking for 3 things in particular: 1) Recommendations on the top sources for GIS articles - important/reliable journals. 2) Major articles from the past - those that paved the way towards the current state of our field. 3) Recent articles showcasing major findings/methodologies. Bonus: I've recently been searching for a good source of information on cartographic design - any articles related to this would be a great help.


How to setup QGIS Web Client?

So we've installed QGIS Server and things look to be working well (thanks Underdark for the great tutorial). Next up we want to get the QGIS Web Client working. It appears we're missing a step or have misunderstood the instructions at https://github.com/qgis/qgis- web-client . How do we get started? Do we copy the above files to the server and modify the links accordingly? It looks like the files in the 'site' folder establish a sample website. Is that what's happening? And that work together with the apache config to rewrite URLs in some manner? I think i can figure this out with just a bit of a nudge in the right direction. the WMS get Capabilities link http://gis.idn12.com/qgis/qgis_mapserv.fcgi.exe?SERVICE=WMS&VERSION=1.3.0&map=c:/myprojects/shapefile.qgs&REQUEST=GetCapabilities thanks! C


how to create a shapefile for 2 million points with geotools

I have to create a shapefile with the geotools java library for approx. 2 000 000 points and whatever strategy I apply I seem to run into out of memory exceptions as well as everything running super slow. Anybody done that before and got it to work?


Network Analysis: Solve Route - No Solution

I'm using ArcGIS 9.3.1 In my network there are isolated network(not connected to main network) and restricted(non-traversable network element position) When I plot 1 point close to a isolated or restricted road. It will snap to it and return me no solution found or restricted network. May I know is there a simple solution to ask the solver to choose another line/point if it can't find a solution? In arcgis 9.3.1 there is no "Exclude restricted portion of the network" and I don't wish to use the query builder to ignore FType that carry restricted options. So the main objective is to make the solver pick another line/point to snap on to. Thanks


How can I access WMS service from Geoserver using ArcGIS Silverlight API?

Having Geoserver installed locally in my machine, I'm currently doing a R&D by trying to access WMS service from Geoserver using ArcGIS API for Silverlight.   I'm trying to replicate the sample in ESRI site which deals with accessing wms service using ArcGIS API for Silverlight. I'm unable to view the map on the browser. Given below is the xaml code used in my application:                   <UserControl x:Class="SilverlightApp.Beginners.MainPage"     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"            xmlns:esri="http://schemas.esri.com/arcgis/client/2009">         <Grid x:Name="LayoutRoot">             <esri:Map WrapAround="True">                      <esri:WmsLayer ID="OtherWMSLayer" Layers="OSOpenData" Url="http://localhost:9595/geoserver/wms" Opacity="0.7" SupportedSpatialReferenceIDs="4326" SkipGetCapabilities="True" Version="1.1" />                      </esri:Map>                   </Grid>          </UserControl>      Please can anyone shed light on this regards.


Will a WMS handle RPF image scale?

When serving RPF imagery (Raster Product Format) from a WMS, will the WMS handle which layer should be on top? For example, let's say I request layer X and layer Y in some bounding box, and layer X should be displayed at scale 1:10000 and layer Y should be displayed at scale 1:20000 I would expect that at scale 1:5000, layer X would show up since it is the higher resolution image (since it displays at the lower scale). Then I would expect at scale 1:15000, layer Y would show up. Is this typical WMS server behavior?


How do I make a path cross the most possible classes in a raster?

I want to create a function and possibly use Arcmap tools to create something similar to Cost Path. Instead of just choosing the LCP, it must cross through the most different integers. Let's say I have a raster with values 1-5. I want this path to use all five values but still use the shortest path in relation to number of cells. The raster values do not represent any sort of cost.


Setting Rasters to the exact same display

I have been tasked to make a series of .jpeg outputs of different sections of a dike displaying elevation data. My problem is that the data i have been given is GIGANTIC, almost the whole region made of of lots of small squares of raster - none of which have logical names, just random. The normal way i would deal with these rasters would be to place them in a raster catalog so that they all have the same display so that the seperation between different rasters will not be obvious. The problem is that there are literally 600 tiny squares of raster making up my dataset and my raster catalog has been loading these rasters for almost an hour now with no sight of an end point! Is there a way i can manually go though each raster (im very fast at clicking!!) or any otherway anyone can think of to make these rasters uniform in their display within arcmap 9.3.1.? I need to of made the .jpegs by 4 oçlock today so i have 3 hours to try and find a solution!! Any ideas?


Setting OSM map data to aerial view in QGIS

I have just started playing around with my first GIS package, QGIS. I have successfully used Ordnance Survey Vector data to create maps but when I try importing maps from an OpenStreetMap export it always gives me a birds eye view. Any idea how I can get it to produce an Aerial view?


OpenLayers ArcGIS93Rest layer not showing up

So this seems like it should be super obvious, but I can't for the life of me figure out why I can't get any ESRI layers to show up on my map. I've tried different layers and messing around with the options, but all that happens is that both layer names show up in the layers panel, but only the Google layer actually shows up on the map. Here is the code I'm using:               function addOpenLayers() {         var mapcenter = new OpenLayers.LonLat(-90.8, 46.45)         var base = new OpenLayers.Layer.Google("Google Satellite", {type: google.maps.MapTypeId.SATELLITE, numZoomLevels:22});              var olOptions = {             controls: [new OpenLayers.Control.PanZoomBar, new OpenLayers.Control.LayerSwitcher, new OpenLayers.Control.Navigation],         }         var olMap = new OpenLayers.Map("map", olOptions);              olMap.addLayer(base);              olMap.setCenter(mapcenter.transform(             new OpenLayers.Projection("EPSG:4326"),             olMap.getProjectionObject()         ), 10);              //This is the part that doesn't work:         var esriRoadsUrl = "http://server.arcgisonline.com/ArcGIS/rest/services/Reference/World_Transportation/MapServer/export";         var esriRoads = new OpenLayers.Layer.ArcGIS93Rest("Roads", esriRoadsUrl, {layers: "0"});         esriRoads.isBaseLayer = false;              olMap.addLayer(esriRoads);     };


Export from SDE to SHP in ArcGIS 9.3.1 - problem: not exporting all fields

I'm exporting a layer from SDE to SHP by python script, and I'm doing it in 2 phases: the first includes select by location (for picking the relevant features) and the second phase includes the Select (Analysis) tool which exports the features to the output SHP. PROBLEM: The Select(Analysis) tool omits fields - in my case, OBJECTID and GLOBALID - which need to be in the output. (I know it's the tool's fault because when I do a manual data>export data, it exports the fields all fine and dandy.) Does anybody know how I can fix this?


Deleting Features In ModelBuilder ArcGIS 9.3

In ModelBuilder, I have a work flow (data is stored in a File Geodatabase) that currently concludes with the use of the Append tool. I am looking to delete a features, as the last function of the work flow, without creating another dataset (more like working directly off of the appended dataset). So how can I delete features that have a specific value for a given field and how can this be done without creating an additional dataset. I've looked at the Delet Features and Delete Rows tools but neither of these tools work for this application. I would be interested in a Python solution as well.


How to perform Full Text Search of Esri geodatabase?

How would you go about searching the **_contents_** of features, the values in the attribute columns, in an Esri geodatabase? (preference for file-gdb, but SDE would be useful too.) I can envisage workflow where one dumps the whole gdb using Export XML Workspace and searches the result for strings (yuk!), or loops through all the tables in a python version of Select by Attributes. While both of these would _work_ , they are not appealing. The goal is to be able to efficiently answer a question like: which of these 50 feature classes has something to do with "Keno"?


Managing symbology in Feature Classes

I'm using an enterprise db to store my data and I'm writing a python tool that allows me to interact with that data in ArcMap. However, all my layers someone have "OTHER" for the symbologyType (not sure why). What I need to do is to change the symbol type for points in each FC. It is fine for now to just use a single feature symbol type, but of course I can't do that when I've got the unsupported symbology type. How can I create my own layer symbology? Once I've got something I know I can apply it using ApplySymbologyFromLayer_management() I'm probably missing something obvious here, but if someone could help point it out I'd appreciate it! Edit (just to be clear, I know I can change the symbology from the layer properties, but I want to be able to script it and control it from a python tool): Here are the features ![point features](http://i.stack.imgur.com/kynsp.png) Here is the symobology reference ![symbologyType check](http://i.stack.imgur.com/pihMw.png) Here is the layer properties ![layer properties](http://i.stack.imgur.com/7rU7c.png)


Change field attribute in one column based on Domain value from another field using Field Calculator

When I am editing a feature class, I want to automatically populate another field base on one column in the table. Here are the fields and data I am working with. Proj_Code, Proj_Name DA, Dawn Lake OTS, Otish South CZ, Cree Zimmer Both fields are text and Proj_Code is a Domain. When Proj_Code is DA, I want to auto populate Proj_Name to be Dawn Lake. Same with the others. I have done some research on this site and found this article Update a field attribute in one column based on a change to another column in one table. I changed the parameters to fit my values but it only works if Proj_Code isn't a Domain. Is there anyway to make it work with Domain? I have only started learning about Python few days ago, so any suggestions will help. Thanks!               def checkValue(c,d):       if c == 'OTS':         return 'Otish South'       if c == 'DA':         return 'Dawn Lake'       if c == 'CZ':         return 'Cree Zimmer'


Misaligned GADM shapefiles and the NE dataset

I am very new to using GIS programs, so please excuse me if this is a trivial question. I'm having the following problem:   When adding a GADM shapefile layer for Uganda onto the Natural Earth set of maps, the GADM Uganda map is shifted by about 11 km east compared to the NE map (a small difference but quite visible). Following instructions in the answers to other people with similar problems I enabled "on-the-fly CRS", set both the layer CRS (in the GADM layer) and the project CRS to WGS84, but that did not change anything. It looks like both the NE set and the GADM shapefiles have the same projection (WGS84), which is how it's specified in the metadata of both the GADM and NE layers. In this case of course setting the CRS to WGS84 shouldn't change anything. What could I look into next to try and fix this problem?


How to calculate the visible sky percentage

Hi I am writing a project and I am stuck: can anyone explain as simply as possible how to calculate the visible sky percentage? I have done a satellite survey and have worked out the height of buildings and the distance between them. How do I use that data to calculate the visible sky percentage according to where I was standing? If possible, could you show an example. thanks


How can I implement Persistance in a Layer Extension?

Last time I checked, arcgis doesn't honor IPersistVariant in layer extensions. Rather advanced code has been provided here showing how to implement IPersistStream. Is there something simpler?


Getting StatPlanet to work with custom shapefile and data?

I'm assigned to get StatPlanet Plus working with some 3rd-party data to display a thematic map, on a Mac. I have the custom regions and attribute data in a map.shp/dbf. And I've configured the settings.csv and data.csv according to the manual instructions in the User Guide. (There is some doubt about whether the Excel macros will work properly, especially on a Mac, so I've elected to do the configuration manually in order to eliminate unknowns.) That guide has good instructions on what to do, but it's hard to find any complete, simple examples of the data.csv, settings.csv, map.shp and map.dbf files (other than the complex world example in StatPlanet_Shapefile_(ESRI)). Most of the maps at http://www.statsilk.com/maps/download-free-shapefile-maps do not include shapefiles. I eventually found that the map for Bhutan did. I used that one as a template for my own data, making only minimal changes to get it to work with my shapefile -- but alas, it still doesn't work. What works for me:   * The StatPlanet_Shapefile_(ESRI) map out of the box, with its many indicators in several categories, shows the countries of the world, colored according to the selected indicator.   * The StatPlanet_Shapefile_(ESRI) map, with the shp/dbf/settings/data for Bhutan that I downloaded.   * The StatPlanet_Mac app for shapefiles, with my own map.shp and map.dbf dropped in, but without modifying data.csv/settings.csv: This displays the regions from my shp, but of course doesn't color them according to our data (I wouldn't expect it to). What doesn't work:   * The StatPlanet_Mac app for shapefiles, with my own map.shp and map.dbf, and with my modified data.csv/settings.csv: This displays the StatPlanet splash screen, and nothing further. No error messages are given (even when I run the app from the command line). I imagine there's something wrong with the data.csv and the settings.csv, but as far as I can tell, I've done everything according to the instructions. Here are the parts of those files that I've modified from the ones that came in the box: # settings.csv   * Set the ID column name next to DBF-ID to GNS_ADM1   * Put in the names and IDs of provinces of Suriname at the bottom under NAMES, e.g. "Nickerie NS14". # data.csv   * Deleted all rows below the first indicator (row 4)   * Put in my own numbers in row 4, columns L through U   * Put in ID's in row 1, columns L through U (these are values from the GNS_ADM1 column, e.g. NS19) If you want to look at my file contents in detail, here they are:   * settings.csv   * data.csv   * map.shp   * map.dbf And in case anyone asks, yes, I copied the map.dbf and map.shp into both the map/ and web/map/ folders. So my question boils down to...   * Can anybody see anything wrong with how I've set up my settings.csv or data.csv?   * Does anyone know how to get StatPlanet Plus to output error messages? So far I've only been using the desktop version of StatPlanet rather than the web version, since it wasn't clear how to use the web version with your own region vector data (and the web also introduces another layer of complexity unnecessary for this assignment).


Recommendations on universal projection API or algorithm for ArcObjects?

As asked on the esri forum here, we are trying to convert a geometry from any spatial reference to any other spatial reference. We have tried the default _IGeometry.Project_ (target_spatial_reference) but with no success. We then turned our attention to _IGeometry.ProjectEx_ (...), but some of the sample data we have does not use a well-nknownn ID (FactoryCode) and we can't find a canned, out-of-the-box GeoTransformation to convert our geometry. We did follow the recommendations in both responses in this other thread here, but with no succes. Does anybody here know of an esri API that can project a geometry from any spatial reference to any other spatial reference? Or, can anybody point us to a code sample or algorithm to properly and accurately project a geometry to/from any spatial reference? Thanks in advance for your help, Eric.


polishing qgis map for publication using inkscape

I have a problem modifying the map I created in QGIS. I need to add some text on the map and axis labels. Apparently, labels cannot be rotated in qgis, so this I need to do in inkscape or in a related programme.   * If I export the map as pdf, I cannot adjust the font size for the "tick marks" (lat and long values) according to the guidelines of the journal I want to submit my article to.   * I discovered the simplesvg tool, which gives a very nice resolution map, but then I don't have the coordinates along the borders of the map (or is there a way with this tool?) Is there someone that can help me? I'm getting pretty desperate.. :s Thanks! Ellen


Eclipse Quickstart installation Problem

i try my best to install GeoTools using **Eclipse QuickStart GeoTools 10 snapshot** ,and follow all the instructions,but i could't succeeded, and its give error message of download jar....i spend a lot of time(more than 3 days) to find the solution but?.....as i m doing my M.Sc research and stuck here in installation..i can not proceed.....(i m new to Geotools). where i make a mistake......i select geotools bec i ask question about my interest on (Looking for java (or python) APIs to read shapefiles), and one recommendation was Geotools. i also try Download Geotools bundles but its also not working. Thanks in advance.... ![enter image description here](http://i.stack.imgur.com/4V6Uz.jpg) **Error:** Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workspace that are strictly compatible with this environment. tutorial Build path JRE System Library Problem (With above Errors, when i did not find the solution i Press run and the following .... )               SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".     SLF4J: Defaulting to no-operation (NOP) logger implementation     SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.     [INFO] Scanning for projects...     [ERROR] The build could not read 1 project -> [Help 1]     [ERROR]        [ERROR]   The project org.geotools:tutorial:0.0.1-SNAPSHOT (D:\java\workspace\tutorial\pom.xml) has 1 error     [ERROR]     'repositories.repository.id' must be unique: osgeo ->      [ERROR]      [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.     [ERROR] Re-run Maven using the -X switch to enable full debug logging.     [ERROR]      [ERROR] For more information about the errors and possible solutions, please read the following articles:     [ERROR] [Help 1] http://          )


Create annotation features programatically

I am using the ESRI Silverlight API for my application. For points, polylines and polygons the Editor class combined with feature layers works great. But it looks like I have encountered a problem. My client needs to add/edit/delete annotations. I created an annotation layer and was able to publish it through ArcGIS Server but obviously couldn't edit it through the API because it's not supported. From the research I did, I couldn't find an answer which lead me to something. Is there a way how this can be achieved through arcpy / webservice / arcobjects / anything ? I appreciate all your help!


Silverlight chart binded to a related table service

I am new to programming - I am using Silverlight 4.0 with ESRI API 2.4. I would like to do the following:   1. Create a chart on a popup/maptip/infowindow when the user click on the feature in the web app.    2. The data to create this chart needs to come from the related table in the service.  I have no clue how to accomplish this. I was looking at some sample code from the silverlight toolkit samples: silverlight toolkit, looking at the line series under the DataVisualization. But I am really lost on how to bind the data to the my service that has a related table. Any help would be greatly appreciated. Thanks, Tanya


"Flight recorder" for automobiles/motorcycles?

As I sat in traffic court last week for a non-moving violation, many of the cases were clearly he said/she said issues.. particularly with stop sign violations. I can easily see how this specific problem could be a source of abuse by both police and citizens. Case in point - I stop at all stop signs. I usually count to 2 before moving, but because of the location of the white line, It may look like I never really stopped to someone coming along the cross street. Are there any **court-admissible** devices that will accurately (and _affordably_ ) record vehicle movement, location, and perhaps speed?


How can I append field from a geodatabase table to a polygon feature class?

I have an existing polygon feature class with about 30 attribute fields. I would like to append another 20 fields from an existing table in the same file geodatabase. Can this be done using an out-of-the-box tool? This is not a problem when creating a new feature class; in this case I would use the Import button on the Feature Class Properties:Fields tab. Now that my feature class contains records (as well as a subtype field with subtypes, in case this makes a difference) the Import button is unavailable (dimmed). ![enter image description here](http://i.stack.imgur.com/EUDQ5.jpg)


Can I disable mouse wheel zoom in QGIS?

I am having problems with the zoom in QGIS 1.8.0 where a slight move of the scroll wheel on the mouse zooms way way out. It will re-render at each zoom level and with large datasets it takes over the computer for sometimes up to a minute. Is there a way to disable the mouse wheel zoom in QGIS?


How to join attributes of donut polygon to hole polygon in ArcGIS?

First of all I'm completely new to the realm of GIS and ArcGIS. Basically I need a reliable way to determine a donut hole's containing donut for a few hundred thousand polygons (where the donut holes are their own polygons in the same feature). I've come across this question which deals with finding polygons within polygons; however, I need to actually map the internal polygon to its containing polygon (i.e. join the "lake" polygon's attributes to its "island" polygon). ArcGIS's Spatial Join tool with JOIN_ONE_TO_MANY and COMPLETELY_CONTAINS options looks very promising but doesn't seem to work as expected. I'm guessing this is because the "lake" polygons don't actually overlap the "island" polygons; the holes are cut out of the containing polygons. Is this possible? I'm using ArcGIS 10.


How to pass multiple latitude and longitude to bing maps from Json

I have an requirement in which i have some five latitude and longitude which is coming from JSON. I am printing the same in the web page. Now i need to pass those five values to BING maps as co-ordinates(Lat and Long). And i should display those points as pin-points in BING map. The 5 Lat and Long will be different each time based on user selection(So no hard-coding the Lat and Long). Note: I am using YUI. Literally i need to know how to pass multiple Latitude and Longitude to map co-ordinates. Know this is big thing, but any help/idea would really help me.


Generate clusters of X points within N meters

I have a set of roughly 4,000 points in very close proximity and I need to generate clusters of 5 points, with each point no farther than 50 meters from the (mean?) center of the cluster. I've explored various tools in ArcMap, especially in the analysis and spatial statistics toolboxes, though I can't seem to find a tool that will do the trick. I know that I would need roughly 800 clusters, but I'm not sure how to derive them from the point data. The buffer solution mentioned here won't work because the points in my data set are in such close proximity that buffering each point and then dissolving would create one or two large polygons that cover most of the data set. Also, I need to each point in my data set to be assigned to a cluster, while creating as few clusters as possible (a small number of clusters with less than five points is acceptable). ![Points](http://i.stack.imgur.com/itZwl.png)


Pseudo-Mercator projection with Decimal Degrees?

Hope this isn't a duplicate, did some searching but none seemed quite the same. Projection I want: WGS84/Pseudo-mercator. Selected. Looks Great. Canvas units I want: Decimal Degress. Selected. Denied. Assumed reason: WGS84/Pseudo_Mercator's CRS code is:               +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs      I assume the units argument is over-riding the user's canvas units choice? Is there any way around this? I don't know how to create a custom CRS but if it's easy enough to do, would it just be a case of copying the line above and omitting the bold bit? Thanks!!


Dissolve a Geometric Network in ArcGIS

I have a geometric network of water mains in ArcGIS. It it composed of a line feature class. I would like to dissolve it based on whether line segments share common endpoints only. ![enter image description here](http://i.stack.imgur.com/4xvJk.png) So basically Everything in the picture should dissolve together except for the Eastern North-South running line because it crosses over the other lines and does not share any nodes. However, when I run a standard Dissolve, all of the features run together.


How can I set a specific meter scale in the print map composer?

I am making a map for an orienteering class at the environmental education center that I work at. In order for us to easily calculate the distance between orienteering points, I need the scale to be 1 cm = 100 meters. I am not sure how to set this under the map item properties in the print map composer. I thought that it would be a 1:10 000 ratio, but in the print map composer this is way too zoomed in to possible be correct. Once I have this scale set is there some way to lock it in place so it does not change again? Also, on my working map in QGIS, the project CRS is set to WGS 84 with on the fly projection enabled. When I switch the map units from decimal degrees to meters, it appears to be incorrect. Distances that I know to be approximately 100 meters in real life appear to be thousands of km apart on the map when I am using the measuring tool. I also get an error message that says "This map is defined with a geographic coordinate system (latitude/longitude) but the map extents suggests that it is actually a projected coordinate system (e.g., Mercator). If so, the results from line or area measurements will be incorrect. To fix this, explicitly set an appropriate map coordinate system using the Settings:Project Properties menu." What am I not understanding here!? Please help!


Features disapearing

When I add a polygon feature it shows on the map. When I add another one the first one disappears. The code for adding is below:               $.postJSON('@Url.Action("GetLayers")', { "planId": planId },                 function(data) {                     var features = [];                     $.each(data, function(i, item) {                         var pointList = [];                         $.each(item.Points, function(y, p) {                             pointList.push(new OpenLayers.Geometry.Point(p.X, p.Y));                         });                         var ring = new OpenLayers.Geometry.LinearRing(pointList);                         var feature = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon(ring));                         feature.url = '@Request.Url.AbsoluteUri';                         feature.fid = item.Id;                         feature.geometry.id = "Link_" + item.Link;                              features.push(feature);                     });                     polyLayer.addFeatures(features);                 }             );      polyLayer is a Vector layer. Adding point features to another vector layer works perfect. Is there something that I'm doing wrong?


How to get distance between one point and all other points in a table?

I have a table in Postgres with lat and long columns. Can I use the `ST_Distance_Sphere` or `ST_Distance_Spheroid` methods to get the distance between one point and all other points in the table? Do I first have to convert my existing lat/long to the Point datatype; if so is there any method to do it?


Habitat Modeling and OLS Regression

I’m performing some habitat modeling for a certain species using resource selection functions to determine optimal variables for including as model parameters. I am using OLS within ArcGIS for the regression analysis on variables trying to determine how the species selects for certain variables based on availability in the surrounding environment. I have a series of known ‘presence’ and randomly generated ‘available’ sites; the response is binary with ‘presence’ as 1’s and ‘available’ as 0’s. I have 546 ‘presence’ points and 2730 ‘available’ points. I have run OLS to produce a number of variable combinations that minimize the AIC. However, once I go in and perform Spatial Autocorrelation (Moran’s Global), the results always indicate the data are clustered. My understanding is that if the Moran’s results indicate clustering, then the variable coefficients, etc. should not be trusted/consulted as it will over/under- predict in some portions of the model. If that’s the case, how can I arrive at results that are not clustered? Secondly, when performing OLS, I’m curious if there’s a specific way to remove variables that are either insignificant or highly correlated. For example, if I run OLS on say 24 variable combinations, perhaps half are returned as significant, and the other half are indicated as insignificant. In addition, some have very high VIF, while others are low. My question is, when removing variables to optimize the variable combination, is it best to first remove variables by order of insignificance, or is it best to eliminate variables with high VIF regardless of insignificance? In my experience, I’m not sure that there is a ‘best’ method, but curious if others have any insight based on their experience. Thanks in advance for any help.


GeoServer clustering with shared data directory

I am planning to cluster GeoServer. I can find several results in the web saying that often clustering is set up by configuring multiple GeoServer nodes which all share the same data directory. At the same time there's some results ( http://osgeo- org.1560.n6.nabble.com/Using-GeoServer-with-shared-data-directory- td4468628.html ) that say that all GeoServer features may not work with shared data directory. I tried to look at the actual GeoServer documentation but I could not find specifics about how a shared data directory can be used, is it supported, which features work with it and which dont. Best I could find was "When setting up a cluster of GeoServer machines it is common to share a single data directory among all the cluster nodes" at http://docs.geoserver.org/latest/en/user/advanced/logging.html. It is not a given that a shared data directory can be used. The nodes could be writing all sorts of files in the data dir, blocking and interfering each other. Without clear GeoServer documentation about it I am hesitant to use this approach in production... Is there some authoritative documentation on   * How to use shared data directory with clustered Geoserver   * Other aspects of clustering Geoserver (ie. can I simply add a load balancer in front and everything is ok? 3.2 at http://opengeo.org/publications/geoserver-production/ says that, is it correct?)


Is there a straight way to copy or clone a QgsVectorLayer Object?

Is there a straight way to clone or "deepcopy" a QgsVectorLayer Object with python? Unfortunately the python module "copy" is not successfull with that. Thanks in advance! nikolaus


Need help to convert 9.3 code for registering .dll to 10.1

This is my code to register my DLL (im using ArcMap 9.3)               Private Sub regDLL(ByVal dllName As String)             Dim asm As System.Reflection.Assembly = System.Reflection.Assembly.LoadFile(dllName)             Dim regAsm As New RegistrationServices()             Dim bResult As Boolean = regAsm.RegisterAssembly(asm, AssemblyRegistrationFlags.SetCodeBase)         End Sub      This same code wont work in ArcGIS 10.1 since there is esriRegAsm. Anyone know how to convert it so dat it will work? I'm using Visual Studio 10.1.


How to count features in polygon using ArcGIS JS API?

I have published in my ArcGIS Server two layers: A polygon one and a point feature one. Points are contained in polygons. I would like to know how to count the number of points belonging/contained to a polygon using **ArcGIS Javascript API**. So, the functionality would be, clicking in one of the polygons and then, present somewhere an integer (in an Infowindow or textbox in sidebar) saying "There are X points in this polygon". Could you provide any ideas or examples? Thanks for your help,


How to pass the name of the highlighted layer (in the TOC) to a script?

A total noob here: Users here add a picture to a map using the 'add data' Their first task is to right-click the jpg in the Table of Contents, select 'properties', select 'symbology' and then 'Classify' and then choose a new colors for the different ranges (to make the background transparent). I can create a model to do this and, alternatively, can write a arcpy script to do this but in both cases, I have to hard-code the name of the input layer. QUESTION: How do I use the selected layer in the TOC (i.e. clicked via the mouse and is now highlighted) as the input (and output) to my script? Ideally, the user would add the picture, click on it to highlight it (in the TOC) and then hit a key combination to execute the script. Any help is appreciated! Best, Eric


Radio Propagation Modelling, from a GIS view point

I've had a request from another department involved in telecommunications to revamp elevation data into GTOPO30, DTED or SRTM formats as input into a program called Radio Mobile. They are working on adding infill sites to low signal areas. Radio Mobile looks to be a program with history and a quick peruse of the message archives and tutorial sites shows there is active user community. The reliance on somewhat dated elevation formats, e.g. they don't seem to have heard of geotiff and do everything in geographic lat/long, got me wondering about the overlap between GIS and radio signal analysis. What communities and/or software systems are there out there approach Radio Propagation Modelling from a GIS point of view? What's your assessment of their GIS "savvyness"? EDIT: This could also be phrased as, where does someone who knows a something about GIS but nothing about radio signal propagation go to learn more?


JavaScript Api geo processing - internal server error 500

I am trying to run a geo processing task using Java Script API for Arcgis. I have created a simple buffer task, published using Arcgis server (synchronous) and used the same (almost) code as the view shed example "http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/demos/geoprocessor/gp_viewshed.html" . The view shed runs fine, but it fails with my REST service with the following error. "Server Error - Object reference not set to an instance of an object. Code: 500" . I have browsed a lot and did some changes with respect but nothing seems to work. Has anyone experienced this? Any help in this regard would be highly appreciated.. thank you very much...


How to overlay WFS output in GML format on a googlemap api v3 using GeoXML3

I would like to overlay a polygon layer on Google map API V3 from a WFS output file in GML2 format from a remote WFS server. No other output format is available in the WFS server. Is it possible to do this using GeoXML3 ? It would be great if some can give me a demo link which using a GML2.


postgis finding lines that touch and update

I am not much of a postgis guy so please bear with me. I have a subset of lines representing exits and roads around those exists. Main roads and exists can be distinguished by their class attribute (exits = class 5). My final goal is to update each single line that together make up an exit with the class attribute of the main road with the smallest value (say you leave the highway (class 1) and continue to a local road (class 4), the exit lines need to be updated to class 1). Sounds pretty straight forward but I'm struggling. I tried to break the problem apart so I came up with the following queries to close in on the problem.               # finds all lines of exits that together form the exit road      SELECT ST_LineMerge (ST_Collect(a.geom))     FROM sr_buffer as a, sr_buffer as b      WHERE ST_Touches(a.geom, b.geom)     AND a.class = 5      AND b.class = 5      This isn't really helping in the end I'm afraid as I'm losing the ids along the way.               # finds all transition points from main road to slip road     CREATE TABLE touch AS     SELECT s2.geom, s2.linkid, s2.class, s1.linkid AS linkid_sr FROM           sr_buffer as s1, sr_buffer as s2     WHERE s1.class = 5 AND s2.class != 5 AND ST_TOUCHES(s2.geom, s1.geom)      This is better already. Now we know that the exists starting with ID 14 and 9 for example should become class 1. > ## Class ID > > 1 14 > > 1 9 Now it should be possible to find all lines that make up the exit starting at ID 14. Any ideas on how to proceed?


Where is the log for advanced Python calculator errors?

There is a specific log file for Advanced Python calculator in QGIS 2.4.0? I got the tab message below point to a log file there I wasn't able to find by myself. ![enter image description here](http://i.stack.imgur.com/pwvA6.png)


Adding multiple layers with timed delay in Mapbox/Leaflet

So I've got a Mapbox map showing data split into several layers. I'd like the user to be able to click a play button to call the function "gogogo", and then the layers get added one at a time every 1 second or so. I'm trying to use simple Javascript to iterate through an array of addLayer's to add them one at a time, but the result of this code is that all the layers are added at once when the user clicks the button. Is there another way I should do this? Or is there some way through Mapbox or Leaflet's JS libraries to natively slow down the addition of layers?               var map = L.map('map').setView([57.8915,86.8359], 3);          // this just adds the basemap only     addLayer(L.mapbox.tileLayer('mymapboxaccount.7xu07ldi'), 'Base Map', -1);     function addLayer(layer, name, zIndex) {         layer             .setZIndex(zIndex)             .addTo(map);     }          var animation;          function gogogo() {       animation = setInterval(addNextLayer, 1000);     }          var layerAdder = function(layer) {         layer             .addTo(map);     };          function addNextLayer() {       for (var i = 0; i < arrayLength; i++) {         layerAdder(layers[i]);       };            var layers =  [addLayer(L.mapbox.tileLayer('mymapboxaccount.wv29be29')),           addLayer(L.mapbox.tileLayer('mymapboxaccount.d08p8pvi')),           addLayer(L.mapbox.tileLayer('mymapboxaccount.0tivygb9')),           addLayer(L.mapbox.tileLayer('mymapboxaccount.lv8l4n29')),           addLayer(L.mapbox.tileLayer('mymapboxaccount.mlr9hpvi'))           ];            var arrayLength = layers.length;            clearInterval(animation);     }


How to scan large paper maps without a large format scanner?

Is there a way people have used to import a paper map as a raster without using a large format scanner. I do not want to cut my map. I'm wondering how much success people have gotten using things like a regular digital camera, and what software they used to process the image to the point where I can just georeference it. I might even try something like microsofts photosynth software, or canons stitching software.


Export ArcGIS Online feature service with attachments

How can one export an attachment enabled feature service from ArcGIS Online and maintain it's integrity, meaning: get the geometry, table values, attachments, and the relationship class which connects them? The route of _"Open in desktop" > select layer > Data > Export_ only saves the geometry and table values. Ditto for Feature Class to Feature Class tool.


Add file GDB in quantumGIS 2.2

In QGIS 2.2.0, while adding vector layer, 'ESRI FileGDB' option was missing under Source-Type, refer the attached screenshot.In this case, how can I attach a file GDB in QGIS 2.2.0? ![enter image description here](http://i.stack.imgur.com/LTuK4.png)


Difference between 'point' and 'WKSpoint' in ArcGIS

I have to add 3-D points to make a polygon in ArcGIS using VB.NET. I have defined an IpointCollection and want to add points to this. I have options to add 'point' or 'pointcollection' or 'WKSpointz'. Which one should I use? Please explain this as I am new to this field.


Display postgis data with qgis 2.2

I have a problem with some shapefile, PolygonZ type, I have imported with "shp2pgsql-gui". This is the output (note 'coord_dimension' value): > >     mode=c, dump=1, simple=0, geography=0, index=1, shape=1, srid=3003 >     Shapefile type: PolygonZ PostGIS type: MULTIPOLYGON[4] Shapefile >     import completed. >   From this point of view it seems a data issue but I must say also that I'm able to display the same data with Qgis 1.8 (build from source). So what could be the cause of this behavior? PS:using Qgis 2.2 and Postgis 2.0.3 from UbuntuGIS repository on Linux Mint Maya


How do I cycle through the available Overlays and Base Layers using OpenLayers

I would like to have my map cycle through the display of loaded overlays and base layers using Javascript or jQuery. I would like to do this with a delay of 5 seconds between cycling. Does anyone have any idea on how to do this? Thank you in advance for your help!


ArcGIS 10.2 Viewshed not using Z Value?

I'm currently trying to produce a line-of-sight map of a tower with no results. Every time I run the viewshed tool, the program uses the base Z value of the DEM. I use the DEM Raster for the elevation model. The point has a Z value in the attribute table of 100.9. Which is the AGL height in meters. I leave the Z factor at 1. For some reason the viewshed is not the line-of-sight from 100.9M but from the base Z value. Anyone have any ideas what I am doing wrong? I have been out of this game for about 5 years. I learned the program back in the 9.1 days. So I could have easily forgotten a step or two.


How to set the transparency for multiple layers or add a global transparancy preference?

How can I set the transparency to 27 % for all 245 layers in QGIS? The only way I know of is by right clicking on the layer name, selecting Properties, then Transparency and then moving the transparency slider left or right. ![a](http://i.stack.imgur.com/dpca2.png) This is simple enough. But this is only good for up to 10 layers maybe. What if you have 245 layers like I do? Do you just keep on repeating the process? Now surely, there there must be a way to apply this to all 245 layers at once!? ![b](http://i.stack.imgur.com/94Nxz.png) Alternatively, is there a global transparency preference setting I can add in so that when I add new layers they automatically get 27 % transparency? The QGIS online documentation mentions something about exporting your transparency setting to a file for a later use. > As you can see this is quite easy to set custom transparency, but it can be > quite a lot of work. Therefore you can use the button Export to file to save > your transparency list to a file. The button Import from file loads your > transparency settings and applies them to the current raster layer. This seems like a useful feature. But I don't think this is what I'm looking for. I tried selecting multiple layers in the table of contents and then right click and select Properties and set the transparency level, apply changes and click OK. It applied the changes, but only to the last layer in the selection, the one I right clicked on. None of the other layers in the selection were affected. _(This could be a bug actually.)_


Postgis 2.1.1 compilation issue

Hi I tried to compile postgis-2.1.1 in RedHat 6.3 with:               # ./configure --with-pgconfig=/usr/local/pgsql/bin/pg_config --with-gdalconfig=/usr/local/bin/gdal-config --with-geosconfig=/usr/local/bin/geos-config --with-xml2config=/usr/bin/xml2-config --with-gui  --with-raster --with-topology      It gives:                 PostGIS is now configured for x86_64-unknown-linux-gnu           -------------- Compiler Info -------------       C compiler:           gcc -g -O2       C++ compiler:         g++ -g -O2       SQL preprocessor:     /usr/bin/cpp -w -traditional-cpp -P           -------------- Dependencies --------------       GEOS config:          /usr/local/bin/geos-config       GEOS version:         3.4.2       GDAL config:          /usr/local/bin/gdal-config       GDAL version:         1.10.1       PostgreSQL config:    /usr/local/pgsql/bin/pg_config       PostgreSQL version:   PostgreSQL 9.3.1       PROJ4 version:        48       Libxml2 config:       /usr/bin/xml2-config       Libxml2 version:      2.6.26       JSON-C support:       yes       PostGIS debug level:  0       Perl:                 /usr/bin/perl           --------------- Extensions ---------------       PostGIS Raster:       enabled       PostGIS Topology:     enabled       SFCGAL support:       disabled           -------- Documentation Generation --------       xsltproc:             /usr/bin/xsltproc       xsl style sheets:       dblatex:       convert:              /usr/bin/convert       mathml2.dtd:          http://www.w3.org/Math/DTD/mathml2/mathml2.dtd      But, when I compile I get:               # make     [...]     usr/local/lib/libgdal.so -L/usr/local/pgsql/lib -L/usr/kerberos/lib64 -ljpeg -lpng -lpq -lpthread -lrt -lcurl -ldl -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lidn -lssl -lcrypto -lxml2 -lz /usr/local/lib/libgeos_c.so /usr/local/lib/libgeos.so -lc -lm     ../../liblwgeom/.libs/liblwgeom.so: undefined reference to `isfinite'     collect2: ld returned 1 exit status     make[2]: *** [raster2pgsql] Error 1     make[2]: se sale del directorio `/root/Descargas/postgis-2.1.1/raster/loader'     make[1]: *** [rtloader] Error 2     make[1]: se sale del directorio `/root/Descargas/postgis-2.1.1/raster'     make: *** [all] Error 1      ¿Any idea? Thank you very much


Why does Find_SRID return zero?

using               SELECT Find_SRID('public', 'myTable', 'myColumn');      I get zero as the result, what does it mean? Regards,


Intersect between Surface and Ray

I am interested in finding the intersection of a Ray and a Surface in ArcObjects. I already know of two solutions. First solution is to use the `Locate` method of ISurface:               Dim intersectionPoint As IPoint = surface.Locate(ray, hint)      The other solution is to use the `GetLineOfSight` method of IGeoDatabaseBridge (where the variable `point` is a calculated point along the path of the ray):               Dim geoDatabaseBridge2 As IGeoDatabaseBridge2 = New GeoDatabaseHelper     geoDatabaseBridge2.GetLineOfSight(surface, baseRay.Origin, point, intersectionPoint, Nothing, Nothing, Nothing, False, False)      Surprisingly, the `GetLineOfSight` method is much faster than the `locate` method. But I am looking for an even faster solution. So my question is: Is there any other (and faster) ways to find the intersection between a ray and a surface? Or can you point me in the direction of literature that explains the calculations I need to roll my own? Thanks! **UPDATE:** I have started the process of creating my own Line of Sight algorithm. I have posted my current solution description in a blog post. Thanks again for all of the suggestions.


How to show cell values of raster in ArcGIS

I would like to know if it is possible to display a raster cell value in the center of a cell with ArcGIS in the same way that SAGA-GIS does when you zoom in.


How to populate a field with the max M value of a feature using Python in Field Calculator?

I need to calculate the max M value for a line feature using Python in ArcGIS 10 Field Calculator but I cannot figure it out. In 9.3 I used the follow VBA expression…               **Pre-Logic VBA Script Code:**     dim m as imcollection     set m = [shape]     dim d as double      d = m.mmax          **EndStation =:**     d      Thanks, Matt


Cannot persist to a blob field

Following this initial thread I'm having some problems implementing what was suggested here: Can I Store An ArcObject inside a BLOB? Well, following the link Kirk provided, I've came up with this:                   public static object GetBlobValue(this IActiveRecord wrapper,FieldAttribute attribute)         {             IMemoryBlobStream blobStream = wrapper.UnderlyingObject.get_Value(attribute.Index) as IMemoryBlobStream;                  IPersistStream blob = new PropertySetClass();             blob.Load(blobStream);                  return blob as IPropertySet;         }              public static void SetBlobValue(this IActiveRecord wrapper,FieldAttribute attribute,object value)         {             if (!(value is IPersistStream))                 throw new ActiveRecordException("Nâo é possível persistir um objeto que não implementa IPersistStream.");                  IPropertySet property = new PropertySetClass();             property.SetProperty(attribute.FieldName, value);                  IMemoryBlobStream memStream = new MemoryBlobStreamClass();             IPersistStream persist = (IPersistStream)property;             persist.Save(memStream, 0);                  wrapper.UnderlyingObject.set_Value(attribute.Index, memStream);         }      Looks like the SetValue code is working. I can see the values in Oracle just fine. But the GetValue method always returns an empty IPropertySet. I've decided to always wrap an object within the IPropertySet as recommended. I'm not sure what I might be doing wrong, since ESRIs documentation on this is sparse not very detailed. I've followed tons of examples (tried using IObjectStream, setting IObjectStream.Stream property with IMemoryBlobStream as described here) but no luck. Always an empty IPropertySet. Oh, also I've should mention that I'm trying to persist another IPropertySet to this field - could that be the problem? Thanks!


How to georeference using Latitude and longitude in QGIS?

I'm trying to georeference a picture using Latitude and longitude. The points are these:               top-left:  (116.30950927734372,39.970805680527725)       top-right:  (116.35620117187497,39.970805680527725)       bottom-left (116.35620117187497,39.93606595478707)       bottom-right (116.30950927734372,39.93606595478707)       When I tried to calculate the area of a polygon,the result is very small(something like e-7).I realized to my horror that the QGIS had treated the Unit as meter.What should I do? (QGIS1.8)


ArcGIS: Summarised Inside Join with Attribute Criteria

I have a situation in which I need to find how many points lie within a polygon, this would be quite simple with a summarized inside join from points to polygons except for the fact that the points have a time field and I only need to know only when the "point time" is in-between the "polygon start time field" and the "polygon end time field". Then I need the sum of all those points that meet that criteria and place into a new field of the polygon layer. I have around 3000 points and 2500 polygons (polygons overlap, thus needing the time constraint) Logic: SUMofPoints (IF Point is over polygon AND IF Polygon Start Time < Point Time < Polygon End time) All Point and polygon times are stored in a attribute field inside a geo- database. If it helps the times are formatted as "yyyymmddhhmm" I have a feeling that this requires python (or maybe even model builder?) but I have no formal experience in python although I have resources to friends and professors who do. So as simple as possible would be nice, but I know these things aren't really that simple. Any Hints, suggestions, places where I should look would be much appreciated. Thank you in advance,   wxmeddler   GIS Student, Millersville University


I have developd a map with TOC, Navigation Toolbar and some other query options using Javasctipt API in .aspx page. When I run it individually, it is working perfectly, but I want to embed it into another .net application. In .NET application I have a page with one dropdown with various options. Upon selection of option from dropdown I need to show the above said map. Iam getting below error. **Message: Could not load class 'dijit.layout.BorderContainer Line: 15 Char: 133114 Code: 0 I have hosted Javascript API in my local IIS. Can anyone help me how to resolve the above issue. Thanks, Uday


Is it possible to configure WFS layer to use GET requests?

Accordingly specification manipulation with WFS services can be perform using POST or GET (for example, `http://demo.opengeo.org/geoserver/wfs?service=wfs&version=1.1.0&request=GetFeature&typeName=topp:states`) requests. Is it possible to configure OpenLayers for using only GET requests (by default POST is used). Now my code looks like:               wfs = new OpenLayers.Layer.Vector('Example of WFS layer', {         strategies: [new OpenLayers.Strategy.BBOX()],         visibility: true,         protocol: new OpenLayers.Protocol.WFS(wfs_property)     });


ST_Union to merge tables containing lines?

I have to build a street network with Postgis that will be used with pgrouting. I have two tables: 1) the_network (182 lines): is a MULTILINESTRING table. Having columns road_name (varchar) / road_length (numeric) (numeric) 2) buildings (104 lines): is a POINT table. Having building_id (integer) The following code creates lines between buildings and the network. The 104 created lines are stored in buildings_to_network_lines_table which is GEOMETRY type.               SELECT ST_ShortestLine(a.geom, ST_Collect(b.geom)) AS geom, ST_Distance(a.geom, ST_Collect(b.geom)) AS shape_length INTO buildings_to_network_lines_table     FROM  buildings a, the_network b     WHERE ST_Dwithin (a.geom, b.geom, 1000)     group by a.gid, a.geom;      ![How to create a new table containing the black lines \(the_network\) and the red lines \(buildings_to_network_lines_table\)](http://i.stack.imgur.com/IOfP2.jpg) Then i just want to create one table named the_network_full that contains all the lines of the_network and buildings_to_network_lines_table tables. I've tried to achieve this by a ST_UNION function :               SELECT ST_Union(a.geom, b.geom) AS the_network_full     FROM  the_network a, buildings_to_network_lines_table b;      ![enter image description here](http://i.stack.imgur.com/WmnR4.jpg) The results looks good but unfortunatelly the resulting the_network_full table (type GEOMETRY) contains 18'928 lines (182 * 104) instead of 182+104 = 286 lines. Any idea of what I am doing wrong ? How would you do to merge these two tables into a new one ? Any help will be greatly appreciated, Theo


Why can I not publish from -QGIS Geoserver plugin?

I am following the tutorial at http://qgis.boundlessgeo.com/static/docs/quickstart.html and I get to the step "To publish the project as it is, just select the QGIS project entry in the OpenGeo Explorer tree, and then click Publish.... You will see the following dialog:" But 'Publish' is greyed out. One oddity is that when I Add a Geoserver Catalogue I get a warning: Warning: Could not connect to the catalog at that URL But I don't understand what this means. Is there something else I need to configure on GeoServer?


How to build Poisson autoregression model

I have a `SpatialPolygonsDataFrame` object in R with about 3000 polygons and associated data. I have columns of expected and observed cases. For the moment, I don't have any covariates. I'd like to perform spatial smoothing. I have used functions such as `empbaysmooth()`, `lognormalEB()`, `EBlocal()` from the `DCluster` package but have not been happy with the results. Therefore I would like to do a conditional autoregression using `spautolm()` \- I would like to model a Poisson model of observed versus expected with neighbour weighting. I cannot figure out how to specify such a model. How do I specify merely a Poisson model for the `spautolm` command with no covariates? Or am I barking up the wrong tree altogether?


Get the ID of polygon in edition sessions of QGIS?

I did a Qt custom form for QGIS which contain a QlineEdit that must get the ID of the current polygon in edit session. For example, I start edit sessions I draw 3 polygons when the Qt form is opened the QLineEdit is empty so only when I save modification and then when I click on my polygons I get the ID. PS: I tried signals of QGIS but that doesn't work on QGIS 1.8.   Could someone help me please !!


Help choosing most suitable bivariate choropleth mapping coloring scheme

I am trying to overlay a nominal variable (2 categories - rainfed vs irrigated) in a choropleth map over a numeric variable. ![enter image description here](http://i.stack.imgur.com/Nl3Kx.jpg) In order to highlight the difference in pattern among the two categories, I have outlined one category with a different color (irrigated areas in "red"), while the uncoloured ones are rainfed areas. However, the map feels cluttered and the outline mixes with darker shades of the numeric variable. I am trying to avoid using two different color shading schemes to represent the two categories as I feel that would hide the overall distribution of the underlying variable. Is there a better way to represent this bivariate classification using the ggplots2 package in R (which I am currently using it for making the attached map)? These maps are eventually going to be printed on paper.


How to export raster into ascii without losing the statistics?

I had a problem in Mike Urban with a difference between a DEM (Digital Elevation Model) and a 2D overflood model and the support group requested me to remove the difference because the problems were at the edges of the area. Then I found an inspiration by: ArcGis--how to lower a DEM's Z value along a line I made a polyline in Arcgis and afterwards converted it to raster and reclassify the file(to remove the NoData) and at last I subtracted the area from the original DEM to edit the height by the Minus Tool. Afterwards I tried to convert the raster file to ASCII by the converting tool, but when I open the file in MIKE Urban (GIS-based urban modeling system for water distribution systems and wastewater collection systems) the statistics (max, mean etc.) were missing. Is there another way to convert the file without losing data?


Generating a multivalue choice list in ArcGIS using Validation [Not availalbe for Standard License]

I'm trying to adapt a model and script combination found on ESRI's blog site titled 'Generating a multivalue choice list'. However, I've concluded that part of the validation used in the embedded script is reliant upon the 'Frequency' Tool in order to function properly, but this is only available with and Advanced license (lame). The blog post explains the workflow and where to download the models and scripts (but I'll happily post them up here upon request). As far as I can tell, the core of the functionality I'm after, generating a multivalue choice list: ![enter image description here](http://i.stack.imgur.com/5WCO0.png) ..is predicated upon the validation script working properly. Without the validation, I'm unable to get the values from the field to appear as a list. Is there anything I can remove out of this validation script to get the functionality I'm after, or is there a workaround? I'm unfamiliar with the validation process. Here is the code for the validation (I was going to post as a Code Sample, but this looks like it might be easier to follow): ![enter image description here](http://i.stack.imgur.com/jBMSl.png) [ **Editor note:** here is the actual validation code, the image is not correct]               import arcpy          class ToolValidator(object):       """Class for validating a tool's parameter values and controlling       the behavior of the tool's dialog."""            def __init__(self):         """Setup arcpy and the list of tool parameters."""         self.params = arcpy.GetParameterInfo()            def initializeParameters(self):         """Refine the properties of a tool's parameters.  This method is         called when the tool is opened."""         return            def updateParameters(self):         """Modify the values and properties of parameters before internal         validation is performed.  This method is called whenever a parmater         has been changed."""         if self.params[1].altered: #Set condition - if the input field value changes             if self.params[1].value: #if the field parameter has a value                 for field in arcpy.Describe(self.params[0].value).fields: #iterate through fields in the input dataset                     if field.name.lower() == self.params[1].value.value.lower(): #find the field object with the same name as field parameter                         try:                             if self.params[2].values: #if this parameter has seleted values                                 oldValues = self.params[2].values #set old values to the selected values                         except Exception:                             pass                         values = set() #create an empty set                         fieldname = self.params[1].value.value #set the value of variable fieldname equal to the input field value                         FrequencyTable = arcpy.Frequency_analysis (self.params[0].value, "in_memory\Frequency", self.params[1].value.value, "") #for large tables create a frequency table                         cursor = arcpy.SearchCursor(FrequencyTable, "", "", self.params[1].value.value, "{0} A".format(self.params[1].value.value)) #open a search cursor on the frequency table                         for row in cursor: #loop through each value                             values.add(row.getValue(fieldname)) #add the value to the set                         self.params[2].filter.list = sorted(values) #set the filter list equal to the sorted values                         newValues = self.params[2].filter.list                         try:                             if len(oldValues): # if some values are selected                                 self.params[2].values = [v for v in oldValues if v in newValues] # check if seleted values in new list,                                 # if yes, retain the seletion.                         except Exception:                             pass            def updateMessages(self):         """Modify the messages created by internal validation for each tool         parameter.  This method is called after internal validation."""         return      Is it possible that my assumption (via testing) that the validation is the key piece is false, and that something else isn't allowing the values to be exposed as a selectable list? Many thanks in advance. Having this type of functionality will really jump start the adoption of several key workflows I'm trying to distribute in our company!


proj4js not convert y

Proj4js.defs["EPSG:2322"] = "+proj=tmerc +lat_0=0 +lon_0=36 +k=1 +x_0=500000 +y_0=0 +ellps=intl +units=m +no_defs ";          Proj4js.defs["EPSG:4326"] = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs";          alert(feature.geometry.getVertices()[0].x);     alert(feature.geometry.getVertices()[0].y);     var point = new Proj4js.Point(feature.geometry.getVertices()[0].x, feature.geometry.getVertices()[0].y);               //Define the source Coord Sys      var src = new Proj4js.Proj("EPSG:4326");     //Define the destination Coord Sys        var dst = new Proj4js.Proj("EPSG:2322");          var gk=  Proj4js.transform(src, dst, point);     alert(gk);      i can get x and y cordinates but when i convert them to epsg 2322. x will change but y is always zero. i found thats code but it is not converting correct * * *                 Proj4js.defs["EPSG:2322"] = "+proj=tmerc +lat_0=0 +lon_0=36 +k=1 +x_0=500000 +y_0=0 +ellps=intl +towgs84=-87,-98,-121,0,0,0,0 +units=m +no_defs";             Proj4js.defs["EPSG:4326"] = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs";             Proj4js.defs["GOOGLE"] = "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs";             Proj4js.defs["EPSG:900913"] = Proj4js.defs["GOOGLE"];                                      //Define the source Coord Sys              var src = new Proj4js.Proj("EPSG:900913");             //Define the destination Coord Sys                var dst = new Proj4js.Proj("EPSG:2322");             var point = new Proj4js.Point(feature.geometry.getVertices()[0].x, feature.geometry.getVertices()[0].y);             Proj4js.transform(src, dst, point);


How Display WMS layer in AxMapControl?

I modify application (on c# .Net) based on arcobjects. It is a desktop application. I use object AxMapControl Map1. I can load .mxd map in it.               Map1.LoadMxFile(mapName);     Map1.Refresh();      Now I need to load wms layer in this application. This wms layer is published and I know its url. Tell me please can I use AxMapControl for this purpose? What classes and interfaces i need use to diplay wms layer? _**UPDATE_** I know it is possible, because I can do it in ArcMap 10.1 as user.


How can I bring in grid files from Geographix into ArcGIS?

I have a set of grids of subsurface horizons, created from contours, that I have created in Geographix and am having trouble brining them into ArcGIS. Currently when I try to export the grid Geographix is only showing me the cell boundary and is not importing the grid values. Do you know how to correctly export the grid from Geographix so that it will display in ArcGIS as a grid file?


How can I develop this kind of web map application?

I wonder can you tell me how is developed map application like on this site? http://www.streetdirectory.com What API is used?


PostgreSQL: transform spatial column from PG_GEOMETRY to ST_GEOMETRY

I have spatial Data stored in my PostgreSQL database as PostGIS Geometry (PG_GEOMETRY). It looks for example like this: 010100002031BF0D0000000000F989264152B81E057E6D5841 Now I would like to move this column to a database with ArcSDE schema, which uses ST_GEOMETRY. Is this possible with a simple sql command, or a more difficult task?


importing coordinates via a csv file does not work

I tried to manually add point data via a CSV file to an empty project in QGIS 1.8.0. The points do show up all right with the correct coordinates, but already the scale is not correct (using the measuring tool it only measured some centimeters where it should be 20km). I used entered decimal degrees and WGS84 datum EPSG 3857. It doesn't work either when I put a Bing aerial first. Something is probably not correct with the projections, even though I tried out different stuff. Thanks for your help.               nom,latitude,longitude     1,-2.6,-78.2     2,-2.5,-78.2     3,-2.6,-78.1     4,-2.5,-78.1


Creating randomly shaped clumps of cells in a raster from seeds of 1 cell/pixel?

As my title says, I wish to "grow" clumps of cells from seeds within a raster. My base raster is full of 1's and 0's, 1's indicate land and 0's sea/NA areas. From the 1's I wish to select 60 random pixels/cells as my seeds, and then randomly grow a connected clump of a pre-defined no. of pixels/cells limit from that seed. I've heard the technique can be referred to as 'spread dye' but haven't had any luck finding much on it. The seed cell would be turned to a value of 2 and then the next cell chosen from surrounding 1's would be converted to 2 as well. 2's are then unavailable to be converted in future. This thread does help a bit, as I would also be willing to do this in R as I'm familiar with reading and manipulating GIS data in R. However, what I require is a set of rules to randomly select pixels surrounding an existing clump. If anyone has done this more basic form of cellular automata in a GIS setting then I would appreciate any advice/guidance. Example: I have a target of 250 cells. I randomly select one cell that has a value of 1. This is turned to a value of 2. Then, one of the neighbours of the seed cell that = 1 is turned to a 2. Then, one of the neighbours of either the cells with a 2 value is selected and turned to a 2. This would continue until a continuous shape numbering 250 cells is reached. **Edit: Further Questions** Based on whuber's great answer, I have a few questions about the code:   1. How do I get allocate the values of the grown cells to just a '2' rather than variable values which represent the order in which they were created?    2. I need to create 60 clumps of cells within my area of '1's. I have devised ways to pick random starting positions but struggle to make it all work within a loop using the `expand` function which you kindly wrote. Can you suggest a way to create 60 clumps which don't clash with each other and are contained within the same final matrix? **Edit: Further Explanation of Problem** Each clump of cells will represent a protected area of a defined size e.g. 250 cells. Each area needs to start on & grow into cells with a value of 1 as this represents land and avoid cells with a value of 0, as this represents sea. I need to iterate this 1000 times with 60 protected areas in each iteration to create a null model, showing what distributions of these areas will be by chance. For this reason, the total count of cells across all 60 areas will need to be identical in each of the 1000 iterations so they are comparable. Therefore, it's ok if the areas touch, but if there is a collision, then ideally the clump would grow in another available direction until the target of 250 is reached. Future modifications to this process will involve varying the size of each of the 60 areas and potentially the shape although I understand this would be difficult. Once each of these 1000 protected area networks are created, they will be used as a mask against other raster data such as biodiversity measures to see (a) whether they intersect particular species ranges and (b) what % of particular species ranges these random networks of protected areas cover. Thanks to @whuber for your help so far, I don't expect you to spend more time helping me, but thought I would try and clarify my situation as you have requested. Kind regards


Global DEM and country borders

I am trying to split up the world into 2 categories based on elevation (below 2000m and above 2000m) while still including a country identifier. So in the end, I would like to have 2 types of units (low areas and high areas) for each country in the world, then I will use Spatial Analyst's Zonal Statistics to calculate the mean values of other rasters of interest in my defined areas. Does anyone have a suggestion for how to do this? My data: \- 16 DEM tiles for the world \- 1 country borders shapefile I am struggling with: 1)...working with all the DEM data at once on a global scale because I have been reading the mosaic-king across UTM zones distorts the data. 2)...whether my final units should be in raster form/ file geodatabase grid. I have heard that I should work in a file geodatabase and forget trying to have my final units be in shapefile form. I know how to reclassify and have been successful at obtaining a raster with only two categories of elevation for each DEM tiles separately (above and below 2000m). Any advice would be greatly appreciated, Liz


My view in Oracle when displayed in ArcMap/ArcCatalog values are being dropped to 0

I created a view in an Oracle Database in order to match formatting of a new database/table I am going to be migrating the data to. The problem is when I look at my view in Oracle I see the correct values (at least values that I expected to see). However, when I bring the view into both ArcMap and ArcCatalog through the add data or database connection those values turn to zeros. Does anyone have any thoughts? I am using arc10 and SQL Developer


Arc by center point in PostGIS does not fit the circle

I'd like to store a GML ArcByCenterPoint in PostGIS. I can work out the start, middle and end points required by the `CIRCULARSTRING` type and all seems to be OK, except that when I visualise the arc it does not fit the circle that it's supposed to be part of. Data (in lon/lat format):               Circle centre point: 29.59444 40.26333     Radius:              18 NM (27780 M)     Arc start point:     29.89250 40.36667     Arc end point:       29.27528 40.31667     Arc middle points:   29.560000 40.511667 (counter-clockwise)                          29.628611 40.015000 (clockwise)      SQL statements to insert the geometries. Note that I'm using `ST_CurveToLine` here, because I don't know of anything that can visualise a `CIRCULARSTRING` directly.               -- The arcs going both ways between the same start and end points     INSERT INTO test (test) VALUES (ST_SetSRID(ST_CurveToLine('CIRCULARSTRING(29.8925 40.36667,29.560000 40.511667,29.27528 40.31667)'), 4326));     INSERT INTO test (test) VALUES (ST_SetSRID(ST_CurveToLine('CIRCULARSTRING(29.8925 40.36667,29.628611 40.015000,29.27528 40.31667)'), 4326));          -- The full circle     INSERT INTO test (test) VALUES (ST_Buffer(ST_GeogFromText('POINT(29.59444 40.26333)'), 15 * 1852)::geometry);      Here is what the result looks like in Google Earth: ![The resulting shapes](http://i.stack.imgur.com/M2w5n.png) The arcs are in red and the lines from the center point to the start and end points are in blue. The arcs do touch the circle at 3 points, so it would appear that the coordinates were calculated correctly (or at least close). But the shape of both arcs is wrong - as you can see, they don't quite follow the circle. Can anyone suggest what's going wrong here? Is either the `CIRCULARSTRING` type or the `ST_CurveToLine` function not doing what I expect? I'd love to take `ST_CurveToLine` out of the equation and visualise the `CIRCULARSTRING` directly, but I don't know of any way to do that. **Edit:** I finally gave up on this approach and approximated the arc in a different way: Storing GML surface in PostGIS


Are database client files platform specific?

I'm just looking for some clarification on a question that came up with me this morning. Are the DLL client files (libeay32.dll, libiconv-2.dll, libintl-8.dll, libpq.dll, and ssleay32.dll) platform specific? ie - If I have QGIS and ArcDesktop installed on the same machine, can I take a copy of those DLL files from the QGIS installation and move it to the Arc \bin\ folder and then connect to a PostgreSQL database? OR, do I need to have a specific set of the DLLs for each platform (QGIS/ArcDesktop)? * * * EDIT - For Clarification: This ESRI Help Article says that in order to set up a connection between ArcGIS and a PostgreSQL database I need to download a set of DLL files from the ESRI Customer Care Portal and place them in the \bin\ folder of my current ArcGIS installation. I noticed that I already have a set of these files that were installed with QGIS. _Can I just use that copy (from QGIS) in place of the ones I would download from ESRI?_


OpenLayers + Geoserver problem with wfs projection

In geoserver i have a layer in EPSG:26191. In OpenLayers i add it on map as WFS:               markerLayer = new OpenLayers.Layer.Vector('Markers',{             strategies: [new OpenLayers.Strategy.Fixed()],             protocol: new OpenLayers.Protocol.WFS({                  srsName:       "EPSG:900913",                  version:       "1.0.0",                              url:           "http://localhost:8080/geoserver/copro/wfs",                              featurePrefix: "copro",                               featureType:   "st",                                featureNS:     "http://localhost:8080/geoserver/copro",                               geometryName:  "geom",               }),             projection:new OpenLayers.Projection("EPSG:900913"),              });     app.mapPanel.map.addLayers([markerLayer]);      > i used QGIS with openlayer plugins the overlay is perfect but with this code > my wfs is send to ocean


what is the format of Geometry data type of SQLServer 2008

I want to know, In which format the Geographic data stored in geometry data type of SQLServer 2008.it looks like a long string,like 0xE6100010466DFEOA4089663524....... for one polygon. My second question is How can i get set of google latitudes/longitudes from this data format ?


MapInfo/PlanWeb and Oracle to ArcGIS/GeoCortex Essentials and Oracle

As an organisation we currently use MapInfo desktop GIS (120 users) and PlanWeb intranet GIS (about 1000 users), both products of Pitney Bowes. We have about 15 core desktop GIS users who edit spatial data in our core Oracle 10g database. Our PlanWeb users are generally read-only users but up to 100 may edit data in Oracle via intranet GIS. We are moving to ESRI ArcGIS Server and Desktop GIS (Advanced Enterprise version) in conjunction with Latitude Geographic's GeoCortex Essentials. Our Oracle 10g will be upgraded to 11g. If anyone else has been through a similar process or any part of this process I'd be interested in knowing what problems you came across and the way in which you undertook the transition. Thanks for any info you can provide.


DTM Extraction/Smoothing in ArcGIS

I have an .las file, intended to be a DTM (bare earth) that I generated from a photogrammetry software package that has come out just a bit too lumpy. I now have the license for that software tied up for a long time on the next one, and am looking for tools to smooth out this DTM in ArcGIS. I have harnessed my education as best as I could, from generating a meaned grid with LAS to Raster to using Focal Mean and Focal Minimum, generating a raster to contours and back to raster. It seems that no matter what I do, how large I make the search area or grid spacing, I can't get rid of the lumps. The area I'm working on is very mountainous, and I believe that to be part of the problem. ![enter image description here](http://i.stack.imgur.com/uGDh7.jpg) Does anyone have any really good tips or tools that might help me out here? I have access to an ArcGIS 10.2 advanced license, Spatial Analyst and 3D Analyst. I also have access to Global Mapper.


How do I turn a GeoTIFF file into a bmp file?

I need to get GeoTIFF files transformed into bmp files so that I can display them as apart of some software that I am working on. Unfortunately, I am a total newbie with GIS and really don't know much about geography. I am working in C++ and need to have this included in what I am doing. A dll file would be great, although it is my understanding that we might need to include the source code from which the dll is created. I am wide open to any other technique that could be used as well. Can anyone help me with this? I should also note that I am working on a Windows machine.


What are some of the features available in non-FOSS GIS software that you'd like to see in your favorite FOSS GIS

For example, a program I use (TransCAD) has the ability to do travel time matrices based on minimal data input, which is really useful if you're looking at doing back of the envelope type calculations. Another feature it has is the ability to do transit routing and GHG emissions modeling. What are some of the features you use in non-free/opensource software that you'd like to see implemented in your favorite FOSS GIS software?


How to delete polygon in Openlayers

I would like to delete my polygon in Openlayers after i have drawn it.

                         <input type="radio" name="type"                             value="none" id="noneToggle"                             onclick="polygonControl.deactivate()"                             checked="checked" />                         navigate

                         <input type="radio" name="type"                             value="polygon" id="polygonToggle"                             onclick="polygonControl.activate()" />                         draw polygon


Creating a tile server from non-map tiles for use in ArcMap

I have tiled top-down imagery that I want to overlay on aerial view maps in ArcMap. **What are some ways to create a WMS or TMS from a custom set of tiles? (aka not using tiles from e.g. OpenStreetMaps) More generally, given a set of tiles that live locally on a computer, how can I use freely available tools to put this imagery into ArcMap in a responsive manner?** * * * A bit of vague background in what I've done previously with this imagery: I have previously used OpenLayer 2's XYZ tile layer capability to create a browser-based viewer. With a customer desiring this imagery in ArcMap instead of a browser, I used the trial version of GeoExpress to create MrSID format files. This worked fine; responsive, in the right location, etc. However, in an attempt to avoid tacking that cost on, I've been investigating 'tile server' approaches to use within ArcMap. I've seen a ton of tools in my various research so far... It seems like just about everybody else is simply making servers using subsets of already extant imagery, thus why I am a bit lost! What I've nearly gotten to work over the past few days is to use MapProxy. I can get MapProxy's demo capability to show my tiles in a browser as a WMS. And MapProxy's services (in particular the Talparo MapProxy bundle) can be loaded into ArcMap. Right now I'm stuck on how to specify the extents/location of the tiles I have. (probably revealing my complete lack of background in GIS:) I feel like I should be able to use the bbox (boudning box) parameter to say, "My tiles span this region on a map." My question is not, though, "how do I fix my MapProxy implementation." Rather, I'm wondering if I grabbed the right tool for the job. If I learn that MapProxy is a good approach, I'll craft a separate question on that topic later.


How to get from Lat/Lon to this format?

I have twitter data with coordinates such as: [-7.2377761, 112.73091137] I'm working with a python geo library called osgeo. The sample code indicates creating a point like this.               point = osgeo.ogr.Geometry(osgeo.ogr.wkbPoint)     point.SetPoint(0, 474595, 4429281)      The values above do not look like lat/lon. How do I perform the conversion?


Trying to script an export using individual selections based in excel

I am currently using Data Driven Pages to select a large group of blocks, and exporting them using a field name (after they have been related to the Excel spreadsheet). The problem is that ALL of the blocks are selected, and therefore the exported PDF might have two of the blocks highlighted on it. I would like to have an individual selection shown on the exported PDF, but still do all of the fields in the spreadsheet. Possible?


From coordinates find country using Python

I have tweets with coordinates. I'm trying to bucket the tweets by country using the coordinate information. I know that I can achieve this using some hosted web services but all of these have API limits that I am sure to run into. UPDATE: I started writing this code learning from another resource about osgeo library.               import osgeo.ogr     shapefile = osgeo.ogr.Open("geodata/worldborders/TM_WORLD_BORDERS-0.3.shp")     layer = shapefile.GetLayer(0)          for i in range(layer.GetFeatureCount()):         feature = layer.GetFeature(i)         countryCode = feature.GetField("ISO3")         countryName = feature.GetField("NAME")         print countryCode, countryName              geometry = feature.GetGeometryRef()      The geometry variable has a member function called Contains that can take another Geometry and checks whether the other is contained inside itself. I have a coordinate value from Twitter data in the following format: [45.29680725, -75.92681408]. However an example on osgeo showcases creation of a point like this:               point = osgeo.ogr.Geometry(osgeo.ogr.wkbPoint)     point.SetPoint(0, 474595, 4429281)      How do I convert my coordinates into the above required format? If I do manage to convert, is this the right approach of mapping twitter coordinates to countries?


What's the reason for this Invalid Layer "Cannot open GDAL dataset ..." error

When adding a rasterfile with QGIS python console there appears an error when the first letter of a rasterfile to be added is not written in capital letters. Why this behaviour? **Example case1:**               >>> qgis.utils.iface.addRasterLayer("C:\geodaten\natural_earth.tif", "raster")      _Error:_ > Invalid Layer "Cannot open GDAL dataset C:\geodaten atural_earth.tif: > `C:\geodaten atural_earth.tif' does not exist in the file system, and is not > recognised as a supported dataset name." **Example case2:**               >>> qgis.utils.iface.addRasterLayer("C:\geodaten\Natural_earth.tif", "raster")      _No error!_ Rasterlayer is added properly. With vectorlayers the above mentioned problem doesn't exist. The QGIS version in use is 2.2.0


How to create a color ramp in ArcGIS 10 with only 10 colors

I am trying to use the company I work for's color scheme in the maps that I am making. I have all the RGB values for the colors, but there are only 10 different shades of each color, while the style manager's ramps need 12 shades. Is there any way to change the number of colors in each color ramp?


Is it possible to cache the same WMS service based on a vendor parameter?

I'm exploring optimization techniques for caching data coming back from a Digital Globe service. We have two unique identifiers we use for their WMS GetMap service that will give us low or hi-res raster images. I'd like to cache both, but the only different between the two is simply a vendor parameter called 'connectid'. In the end, we'll cache at least one of them, but we'll need to make a choice of which one if it's not possible to do both.


Work-around for slow processing times in ArcGIS 9.3 with Spatial Analyst functions

I am batch processing a large amount of distance functions (~50,000) using ArcGIS 9.3. In this version, using spatial analyst functions, it seems to be the case that users cannot parallelize processes across cores, or write to in_memory instead of the hard disk for intermediate steps, and there's a memory leak inherent in the program that causes processing to slow down over multiple loops. I've seen a forum post that shows a crude workaround for the memory leak that just turns off garbage collection, but that alone probably won't help a whole lot. Right now I'm looking at processing times on the order of a few weeks on the computer I'm using for this. Does anyone know of any reliable work-arounds that would allow me to write SA output to in_memory, parallelize processes, or in some other way significantly speed up processing? I'm open to using ERDAS if I have to. Script:               # Import system modules     import sys, string, os, arcgisscripting, time, shutil          # Create the Geoprocessor object     gp = arcgisscripting.create(9.3)              # Allow overwrites     gp.overwriteoutput = 1          # ----------------------------------------------------------     # Set changeable model parameters     # ----------------------------------------------------------          cell_sz = 90.04245658     Max_oid = 1 # Should be = 54567 for irrigated agriculture, in province sources - Range function starts at 0 and stops 1 before number in range - so this number should be = number of records in shapefile     Win_sz = 3100 # This is the minimum possible size, and should make it so that even the largest k results in values = 0.001 or less at boundary           # Create a folder for this set of runs, designated by the current time, then copy the script being run to the folder and time stamp it     t = time.localtime()     timeholder = str(t[0]) + '_' + str(t[1]) + '_' + str(t[2]) + '_' + str(t[3]) + str(t[4]) + '_' + str(t[5])     folder_time_name = "M:\\Jess_GIS_NIDR\\" + timeholder     os.mkdir(folder_time_name)     filename=sys._getframe().f_code.co_filename     shutil.copyfile(filename, folder_time_name + '\\this_script_executed_' + timeholder + '.py') #shutil          # Check out any necessary licenses     gp.CheckOutExtension("spatial")               cell_sz_str = str(cell_sz) + " METERS"     gp.cellSize = cell_sz               # Set up loop to go through the data set, iteratively select cells out, and processs distance calculations          for i in range(Max_oid):         pt = i         print "Processing point number " + str(pt)              # Load prepped dataset containing this point         irragg = "M:\\Jess_GIS_NIDR\\Pts_irragg\\pt_int_" + str(pt) + ".shp"              # Publish output to common folders - may add additional dists_proc style folders         Dists_raw = "in_memory\\dists_raw"                   # Define local variables (files only associated with processing this source cell)         DEM = "M:\\Jess_GIS_NIDR\\InputRasters_Globcover_Hydrosheds\\HydroSHEDS\\dem"         Dir_hydro = "M:\\Jess_GIS_NIDR\\InputRasters_Globcover_Hydrosheds\\HydroSHEDS\\drain_dir"         Dists_fin = folder_time_name + "\\Dists\\Dists_fin.shp"                   # Identify and set processing extent              y = []         x = []              cur = gp.SearchCursor(irragg)         row = cur.Next()              while row:             extent = row.Shape.Extent                y.append(extent.ymin)                 x.append(extent.xmin)                 row = cur.Next()              del row             del cur              ypt = y.pop(0)         xpt = x.pop(0)              def incmax(a): return (a + Win_sz)             def incmin(b): return (b - Win_sz)              ymin = incmin(ypt)             ymax = incmax(ypt)             xmin = incmin(xpt)             xmax = incmax(xpt)              del y             del x              gp.extent = "%f %f %f %f" % (xmin, ymin, xmax, ymax)                    # Path-distance function              gp.PathDistance_sa(irragg, Dists_raw, "", DEM, Dir_hydro, "FORWARD 0.01 0.5", "", "", "", "")         # Convert distance results to permanent shape file         gp.RasterToPoint_conversion(Dists_raw, Dists_fin, "VALUE")                        # Further processing of original distance raster to get at first order ideas of distance              # ---------------------------------------------------------------------------------------              # Crudely correct for the fact that the original land-use data was originally at a coarser resolution than this dataset         gp.AddField_management(Dists_fin, "Dcorr", "DOUBLE", "", "", "", "", "NULLABLE", "", "")              gp.CalculateField_management(Dists_fin, "Dcorr", "[RASTERVALU] - 90.04245658", "", "")                 # First order distance function         gp.AddField_management(Dists_fin, "Dist_k", "DOUBLE", "", "", "", "", "NULLABLE", "", "")         gp.CalculateField_management(Dists_fin, "Dist_k", "Exp([Dcorr]*-0.00231)", "", "")


What are the highest and lowest precision Coordinate Reference Systems for US East Coast?

And does it matter what system your data layer begins with if you choose the right system for your project? Do some applications use more precise projection systems than others?