ARCGIS Integration with Adobe flex Builder

we have values ZONE,STREET,PLOT,PIN and ARCGIS MAP Server on plot Layers 67 , 68 , 69. our Business logic as below.   1. Get Electricity or Water No from customer    2. Query Electricity or Water No from METER_MASTER and ZONE,STREET,PLOT,PIN details     1. Apply Spatial query on Feature Class: Urban Physical Development Plot based on ZONE,STREET,PLOT Values URL hqwgis04/ArcGIS/rest/services/WaterGIS/MapServer/68 Feature Class Field Names: ZONE_NO,STREET,PLOT If this query return polygon, this is the customer location plot   3. If spatial query on Urban Physical Development Plot in step No: 3 did not return polygon feature, then Apply Spatial query on Feature Class: Cadastre Plot based on PIN URL hqwgis04/ArcGIS/rest/services/WaterGIS/MapServer/67 Feature Class Field Name: PIN If this query return polygon, this is the customer location plot 5 If Spatial queries on Urban Physical Development Plot,Cadastre Plot in step No 3,4 did not return polygon feature,then Apply Spatial query on Feature Class: "History Plot" based on PIN URL hqwgis04/ArcGIS/rest/services/WaterGIS/MapServer/69 Feature Class Field Name: PIN If this query return polygon, this is the customer location plot   1. We can't locate customer location If no polygon feature return after applying spatial queries in step No: 3,4,5 The Issue: right now er have 4 URLs(Layers 67 , 68 , 69) for each of the above field and there is no relation between each of those The Question is how we can Run the Query to retreive from the 4 URLs or find a relationship between them while searching and show the location View in the MAP. Otherwise How I can Generate this 4 values to Table Database or Excel from ARCGIS MAP Server. Please advise . Thanks


Not Found proxy.cgi file

I have a problem with proxy.cgi. I read other posts but didn't find a solution. When I make my WFS request in console, the following error comes up: "POST http:// localhost:8081/cgi- bin/proxy.cgi?url=http%3A%2F%2Flocalhost%3A8080%2Fgeoserver%2Fwfs 404 (Not Found)", in other words the application don't find my proxy.cgi file. My settings are:   * OpenLayers.ProxyHost="/cgi-bin/proxy.cgi?url=" in OpenLayers.js;   * uncomment tag servlet and servlet-mapping in web.xml file of server Tomcat;   * add privileged="true" attribute to tag Context in context.xml of server Tomcat;   * change first row of proxy.cgi in #!C:/Python27/python.exe (installation path on Windows 7). Any idea how to resolve the problem? ![enter image description here](http://i.stack.imgur.com/5xpZV.jpg)


Calculate file path with field calculator

Doeos anyone have script out there to calculate the file path name with the field calculator....I am trying to add a field with the file path name so I can keep track of the original source directory of .shp's... Thanks!


Google maps on iOS - query string to achieve what I need

I would like Google maps to show indoor maps on iOS. I use Google API on Android, but accordingly to their site, Google maps SDK for iOS does not support indoor mapping. Thus, I think the closest thing I can come is showing URLs like this in embedded browser: > https://maps.google.com/maps?q= %string% &output=embed' I would like the query string to achieve the following:   * Multiple markers (I think one is max)   * Enable position location (so user can see himself as arrow/dot)   * Hybrid view


Has anyone used ArcGIS for 'automatically' detecting lineaments from a high-resolution (1m) DEM?

I have a set of DEM's produced from LIDAR data. I am wondering if anyone is familiar with or knew of any published research papers which looked at (semi-)automatically detecting lineaments /or fractures of the Earth surface. I would like to do this in ArcGIS 10.1. Or is there any way to write an application/code in ArcGIS for it?


Is there a way to select only a certain polygon for editing?

I have a spatialite data base with 4300 polygons contained within. I wish to be able to edit the polygons but once i have highlighted the Polygon from the attributes table i find it hard to edit the vertices as when i try to select the cross hairs (vertex) unless i am extremely careful i end up selecting another polygon? Is there a way of selecting the polygon i wish to edit from within the attributes table and making only that polygon editable? I know i could export it, edit it and then merge it back into the Spatialite database but this is additional steps that i would rather avoid if possible. Any help or suggestions would be much appreciated.


is there a public street database that I can do SQL queries on?

Sorry if this isn't strictly a GIS question. I want to know if there's a public database of US streets and US States that I can simply connect to (e.g. JDBC) and run SQL queries. For example, I want to find all the streets named "California" in the state of California. I've read about Gisgraphy and OpenStreetMaps and Geonames, but I don't see how to do the kind of query I'm talking about.


Are ellipsoids a mathematical necessity?

The literature usually just tells us that the Geoid is complex to describe mathematically and that we therefore fit different Ellipsoids to approximate it. Are these Ellipsoids mathematically necessary, or could we define projections from the Geoid model to plane coordinates too?


extract elevation values along a line using Google Elevation API

I note that there is the Google Elevation API. I see they have an example at the bottom showing an elevation profile for a line. Is there a premade service someone has put up on a website for me to submit a line and it will return elevation values at preset distances along the line? I have downloaded the SRTM data for the area I'm interested in and can do this using ArcGIS, but it would be good to compare it to what Google Elevation API has as well. I see someone has done this with Mathematica, but I have never used this program and don't understand how easy it would be for a beginner to produce what they have done on the blog. General comments about this are welcome.


Create polygon from OGREnvelope

I have a folder full of about 2000 files and I would like to generate a kind of key map for each file so people don't need to just randomly load each one in order to find what is what. I have the following python code using ogr but OGREnvelope isn't really a OGRGeometry so I can't add it to a shape file or export it as wkt to import in QGIS.               for filename in glob.glob(path + "*.shp"):        ds = ogr.Open(filename)        layer1 = ds.GetLayer(0)        #print filename + " : " + str(layer1.GetExtent())        extent = layer1.GetExtent()        # I need to be able to export the extent region as a polygon.      I have been looking around but just can't seem to find anything. I really thought something like this would be easy.


How I can create a raster and have the same overlay as another raster in QGIS 2.4?

I have made a graphical model in QGIS 2.4. I have to create a raster equation to rasterize a polygon shapefile. I want to rasterize my shapefile and I want to ensure that this new raster will perfectly overlay the position of another raster. I have used the tool "Rasterize" but it does not overlap my other image. In ArcGIS we have some parameters that allow to specify to snap the pixel raster to another but I can't find the equivalent in QGIS. Can somebody help me?


OpenStreetView or points from CSV but not both showing?

I'm using QGIS on Mac (most recent version) and am trying to map coordinates from a csv file. When I import the file normally without having any base map, the coordinates how up distributed like I want. When I put a base map like Google Street View and then add the coordinates, the coordinates don't show up anywhere. Instead, I get a dot in the middle of the map (off the coast of Africa). What's the reason for this? I was told to use Pseudo Mercator EPSG:3857 WGS 84. I've tried using different projections as well. Thank you for your help! EDIT: I am using longitude/latitude coordinates. For either OpenStreetView or Google Street View, the same issue is happening.


Data needed for wolf habitat/potential distribution in Pacific NW region

Hello fellow GIS’ers, I am assisting a nature writer with maps for a book he’s writing on wolves in the Pacific NW (Titled “Wolves in the Land of Salmon”). I’m writing therefore in the hopes that some of you may know where I can find spatial data on wolves. My hope is to map wolf subspecies ranges, source populations and regional dispersal corridors, regional historic and current wolf ranges, and projected regional population hubs. I know of a few habitat suitability studies that have been undertaken (i.e. Washington Fish&Game, Carrol et al) but so far have been unable to track down much useful GIS data. I apologize for any cross posting. Thanks in advance to any leads any of you may have!


Live updating in tilemill/tilestream

This seems like a simple question, but I'm having trouble finding out the answer. I'm building a map in tilemill and using data from a geojson file. I plan on hosting it later using tilestream. Once I do, will I be able to update the underlying data and have it be reflected in the map? Or will I need to reexport and deploy again?


PDF Output for Manifold 8

Does anyone have any recommendations for outputting a PDF of map from Manifold 8? The following printer drivers have all failed to output anything: CutePDF PDF995 eDoc Nitro PDF worked (after 3 hours), but produced a 30mb mess of a map. Primo PDF is still going, and has been processing for hours... My preference is for the output to remain as vectors to keep the quality of the map. Not fussed if it's a GeoPDF or straight PDF.


What is the status of any ongoing efforts that will allow QGIS to display .las files directly in the main 2D window?

After some research on QGIS's ability to display .las files, I came to the conclusion that it is not possible: currently any attempt at this requires converting .las to .shp as described here and here. I am wondering if there is an ongoing effort to make direct .las viewing possible in the main window of QGIS (not a separate 3D window), and more broadly, what the main challenge is from a development perspective? (I'm no expert programmer, so I am looking for a digested explanation if anyone can provide one.) Are there any similar efforts happening in other opensource GIS software that might be ahead of those of QGIS?


I want to Know that: Javascript or silverlight is better than another for webGIS? http://blogs.msdn.com/b/webapps/archive/2014/01/17/silverlight- support-roadmap.aspx


How to make a transparent background image using r.out.png?

Can the white background of the r.out.png of GRASS be changed to transparent?


How to Match Point Data in QGIS?

How do I match the same points (WGS84) in two different point layers? I want to get the points that lie exactly upon each other in the two datasets.


Looking for a .NET Dijkstra component using Shapefile

I'm totally new to stackexchange and i'm in this beautiful informative place for one problem. I'm a .net programmer and i need to write a program that reads a shapefile and performs routing operation. I'm looking for an open source solution. Is there any idea? Thanks in advance Best Regards


Rendering raster layer from DTED based on height color map

I have a raster layer that was create from DTED file (dt1 specifically), created by the following code:               var rasterLayer = new RasterLayer();     rasterLayer.CreateFromFilePath(dtedFilePath);      The dted file is treated like raster and is displayed as grayscale. From the other hand, I have a color map file (.clr) that maps specific colors to specific elevation values. The file is in the form               0 63 187 239     1 63 187 239     2 125 198 34     ...     2806 220 220 220      I would like, somehow, to have that coloring (the one in the clr file) used by some kind o renderer to render the aforementioned raster layer. Is there any way to do this? Thanx Edit: forgot to mention, we are talking about a windows form application written in C#, with a simple map control in the center. I'm using ArcGIS Engine 10


Is it possible to add custom SQL-based layers in GeoServer?

I would like to add a layer to GeoServer that builds its features from an SQL query executed against a PostGIS database (something like a PostGIS layer in QGIS, but customized with additional SQL query). Is it possible to have not a whole PostGIS geometries table, but some 'SELECT' from it to be published by GeoServer?


How to avoid sharp turns in PgRouting?

I need to generate routes that will be performed in long vehicles. The path can not have curves 90 degrees because the streets are narrow.


PostGIS uuid type not visible in QGIS or GeoServer

This is probably a simple question, but nothing comes to my mind right now. I have created a _view_ in PostGIS containing multiple columns, including one column of data type `uuid`. When I try to visualize the view as a layer in either _QGIS_ or _GeoServer_ the column of data type `uuid` is simply omitted while the rest of the columns looks fine. **Is the data type uuid not supported by neither QGIS or GeoServer or is it a simple mistake on my part?** Versions:   * QGIS: 1.7    * PostGIS: 1.5.2    * PostgreSQL: 9.0.1   * GeoServer: 2.0.2


OpenLayers and GeoExt are displaying my lines features as point features

I stored data (road network: line features) on OpenGeo Geoserver compilation and when I tried to display these in openlayers or GeoExt, they are shown as point features.


QGIS not Printing to PDF

Simple QGIS 1.8.0 not printing to PDF. Suddenly stopped. Is this an error or something. the resultant PDFs are blank pages. When i file print and use a pdf printer it creates blank docs. when i export to pdf it crashes. when i export to jpeg it does not print map.


Attaching files to features: File server vs SDE attachment

I have some files that I would like to attach to my sde features. Files are small in size ( <40 KB) and have 1:1 relation to features. I wonder which method is superior, specially in terms of performance? 1) to add a URL field to my features and store my files on the file server 2) To let arcsde do it for me on the database (attachment table) What are the advantages and disadvantages of storage of small files within the SDE geodatabase?


Split vector layer by field name

I have a vector layer of 108374 lines I want to split the vector layer into field names of the layer, which is 17. Now, I want to create a new vector layer containing one of the field names e.g. "OBJECTTYPE". From this field name I want to calculate the distance from a certain category to another vector layer. I have tried to use "split vector layer" in QGIS, but it gives an error: "TypeError: the sip.simplewrapper type cannot be instantiated or sub-classed". I'm using QGIS 1.8 Lisboa for Mac. Thanks in advance.


Access SQL database in postgres for routing

i am trying to access sql database in pgadminIII. Using postgres_fdw I am trying to connect. But I am struck in the middle..Following are the steps I followed               CREATE EXTENSION postgres_fdw;          CREATE SERVER ws253 FOREIGN DATA WRAPPER postgres_fdw OPTIONS (host '192.168.0.253', dbname 'allahabad', port '1433');          CREATE USER MAPPING FOR postgres SERVER ws253 OPTIONS (user 'sa', password 'track');          CREATE FOREIGN TABLE routing     (      gid serial NOT NULL,      name character varying(255),      district character varying(255),      state character varying(255),      the_geom geometry,      name_hindi character varying,      name_hindi_display character varying(255)     )     SERVER ws253;      What is the next step I have to do?


create polylines with different colors in leaflet

I have one function which creates poly line & adds that polyline to map               function makeRoute(e)     {         if(pointsSelection.length > 0)         {             pointsSelection.push(e.target.getLatLng());             var firstpolyline = new L.Polyline(pointsSelection, {             color: 'blue',             weight: 5,             smoothFactor: 1             });                  firstpolyline.addTo(map);                  pointsArrayCollection.push(pointsSelection);             polyArrayCollection.push(firstpolyline);                  selection = [];             pointsSelection = [];         }         else         {             alert("Please select more than one point");         }     }      my problem is that It adds line with same color every time. I want to add poly lines with different colors every time. So how can I change color of polyline dynamically.


get zoom levels from mapnik xml (MaxScaleDenominator and MinScaleDenominatcanor)

I exported styles from .mss in Tilemill to mapnik xml, and tried to parse it, but I don't have zoom leves as filter, just MaxScaleDenominator and MinScaleDenominatcanor. How can I convert this values to zoomlevel like in .mss file? Thanks in advance!


Is it possible publishing a Python Add-in in a web service?

I'm trying to make a multiuser web service for editing an ArcSDE geodatabase. I wanted to know if I can to add my python add-in in Arcgis Server? And if the answer is yes, how can I publish it?


order layer in QGIS with pyqgis

I´m new in pyqgis. I´m looking for a code to move one layer in TOC to a specific position. Is it possible? Thanks a lot!


ogr: what is the advantage of using `geom.Clone()` over `geom`?

What is the advantage of using `geom.Clone()` over `geom`? Simple example:               geom = link_feat.GetGeometryRef()     newfeature.SetGeometry(geom.Clone()) # or     newfeature.SetGeometry(geom)     layer.CreateFeature(newfeature)


ArcPy Clip Data Frame To Geometry

I have made an ArcPy add-in that assists a user by adding layers from a nominated fGDB to their map based on a nominated extent. I wish to add a button that changes the data frame properties to clip all the TOC layers to shape (the extent polygon). I can't find an ArcGIS Desktop function to do this. There is however a production mapping (PLTS Extension) function that might suit, but we don't wish to purchase a "solution" for a 9 click standard desktop process. **ArPyProduction Clip To Data-frame:** http://resources.arcgis.com/en/help/main/10.1/index.html#//010300000306000000 Any ideas?               class ButtonClass3(object):         """Implementation for Version1_Addin_addin.button_1 (Button)"""         def __init__(self):             self.enabled = True             self.checked = False         def onClick(self):         print "Limiting display of layers to your extent"                   mxd = arcpy.mapping.MapDocument('current')         df = mxd.activeDataFrame         global ExtentFC         ExtentFC = "C:\\Data\\ArcGIS\\SelectData.gdb\\ExtentFC"          global ExtentFCLayer         ExtentFCLayer ="Current_Extent"         global ExtentLyrPath         ExtentLyrPath = "C:\\Data\\ArcGIS\\ExtentLayerFile.lyr"                   ### Carto         arcpy.MakeFeatureLayer_management(ExtentFC, ExtentFCLayer"", "", "")         FeatureClassLayerMapping = arcpy.mapping.Layer(ExtentFCLayer)         ExtentLyr = arcpy.mapping.Layer(ExtentLyrPath)         arcpy.mapping.UpdateLayer(df, FeatureClassLayerMapping, ExtentLyr, True)                   ### Select Extent & Zoom         arcpy.SelectLayerByAttribute_management(ExtentFCLayer,"NEW_SELECTION","\"OBJECTID\" >0 ")         df.zoomToSelectedFeatures()         arcpy.RefreshActiveView()                   ### arcpyproduction EXAMPLE A:         arcpyproduction.mapping.ClipDataFrameToGeometry (data_frame, clip_geometry, {exclusion_layers})              ### arcpyproduction EXAMPLE B:         arcpyproduction.mapping.ClipDataFrameToGeometry (df, ExtentFCLayer, [0])                   del ExtentFC, ExtentFCLayer, ExtentLyr


How do I add a column in an attribute table using QGIS graphical modeler?

I have started to make a model in QGIS 2.2 graphical modeler. I have made a buffer around a polyline and used it to clip a polygon layer. So far i t works. But the next step is to add a new column to the clipped polygon layer, and get that column to include rownumber? I have done this outside of the model before, but I don't understand how to make it work inside the model? I tried using the algorithm 'Field calculator' but it doesn't work. How do I use the field calculator inside a model? EDIT: Is there any other way of adding a column with rownumbers to the attribute table inside the model? I got the tip to use the 'Advanced Python field calculator' in an answer below, but I don't understand how to use it. ![screenshot python field calculator](http://i.stack.imgur.com/6jH1F.jpg)


How to get feature for a given bbox from shapefile by ogr

I have some features point,line,polygon with shapefile format, now I want to get features for a given boundbox, is it possible to remove the features out of the bbox? And for a polygon, I think it is necessary to close it. I wonder if this is possible?


**What datum (reference ellipsoid) does Nasa Worldwind use?** I can't seem to find where Nasa Worldwind tells explicitly what datum they use. I need some sort of valid link.


Openlayers - Calculate distance between two points

I don't understand why I have two different results between Openlayers distanceTo () and Movable Type Scripts LatLng : **(43, 3)**   LatLng : **(42, 4)**   OL : **187.6**   Movable Type Scripts : **138.1** Any help appreciated.               var Geographic  = new OpenLayers.Projection("EPSG:4326");      var Mercator = new OpenLayers.Projection("EPSG:900913");     var point1 = new OpenLayers.Geometry.Point(3, 43).transform(Geographic, Mercator);     var point2 = new OpenLayers.Geometry.Point(4, 42).transform(Geographic, Mercator);            console.log(point1.distanceTo(point2)/1000);


Get a Shapefile Geometry Type

I am making a python code for Arcgis9.3. In this code I have an input feature and I create a Output feature. I want that the output feature is the same geometry type as the input feature. At the moment my code to create the output feature is :               gp.CreateFeatureclass("C:/Users/Desktop/Test/", NameOutFC, "POLYLINE")      But I would like to get the input feature geometry type and use it to create my output feature :               gp.CreateFeatureclass("C:/Users/Desktop/Test/", NameOutFC, GeometryLikeInput)      I found the code with ArcPy :               desc = arcpy.Describe('C:/shapefile.shp')     geometryType = desc.shapeType          if geometryType == 'polygon':     print 'Polygon'     elif geometryType == 'point'      But I can't use it with arcgis9.3. Thanks for your help


Problem with QGIS 2.2 joins between shp and csv

Didn't see question like this asked, so... I've joined csv to shp file and everythings seems ok. I've modified attribute form so that fields from joined csv appears in there. So far so good- it's there. Bet when I reopen the project and identify some feature, insted of joined fields there's "Error:Field does not exist in datasource" even though I see it when opening attribute table. If I open Layers properties and then press ok- attributes are back in my form. Is there any way to avoid this annoyance? Valdis


How to change the style of a point when clicked?

Sorry for this common question. I do succeed in changing the style of a polygon when clicked, like in this example. But I don't succeed with points, with the same code.               select = new OpenLayers.Layer.Vector("Selection", {styleMap:                  new OpenLayers.Style(OpenLayers.Feature.Vector.style["select"])     });      When I click on an area, an http request is send to geoserver and returns an xml with the caracterics of each points. But it does not display it. An idea ? Thks!


ArcPy method to determine ArcMap document version

Is there a way with **ArcPy** to identify the version of a Map Document (MXD). I am working on a solution to inventory our MXD's and would like to know if a document is 8.1, 9.2, 10.0, etc. I am currently using ArcGIS 10.0, but if there is an update in 10.1 that does not exist in 10.0, I would appreciate hearing that, too. I see there is a previous question of How can you find ArcGIS version programatically?, but it references all ArcObjects solutions (which I suppose I could call from python, but I would prefer not to).


Arcobjects .Net, suppress geoprocessing messages

I am executing the copy features tool via the geoprocessor inside my .net custom geoprocessing function tool. When the copy features tool executes it is writing it's messages to my tool's results. I want to stop these messages from being written and handle them myself. Is there a way to stop a geoprocessor from writing messages? I am writing .net on 10.1. This is the code I am running the tool with.                           IGeoProcessor2 gp = new GeoProcessorClass();                 IGeoProcessorResult results = new GeoProcessorResultClass();                 IVariantArray parameters = new VarArrayClass();                 parameters.Add(tempFC);                 parameters.Add(outFC);                 results = gp.Execute("CopyFeatures_Management", parameters, null);


How can I enable panning using Openlayers and a vector overlay with controls?

I am creating a map using the following code:               map = new OpenLayers.Map({         div: "map"     });      Then I load in a geojson polygon layer and add two controls               var highlightCtrl = new OpenLayers.Control.SelectFeature(geojson_layer, {         hover: true,         highlightOnly: true,                renderIntent: "temporary",         eventListeners: {                     beforefeaturehighlighted: unreport,                     featurehighlighted: report,                     featureunhighlighted: unreport                 }     });           selectCtrl = new OpenLayers.Control.SelectFeature(geojson_layer,         {clickout: true ,           renderIntent: "select",          onSelect: selected,           onUnselect: function(e){console.log('unselected)}     });              map.addControl(highlightCtrl);     map.addControl(selectCtrl);              highlightCtrl.activate();     selectCtrl.activate();        This layer covers the entire map div, and now I can no longer pan the map. Is there a way that I can enable panning when I have a layer with controls that cover the basemap?


How can I merge segments to one segment in QGIS (picture inside) and than get the center of each road?

I want to run a process that will make a table with lots of roads into distinct table of roads and than calculate the center of each road. How can I auto merge segments with same name to one long segment ? Attached example of 1 road built from 3 different segments , I want to make it one road and have it center point. (so I can zoom on it from OpenLayers) ![enter image description here](http://i.stack.imgur.com/7l2iZ.png)


How to manually break statement execution in python console of ArcMap

How does one break the execution of a long-running process in the python console of ArcMap? For example, how do you break a long iteration like the one below once it is started?               for i in range(1, 50):       # some long process which takes over a minute to complete      I want to stop the process at any time I want by pressing a keyboard combination, clicking a button or something similar **while the code I have input in the console window is running**.


Is the quadrilateralized spherical cube map projection the same as Snyder's cubic equal area map projection?

Is the quadrilateralized spherical cube map projection [1] the same as Snyder's cubic equal area map projection [2]? I know both are equal area polyhedral map projections ( http://www.progonos.com/furuti/MapProj/Dither/ProjPoly/projPoly.html ) based on the cube, but i can't access either publication to answer the question myself. Thanks. * * * [1] E. M. O’Neill and R. E. Laubscher, Extended studies of the quadrilateralized spherical cube earth data base, Tech. Report 3-76, Computer Sciences Corp Silver Spring Md System Sciences Div, 1976. [2] Snyder, J.P. 1992. An equal-area map projection for polyhedral globes. Cartographica 29(1): 10-21.


Can I export a polygon shapefile to a Garmin device?

I want to export the boundaries of a parcel to my GarminMap 60CSx. I downloaded a parcel map from the county, and I want to use it to walk the perimeter. Does the .gpx format support polygons? Or is there some other way? I'm on Mac, using QGIS 1.7.4.


Tilemill Styling Multiple feature Overlap some data

Please see the following Image. ![enter image description here](http://i.stack.imgur.com/nIkaG.png) I am using a single feature layer for road. Now I using the following code                   #roads {       [ROAD_TYPE = 1] {line-width:8; line-color:#194536;}       [ROAD_TYPE = 2] {line-width:8; line-color:#456321;}       [ROAD_TYPE = 3] {line-width:8; line-color:#785632;}       [ROAD_TYPE = 4] {line-width:8; line-color:#236485;}       [ROAD_TYPE = 5] {line-width:8; line-color:#FFFFFF;}       [ROAD_TYPE = 6] {line-width:8; line-color:#194536;}       line-join: round;       line-cap: round;       line-smooth: 0.1;       }      The problem is in the Black circles the white goes under the green road layer. But in the red circle the white layer overlap the green and other major layers. How can I solve it and make it a very nice style as Google or OSM map?


How to install SDA4PP plugin for Kriging in QGIS?

I am trying to do kriging in QGIS. I have loaded the SDA4PP plug in. Almost all of the items in the SDA4PP dropdown menu are not highlighted and are unresponsive when clicked on - including the kriging option. Any ideas? - I am very new to GIS. thanks...


Python, GDAL and building raster attribute tables

I have an integer raster for which I would like to build a raster attribute table using Python and GDAL. I can create a GDAL raster attribute table in Python as follows:               >>> rat = gdal.RasterAttributeTable()      This works fine, as we can see:               >>> rat     <osgeo.gdal.RasterAttributeTable; proxy of <Swig Object of type 'GDALRasterAttributeTableShadow *' at 0x0000000002A53D50> >      The table thus created has no rows or columns:               >>> rat.GetRowCount()     0     >>> rat.GetColumnCount()     0      I create a column called "Value" to store the unique values in the raster:               >>> rat.CreateColumn("Value", gdalconst.GFT_Integer, gdalconst.GFU_MinMax)     0      This is fine, and the column count is updated:               >>> rat.GetColumnCount()     1      Now I have to add values (records) to the column for it to be of any use. I can get a list of unique values from the raster's band like so:               >>> data = band.ReadAsArray(0, 0, dataset.RasterXSize, dataset.RasterYSize)     >>> vals = list(numpy.unique(data))     >>> vals     [3, 7, 8, 10, 11, 12, 13, 14, 17, 18, 20, 22, 23, 25, 27, 28, 41, 45, 52, 56]      What I would like to do is create a for loop to loop through `vals` and populate the column in the attribute table. I thought I could do something like this:               >>> for i in range(len(vals)):             rat.SetValueAsInt(i, 0, vals[i])      ...where `i` is the row (record), `0` is the field index and `vals[i]` is the integer value I want to insert. But it causes an error:               Traceback (most recent call last):       File "<pyshell#32>", line 2, in <module>         rat.SetValueAsInt(i, 0, vals[i])       File "C:\Python27\lib\site-packages\osgeo\gdal.py", line 1139, in SetValueAsInt         return _gdal.RasterAttributeTable_SetValueAsInt(self, *args)     TypeError: in method 'RasterAttributeTable_SetValueAsInt', argument 4 of type 'int'      The error is caused because I use `vals[i]` in the call to `SetValueAsInt()` rather than using an integer directly. For example, `rat.SetValueAsInt(0, 0, 0)` works fine, but is useless for populating the column if I just want to loop over the list of unique values. Is this a known issue? Google has so far not been very useful. What can I do to get around this problem?


Appending in Modelbuilder to a derived dataset

I have a simple model with a file gdb model parameter `InputGDB`, which contains a feature class `fc1`. Inside the model is a preset output folder and a template (empty) file gdb `TemplateGDB`, which contains a feature dataset `template_fds` and a feature class `template_fc`. A copy of `TemplateGDB` is made in the output folder and takes its name from `InputGDB` (using inline variables). I would like to Append `fc1` into `template_fc` with the schema set to `NO_TEST`. However, since the target dataset `template_fc` does not exist yet because the model hasn't run, the Append tool will obviously not validate. Is there a way for me to run the model without having to first run the first section, then validating to run the Append process?


Creating a new feature class with python and then adding attibutes

I am having trouble adding rows to a shapefile after it has been created. I'm not sure if I need to create the shapefile in memory and add the data or creating then re-open the file. While I've attempted to re-open the file, it will exit code 1 that file doesn't yet exist. Any and all suggestion would be useful. (except setting it on fire). I'm getting a "AttributeError: Row: Error in parsing arguments for SetValue" .... Please help.               for row in arcpy.da.SearchCursor(featureClass, ['FID','SHAPE@JSON','STREAM_ID','REACH_ID','SR_ID','STATION','INTERP','XS_ID','WSP001','WSP002','WSP003','WSP004','WSP005','WSP006','WSP007']):     featureClassData.append([row[0],row[1],row[2],row[3],row[4],row[5],row[6],row[7],row[8],row[9],row[10],row[11],row[12],row[13],row[14]])          outPutPath = "C:\\projectTemp\\FloodAnalysis\\output"     for i in range(0, len(featureClassData) -1):     FirstRowData = featureClassData[i]     SecondRowData = featureClassData[i+1]     FirstRowData[1] = eval(FirstRowData[1])          for cord in FirstRowData[1]['paths']:         for c in cord:             point = arcpy.Point(c[0],c[1])         dataSetCreate = arcpy.CreateFeatureclass_management(outPutPath, 'test_section_' + `i` ,"", featureClass)         dataSet = arcpy.InsertCursor(dataSetCreate)         row1 = dataSet.newRow()         row1.Shape = arcpy.geometries.Polyline(array1,spatialRef)         row1.setValue(FirstRowData[2], FirstRowData[3], FirstRowData[4],                       FirstRowData[5], FirstRowData[6], FirstRowData[7],                       float(FirstRowData[8]), float(FirstRowData[9]), float(FirstRowData[10]),                       float(FirstRowData[11]), float(FirstRowData[12]),                       float(FirstRowData[13]), float(FirstRowData[14]))         dataSet.insertRow(row1)


How to map districts without showing features in other districts?

We want to have a map of each individual district, with the shops on it, so that the person responsible for each district can have a map of their territory. The reason I want to merge them is so that I don't end up with a map of one district with lots of dots around it from other shops all over the state. I'm using QGIS 1.7.0. I have a shapefile that splits my state into districts, and a geoJSON that has a list of shop locations. I want to make a file of each district, with a dot at each shop. Is it possible to have QGIS put both pieces of information into one file (I haven't had any luck with merge shapefiles). After that, it would be wonderful if I could get it to split each section into it's own file, with the dots that it contains. If there is not a way to get it to do that automatically, would the most efficient thing to do be putting a mask layer over the map and just cutting out a hole for each district, one at a time? I'm mostly self-taught with QGIS, so I don't necessarily know some of the non- basic stuff. But I'd appreciate any help y'all could give me.


Passing attributes to neighbouring polygons

I have an ecosystem polygon layer that has been updated using a more recent tree cover layer (to remove cleared areas and also to re-align veg boundaries where growth has occured). Where the polygons have been 'grown out', not all values have been passed along to the new, neighbouring polygon (only the actual RE value itself). In other words, the existing polygon is in the data, with an adjoining polygon to represent the new area, which should be treated as the same RE unit). What would be the best approach to re-attribute these polygons?


Using of Document Properties>Hyperlink Base to prevent broken links when moving MXDs?

I am going to try this later this week (when I am back in office) but I thought I ask this here first. Can anyone advise if Using Hyperklink Base can indeed help prevent broken links (not hyperlinks) when moving of mxds to another location? I believed mxds are set to be on relative link type, and not full path. I seen someone claiming so but i thought Hyperlink Base is strictly for relative hyperlinks, especially when someone moves the MXD two levels above and hyperlinks will still work. Am I right to say that? ![enter image description here](http://i.stack.imgur.com/sk4og.jpg) So in this example, I key in Project Folder into "Hyperlink Base" box and I have a ABC.mxd sitting in DATED_1>_MXD with files sitting in various folders under DATED_1. I will copy ABC.mxd and paste it into DATED_2>_MXD. When I open DATED_2>_MXD>ABC.mxd, there will be broken link (but I will need to repair the links). Once done, I can copy and paste mxd to DATED_1 or _2 or _3 or_4 , and I will not have broken links, with data pointed to various folders under DATED_1. If I attempt to put this mxd anywhere else in any SHP / GEOREF / FGDB folder, all the links in mxd will be broken. My knowledge of relative links is that they are paths of files with location of mxd as base. Hence, any folders / structure "above" mxd does not matter. and my guess for the "Hyperlink Base" method is that the base is set when I key "Project Folder" into the box(?). And that mxds placed into any folders two levels below will not have broken links. So I can place my mxd in DATED_3>_MXD>ABC.mxd and it will be fine, since it is too two levels below. I might have got above example wrong but anyone who can advise me on this, pls enlighten me. Many thanks in advance. FYI, I am using 9.3.1 on Win7 x64. Also, can anyone advise how should I accept answers to questions that i posed out previously? I just couldn't find the buttons to do that.


How can I connect to a PostGIS database from ArcCatalog 9.3 via ArcSDE?

I have a problem connecting to my postgis database via ArcSDE in Arc Catalog. When i want to establish connection to my database i get an error: ![alt text](http://i.imgur.com/v6tQO.jpg)


Restrict panning in a map using CartoDB

I want to restrict the ability for someone to pan away from the extent the map has when it's loaded. I have a map of New Zealand to be viewed at a national and regional level but worried people will get lost if they pan out to sea as it is the only geography loaded. Ideally someone can pan around regions but not too far from New Zealand.


Cutting Polyline at the beginning and end by some unit

The problem is: I have got a IGeometry (polyline dimension) - let call it A. Given a ray and a center point (disk B, polygon dimension ) I would like to result in a IGeometry that does not have the disk B (filled one), (set definition A/B, polyline dimension). How to apply ITopologicalOperator to get VALID difference operation. I am interested in code.


extract edge of a line of a vector layer in a new point layer

I'm using python to build a plug-in in Qgis. I need to extract the edges of each line feature of a vector layer to create a new point layer of all edges. Someone can help me? My data input is a vector line shapefile that represent the roads of a city. Thanks, Raffaele


How to split a polyline into points at certain intervals?

I am trying to split a polyline into points with 2m intervals in ArcGIS but I don't have the necessary license. Is there a way that I can do this in QGIS? Context: I have drawn a hypothetical lake surface based upon a contour line and need to divide it. cheers


How to display OSM relations in Openlayers with tags as legend?

I would like to show this type of relations in a simple map with Openlayers. http://www.openstreetmap.org/api/0.6/relation/1637735/full I'm specially interested in being able to show tags as legend. Do you know how can I do it in the simplest way possible? I'm not sure if Openlayers has already a package to display relations.


Problem in long expression in field calculator

I am trying to compute the following expression with Field calculator. The input table values are around the size of this value: 562643580,7843, and the field name (the field of destination) is: double, precision=20, scale=20: `([Sum_Pri_17]*0.0669)+(([Sum_Pri_18]-[Sum_Pri_17])*0.0551)+(([Sum_Pri_19]-[Sum_Pri_18])*0.0306)` The destination field should therefore not be too short. When doing the calculation, no result is computed and no error appears either. I thought the expression was too long, so I tried to compute the following: `[Sum_Pri_17]*0.0669` The calculation's result was the same: no result is computed and no error appears either. What am I doing wrong? Thank you for your help!


How to set up QGIS Server on Win7?

I want to share QGIS files and maps which are made by me, to some of my friends trough a server. Then I want to know   1. how to establish a server and network to upload QGIS maps and files; My system is **Windows 7** , How to install or setting up server,   2. how to upload maps and QGIS files I refer your QGIS server instructions, but I couldn't get any favorable result. I want simply understandable instructions. Best Regards


How to install multiple versions of postgres in same os windows 7 64-bit?

I have already installed PostGIS along with opengeosuite and it is the latest version. Now I want to run pgrouting but the latest stable version does not compatible to the latest postgres versions. Can I downgrade the postgres from 9.2 to 8.3. I cant try some unstable versions of pgrouting that are compatible with postgres 9.1/9.2 because, there are issues in shooting star algorithm...or can I install another version parallel to this. I tried unistalling opengeosuite completely and installed only postgres 8.3 and postgis 1.4 but there are more and more errors I am getting and I am afraid to solve those as its for my mini project and I have only 3 days to prepare documentation.. So someone please help! I am trying but I am confused with these kind of installations.


How to use gdal_contour in QGIS Python console?

Is there a way to use the gdal_contour utility with-in the python console of qgis ? Thank you


geography, geometry, distance, and wkt - PostGIS

I'm trying to understand the data conversions that happen in PostGIS when calculating distances in SRID 4326. Why is it that when I run on my marin_jobs points table:               select cast (the_geom as geography), the_geom from      marin_jobs where blockid10 = '060411141001010' limit 1;      I get               the_geom      the_geom     geography     geometry     010100....    010100....      And the wkt output values are exactly the same? I came to this question because when I run a distance query (see below for code) on two points in my dataset, if I don't use `cast () as geography` I get out degrees, just like the Boundless Geography tutorial said I would. http://workshops.boundlessgeo.com/postgis-intro/geography.html But I don't understand how if the inputs are (seem to be anyway) exactly the same, the outputs are different. Or should I ask...are the outputs really different? Does that mean that the value of `0.0616262566763201` degrees and `6007.875564598` meters are the same, but just in different units? But this doesn't jive with what the Boundless Tutorial says, "On a sphere, the size of one “degree square” is quite variable, becoming smaller as you move away from the equator. Think of the meridians (vertical lines) on the globe getting closer to each other as you go towards the poles. So, a distance of 121 degrees doesn’t mean anything. It is a nonsense number." Any plain English claficiation would be _really_ helpful. This is keeping me up at night. Distance Queries:               select st_distance (                    (select the_geom from marin_jobs where blockid10 = '060411141001010' limit 1),                    (select the_geom from marin_jobs where blockid10 = '060411070005007' limit 1)                    );      output: 0.0616262566763201               select st_distance (                     (select cast (the_geom as geography) from marin_jobs where blockid10 = '060411141001010' limit 1),                     (select cast (the_geom as geography) from marin_jobs where blockid10 = '060411070005007' limit 1)                    );      output: 6007.875564598


using REST "delete features" in arcgis api for javascript

I am developping a web application that uses a feature service, what i want to do is save the data in the feature server, and then delete all the features at the start of the application. I am able to save data in the feature service, my problem is how to delete the features in the start of the application. I found a solution to that suggesting that I use the operation: "Delete Features" of the REST API, but I think I am making a mistake in the syntax, here is my code sample:               var theurl= "***/arcgis/rest/services/edt/FeatureServer/0/deleteFeatures"     var request = esri.request({          url: theurl,     // Service parameters if required, sent with URL as key/value pairs     content: {     f: "json",     where: "1=1"}      }); I don't know what I am missing can you please help


How do I programatically edit the layer 'Display Expression'

I'm wondering if someone has or knows where a tool is to edit the 'Display Expression' of a Layer, or more specifically, a TableView, in ArcGIS Desktop. I know that it can't be accessed with Python, but it should be editable with ArcObjects. But this isn't something I know how to do yet. I'm using a Python Add-in to add a Layer into ArcMAP which has a relate with a couple TableViews that I add at the same time. The trouble is that it always resets the field that is displayed in the identify window to something unhelpful. Thanks for any suggestions.


Unregistering OpenLayers events?

map.events.register('click', map, fucntion(e){alert('on')} );          map.events.unregister('click', map, fucntion(e){alert('off')} );       Looks easy enough but un-registering just won't trigger. I try nesting unregistering inside register function call back but still nothing. Here is how I created my map..                   var bounds = new OpenLayers.Bounds(                  146501.328125, 2420230.75,                  352670.46875, 2801126.25          );          var options = {                  controls: [],                  maxExtent: bounds,                  maxResolution: 1487.873046875,                  projection: "EPSG:3826",                  unit: 'm'          };          format = "image/png";          map = new OpenLayers.Map( 'MapPage_map-canvas2', options );               //SETUP MAP EVENT          event = map.events.register('move', map, function (evt) {                  document.getElementById('map-url').innerHTML = map.getCenter();          });               var county = new OpenLayers.Layer.WMS(                  "AllenProject:county",                  "http://localhost:8080/......./wms",                  {                          LAYERS: 'AllenProject:county',                          STYLES: 'AllenProject_BlackBorder_GreyBackground',                          format: format,                          tiled: true,                          transparent: true,                          //tilesOrigin : map.maxExtent.left + ',' + map.maxExtent.bottom                  },                  {                          buffer: 0,                          //displayOutsideMaxExtent: true,                          transitionEffect: null, //'resize',                          isBaseLayer: true                  }          );          map.addLayer(county);               map.events.register('click', map, function (evt) {                  alert('on');             });               map.events.unregister('click', map, function (evt) {                  alert('off');          });       I don't understand this.


QGIS API changes from 2.0 to 2.2

I have the same program running on two different machine, one with Qgis 2.0 and the other Qgis 2.2. The machine running 2.2 doesn't seem to render the map canvas. I thought it was how I has creating the layers but sorted all that out. As a test I have set the canvas colour to red, it still comes up white on the 2.2 version. The start of the code is as follows               class trackerMain(QtGui.QMainWindow, Ui_trackerMain):         def __init__(self):             QtGui.QMainWindow.__init__(self)             self.setupUi(self)                  # set the canvas to white and fix the panning             self.mapCanvas.setCanvasColor(QtCore.Qt.red)             self.toolPan = QgsMapToolPan(self.mapCanvas)             self.mapCanvas.setMapTool(self.toolPan)             self.mapCanvas.mapRenderer().setDestinationCrs(QgsCoordinateReferenceSystem(4326))             self.mapCanvas.mapRenderer().setMapUnits(QGis.DecimalDegrees)             self.mapCanvas.mapRenderer().setProjectionsEnabled(True)             # Custom map tools             self.auvGotoTool = AuvGotoTool(self.mapCanvas)      Is there some additional step needed in the 2.2 that I am not doing as nothing on the canvas will render. I also have a custom map tool that works, it gtes the correct coordinate. When I load my layers and set the canvas extent to that of the layer it also works so it is just a render problem? TIA Christian


What are the differences between 81989 and 27700 CRS for the British National Grid?

We are using applying Oracle Spatial to run point in polygon queries in Great Britain using Ordnance Survey MasterMap and point data. MasterMap is on British National Grid (BNG) and has the Coordinate Reference System (CRS) 27700 while our point data has the Oracle Spatial 'BNG version' 81989. Will it matter that we are using different systems? Thanks for your time.


Combining Feature Selection and Marker Clustering

I am using the basic structure for layer toggling found in this CartoDB tutorial, with buttons wired to a ul navigation menu. In the meantime, I was happy to implement the Marker Cluster Leaflet plugin as instructed here. However, now the navigation won't work. Here is the js I have been trying:               var baseLayer = L.tileLayer('http://{s}.tile.stamen.com/toner/{z}/{x}/{y}.jpg', {     attribution: 'Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA.'     });     var markers = L.markerClusterGroup();     $.getJSON("http://username.cartodb.com/api/v2/sql?format=GeoJSON&q=SELECT * FROM table_name", function(data) {     var geojson = L.geoJson(data, {       onEachFeature: function (feature, layer) {         layer.bindPopup("
" + feature.properties.label + "

Address: " + feature.properties.address +  "

" + feature.properties.href);       }     });     markers.addLayer(geojson);          var map = L.map('map', {maxZoom: 18, center: [20, 40],     zoom: 2     });          baseLayer.addTo(map);     markers.addTo(map);     sublayers.addTo(map);          });          var sublayers = [];          cartodb.createLayer(map, layerUrl)     .addTo(map)     .on('done', function(layer) {     var subLayerOptions = {     sql: "SELECT * FROM table_name"     };          var sublayer = layer.getSubLayer(0);          sublayer.set(subLayerOptions);          sublayers.push(sublayer);     }).on('error', function() {     //log the error     });          $('.button').click(function() {     $('.button').removeClass('selected');     $(this).addClass('selected');     LayerActions[$(this).attr('id')]();     });               var LayerActions = {     group1: function(){     sublayers[0].setSQL("SELECT * FROM table_name WHERE group = 'Group 1'");     return true;     },     group1: function(){     sublayers[0].setSQL("SELECT * FROM table_name WHERE group = 'Group 1'");     return true;     },     category1: function(){     sublayers[0].setSQL("SELECT * FROM table_name WHERE category = 'Category 1'");     return true;     },          ...          }     };      Any insight into how to merge button toggling and marker clustering would be helpful. With thanks. UPDATE: I have a work-around, adding separate marker cluster groups for each 'Group 1', 'Group 2', ...                 var markers1 = L.markerClusterGroup();          $.getJSON("http://username.cartodb.com/api/v2/sql?format=GeoJSON&q=SELECT * FROM example_table WHERE group='Group 1'", function(data) {     var geojson = L.geoJson(data, {       onEachFeature: function (feature, layer) {         // ADD A POPUP WITH SOME INFO         layer.bindPopup("
" + feature.properties.label + "

Address: " + feature.properties.address );       }     });     markers1.addLayer(geojson);     });               var markers2 = L.markerClusterGroup();          $.getJSON("http://username.cartodb.com/api/v2/sql?format=GeoJSON&q=SELECT * FROM example_table WHERE group='Group 2'", function(data) {     var geojson = L.geoJson(data, {       onEachFeature: function (feature, layer) {         // ADD A POPUP WITH SOME INFO         layer.bindPopup("
" + feature.properties.label + "

Address: " + feature.properties.address );       }     });     markers2.addLayer(geojson);     // CONSTRUCT THE MAP     var map = L.map('map', {maxZoom: 18, center: [20, 40],     zoom: 2     });          baseLayer.addTo(map);     markers1.addTo(map);     markers2.addTo(map);     sublayers.addTo(map);          });      It's not a perfect solution—it basically separates the clusters so that you end up with overlapping cluster-dots. I'll probably need to use the leaflet layer selector instead of my current navigation menu for this project, like the DOC huts example provided on the thematicmapping site by Bjørn Sandvik. UPDATE: I am finding this answer helpful UPDATE: I have switched to the CartoDB clustering method and have added both the clustered layer (lyr0) and non-clustered layer (lyr1) to my map. Now I just want to turn on lyr1 only at a specific zoom level. I am currently unable to get zoom-based show/hide to work. Maybe someone will see the errors in the following ways:                     function main() {              // create leaflet map         map = L.map('map', {            zoomControl: true,           center: [40.79, -111.9],           zoom: 6         });              // add a base layer         L.tileLayer('http://tile.stamen.com/toner/{z}/{x}/{y}.png', {           attribution: 'Stamen'         }).addTo(map);              var gridsize = 48;         var baseSql = $('#sql_template').html().format(gridsize);         var cartoCss = $('#cartocss_template').html().format(gridsize);         var lyr0;         $("#cluster_size").on('change',function(){           $('.size').html($("#cluster_size").val());         });         $("#cluster_size").on('mouseup',function(){         lyr0.setSQL($('#sql_template').html().format($("#cluster_size").val()));         lyr0.setCartoCSS($('#cartocss_template').html().format($("#cluster_size").val()));         });         // add cartodb layer with one sublayer         cartodb.createLayer(map, {           user_name: 'username',           type: 'cartodb',           sublayers: [{              sql: baseSql,              cartocss: cartoCss,              interactivity: 'cartodb_id'           }]         })         .addTo(map)         .done(function(layer) {           sublayer = layer.getSubLayer(0);           sublayer.setInteraction(true);           addCursorInteraction(sublayer);         });              var lyr1 = [];         cartodb.createLayer(map, layerUrl)         .addTo(map)         .on('done', function(layer) {         // change the query for the first layer        if (zoom <= 10) {          layer.hide(lyr1);         } else if (zoom >= 10) {           layer.show(lyr1);         } else {           layer.show(lyr0);         }     var subLayerOptions = {     sql: "SELECT * FROM table_name"          };               lyr1.set(subLayerOptions);          lyr1.push(lyr1);     }).on('error', function() {     //log the error     });          $('.button').click(function() {     $('.button').removeClass('selected');     $(this).addClass('selected');     LayerActions[$(this).attr('id')]();     });               var LayerActions = {     group1: function(){     lyr0.hide();     lyr1.getlyr0[0].setSQL("SELECT * FROM table_name WHERE group = 'Group 1'");     return true;     },     category1: function(){     lyr0.hide();     lyr1.getlyr0[0].setSQL("SELECT * FROM table_name WHERE category = 'Category 1'");     return true;     },     ...      UPDATE: I've decided to return again to the Leaflet markerCluster option because I couldn't get the fitBounds option to work on the sublayers in CartoDB, alas. I have been adding a marker cluster layer for every item in the layers control menu. Is there a way to slim down the code for adding multiple cluster layers from geoJSON? Here's what I have:               var group1 = new L.markerClusterGroup();         $.getJSON("http://userid.cartodb.com/api/v2/sql?format=GeoJSON&q=SELECT * FROM table_name WHERE table_name.group='Group 1'", function(data) {         var geojson = L.geoJson(data, {           onEachFeature: function (feature, layer) {             // ADD A POPUP WITH SOME INFO             layer.bindPopup("
" + feature.properties.label + "

Address: " + feature.properties.address +  "

" + feature.properties.href);           }         });         group1.addLayer(geojson);       });          var category1 = new L.markerClusterGroup();     $.getJSON("http://userid.cartodb.com/api/v2/sql?format=GeoJSON&q=SELECT * FROM table_name WHERE table_name.category='Category 1'", function(data) {         var geojson = L.geoJson(data, {           onEachFeature: function (feature, layer) {             // ADD A POPUP WITH SOME INFO             layer.bindPopup("
" + feature.properties.label + "

Address: " + feature.properties.address +  "

" + feature.properties.href);           }         });         category1.addLayer(geojson);       });       ...


How to create a centerline from polygon in Arcgis 10

In Network Analyst, I want to create a center line from a road polygon layer of an area for shortest path creation. How do I do this in ArcGIS 10?


Disk space and numbers of tiles for world layer

I'm thinking about testing tiles generation of a world layer for webmapping. In this context, I want to know how I can calculate the number of tiles (256x256 for tilecache if I remember) I will need for n levels in WGS84 coordinates. Maybe I will use a composite solution with pregenerated tiles and on the fly generation but I have to know at the end the available disk space if every tiles are generated and the number of files it will represent. There are two goals, time it will take and disk space needed. Any informations are welcome **Edit:** I've found this script to calculate the number of tiles to generate depending on zoom levels and your data extent. See this gist https://gist.github.com/1675606


Combining MapInfo records with a duplicate value

I have a MapInfo table with a lot of points in it. The points are clustered together - they represent the first part of a post code, so they're in a similar position but not identical. What I would like to do is combine the duplicate rows and attach a single point to each row that represents the rough centre of the other points. In fact, making the centroid for a record is easy, so my real question is how do you combine rows that have a duplicate field? There are about 1.5 million rows so doing anything by hand is a no-no! Thanks in advance!


How do I programmatically create non-feature-linked, simple line callout annotation and set the anchor point?

Vitals: ArcGIS-ArcView 10.0, Python 2.6.5, PythonWin, comtypes I'll start with my main questions: **How, using ArcObjects, do I go about creating non-feature-linked geodatabase annotation features that have a simple line callout format, and how do I set the anchor point so that the leader line remains functional, i.e. remains anchored on the point feature it references even when the annotation is moved?** I have a standalone Python script that accesses ArcObjects through comtypes wrappings of ArcGIS OLBs -- works great. Overall, this ArcMap automation script cursors through a point feature class, creating complex vector graphics (in map units in the data view) from attribute info in the points and loads each of those graphics (an IGroupElement) into a non-feature-linked annotation feature as the anno's graphic element. I want to have functional simple line callout leader lines, but the latter graphics-containing anno features won't support a simple line callout. So my idea is to create, for each of the graphic anno features, an underlying, transparent dummy text anno feature that will carry the leader line. I've tried a bunch of things, but I can't get a leader line to show up. I have defined separate annotation classes within the target annotation feature class for storage of graphic versus dummy text leader line anno features. The leader line anno class was defined with transparent text and a simple line callout symbology. Now, below are code excerpts that include the function I call to create each annotation feature, be it graphic or leader line dummy:               #make front leader text element     ldrText = '|'     pFLdrTextElement = BuildTextElement(ldrText, 'Leader', 'null', annoRefScale, False, (fX, fY))  #returns ITextElement     pFLdrTxtElem = CType(pFLdrTextElement, esriCarto.IElement)     pFLdrTxtElem.Geometry = pTweakedTxtPoint     ...     ldrannoclass = 1     CreateAnnoFeature(annoFC, pFLdrTxtElem, fOID, ldrannoclass)          def BuildTextElement(s, signType, txtcolor, annoRefScale, has_outline, featPos=None):     ...         #separate out leader annotation text         if signType == 'Leader':             import comtypes.gen.esriGeometry as esriGeometry             pTextColor = GetRGBColor(txtcolor)             pSimpleLineCallout = NewObj(esriDisplay.SimpleLineCallout, esriDisplay.ISimpleLineCallout)             anchorPoint = NewObj(esriGeometry.Point, esriGeometry.IPoint)             anchorPoint.PutCoords(featPos[0], featPos[1])             pSimpleLineCallout.AnchorPoint = anchorPoint             pSimpleLineCallout.AutoSnap = True             pLeaderLineSymbol = NewObj(esriDisplay.CartographicLineSymbol, esriDisplay.ILineSymbol)             pLineColor = NewObj(esriDisplay.RgbColor, esriDisplay.IRgbColor)             pLineColor.Red = 0             pLineColor.Green = 0             pLineColor.Blue = 0             pLeaderColor = CType(pLineColor, esriDisplay.IColor)             pLeaderLineSymbol.Color = pLeaderColor             pSimpleLineCallout.LineSymbol = pLeaderLineSymbol             pSimpleLineCallout.LeaderTolerance = 0.0             pTextBackground = CType(pSimpleLineCallout, esriDisplay.ITextBackground)             pTextSymbol.Background = pTextBackground             pTextSymbol.Color = pTextColor             pTextElement.Symbol = pTextSymbol             pTextElement.Text = s             pTextElement.ScaleText = True             return pTextElement     ...          def CreateAnnoFeature(pAnnoFC, pElement, featID, annoclass):         """Creates new annotation feature, loads the graphic into it,         and inserts the new anno feature into the anno feature class"""         import comtypes.gen.esriGeoDatabase as esriGeoDatabase         import comtypes.gen.esriCarto as esriCarto         #make Insert cursor and FeatureBuffer for use in InsertFeature method         pFCursor = pAnnoFC.Insert(True)         pFeatBuffer = pAnnoFC.CreateFeatureBuffer()         pFeature = CType(pFeatBuffer, esriGeoDatabase.IFeature)            #set annotation of anno feature         pAnnotationFeature = CType(pFeature, esriCarto.IAnnotationFeature2)         pAnnotationFeature.Annotation = pElement         pAnnotationFeature.Status = esriCarto.esriAnnoStatusPlaced         pAnnotationFeature.AnnotationClassID = annoclass         pFeature = CType(pAnnotationFeature, esriGeoDatabase.IFeature)         #insert the new anno feature         pFeatOID = pFCursor.InsertFeature(CType(pFeature, esriGeoDatabase.IFeatureBuffer))         pFCursor.Flush()         mxDoc.ActiveView.PartialRefresh(esriCarto.esriViewGraphics, None, None)      The BuildTextElement() function contains the code to build either a plain text element or one with a simple line callout format including setting of the anchor point. (See code above for the latter.) The latter results in what looks like a simple line callout, but when the annotation is moved the leader line does not remain anchored on the point feature. The text and leader line are simply combined into a graphic that moves around as a whole with the anno. In the case of the plain text element, I was hoping that a leader line would show, because the simple line callout format is defined in the annotation class symbology. **In this case, how would I set the anchor point?** In fact, in either case the leader line dummy is created--the transparent text box is placed, but there is no leader line. I really don't have a good idea of whether I am going about this in the best way. I can't change the structure of looping through the point features one at a time, but how I go about building the annotation features can certainly change. For instance, using an IFDOGraphicsLayer and realted objects instead of an Insert Cursor might work. I would welcome any suggestions. If anyone can stand to read more ... A related desire on my part is to be able to **populate attributes of each anno feature right after (as?) I create it.** Some of the attribute info will come from the point feature and some will capture the state of some of the properties of the anno feature. I really don't know how to go about this efficiently. **What are some ways I might do this?** Thank you, all, for wading through this tome. I really appreciate your patience and generous help. **EDIT: Followup Question** So, where in my code above can I get an ISymbolCollectionElement and on what? I gather I should be making an empty text element with only a point location geometry assigned, passing this into CreateAnnoFeature(), and setting properties there through ISymbolCollectionElement. Because I create the anno feature as a FeatureBuffer from the anno feature class, the feature _is_ an annotation feature; however, I don't think a feature supports ISymbolCollectionElement, and the TextElement I pass in is just a plain TextElement. It isn't the element of the anno feature until I set the Annotation property. Can I get an ISymbolCollectionElement on the TextElement before I set it as the annotation element? Assuming I can, I guess that all I would have to set is the text, the symbolID, and the anchor point. The leader line, text size, and transparency should be picked up through the symbology defined in the anno feature class, is that correct? On a related note, how do I know the SymbolID to assign? In my existing anno class properties, the symbology tab shows the symbology that is defined for each of the annotation classes. When I create an anno feature and assign it to an annotation class, does it pick up the annotation class' symbology or do I need to assign the SymbolID explicitly (hence the first question above)? (Right now, I set the TextElement properties through ITextSymbol, so I imagine any link to the SymbolCollection that may normally exist is broken.) Thank you, all for the continued help.


Problem with the layernode.js, GeoExt Application

Attached is the code i have written on the html file. When i run it on the mozilla firefox browser i get the following error from firebug: ![enter image description here](http://i.stack.imgur.com/RN0B3.png) Most of the code has been taken from an existing javascript file from GeoExt (tree.js). The code i have changed/added starts from var mapPanel, tree, map; and ends to map.addLayers(layers); When i actually run it on a browser it is not loading properly but when i minimise it and then maximise the window i get the image that i want. Any ideas why iam getting this error. Thanks                 <script type="text/javascript">     var mapPanel, tree, map;     Ext.onReady( function() {                   // create a map panel with some layers that we will show in our layer tree         // below.         layers = [];              layers.push(new OpenLayers.Layer.OSM());              layers.push(new OpenLayers.Layer.WMS(         "National Parks", "http://localhost:8080/geoserver/wms", {             srs: 'EPSG:4326',             layers: 'National_Parks',             format: 'image/png',             buffer:0         }, {                  'isBaseLayer': false              }         ));              map = new OpenLayers.Map({             allOverlays: false,             projection: new OpenLayers.Projection("EPSG:900913"),             displayProjection: new OpenLayers.Projection("EPSG:4326"),             units: "m",             numZoomLevels: 18,             maxResolution: 156543.0339,             maxExtent: new OpenLayers.Bounds(-20037508, -20037508,             20037508, 20037508.34)         });              mapPanel = new GeoExt.MapPanel({             region: "center",             center: [-7924121.1710935, 6185868.5449234],             zoom: 10,             map: map         });              map.addLayers(layers);                        // create our own layer node UI class, using the TreeNodeUIEventMixin         var LayerNodeUI = Ext.extend(GeoExt.tree.LayerNodeUI, new GeoExt.tree.TreeNodeUIEventMixin());              // using OpenLayers.Format.JSON to create a nice formatted string of the         // configuration for editing it in the UI         var treeConfig = new OpenLayers.Format.JSON().write([{             nodeType: "gx_baselayercontainer"         },{             nodeType: "gx_overlaylayercontainer",             expanded: true,             // render the nodes inside this container with a radio button,             // and assign them the group "foo".             loader: {                 baseAttrs: {                     radioGroup: "foo",                     uiProvider: "layernodeui"                 }             }         },{             nodeType: "gx_layer",             layer: "Tasmania (Group Layer)",             isLeaf: false,             // create subnodes for the layers in the LAYERS param. If we assign             // a loader to a LayerNode and do not provide a loader class, a             // LayerParamLoader will be assumed.             loader: {                 param: "LAYERS"             }         }], true);              // create the tree with the configuration from above         tree = new Ext.tree.TreePanel({             border: true,             region: "west",             title: "Layers",             width: 200,             split: true,             collapsible: true,             collapseMode: "mini",             autoScroll: true,             plugins: [             new GeoExt.plugins.TreeNodeRadioButton({                 listeners: {                     "radiochange": function(node) {                         alert(node.text + " is now the active layer.");                     }                 }             })             ],             loader: new Ext.tree.TreeLoader({                 // applyLoader has to be set to false to not interfer with loaders                 // of nodes further down the tree hierarchy                 applyLoader: false,                 uiProviders: {                     "layernodeui": LayerNodeUI                 }             }),             root: {                 nodeType: "async",                 // the children property of an Ext.tree.AsyncTreeNode is used to                 // provide an initial set of layer nodes. We use the treeConfig                 // from above, that we created with OpenLayers.Format.JSON.write.                 children: Ext.decode(treeConfig)             },             listeners: {                 "radiochange": function(node) {                     alert(node.layer.name + " is now the the active layer.");                 }             },             rootVisible: false,             lines: false,             bbar: [{                 text: "Show/Edit Tree Config",                 handler: function() {                     treeConfigWin.show();                     Ext.getCmp("treeconfig").setValue(treeConfig);                 }             }]         });              // dialog for editing the tree configuration         var treeConfigWin = new Ext.Window({             layout: "fit",             hideBorders: true,             closeAction: "hide",             width: 300,             height: 400,             title: "Tree Configuration",             items: [{                 xtype: "form",                 layout: "fit",                 items: [{                     id: "treeconfig",                     xtype: "textarea"                 }],                 buttons: [{                     text: "Save",                     handler: function() {                         var value = Ext.getCmp("treeconfig").getValue()                         try {                             var root = tree.getRootNode();                             root.attributes.children = Ext.decode(value);                             tree.getLoader().load(root);                         } catch(e) {                             alert("Invalid JSON");                             return;                         }                         treeConfig = value;                         treeConfigWin.hide();                     }                 },{                     text: "Cancel",                     handler: function() {                         treeConfigWin.hide();                     }                 }]             }]         });              new Ext.Viewport({             layout: "fit",             hideBorders: true,             items: {                 layout: "border",                 deferredRender: false,                 items: [mapPanel, tree,{                     contentEl: "desc",                     region: "east",                     bodyStyle: {                         "padding": "5px"                     },                     collapsible: true,                     collapseMode: "mini",                     split: true,                     width: 200,                     title: "Description"                 }]             }         });     });


ArcGIS Conflation Tool Recommendation or Custom Script for Comparing Points

Can anyone recommend conflation tools for ArcGIS Desktop (10 or 10.1, paid or free) or a scripting outline / procedure (or just a script) to have a technician efficiently process the following rules? We need to compare and update 2 points of interest (POI) point layers, let's call them MasterPOI and ComparePOI. Aprox 30k points in each. The rules for a technician would be the following:   1. Find any ComparePOI points within a ~1000m of MasterPOI.   2. If a ComparePOI point has a better location or a better description (using their human judgement), update MasterPOI with either location or its description field.   3. Separate step maybe -- then any ComparePOI point not used to update MasterPOI, simply add it to the MasterPOI. Most points would fall into this category. (I'm thinking just put a flag on a feature in ComparePOI when #2 occurs.) I could script it myself eventually, but wondering if someone has some experience they could share -- thanks much!


How to list all of feature class in SDE?

I am getting a problem: my SDE contains some feature classes, but after using the statement:               var namesEnum = workspace.DatasetNames[esriDatasetType.esriDTFeatureClass];     var tempName = namesEnum.Next(); // get value null      The value of tempName is Null, but it is ok if I use esriDatasetType.esriDTFeatureDataset.


Extract overlapped parts of the routes - Network Analysis

I am on the project to identify the specific roads that are more frequently used than others. With the network shapefiles (OS ITN), origins and destinations (OD) points, route was created for each set of OD (Closest facility tool). What I want to do next is to identify the roads that are used for more than one routes; for instance, assuming that there are 5 people, each of them departs from different point (origin) to get to the point A (destination), but there are some roads that all of them need to use along the way. In other words, I want to extract the lines that "overlapped". As an experiment, I created 3 routes separately and tried to extract overlapped features using overlay tool - intersect - but it didn't work. I tried converting it to Raster and did "Overlay sum" but didn't work. If anyone can suggest the way to solve my problem, that would be really helpful.


Interpolating Maps - Statistical Learning Techniques vs Spatial Statistics Techniques

I have recently begun experimenting with the interpolation of variales over a whole country. I have good sized training set where I have several dependant variables (continuous and categorical) associated to many independant variables. The independant variables are available for the whole country. I'm not at all an expert in spatial statistics so my first approach was to train machine learning models like random forests, svm, gradient boosting, etc Which are behaving very well. But I have been fiding out that there are default methods for interpolating available in gis packages. Kriging. I played a bit with Kriging was not satisfied. Could co-kriging - regression-kriging get to better perfomances than these before mentioned methods (rf, svm)? Also, I have noticed that there are methods which seem to be tailored for these problems like geographically weighted regression. I am just wondering if my approach is somewhat off if there are methods specifically designed for these tasks. Thank you.


Leaflet add and remove legends with layer selection

I'm new to Leaflet/Javascript and have been struggling to get legends a map to show only when a specific layer is selected from the layer control. I have three layers, one of which I would like to have no legend and two others that have a corresponding legend. I came across an example, but have not been able to make it work:               // Add and remove legend from layers     map.on('overlayadd', function (eventLayer) {     // Switch to the Permafrost legend...        if (eventLayer.name === 'Permafrost') {            this.removeControl(legend1);            legend2.addTo(this);}       else { // Or switch to the treeline legend...            this.removeControl(legend2);            legend1.addTo(this);       }});      I created a jsfiddle with the specific example: http://jsfiddle.net/gerlis/T8DHb/3/ Any guidance would be greatly appreciated.


Renaming a variable input to replace spaces with underscores to be used in an output's name

This may be easier than i am making it. Using Model Builder, I have a variable input "Name", which is set as a model parameter, used for a 'Select by Attribute' early in the model. I would like to then use this variable as an input into the final feature class output's name. My issue is that some of these "Names" have spaces in them (E.G. Name = "Watershed 1"). Is there a way, using Model Builder, that i can replace the spaces with underscores/remove the spaces before inserting the variable into the output's name? Resulting in (....spatialjoin_dissolve_Watershed_1) Since this model will be run individually for multiple areas i need the name of the watershed to be included, without having to have the user enter in the watershed name with underscores as a parameter. Thanks for any help!


How to raster vector- and shape-files correctly

does anybody know how to convert vector- and shape-files correctly? Doesn't work with tab Raster/convert/vector to shape files. The output always contains strange input-data (wrong and strange coordinates).


Populate Table from Table Spatialite

I am trying to populate a column in a table from another table using Spatialite. My query will not populate the column, and I can't seem to identify what is wrong. I modeled the query from the following post: http://www.surfaces.co.il/wp-content/uploads/2012/05/SL_update3.png What I would like to achieve is to have the corresponding values from lu_grid.gridid to populate lu_geophotos.gridid where lu_geophotos intersects with lu_grid. (A column in a point layer should get the values from a polygon where the points intersect the polygon) Here is my code:               UPDATE lu_geophotos SET gridid = (SELECT GRIDID     FROM lu_grid AS s      WHERE ST_WITHIN (s.Geometry, lu_geophotos.Geometry)      AND s.ROWID IN (SELECT ROWID       FROM SpatialIndex       WHERE f_table_name = 'lu_grid' AND search_frame = lu_geophotos.Geometry)     );      ![enter image description here](http://i.stack.imgur.com/Pp41a.png)


ESRI License Initialize & Binding Failure

Despite following guidance about how to first bind, then initialize a licence for a standalone WinForm uses some arcobjects, I still get the "80040111 ClassFactory cannot supply requested class" error once I call GxDialogClass(). When debugging, the status object beneath comes back as licence checked out - so it successfully binds AND gains a licence. Yet the 80040111 indicates that I haven't. We are running ArcGIS 10.2.1.               ESRI.ArcGIS.RuntimeManager.Bind(ProductCode.Desktop);     IAoInitialize aoInitialize = new AoInitializeClass();     var status = aoInitialize.Initialize(esriLicenseProductCode.esriLicenseProductCodeAdvanced);     IGxObjectFilterCollection dialog = new GxDialogClass();      Any ideas? Matthew


Getting OSM maps in Equirectangular Projection via osm2pgsql

I'm trying to import some OSM data into psql as equirectangular projection using osm2pgsql with the following command:               osm2pgsql -c -d osm -S /usr/local/share/osm2pgsql/default.style -l /OPENSTREETMAP/south-america-latest.osm.pbf      However, it fails with this error:               Projection code failed to initialise      I have installed the latest version of the PROJ framework from here. What am I doing wrong? Thanks EDIT 1: Running 'select * from spatial_ref_sys where srid=4326;' on the database produces this:                srid | auth_name | auth_srid |                                                                                srtext                                                                                |              proj4text                    ------+-----------+-----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------      4326 | EPSG      |      4326 | GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]] | +proj=longlat +datum=WGS84 +no_defs      (1 row)


Define transparent color in singleband pseudocolor raster layer style

Can I somehow define "transparent" color for values higher than 32000 in raster layer? See the style dialog: ![enter image description here](http://i.stack.imgur.com/FxiXK.png)


qgis2 composer - non-rectangular inset map?

I'd like to have a near-full-page rectangular map object, then add a non- rectangular inset map object with 6 vertices. Any suggestions on how to accomplish this, other than making two actual maps then brute-force post- processing the images? Thanks!


Sum of values within a buffer polygon

I need to do the following in QGIS and hope so much anyone could help. I have a vector layer with points. Each point represents a firm with the number of employees in the attribute table. I want to buffer around every point, so that the buffer's attribute table contains the sum of employees within the buffer. It would be so great if the sum to each point could be written to the attribute table. Thanks for your help.


Quantifying polyline overlap

I have a set of regions and would like to quantify the degree to which the boundary of these regions are situated on/near rivers. I have turned the regions from polygons to polylines in arcgis 10.1 and have the rivers as polylines. Is there any way to quantify what percentage of the boundaries fall on rivers, and therefore statistically show the degree of overlap between these two vector features?


What are the pros and cons of each mashup baselayer?

I've been making some mashups recently in OpenLayers and find myself naturally favouring OpenStreetMap as a baselayer, I think this is mostly because I like the concept. I realised the other day that I didn't really know why I prefered it, and have played about with googles various base layers, andlong with those of Yahoo and Bing. Are there any discernible benefits of any of the baselayers that I have mentioned (or any others that I havent)? Do you find any problems with any of them or do you find that your users prefer one above the rest?


Unable to open old qgis files into the new version ( 1.8.0)

I have downloaded QGIS today for my school work also my Qgis version is 1.8.0 and my school's QGIS version is 1.7.0. So My new Version QGIS cannot run the QGIS file they have send me So Please help in thios I want to run that file in my computer.I have a project to do in it.


Looking for similar tool (like ArcGIS Diagrammer) in open source for QGIS?

Is there any diagrammer tool available (similar to ArcGIS Diagrammer) for QGIS? thanks in advance : )


Using a ArcGIS Server Feature Service's addFeature method: Parameters?

I am wanting to post data back to a feature service using the addFeatures method on a feature service. Here it says to use a query and an esri rep says to use a query task. But my "Query" object doesn't seem to have a "features" definition as suggested in the linked doc page above where they say the parameters table. Anyone have any ideas on how to do the addFeatures.               QueryTask queryTask =                     new QueryTask("http://server/ArcGIS/rest/services/geoprocessing/featureServiceName/FeatureServer/0/addFeatures");                      ESRI.ArcGIS.Client.Tasks.Query query = new ESRI.ArcGIS.Client.Tasks.Query();                 query.???


How to access all mxd files in a folder?

I'm a beginner to Python and am trying to figure out how I can access several mxds in a folder. For example, when I want to use the `AnalyzeforMSD` function in ArcGIS:               import arcpy     mxd = arcpy.mapping.MapDocument(r"C:\Project\ReadyForMSD.mxd")     analysis = arcpy.mapping.AnalyzeForMSD(mxd)      How can I define a folder with mxds as a path, e.g. C:\Projects\data, and analyze all the mxds in it? Best regards, Trashken               import os, arcpy          directory = r"C:\Project"      for root, dirs, files in os.walk(directory):        for myFile in files:             fileExt = os.path.splitext(myFile)[1]             if (fileExt == ".mxd"):                 fullPath = os.path.join(root, myFile)                 print myFile                      myMap = arcpy.mapping.MapDocument(fullPath)                 analysis = arcpy.mapping.AnalyzeForMSD(myMap)           for key in ('messages', 'warnings', 'errors'):      print "----" + key.upper() + "---"      vars = analysis[key]      for ((message, code), layerlist) in vars.iteritems():     print "    ", message, " (CODE %i)" % code     print "       applies to:",     for layer in layerlist:         print layer.name,     print


featureId filtering in wfs openlayers

I want to define a featureId fiter for wfs layer like below:               wfs = new OpenLayers.Layer.Vector("WFS Vectore", {             strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],             projection: new OpenLayers.Projection("EPSG:4326"),             protocol: new OpenLayers.Protocol.WFS({                 version: "1.1.0",                 srsName: "EPSG:4326",                 url: "http://localhost:8080/geoserver/iran/wms?service=WFS",                 featureType: "population",                 featureNS: "http://iran.kadaster.org",                 geometryName: "the_geom"             }),             filter:                 new OpenLayers.Filter.FeatureId({                     fids: ['population.913', 'population.912']                     //type: ?????                 })              });      I don't know to what set 'type' variable in filtering option?


Moving from OpenLayers to Leaflet breaks tilecache

My tilecache.cfg is like so (working with MapServer)               [mylayer]     type=WMS     url=http://server/mapserver/app     spherical_mercator=true     layers=mylayer      The following works just fine               var mylayer = new OpenLayers.Layer.WMS(         "My Layer",         "http://server/tilecache/tilecache.cgi",         {layers: "mylayer", transparent: true},         {isBaseLayer: false, opacity: 0.6, visibility: true}     );      However, when I change the above to Leafletjs like below               var mylayer = L.tileLayer.wms("http://server/tilecache/tilecache.cgi", {         layers: 'mylayer',         format: 'image/png',         transparent: true,         attribution: 'Data from blah blah'     });      I get the following error `An error occurred: Current y value -5009377.085697 is too far from tile corner y -10018754.170400` Suggestions? **Update2:** (top-posted). I tried adding `srs` definitions (`srs:"EPSG:4326"` or `srs:"EPSG:900913"`). While the latter didn't help at all, the particular error I reported above went away with 4326, and a couple of tiles were also returned, though most tiles were just blank. This tells me something is goofy with the way Leaflet expects the projection. I'd rather not change anything on the source (MapServer or Tilecache side), if possible, as other applications are depending on that to be working. **Update:** Adding the MapServer map file, in case that might help               MAP         EXTENT -180.150250417362 -90 180.150250417362 90         IMAGECOLOR 255 255 255         IMAGETYPE "png"         NAME "mylayer"         SIZE 1200 600         STATUS ON         UNITS DD         DEBUG 3         CONFIG "MS_ERRORFILE" "/tmp/ms_mylayer_error.log"              OUTPUTFORMAT             NAME "png24"             MIMETYPE "image/png"             DRIVER "AGG/PNG"             EXTENSION "png"             IMAGEMODE RGBA             TRANSPARENT ON         END              SHAPEPATH "/path/to/files"              PROJECTION             "init=epsg:4326"         END              WEB             IMAGEPATH "/tmp/ms_tmp/"             METADATA                 ows_enable_request "*"                 wms_abstract "This WMS mapservice serves a map of mylayer"                 wms_accessconstraints "none"                 wms_title "mylayer"                 wms_onlineresource "http://sever/cgi-bin/mylayer?"                 wms_srs "EPSG:900913 EPSG:4269 EPSG:4326"                 wms_keywordlist "World,mylayer"                 wms_enable_request "*"             END         END              LAYER             NAME "global"             TYPE RASTER             ..                  METADATA                 wms_srs "EPSG:4326"                 wms_name "global"                 wms_server_version "1.1.1"                 wms_format "image/png"                 wms_enable_reques "*"                 wms_extent "-180 -90 180 90"             END         END     END


How to find the distance to the nearest coastline from a land-based latitude/longitude point?

I'm completely new to GIS and unsure what I need to solve this problem: ![GSHHG shapefile loaded into QGIS](http://i.stack.imgur.com/aCJ40.png) _In the image above turquoise is actually land. Sea is white._ I tried using the NASA Distance to the Nearest Coast data dump by loading it with NumPy and performing a binary search, which worked and was blazingly fast, but the dataset's resolution wasn't high enough. I need a resolution of about 10 metres. I've now downloaded the GSHHG shapefile (shown above loaded in QGIS), but I'm unsure what to do with it. I'm seeing a lot of posts here mentioning PostGIS and SpatiaLite, but I'm not sure if these would be fast enough, or even the right tool. The maximum lookup time needs to be under 100ms as I will be running this against 10,000s of locations during the back-end indexing phase of a travel search engine website. **EDIT:** I'm trying to generate the raster from the shapefile, but I'm not sure what resolution to use for the `-tr` option. According to http://gis.stackexchange.com/a/8655/30920 I need `0.0001`, as 11 metres would be ideal. Below shows the output of `-tr` set to `1`, `0.1` and `0.01` respectively. The file size seems to be growing by 100x for each decimal place. With `0.01` being 4.1gb that would make `0.0001` 41tb (way too big). ![-tr 1 1](http://i.stack.imgur.com/nvKst.png) ![-tr 0.1 0.1](http://i.stack.imgur.com/6vG6p.png) ![-tr 0.01](http://i.stack.imgur.com/HvpLy.png) I'm running: `gdal_rasterize -a level -tr 0.01 0.01 -l GSHHS_f_L1 GSHHS_f_L1.shp 0.01.tif` Is this right?


Looking for help identifying projections and reprojecting

Hi there at the new forum, I'm still struggling with projections in qgis. The "Vogelschutzgebiete" reprojection worked. But these ones seem to be tougher: www.projektidee.org/images/extern/Gemeinden.zip as well as the same URL with **Aemter.zip** at the end. Are these the same projections? Does anyone here by any chance know how to reproject these to EPSG:32633 (WGS84 UTM33N)? (shapes without projection information are a pain in the a...) Refering also to this thread: http://forum.qgis.org/viewtopic.php?f=2&t=10244&sid=52667e4eb2cfdad92b4f88e160c1b577 best regards desputin


Web Map data display/filter/query

I have been learning as much web mapping as possible lately. I really enjoy it, as it seems what you need to know to keep up with the geospatial field. I do have a question that is probably easy for most people to answer. What is the best way to query/filter/display/symbolize data based on attributes stored on a spatial database and displayed through something like OpenLayers. I know SQL is great for querying data. But how does this fit into the aspect of a web page?? Is this where PHP comes into play? Or Ajax? I am having a lot of trouble desciphering between where the serverside/clientside work ends and begins. Open layers is great and easy to make maps. But I want to do more with these maps and having trouble what exactly I should learn next in order to actually do something with my data. Can I do all my querying within javascript if something is served through WMS? Can I do basic queries to my GeoJSON files? Or is that where filtering comes in? I saw with CartoDB, they return a url that has the SQL in it. Is this an httpGetRequest? If I have data in MapBox, how can I filter through it and display data based on a attribute, pick from a drop-down box? Sorry if this is a lot of question. Haha. I am just trying to grasp the concept of how to actually manipulate the data I have displayed on OpenLayers. I understand the differences between the database/map server/APIs and their function. But tying them together in a way which can change how/what/where/when my data displays is whats getting to me. For example, if I want data to be displayed based on an an attribute I type into a box. Where is this work done? Or if I want to find the closest bar to a point I place on the map, what is it on the serverside or clientside that goes through my data and finds this? Thanks!


ArcGIS for Server Printing - Data Frame Grid

We need to print the map from web client (Developed using ArcGIS JavaScript API). I have prepared the Templates and published as Export Web Map (GP Tool). My templates are using Data Frame Grid (Measured grid). I need to customize the grid size based on the printing scale. Is there any possibility of sending the grid size and scale as parameters to Export Web Map tool while generating the print? please suggest if there is any Paid / Free tools available for printing the data frame grid dynamically on ArcGIS server.


How to generate heatmaps with QGIS1.9 plugin automatically?

I created a few heatmaps with the new plugin in QGIS 1.9, but now I would like to generate a lot of them automatically. How should I do? I created a few of them by hand, but I should first import the data, select the CRS, then select the plugin, select the imported data and the parameters for the heatmap (and pick again the CRS). It takes quite long as soon as you want more than a few heatmaps. I have 300'000 data in one day. I separate them in groups of 15 minutes, and I would like to visualize the heatmap for all groups of 15 minutes (~64), in order to observe the evolution in time. I'm interested in either:   * a way to make it in QGIS automatically, or   * a way to do it in another software, that would be more adapted for this purpose.


How to fix "spatial_ref_sys relation does not exist"

I am trying to install postgis in my database. I compiled the library successfully. Now when I try to import the sql spatial_ref_sys is shows the error that               spatial_ref_sys relation does not exist      When I looked into the sql, it has no create table at the top. What should I do. Am I supposed to have these two tables geometry_columns and spatial_ref_sys from other sources. I just created a database mydatabase and tried to import the spatial_ref_sys.sql into it. Any suggestions? The version of my postgresql is 9.1.3 and the version of my postgis is 2.0.0


Accessing arcpy functions from IronPython

I made a few python scripts to automatically optimize and publish my data..   Now i'm thinking about writing a .NET program to manage and run these scripts: the obvious way is invoking them in a different process from the .NET code but this seems downright ugly I was thinking about using IronPython and migrate my scripts into .NET.   Does anyone know if it's possible to invoke arcpy functions from IronPython? Thanks!