title: Add joined data in fiona with new schema

text: Looked more closely at problem on how to add data to a shapefile using fiona. Docs for fiona very unclear on how to do this. I know how to add a schema after that looks very unwieldy and can not figure things out. So has anyone just done a join (out side of fiona) and added data to shape file using fiona. A reasonably large file not just one record. I know how to join data just start from there. You have a shape file get the data for the record attributes join it then what? Seems easy. Really just use the bottom part for historical reference. OK coped shape and added new schema with ordereddict and successfully (I think). Then using append in fiona I just want to add data using ordereddict or something like that to properties data. See code below. The variables are matched up but keep getting error. TypeError: string indices must be integers, not str I don't know how it wants the data input or something else is the problem. Below is the code and the ordereddicts I am using. I use the write funtion to add new Schema first then append data to add variables to shapefile. I think that was the way to do it.               bx = 0          with fiona.open(         '/*/adata.shp',         'w',         driver = source_driver,         crs = source_crs,              schema={'geometry': 'Polygon','properties': wschema,}) as c:         print len(c)              print c.schema          close()          0     {'geometry': 'Polygon', 'properties': OrderedDict([(u'scalerank', 'int:4'), (u'featurecla', 'str:30'), (u'labelrank', 'float:16.6'), (u'sovereignt', 'str:254'), (u'sov_a3', 'str:254'), (u'adm0_dif', 'float:16.6'), (u'level', 'float:16.6'), (u'type', 'str:254'), (u'admin', 'str:254'), (u'adm0_a3', 'str:254'), (u'geou_dif', 'float:16.6'), (u'geounit', 'str:254'), (u'gu_a3', 'str:254'), (u'su_dif', 'float:16.6'), (u'subunit', 'str:254'), (u'su_a3', 'str:254'), (u'brk_diff', 'float:16.6'), (u'name', 'str:254'), (u'name_long', 'str:254'), (u'brk_a3', 'str:254'), (u'brk_name', 'str:254'), (u'brk_group', 'str:254'), (u'abbrev', 'str:254'), (u'postal', 'str:254'), (u'formal_en', 'str:254'), (u'formal_fr', 'str:254'), (u'note_adm0', 'str:254'), (u'note_brk', 'str:254'), (u'name_sort', 'str:254'), (u'name_alt', 'str:254'), (u'mapcolor7', 'float:16.6'), (u'mapcolor8', 'float:16.6'), (u'mapcolor9', 'float:16.6'), (u'mapcolor13', 'float:16.6'), (u'pop_est', 'float:16.6'), (u'gdp_md_est', 'float:16.6'), (u'pop_year', 'float:16.6'), (u'lastcensus', 'float:16.6'), (u'gdp_year', 'float:16.6'), (u'economy', 'str:254'), (u'income_grp', 'str:254'), (u'wikipedia', 'float:16.6'), (u'fips_10', 'str:254'), (u'iso_a2', 'str:254'), (u'iso_a3', 'str:254'), (u'iso_n3', 'str:254'), (u'un_a3', 'str:254'), (u'wb_a2', 'str:254'), (u'wb_a3', 'str:254'), (u'woe_id', 'float:16.6'), (u'adm0_a3_is', 'str:254'), (u'adm0_a3_us', 'str:254'), (u'adm0_a3_un', 'float:16.6'), (u'adm0_a3_wb', 'float:16.6'), (u'continent', 'str:254'), (u'region_un', 'str:254'), (u'subregion', 'str:254'), (u'region_wb', 'str:254'), (u'name_len', 'float:16.6'), (u'long_len', 'float:16.6'), (u'abbrev_len', 'float:16.6'), (u'tiny', 'float:16.6'), (u'homepart', 'float:16.6'), ('Country', 'str:254'), ('Index', 'str:38'), ('A2', 'str:254'), ('A3', 'str:254'), ('Code', 'str:38'), ('1', 'str:38'), ('730', 'str:38'), ('1000', 'str:38'), ('1150', 'str:38'), ('1280', 'str:38'), ('1300', 'str:38'), ('1348', 'str:38'), ('1400', 'str:38'), ('1450', 'str:38'), ('1500', 'str:38'), ('1550', 'str:38'), ('1570', 'str:38'), ('1600', 'str:38'), ('1650', 'str:38'), ('1700', 'str:38'), ('1720', 'str:38'), ('1750', 'str:38'), ('1775', 'str:38'), ('1800', 'str:38'), ('1820', 'str:38'), ('1850', 'str:38'), ('1870', 'str:38'), ('1890', 'str:38'), ('1913', 'str:38'), ('1929', 'str:38'), ('1950', 'str:38'), ('1960', 'str:38'), ('1973', 'str:38'), ('1980', 'str:38'), ('1990', 'str:38'), ('2000', 'str:38'), ('2008', 'str:38')])}                    with fiona.open('/*/adata.shp', 'a') as cwt:              kr = gh[0]              print kr              cwt.write({'geometry':'Polygon','properties': kr,})          close()      > * * * > > TypeError Traceback (most recent call last) in () 2 kr = gh[0] 3 print kr > ----> 4 cwt.write({'geometry':'Polygon','properties': kr,}) 5 close() > > /home/matthew/Enthought/Canopy_32bit/User/lib/python2.7/site- > packages/fiona/collection.pyc in write(self, record) 209 def write(self, > record): 210 """Stages a record for writing to disk.""" --> 211 > self.writerecords([record]) 212 213 def validate_record(self, record): > > /home/matthew/Enthought/Canopy_32bit/User/lib/python2.7/site- > packages/fiona/collection.pyc in writerecords(self, records) 203 if > self.mode not in ('a', 'w'): 204 raise IOError("collection not open for > writing") --> 205 self.session.writerecs(records, self) 206 self._len = > self.session.get_length() 207 self._bounds = self.session.get_extent() > > /home/matthew/Enthought/Canopy_32bit/User/lib/python2.7/site- > packages/fiona/ogrext.so in fiona.ogrext.WritingSession.writerecs > (src/fiona/ogrext.c:15787)() > > /home/matthew/Enthought/Canopy_32bit/User/lib/python2.7/site- > packages/fiona/ogrext.so in > fiona.ogrext.WritingSession.writerecs.validate_geometry_type > (src/fiona/ogrext.c:15230)() > > TypeError: string indices must be integers, not str > > OrderedDict([(u'scalerank', 1), (u'featurecla', u'Admin-0 map subunit'), > (u'labelrank', 3.0), (u'sovereignt', u'Afghanistan'), (u'sov_a3', u'AFG'), > (u'adm0_dif', 0.0), (u'level', 2.0), (u'type', u'Sovereign country'), > (u'admin', u'Afghanistan'), (u'adm0_a3', u'AFG'), (u'geou_dif', 0.0), > (u'geounit', u'Afghanistan'), (u'gu_a3', u'AFG'), (u'su_dif', 0.0), > (u'subunit', u'Afghanistan'), (u'su_a3', u'AFG'), (u'brk_diff', 0.0), > (u'name', u'Afghanistan'), (u'name_long', u'Afghanistan'), (u'brk_a3', > u'AFG'), (u'brk_name', u'Afghanistan'), (u'brk_group', None), (u'abbrev', > u'Afg.'), (u'postal', u'AF'), (u'formal_en', u'Islamic State of > Afghanistan'), (u'formal_fr', None), (u'note_adm0', None), (u'note_brk', > None), (u'name_sort', u'Afghanistan'), (u'name_alt', None), (u'mapcolor7', > 5.0), (u'mapcolor8', 6.0), (u'mapcolor9', 8.0), (u'mapcolor13', 7.0), > (u'pop_est', 28400000.0), (u'gdp_md_est', 22270.0), (u'pop_year', -99.0), > (u'lastcensus', 1979.0), (u'gdp_year', -99.0), (u'economy', u'7. Least > developed region'), (u'income_grp', u'5. Low income'), (u'wikipedia', > -99.0), (u'fips_10', None), (u'iso_a2', u'AF'), (u'iso_a3', u'AFG'), > (u'iso_n3', 4), (u'un_a3', u'004'), (u'wb_a2', u'AF'), (u'wb_a3', u'AFG'), > (u'woe_id', -99.0), (u'adm0_a3_is', u'AFG'), (u'adm0_a3_us', u'AFG'), > (u'adm0_a3_un', -99.0), (u'adm0_a3_wb', -99.0), (u'continent', u'Asia'), > (u'region_un', u'Asia'), (u'subregion', u'Southern Asia'), (u'region_wb', > u'South Asia'), (u'name_len', 11.0), (u'long_len', 11.0), (u'abbrev_len', > 4.0), (u'tiny', -99.0), (u'homepart', 1.0), ('Country', 'Afghanistan'), > ('Index', 104L), ('A2', 'AF'), ('A3', 'AFG'), ('Code', 4), ('1', nan), > ('730', nan), ('1000', nan), ('1150', nan), ('1280', nan), ('1300', nan), > ('1348', nan), ('1400', nan), ('1450', nan), ('1500', nan), ('1550', nan), > ('1570', nan), ('1600', nan), ('1650', nan), ('1700', nan), ('1720', nan), > ('1750', nan), ('1775', nan), ('1800', nan), ('1820', nan), ('1850', nan), > ('1870', nan), ('1890', nan), ('1913', nan), ('1929', nan), ('1950', > 644.7561631573), ('1960', 739.4106486121), ('1973', 684.0618506358), > ('1980', 689.9746687251), ('1990', 604.0490304301), ('2000', > 565.2309015098), ('2008', 868.8580032192)])


title: Change CartoDB tooltip offset

text:
How can I change the offset of the CartoDB tooltip from the cursor? When I add a   to the template content, the cursor overruns the tooltip and I would like to tweak the offset a bit so its 5,-5 pixels up and left of the cursor.               vis.addOverlay({        layer: spillLayer,        type: 'tooltip',        template: '
{{type}} spill of
{{totvol}} gallons
'     });


title: Where can I find GIS data about NYC's combined sewers (CSO) that's free to use?

text: I've located two sites that display the data that I'm looking for, but both lack exporting functions. OASIS NYC and maps.nyc/gov Otherwise I can't locate this data anywhere in a format I can use in QGIS. Anyone have any suggestions? Otherwise, is there a simple way to go from an image with points to creating a shapefile with the proper coordinates? Cheers


title: How can I duplicate a layer in QGIS?

text: I'd like to display the same vector data in different ways as different layers. While it's very handy to be able to copy and paste the layer **style** in 1.8+, it would be nice to be able to select a layer and right-click to copy or duplicate it directly. Any easy way of doing this, like a Python command? * * * Update: @dakcarto's suggestion works perfectly. Since I needed to add many duplicate layers, I adapted it to loop as many times as needed:               for n in range(1,5):          iface = qgis.utils.iface; vl = iface.activeLayer(); iface.addVectorLayer(vl.source(), vl.name() + "_clone" + str(n), vl.providerType())      The only problem is that the new layer becomes the activeLayer, so it adds "_clone" and the number to the previous name, ending up with example_clone1, example_clone1_clone2, up to the unwieldy example_clone1_clone2_clone3_clone4_clone5. Need to figure out how to duplicate from the originally selected layer, now.


title: Layers not appearing when updated with UpdateLayer in arcpy

text: I have a script that calculates kernel density for several sets of points, adds the output to a base map, updates the added layer to use the same color scheme and resampling function of a template layer, then zooms to the extent of the new layer. This works fine for **_some_** of the resulting maps; the density output shows on the map, the color is as it should be, and it is sampled using bilinear interpolation as I wanted. The problem is that _most_ of the resulting maps do not show the kernel output at all; only the basemap is visible. I have isolated the code I am using and have altered it to compute one simple test case. Here is what I have:               SubjectLyr = arcpy.mapping.Layer(r"F:\\testFiles\\output\\Population23_KDens.lyr")     mxd = arcpy.mapping.MapDocument("F:\\testFiles\\testMap.mxd")     df = arcpy.mapping.ListDataFrames(mxd)[0]      wPath = "F:\\testFiles\\output\\" # same as in line 1          #Add the layer to basemap     arcpy.mapping.AddLayer(df, SubjectLyr,"AUTO_ARRANGE")           #Update the layer     SubjectLyr = arcpy.mapping.ListLayers(mxd, SubjectLyr.name, df)[0] # change reference to layer in mxd     sourceLayer = arcpy.mapping.Layer(wPath+"templates\\template.lyr") # get template layer     arcpy.mapping.UpdateLayer(df, SubjectLyr, sourceLayer, True)          ###Zoom to selection     df.zoomToSelectedFeatures()     lyrExtent = SubjectLyr.getSelectedExtent()     df.extent = lyrExtent     arcpy.mapping.ExportToPDF(mxd, r"F:\\testFiles\\output\\Population23_KDens_Map.pdf")     print('DONE!')      I have read that there is some existing issue with UpdateLayer in ArcMap 10.1, though I am using 10.0. As shown, my code is practically identical to the code that is a "workaround" to this problem described in the above linked forum. This code works for some, but not all of my datasets. I have also tried using the ApplySymbologyFromLayer_management() function, which _does_ make all the kdens output layers appera; however, this does not change the resampling function used when drawing the output, and I need to to use bilinear interpolation. Does anyone know what could be going on? Are there any other functions I could use?


title: How to do Reverse Geocoding from MySQL/PostGIS Sql ???

text: I want to do reverse geocoding from MySQL or PostGIS SQL. I have shapefile up to town level of India. So I have a geometry boundary for each town. What I want is to first find the nearest point from the current position and check that point is in which towns. I want to get the result in this format: Towns, District, State, Country I dont have knowledge of PostGIS SQL but I know MySQL. But if anyone can help me I will use the PostGIS SQL also. So I want fastest way to do reverse geocoding. Thank you.


title: ArcObjects 10.0: Adding Annotation Feature Class To Map

text: ArcObjects 10.0, SDE on MS Sql Server, Visual Studio 2010, C#.Net Using ArcObjects, I am able to add feature classes to the map with no problem. However, when adding an annotation feature class to the map, the layer appears with the red exclamation point, which indicates that it is not valid. Can someone provide some code that shows how to properly add an annotation feature class to a map? Thanks in advance.


title: Error Installing libgdal1 Package

text: I'm trying to install the libgdal1 package on Ubuntu 12.04, but the apt is returing this error: > dpkg: error processing > /var/cache/apt/archives/libgdal1_1.9.1-2~precise4_amd64.deb (--unpack): > > libgdal 1.9.1-1 trying to overwrite '/usr/lib/libgdal.so.1.16.1', which is > also in package libgdal 1.9.1-1 I believe libgdal 1.9.1-1 is installed from OpenGeo Suite. How can I fix this problem? QGIS and osm2pgl require the libgdal1 package.


title: Problem with double field type in postgis database

text: I have connection to PostGIS spatial database through ArcSDE, and all double type numeric fields are cutting numbers after comma. Does anyone know how can I fix this problem?


title: Converting GeoExplorer gps data points

text: I have been given what I'm told are differential corrected gps points (DGPS) and asked to convert them to something usable in current GIS (e.g. Arcgis, Qgis). They have names like `R081320a.cor`, `R081323a.cor` and assuming the file time stamps are accurate were created in 1999. Opening with a text editor reveals a binary format, with the first legible text as `MCORR400 v4.55 W32`, followed a little later with `Automatically Created By GeoExplorer` and `Geo-Explorer Version 2.20`. Given the context, the GeoExplorer mentioned is probably the Trimble flavour, which needless to say I don't have. What are my options for recovering these data?


title: Is it possible to connect to ArcSDE using QuantumGIS?

text: Is anyone aware of any plugins, or any other way to connect and view data from an ArcSDE database in Quantum GIS desktop?


title: Calculate cumulative distance between points in a dataset in ArcGIS 9.3 ArcInfo

text: I am working with several point datasets that I have received, with the points representing xy locations with elevation data for several levees in south Louisiana. I would like to be able to calculate the cumulative distance of each point from a point of origin. By example, if my point of origin would represent 0, the distance to point 1 is 85 feet, the distance from point 1 to point 2 is 90 feet, the distance to from point 2 to point 3 is 70 feet, then the cumulative distance for point 1 would be 85 feet, point 2 would be 175 feet, point 3 would be 245 feet, etc. And I would have to add the point of origin to several of the datasets for the purpose of consistency. Thanks in advance for any assistance.


title: How to merge two Polygons in OpenLayers?

text: I have two polygons.               polygon1 = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon([linearRing1]))     polygon2 = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon([linearRing2]))      How can I merge the two polygons into one using OpenLayers? ![http://i.stack.imgur.com/SrqYF.png](http://i.stack.imgur.com/Zk1wr.png)


title: CQL Filter contradiction between WFS getFeature request and WMS mergeNewParams

text: I am developing a web map application by using Geoserver 2.4.0. In my application, I have developed a module like Arcgis Query builder as shown below screenshot. ![enter image description here](http://i.stack.imgur.com/74oLq.png) In that, while I am using CQL Filter, WFS and WMS returns different result for same layer.               var oXml = OpenLayers.Request.GET({     url: "http://xxx.xxx.x.xx:8080/geoserver/wfs?service=wfs&version=1.1.0&request=GetFeature&typeName=Buildings&cql_filter=" + $("#txtBoxQuery").val(),     async: false     });          var strXml = oXml.responseXML;     var featuresLst = strXml.getElementsByTagName('Buildings');     console.log("Features1: " + featuresLst.length);              //Return Error                newFilter = format.read($("#txtBoxQuery").val());          var oXml2 = OpenLayers.Request.GET({     url: "http://xxx.xxx.x.xx:8080/geoserver/wfs?service=wfs&version=1.1.0&request=GetFeature&typeName=Buildings&cql_filter=" + newFilter,     async: false     });          var strXml2 = oXml2.responseXML;     var featuresLst2 = strXml2.getElementsByTagName('Buildings');     console.log("Features2: " + featuresLst2.length);             //Return Error      ![enter image description here](http://i.stack.imgur.com/0YY5r.png)               //tocLayer is Buildings layer          tocLayer.mergeNewParams({ cql_filter: $("#txtBoxQuery").val() });        //Return 1      I am very new to CQL Filter, Kindly help me to fix this issue. Thanks in advance


title: Can we get google map layers through OpenLayers proxy configuration

text: I have a client which is in the LAN and doesn't have internet connection. It can get all the required layers from the webserver through LAN only. but the webserver has the internet connection. Now the question is, how to render google map layers from this client which doesn't have internet connection !... Hope i will get reply soon to solve my problem. Thanking in anticipation for an early reply.


title: python calling def __init__(self, uri=None): method

text: I am working on python plugins for QGIS. I have my _QueryBuilder.py_ and _postgis.py_ files. I connected it to database using `Connection` class and under `def __init__(self, uri=None)` in _postgis.py_ file. I want to connect to database through _QueryBuilder.py_ file.I imported postgis.py into _QueryBuilder.py_ But how to call `def __init__(self, uri=None)` of _postgis.py_ from _QueryBuilder.py_? I need to create instance of 'Connection' class in order to call `def __init__(self, uri=None)` method of _postgis.py_ in _QueryBuilder.py_ How do I go about it? postgis.py file:               class Connection(DbConn.Connection):          @classmethod     def getTypeName(self):         return 'postgis'          @classmethod     def getTypeNameString(self):         return 'PostgreSQL'          @classmethod     def getProviderName(self):         return 'postgres'          @classmethod     def getSettingsKey(self):         return 'PostgreSQL'          @classmethod     def icon(self):         return QIcon(":/icons/postgis_elephant.png")          @classmethod               def __init__(self, uri=None):              DbConn.Connection.__init__(self, uri)              #self.host = uri.host()         #self.port = uri.port()         #self.dbname = uri.database()         #self.user = uri.username()         #self.passwd = uri.password()                        self.host ='localhost'          self.port =5432          self.dbname ='ssss'         self.user = 'j'         self.passwd = 'jkj'                   if self.dbname == '' or self.dbname is None:             self.dbname = self.user              try:             self.con = psycopg2.connect(self.con_info())         except psycopg2.OperationalError, e:             raise DbError(e)              self.has_spatial = self.check_spatial()              self.check_geometry_columns_table()              # a counter to ensure that the cursor will be unique         self.last_cursor_id = 0                    '''                    '''     if __name__ == "__main__":     window = Connection()      and QueryBuilder.py is:               import sys     import pdb          from PyQt4 import QtGui, QtCore     import psycopg2     import pprint               #from qgis.core import *     #from qgis.gui import *               import postgis          from DatabaseModel import TableItem, SchemaItem, DatabaseModel     import DbConnection          from ui.DlgQueryBuilder_ui import Ui_Dialog     from DlgDbError import DlgDbError          from QueryParser import QueryParser     from QueryManager import *          class DlgQueryBuilder(QDialog, Ui_Dialog):         so on.....


title: Can layer names in Layered PDF exported from ArcGIS for Desktop be overridden?

text: Does anyone know how to override the layer names output by ArcGIS, where the output layer is called Other, or . These usually refer to things like the map border, labels and the background.


title: How to translate coordinates on the earth

text: I am trying to translate coordinates. I have a set of coordinates for city A which I need to map to city B, given a point P1 in city A maps to P2 in city B. How do I do this? This problem would be similar to a translation transformation but in this case, it's on a sphere and not on a plane.


title: ArcGIS Feature Class Extent Changing

text: I've been having a problem with the extents of feature classes in our SDE here at work. Our database is divided into feature datasets that have various feature classes in them. The problem is as follows: The feature classes are all in GCS NAD 27. Sometimes, when using ArcMap and editing data (digitizing features and filling in the fields mainly), at some point, the extent of the feature class will change. The data source is still set correctly, and while the top and right extent are still correct, the bottom and left extent get changed to -400.00 dd. It's always the bottom and left extent that get changed as well, and it's not every feature class being edited, just one feature class at a time. I can't think of anything in particular that I'm doing to cause this. There are a couple of us editing various features classes in the SDE at the same time, but we are always working in different feature class files. The only thought I've had so far, and I haven't had time to test this out since I thought of it, was that adding a shapefile to the mxd that has an extent outside the feature class extent is causing the feature class extent to change. It's possible to fix the extent by resetting the data source from a feature class that still has the correct extent, but I'd like to know why this is happening so that we can fix it permanently.


title: Need help getting GeoMoose working on CentOS

text: Anybody know how to get GeoMoose to work? I've installed on Centos 6, following the destructions on the Geomoose website. I'm down to the bottom of the page, and should be done. I open the demo page and get almost nothing. There's the GeoMoose logo, a Catalog pane where the layers should be listed, and the footer. No map, or tools, or layers list. I have MapServer installed...               # /var/www/cgi-bin/mapserv -v        MapServer version 6.0.3        OUTPUT=GIF        OUTPUT=PNG        OUTPUT=JPEG        SUPPORTS=PROJ        SUPPORTS=AGG        SUPPORTS=CAIRO        SUPPORTS=FREETYPE        SUPPORTS=ICONV        SUPPORTS=FRIBIDI        SUPPORTS=WMS_SERVER        SUPPORTS=WMS_CLIENT        SUPPORTS=WFS_SERVER        SUPPORTS=WFS_CLIENT        SUPPORTS=WCS_SERVER        SUPPORTS=SOS_SERVER        SUPPORTS=FASTCGI         SUPPORTS=THREADS        SUPPORTS=GEOS        INPUT=POSTGIS        INPUT=OGR        INPUT=GDAL        INPUT=SHAPEFILE      ... and can hit it across the internet. I have PHP installed and working. I have the /tmp/out directory, the local_settings.ini, and the Apache geomoose.conf. Apache restarts OK, and I get the blankish page. Any suggestions would be greatly appreciated. Thanks. Apparently, I need a better reputation to be able to post more links, so you'll have to believe me on the MapServer and PHP. Or, I could put them in a reply if you want to actually see the info.php page.


title: Populate more than one Silverlight Image from Bing Maps async request

text: I have the following code, which works fine if you just want to populate one Image with a response from Bing Maps. But if I try to do two then the variable _currentImage always ends up being "image1" because the calls are asynchronous. How can I pass the image variable along to the ImageryServiceGetMapUriCompleted method?               using System;     using System.Windows.Controls;     using System.Windows.Media.Imaging;     using BasicBingMapsImagerySvc.ImageryService;          namespace BasicBingMapsImagerySvc     {         public partial class MainPage : UserControl         {             private const string BingMapsKey = "my key";                  private Image _currentImage;                  public MainPage()             {                 InitializeComponent();                      GetMap(42.573377, -101.032251, image0, MapStyle.AerialWithLabels);                      GetMap(42.573377, -101.032251, image1, MapStyle.Road_v1);             }                       private void GetMap(double lat, double lon, Image image, MapStyle mapStyle)             {                 var mapUriRequest = new MapUriRequest();                      // Set credentials using a valid Bing Maps key                 mapUriRequest.Credentials = new Credentials();                 mapUriRequest.Credentials.ApplicationId = BingMapsKey;                      // Set the location of the requested image                 mapUriRequest.Center = new Location();                 mapUriRequest.Center.Latitude = lat;                 mapUriRequest.Center.Longitude = lon;                      // Set the map style and zoom level                 var mapUriOptions = new MapUriOptions();                 mapUriOptions.Style = mapStyle;                 mapUriOptions.ZoomLevel = 13;                      // Set the size of the requested image to match the size of the image control                 mapUriOptions.ImageSize = new SizeOfint();                 mapUriOptions.ImageSize.Height = 256;                 mapUriOptions.ImageSize.Width = 256;                      mapUriRequest.Options = mapUriOptions;                      var imageryService = new ImageryServiceClient("BasicHttpBinding_IImageryService");                 imageryService.GetMapUriCompleted += ImageryServiceGetMapUriCompleted;                      _currentImage = image;                      imageryService.GetMapUriAsync(mapUriRequest);                       }                  private void ImageryServiceGetMapUriCompleted(object sender, GetMapUriCompletedEventArgs e)             {                 // The result is an MapUriResponse Object                 MapUriResponse mapUriResponse = e.Result;                 var bmpImg = new BitmapImage(new Uri(mapUriResponse.Uri));                      _currentImage.Source = bmpImg;             }         }     }


title: How to draw or edit curved lines in free GIS?

text: I'm searching informations about drawing simple curved arrow lines into free GIS like QGIS, in this problem data geometry is CIRCULARSTRING ( a type which exists in latest postgis version) It seems GIS like QGIS doesn't actually support editing (and drawing?) of this type of geometry, so i'm searching a plugin like cadtools to draw this lines, but without transformation into simple LINESTRINGS, and try to using directly curve lines drawing function into QGIS API (or other free gis) , if it's possible .. Any idea ? Thanks a lot! SR.


title: qgis to local postgis connection - fails

text: It seems pretty clear I cannot connect to a local postgresql installation out of QGIS. This is my first experience with PostGIS. I am using PostgreSQL 9.0 on a win7 machine. I can see the successful installation of Postgresql and the postgis database in both PGAdmin and NaviCat. I have added a user account in PGAdmin which is not a superuser (meaning I believe I have dealt with the issues discussed at http://pgsnake.blogspot.com/2010/07/postgresql-passwords- and-installers.html). Has something changed on QGIS 1.7? After I choose to Add Postgis Layer, I specify a new connection which resembles my configuration and is consistent with http://www.gistutor.com/quantum-gis/20-intermediate-quantum-gis- tutorials/34-working-with-your-postgis-layers-using-quantum-gis-qgis.html and the Linfinity blog. I have toggled SSL mode after reading http://osgeo- org.1803224.n2.nabble.com/Postgis-SSL-connection-td2037146.html. The failure in the test connection leads to "ERROR:service file "/etc/pg_service.conf" not found". Has anyone got some more positive experience with PostgreSQL, QGIS and Win7?


title: How to add a Group Layer control to a Table of Contents sample

text: I'm still trying to find the perfect Table of Contents sample for the ArcGIS Server JavaScript API 2.3. My previous question gave some hints but I now have a more specific question regarding checkboxes for layer control. I need to provide a Table of Contents containing a variety of Tiled, Feature and Dynamic layers, which may be sourced from multiple ArcGIS Server instances. The TOC should allow the user to toggle individual layers on/off, and toggle multiple layers on/off simultaneously using a Group layer checkbox (ie, one high-level checkbox to control multiple lower-level layers). This sample contains a nice Group layer control, but presumes that all the component layers may be switched on/off as VisibleLayers of a single Dynamic layer. This logic seems to be integral to the sample, so it doesn't look like a simple matter to modify it for feature and tiled layers. (Please let me know if I'm on the wrong track, and this sample would prove suitable) The Legend Widget sample is more suitable as it simply switches any layer on/off (see the Natural Disasters panel on the right-hand side). **My question** How would I add a Group Layer control to the Legend Widget sample? eg, add a higher-level checkbox which will switch both Fire and Earthquakes layers on/off.


title: Could this ugly work-around work to fake a Multimodal network with pgRouting and QGIS?

text: I have a road network that is working with pgRoutingLayer in QGIS (I imported the layer to my dbserver, ran psql pgr_createTopology and got it back into QGIS as a new PostGIS layer. From here I can run all the pgRouting analysis which is good. My somehow strange plan is to take the same road network, remove all non- walkable roads like highways and then set the speed to 4 km/h and use it as a pedestrian network. On top of this network I simply want to draw straight lines between train stations and connect them to the road network somewhere close to the actual stations. The straight lines would intersect a lot of roads on the way to the next station but as long as theres no nodes the traffic wont "leak out" right? In the attribute table I would specify the cost in minutes for that specific train journey. At the nodes where I connect with the road network I could add a shorter road between them with a "transfer" cost. If it's possible to create bridges with pgRouting this should be possible? Since the straight line from station A to station B could be considered as a long bridge with no ramps except in the beginning and the end and with higher speed limit then the rest of the network then a driving_distance would choose this route over a slower one and we've just created a fake multimodal network? What do you think? Could it work? If so how would you insert the straight lines and connect them to the network without creating a new node everytime it intersects with the road network? Would you draw this before or after you've created the topology with pgr_createTopology? Thanks!


title: How to load the default layer style from Postgresql with Python?

text: I would like to write a python macro that upon opening my QGIS project file will reload the default style for each layer from the postgres 'layer_style' table. I have had a look at the documentation and can only work out how this is done from a sqlite db or .qml file. Any pointers would be appreciated. I am running QGIS 1.9 Master. Thank you.


title: How to make pgRouting understand bridges and tunnels?

text: I have I highway that runs on a bridge over a couple of blocks in a city. How do I get pgRouting to understand that cars can't move from the small blocks on the ground up to the highway on the bridge and vise verse? What if I manually remove the nodes/vertices? Would a driving_distance understand that the highway and the smaller block-roads underneath aren't connected? I'm using QGIS+pgRouting+Postgresql+PostGIS


title: Joining two tables in CartoDB mysteriously returns no rows

text: I have two tables in CartoDB, one with locations and one with related data to those locations. They are related through the common columns "placeid" and "relatedid". Both columns are string, (and definitely there are common entries). Still, the query "Select * from lugares, related where lugares.placeid = related.relatedid" gives no results. Where are the possible traps? I managed to make them join correctly when using only small excerpts of the data. Can it be an encoding problem?


title: ArcMap Change Values Greater than Standard Deviation of Mean to Zero

text: I have a feature class with greater than 1000 features and I would like to change all values greater than 2 Standard Deviations to a Zero. Seems like I could possibly use Field Calculator for something like this but I'm not exactly how to attack it. I'm not seeing a way to even calculate the Standard Deviation from within the Field Calculator. And secondly, I not sure how I would do the replace of these values. Any direction on this would be appreciated.


title: Failed connection with .sqlite file in QGIS converted from osm by spatialite

text: I have converted a *.osm file to a *.sqlite file using the spatialite_tool i.e sspatialite_osm_map.. Now I want to view the map using QGIS. However, at the time of using the add spatialite table option I am getting an error: > Failure while connecting .sqlite file - seems to be a valid SQLite DB, but > not a SpatiaLite one ...


title: Arcpy adds erroneous interior ring when writing adjacent, multipart geometry

text: I've run into an odd issue when using Arcpy to write multipart geometry to a shapefile. I am using an InserCursor to create a multipart feature from a list of parts each with a list of vertex pairs. I understand that when this feature is created, adjacent multiple parts are automatically "dissolved" into a single part. But for some reason, this is creating an interior ring, even though I did not include a Null arcpy.point() in the array as is usually required to add interior rings. Here's a visualization: ![Visualization of arcpy error](http://i.stack.imgur.com/nnLX6.png) Does anyone have any idea why this is happening and/or how to overcome the issue? For reference, here's my code:               import arcpy          arcpy.CreateFeatureclass_management(r"C:\temp", "test.shp", "POLYGON")     OutputCursor = arcpy.InsertCursor(r"C:\temp\test.shp")          # List of parts, each with list of vertex pairs     ListOfParts = []     ListOfParts.append([[0,1],[1,1],[1,0],[0,0],[0,1]])     ListOfParts.append([[0,2],[1,2],[1,1],[0,1],[0,2]])     ListOfParts.append([[0,3],[1,3],[1,2],[0,2],[0,3]])     ListOfParts.append([[1,1],[2,1],[2,0],[1,0],[1,1]])     ListOfParts.append([[1,2],[2,2],[2,1],[1,1],[1,2]])     ListOfParts.append([[1,3],[2,3],[2,2],[1,2],[1,3]])     ListOfParts.append([[2,1],[3,1],[3,0],[2,0],[2,1]])     ListOfParts.append([[2,2],[3,2],[3,1],[2,1],[2,2]])     ListOfParts.append([[2,3],[3,3],[3,2],[2,2],[2,3]])          # Array of parts to be passed to newRow()     ArrayOfParts = arcpy.Array()          # Add parts to array     for Part in ListOfParts:         ArrayOfVertices = arcpy.Array()         for Vertex in Part:             ArrayOfVertices.add(arcpy.Point(Vertex[0],Vertex[1]))         ArrayOfParts.add(ArrayOfVertices)         ArrayOfVertices.removeAll()          # Output new feature     OutputFeature = OutputCursor.newRow()     OutputFeature.shape = ArrayOfParts     OutputCursor.insertRow(OutputFeature)


title: A simple geotool app example

text: I've been playing around with the GeoTools libraries, but I can only show shape files and no custom layers. Requirements are that it must use the SWTMapPane and not via the static SWTMapFrame.showFrame(). I'm looking for sample code that just creates features, say points, give it a style and show it on the pane. Load shape file:               File openFile = new File(XXX);     if (openFile != null && openFile.exists()) {         FileDataStore store = FileDataStoreFinder.getDataStore(openFile);         SimpleFeatureSource s  =  store.getFeatureSource();         Style style = Utils.createStyle(openFile, s);         FeatureLayer featureLayer = new FeatureLayer(s, style);         mapContent.addLayer(featureLayer);         getMapPane().reset();         getMapPane().redraw();     }      Now I want to add a custom layer containing features with a style, and then adding it to the mappane. Sample code I found always seem to contain deprecated code or JMapPane code.


title: Using network analyst new closest facility to calculate certain routes but not others?

text: I'm working on calculating a variety of distances between many points using network analyst using ArcGIS 10.2. Using the new closest facility option, I have 100,000 facilities and 100,000 incidents, and I want to calculate specific routes: Location 1 to Location 1, Location 2 to Location 2, etc. I don't care about calculating Location 1 to Location 3 or 4 - I only care about the distance between the corresponding locations. I'm planning on using a workaround, where I set the "facilities to find" under Analysis Settings to 100,000, and then just deleting out all of the irrelevant results once the model is finished. This would be much more efficient, though, if I could only calculate the 100,000 I care about, instead of the 10 billion it will calculate otherwise. Is there an easy way to restrict this, either by using new closest facility or some other Network Analyst capability? Thanks. The screenshot shows my (probably) flawed method that I've been trying to use in a test case I did before doing the 100,000 - when I have 5 facilities and 5 locations I ask the model to find five facilities, which gives me 25 routes, and then I delete all the irrelevant ones. ![enter image description here](http://i.stack.imgur.com/YXSs7.png)


title: How to Add Field Between Two Existing Field in Shapefile

text: Can you please let me know if it is possible to add a new Field between two existing field using ArcPy? For Example if I have "Name", "Area", fiels already in my shapefile can I add a new field called "Scope" between these two? so the table looks like "Name","Scope", "Area" Thanks


title: Can anyone explain me the TSP pgRouting function?

text: I have no problems using Dijkstra or A* functions, but when I try to run TSP, I really don't know where to start. What I'm, trying is to get the 'best route' to link four points (typical TSP problem), but I do not know how to implement this. According the documentation:               SELECT seq, id1, id2, round(cost::numeric, 2) AS cost     FROM pgr_tsp('SELECT id, x, y FROM vertex_table ORDER BY id', 6, 5);      My questions are:   1. What means "cost::numeric" and specially "::"? I have seen it before, but still don't know what it is.   2. Should I have another table with the points with x and y fields? Because if tsp refers to a "vertex table" that I supose will be the point table, where is the edge table (e.g streets) that I queried with Dijkstra?   3. And what means that 5 and 6? Sorry if this a strange question, but I'm trying to run this function but I can't do it, and I don't find any documentation but the official docs, (that I don't understand).


title: How do I set relative paths for KMZs?

text: This is an Arc2Earth question - I'm converting a large vector dataset to a KML with regions. The resulting kmz works great on my computer but the files paths are all actual paths and not relative, so they don't work on other computers or the server. I would really prefer not to edit all of the resulting KML files, so I'm hoping somebody could help me figure out how to set a relative paths in the Arc2Earth dialogue box. Thanks!


title: How to compare multiple spatial point patterns over a polygon

text: I have multiple point pattern distributions over the same region/polygon. Each point pattern distribution has different number of points. Here is an example of two spatial point patterns for the region/polygon, the first one covers the polygon, while in the second not all of the polygon area is covered by the point pattern. ![enter image description here](http://i.stack.imgur.com/CvqcG.png) How can I compare the distributions within a polygon? I prefer a solution for this problem in R.


title: ArcPad APL - enforcing unique values

text: At my work we use ArcPad to collect inspection point data. One of the fields is SITEID that is manually entered by a staff member (its a combination of their initials and a number (eg ST01). I would like to add an event handler (I'm using OnChange in my code) to my APL file that checks if the SITEID already exists. Im finding it very difficult to debug in ArcStudio so any help would be greatly appreciated! Below is my APL file               <?xml version="1.0" encoding="UTF-8"?>         <ArcPad>     <LAYER name="SoilSurvey_InspectionSitesSimple_UTM10N" transparency="1">         <FORMS>             <EDITFORM name="EDITFORM" caption="Soil Inspection Sites" width="160" height="150" color="Blue" picturepagevisible="true" attributespagevisible="true" symbologypagevisible="true" geographypagevisible="true" required="false">                 <PAGE name="SiteDetails" caption="Site Details">                     <LABEL name="slblSiteID" x="3" y="3" width="35" height="10" caption="Site ID" tooltip="" group="true" border="false"/>                     <LABEL name="slblDate" x="3" y="18" width="35" height="10" caption="Date" tooltip="" group="true" border="false"/>                     <EDIT name="txtSiteID" x="45" y="1" width="75" height="12" defaultvalue="" **onchange="Call CheckSITEID"** tooltip="" tabstop="true" border="true" required="true" field="SITEID" uppercase="true" multiline="true"/>                     <DATETIME name="dtDate" x="45" y="17" width="75" height="12" defaultvalue="Now ()" tooltip="" tabstop="true" border="true" field="DATE_"/>                     <LABEL name="slblComments" x="3" y="35" width="35" height="10" caption="Comments" tooltip="" group="true" border="false"/>                     <EDIT name="txtComments" x="3" y="48" width="100" height="50" defaultvalue="" tooltip="" tabstop="true" border="true" field="Comments" uppercase="true" multiline="true"/>                 </PAGE>             </EDITFORM>         </FORMS>         <SYMBOLOGY>             <SIMPLELABELRENDERER visible="false" field="" rotationfield="" expression="" language="">                 <TEXTSYMBOL fontcolor="Black" font="Arial" fontsize="8" vertalignment="bottom" rtl="false" fontstyle="regular"/>             </SIMPLELABELRENDERER>             <SIMPLERENDERER>                 <SIMPLEMARKERSYMBOL color="76,230,0" width="3" outlinewidth="1"/>             </SIMPLERENDERER>         </SYMBOLOGY>         <METADATA/>         <QUERY where=""/>         <FIELDHISTORY>             <FIELDS>                 <FIELD name="X"/>                 <FIELD name="Y"/>                 <FIELD name="SITEID" value="3"/>                 <FIELD name="Z"/>                 <FIELD name="DATE_"/>                 <FIELD name="ID"/>                 <FIELD name="Comments" value=""/>             </FIELDS>         </FIELDHISTORY>         </LAYER>          <SCRIPT language="VBScript">         Sub CheckSITEID         Dim objEditForm, InputSite, ExistingRec         Set  InputSite = ThisEvent.Object.Value          Dim objRS         Set objRS = Map.Selectionlayer.Records         If (objRS.RecordCount > 0) Then             objRS.Movefirst             While Not objRS.EOF                 Set ExistingRec = objRS.Fields("SITEID").Value                 If InputSite = ExistingRec Then                 ThisEvent.Result = False                 ThisEvent.MessageText  = "SITEID ALREADY EXISTS"                 End If                 objRS.MoveNext              Wend         End If         End Sub     </SCRIPT language="VBScript">     </ArcPad>


title: display 3D raster/vector in GRASS 7.0 from command line

text: I am using GRASS 7.0 on ubuntu linux 12.04 x64. I am working through some GRASS tutorials and am able to get a 3d raster to show up when I use the GUI. However, I cannot get the command line interface for the 3d raster to work. When I type `nviz ...` or `wxnviz` I get nothing. The manual only seems to clicking on the dropdown box on the displayed 2d image (generated from the command line) in order to show the 3d display. However, when I generate a 2d raster from the command line and then click on the dropdown box in the image window to make it 3d, I just get a blank screen. So the functionality works in the gui but not from the command line. Is there a way to generate a 3d display from the command line? What are the commands or what am I doing wrong? Thanks.


title: Visualizing and organizing traffic flow data for an intersection

text: I'm looking for advice on how to organize data that describes traffic flows through several unconnected intersections over several years. I'd like to learn about the most basic representation of this data, that would lend itself to future more complex analysis. In this case the traffic flow is of bicycles, so the numbers are quite low. I read through this question and all the answers. glennon provided several useful links in his answer, but I think it that such an approach is more sophisticated than required here. I'm also interested in compelling ways of showing these flows over time and would appreciate any suggestions.


title: Converting feature class with domains to SHP file

text: I have a feature class which has coded value domain associated with it. The code and the description are different. For example, I have coded value domain for pipe diameter. For pipe diameter of 8" I have assigned coded value 1. Now, when I convert the feature class to shapefile I understand that it assigns the coded value not the description. I know that I can convert those values using field calculator but I have 20 coded values. It will take considerable amount of time to do this operation. Is there a script/tool that I can use which can assign description not the coded value for that attribute column when converting from FC to SHP? Thank you in advance.


title: Finding Nearest Feature Methods VB ArcObjects

text: Greetings, I have: (a) point feature class (b) polyline feature class I am trying to loop through the (a) point feature class to find the nearest feature from the (b) polyline feature class. Just as a start to more complex command, I'd like to find and select the nearest (b) polyline, and create a message box that tells me its ObjectID, just so I know that the method for finding the nearest line is working. I've come across 2 options, both of which I'm having issues with. (1) The **IIndexQuery.NearestFeature** method, which I could use in combination with the **IFeature.GetFeature** method to select the polyline feature of interest. I've successfully entered the parameters (I think), but the NearestFeature method returns a "-1" for each of the features FIDs. Maybe this is because my features have an 'ObjectID' field, but no 'FID' field, though, I tried the same code with a polyline feature that did have an FID field, and it still gave me -1's across the board. Could anybody speak to this? (2) The **IHitTest.HitTest** method, which returns a segment index of the nearest feature. The problem here is that I'm looking for a value in a field for the whole line, not just a segment of the line. Is there a way to return the whole feature from the segment index? Any other suggestions on finding the nearest line from a given point? I couldn't figure out how to get the coloring right on the code below... Thanks so much, DR               Private Sub NHD_Prep_Click()          'Set general variables            Dim pMxDoc As IMxDocument     Set pMxDoc = ThisDocument     Dim pMap As IMap     Set pMap = pMxDoc.FocusMap          'Set variables for the line layer of interest          Dim pNhdLayer As ILayer     Set pNhdLayer = pMap.Layer(0)     Dim pNhdFLayer As IFeatureLayer     Set pNhdFLayer = pNhdLayer     Dim pNhdFClass As IFeatureClass     Set pNhdFClass = pNhdFLayer.FeatureClass     Dim pNhdFeatureIndex As IFeatureIndex     Set pNhdFeatureIndex = New FeatureIndex     Set pNhdFeatureIndex.FeatureClass = pNhdFClass     Dim pNhdIndexQuery As IIndexQuery2     Set pNhdIndexQuery = pNhdFeatureIndex          'Set variables for the point layer of interest          Dim pLayer As ILayer     Set pLayer = pMap.Layer(1)     Dim pFLayer As IFeatureLayer     Set pFLayer = pLayer     Dim pFClass As IFeatureClass     Set pFClass = pFLayer.FeatureClass          'Set number variables          Dim nearReachFID As Long     Dim distance As Double     Dim strReach As String     Dim dblmeas As Double          'Check to make sure the layer of interest is on top          If pMxDoc.FocusMap.Layer(0).Name <> "NHD Flowline" Then         MsgBox "Please place NHD Flowline on the top spot of the TOC..."         Exit Sub     End If          'Start Cursor on point layer features          Dim pFCursor As IFeatureCursor     Set pFCursor = pFClass.Search(Nothing, True)     Dim pFeature As IFeature     Set pFeature = pFCursor.NextFeature          Do Until pFeature Is Nothing              'Use nearest point method to find the line FID and distance to it              Dim pPointFeature As IPoint         Set pPointFeature = pFeature.Shape              pNhdIndexQuery.NearestFeature pPointFeature, nearReachFID, distance              MsgBox "This is the " & pFeature.Value(pFeature.Fields.FindField("Name")) & " feature. " _         & "The distance from this point to the nearest line, " & nearReachFID & ", is " & distance              Set pFeature = pFCursor.NextFeature     Loop      End Sub


title: How to project vector data in QGIS 2.2?

text: I'm running QGIS 2.2 on Ubuntu 14.04. Trying to project data gives me a hard time right now. The last time I did that was in 2.0 and I basically changed the projection by saving the data as a new file with a certain layer CRS and opening it in another QGIS project. That doesn't work right now, even when on-the-fly transformation is disabled in the project properties. I've been trying project some vector data with WGS 84 geographical coordinates on WGS 84 UTM 32 N (Germany) but see no results from changes I make in the project or the layer properties. Thank you for your help.


title: Open source location allocation modelling

text: I'm looking for open source tools for location allocation modelling (eg planning public health facilities). Preferably in a GIS environment. I know GRASS somewhat, but v.net.alloc doesn't seem to take account of demand. I don't know if SAGA or Sextante have something? Thanks!


title: Overlay is blurry on Google Maps base layer but not OpenStreetMap with OpenLayers

text: As the title says, my layers will show up blurry on top of any of the Google Maps base layers, but not on top of OpenStreetMap. I am using OpenLayers 2.12. See the screenshots attached below: ![GMAPS](http://i.stack.imgur.com/q0wqA.png) ![OSM](http://i.stack.imgur.com/iFokL.png)


title: Giant 2.5 GB JP2 image: How to tile it?

text: I have a single 2.5 GB JP2 image of a city that I need to split into tiles, which I'll then process to create flight simulation scenery. Google as I might, I can't find the solution. The JP2 apparently has GIS XML data embedded, which doesn't affect me either way, since I don't need it. All I'm trying to do is break the image down into x-number of preferably 2048 x 2048 tiles. A utility to do this in either OSX or Win7 would be great. Ideas? Thanks!


title: Trying to view large shapefiles

text: Is there a way of viewing only a part of a shapefile in ArcGIS 10? At the moment if I try to add it the software crashes? Any help appreciated.


title: CAD Like functions in QGIS

text: Is it possible for a script to be built that will use a reference point and have it draw several polygons based on distance and bearing, then assess the terrain under the polygon for highest obstacles or terrain? I know there is a gent on github that has the formulas built to identify the locations, I need to extend that capability by assessing underlying terrain.


title: OpenLayers removeControl() strange behaviour

text: I have a startEditing() function:               function startEditing(){                 colorPoly = document.getElementById('color_picker_'+shapeId).value;                  var shapeStyle = {                 strokeOpacity: 1,                 strokeWidth: 1,                 fillColor: colorPoly,                 fillOpacity: 0.45,             }                  var shapeStyle2 = {                 strokeOpacity: 1,                 strokeWidth: 1,                 fillColor: colorPoly,                 fillOpacity: 0.45,                 pointRadius: 5,             }                  var styleMap = new OpenLayers.StyleMap({                 "default": shapeStyle,                 "temporary": shapeStyle,                 "select": shapeStyle,                 "vertex": shapeStyle2             }, {extendDefault: false});                      var newShape = new OpenLayers.Layer.Vector( "Editable",{                     styleMap: styleMap                 });                      newShape.events.register("sketchcomplete", newShape, function(){                     map.addLayer(newShape);                     newShape.id = shapeId;                     createdShapes.push(newShape);                     alert(createdShapes.length)                 });                      editingToolBar = new OpenLayers.Control.Panel({                     displayClass: 'customEditingToolbar',                     allowDepress: true                 });                      var draw = new OpenLayers.Control.DrawFeature(                 newShape, OpenLayers.Handler.Polygon,                 {                     title: "Draw Feature",                     displayClass: "olControlDrawFeaturePolygon",                     multi: true                 });                      var edit = new OpenLayers.Control.ModifyFeature(newShape,                 {                     title: "Modify Feature",                     displayClass: "olControlModifyFeature",                     vertexRenderIntent: "vertex"                 });                      editingToolBar.addControls([edit, draw]);                 map.addControl(editingToolBar);     }      and I have a stopEditing() function:               function stopEditing(){         map.removeControl(editingToolBar);     }      When I call stopEditing(), the EditingToolBar disappears from the map. However, the cursor can still draw new features. map.removeControl(editingToolBar); doesn't stop the control, it just makes the icon disappear. How to disable the editingToolBar controls and bring back the default pan cursor? More, when I call startEditing() a second time after stopEditing(), the editingToolBar does not appear but the cursor can still draw.


title: ArcObjects (ArcGIS for Desktop and C#): How to cast between the ArcMap COM UI and my custom .Net UserControl objects?

text: I'm creating a utility to run in ArcGIS for Desktop using ArcObjects (9.3.1 SDK) and C#.Net. My prototype involves a toolbar with two comboboxes and a tool. The first combo selects a layer in the TOC, and the second selects a field from the selected layer. The tool will be used to interact with the map. Basically I want to select a layer, select a valid field, then click a feature in the map and get its value for the chosen field. Here's an image of the toolbar, if it helps: ![enter image description here](http://i.stack.imgur.com/zkIlx.png) **[question almost entirely re-worded from here down]** The problem I am having is passing state between the native COM UI parts and my custom .Net controls. For example, I want to catch the DropDownClosed event on the Layer combobox, assemble a valid list of columns relative to that layer, then apply the list of field names (via IFields) to the Fields combobox. After applying some the initial comments by RagiYaserBurham and blah238, and merging them with details from this page, the following DropDownClosed event handler does go from the combobox back to the toolbar (ICommandBar), but I don't understand how to cast from ICommandItem back to my implementation of the Fields combobox in a UserControl:               private void layerSelectCBO_DropDownClosed(object sender, EventArgs e)     {         _completionNotify.SetComplete();              string layerName = (sender as ComboBox).SelectedItem as string;              // These two lines are a combination of initial commenter suggestions.         ICommandItem toolbar = _iApp.Document.CommandBars.Find("ArcProject.UI.AngryToolbar", false, false);         ICommandItem fieldsItem = (toolbar as ICommandBar).Find("ArcProject.UI.FieldSelectUC", false);          }      So.. now that I'm here.. how do I cast fieldsItem to FieldSelectUC ? [ **The Solution** ] As blah238 suggested, I tried casting ICommandItem.Command to my custom UserControl implementation and that did the trick. First, I had to add a public accessor to my `FieldSelectUC` UserControl to return a reference to its ComboBox; that simple accessor looks like this:               // fieldSelectCBO is the name of the combobox control in the design view..     public ComboBox FieldsComboBox { get { return fieldSelectCBO; } }      With that modification in place, here's a DropDownClosed event handler that will populate the Fields combobox with all the fields of the selected layer:               private void layerSelectCBO_DropDownClosed(object sender, EventArgs e)     {         _completionNotify.SetComplete();              string layerName = (sender as ComboBox).SelectedItem as string;              // get the toolbar..         ICommandItem toolbar = _iApp.Document.CommandBars.Find("ArcProject.UI.AngryToolbar", false, false);              // get my fields combo by way of CommandItem.Command..         ICommandItem fieldsCI = (toolbar as ICommandBar).Find("ArcProject.UI.FieldSelectUC", false);         FieldSelectUC fieldsUC = fieldsCI.Command as FieldSelectUC;         ComboBox fieldsComboBox = fieldsUC.FieldsComboBox;              // get the fields for the selected layer..         IFields fields = null;         int layerCount = _iDoc.FocusMap.LayerCount;         int i;         for (i = 0; i < layerCount; i++)         {             if (_iDoc.FocusMap.get_Layer(i).Name == layerName)             {                 if (_iDoc.FocusMap.get_Layer(i) is FeatureLayer)                 {                     fields = (_iDoc.FocusMap.get_Layer(i) as FeatureLayer).FeatureClass.Fields;                 }             }         }              // Build a list of field names for the combobox items..         List<string> fieldNameList = new List<string>();         if (fields != null)         {             int fieldCount = fields.FieldCount;             int j;             for (j = 0; j < fieldCount; j++)             {                 string oneFieldName = fields.get_Field(j).Name;                 fieldNameList.Add(oneFieldName);             }         }              // Populate the combobox items..           if (fieldNameList.Count > 0)         {             fieldsComboBox.Items.Clear();                  foreach (string fieldName in fieldNameList)             {                 fieldsComboBox.Items.Add(fieldName);             }                  fieldsComboBox.SelectedItem = fieldsComboBox.Items[0];         }         else         {             fieldsComboBox.Items.Add("Error: No fields!");         }     }      This is still a dirty testbed (hence AngryToolbar). But the solution shows how to start from an extended UserControl that implements ICommand and IToolControl and drill back down to a .Net component. I really appreciate the assistance of everyone who offered suggestions. Thanks so much. :)


title: parallelization of raster mosaic

text: I would like to create a raster mosaic of the national USGS NED 30m DEM (~50 GB). I'd like to leverage parallel processing using python `multiprocessing` module where possible. I'm using ArcGIS 10.0. My first approach was divide and conquer - mosaic 2-10 at a time and then mosaic the result. **Q)** What is the best method for mosaic parallization? Examples? EDIT: the original two-part question was split into two questions. The other is here.


title: Openlayers - Vertex style in Control.ModifyFeature

text: I want a custom vertex and polygon style for the Control.ModifyFeature. I want to keep the default fillColor of the polygon while editing it, not the blue. I thought this code will work but the blue is still there.                   var shapeStyle = {             strokeOpacity: 1,             strokeWidth: 1,             fillColor: colorPoly,             fillOpacity: 0.45,         }              var shapeStyle2 = {             strokeOpacity: 1,             strokeWidth: 1,             fillColor: colorPoly,             fillOpacity: 0.45,             pointRadius: 3,         }              var styleMap = new OpenLayers.StyleMap({                "default": shapeStyle,                 "vertex": shapeStyle2         }, {extendDefault: false});              var newShape = new OpenLayers.Layer.Vector( "Editable",{                 styleMap: styleMap          });              var edit = new OpenLayers.Control.ModifyFeature(newShape,              {                 title: "Modify Feature",                 displayClass: "olControlModifyFeature",                 styleMap: "default",                 vertexRenderIntent: "vertex"         });      colorPoly is the variable containing the #color_code.


title: How to update a QGIS plugin for new version (2.2)?

text: The updates to QGIS 2.2 have been fantastic and I'm really liking the improvements to the interface, features and performance. However, it seems that some plugins have not survived the upgrade. cartogram-plugin is one such example, about which there is already a question on this site. My question is not where it has gone, but how I can help get it working again. The latest version of it is, I believe, on GitHub, meaning that a collaborative effort should be able to get it running on QGIS 2.2 is possible. I am up for giving this a try but would like some advice from the community before I start. Where's the best place to start? There seems to be plenty of advice for people wanting to create _new_ plugins - like the PyPGIS Developer Cookbook and the Plugin Builder plugin. But what about info for people like me who want to upgrade an existing plugin? Sure there is much work to be done in this area, so the answer may be of use beyond cartogram-plugin. To some extent the question depends on the differences between QGIS 1.x and 2.x. Does that mean this is a good place to start? http://qgis.org/api/2.0/classQgisInterface.html Many thanks, Robin


title: Calculations from Feature Server and display values

text: Using the ESRI JS API I would like to apply some basic math based on the Shape.area of a feature and then return that calculation to the web-page. I can't see any reference to something even remotely similar to this on the ESRI API Reference page, so I am thinking that this will have to be done entirely using DOJO or DIJIT. Can somebody please just nudge me in the correct direction.


title: How to control how points are displayed across different programs

text: I'm completely new to GIS, but I'm trying to control how Points are displayed (shape, color, size, etc) across different programs (ArcGis, qGis, etc). Is there a way to control the rendering of Points in a shapefile consistently in different GIS programs?


title: Converting WMS getmap request to Geotiff

text: I'm accessing a WMS server that doesn't provide geotiff as one of the format capabilities, but does provide PNG and KMZ. http://tds.marine.rutgers.edu:8081/ncWMS/wms?SERVICE=WMS&REQUEST=GetCapabilities&VERSION=1.3.0 I'm thinking that it should be possible to write a little shell script that would either:   1. Request KMZ and convert that to geotiff, using the implied SRS and bounding box info    2. Request PNG and use the WMS query bounding box and SRS to create the geotiff, perhaps using gdal or similar Has anyone done something like this, or is there a better way? Thanks, Rich


title: arcpy 10.0 iterate through shapefile1 clip shapefile2 to shapefile1's polygons

text: I know that this question has been answered several times before, but for some reason I cant get this script to run...So I was hoping someone could point out where Im going wrong. I have 2 shapefiles, shapefile1 has polygon boundaries and shapefile2 has a single polygon that overlaps the firsts polygonal boundaries. I would like to clip shapefile2 according to each polygon of shapefile1. I have seen several sites and examples, but for some reason I must be overlooking a detail in getting this to work Some of the examples ived seen are: How to Batch Clip in ArcGIS Desktop 10 using Python/ArcPy? Batch clip feature class to preserve area field Clipping buffers to census tracts               import arcpy          arcpy.env.workspace = "path\\to\\workspace\\MaintenanceDivisions"     arcpy.env.overwriteOutput=True          #variables     md = "MaintenanceDivisions.shp"     out = arcpy.CreateUniqueName( "clipped.shp" )      mfp = "dissolved.shp"     try:         #clip polygons from selected area         rows = arcpy.SearchCursor(md)         row = rows.next()         for row in rows:             feat = row.Shape             arcpy.Clip_analysis([mfpd], feat, out, "")             row = rows.next()          except arcpy.ExecuteError as e:         print(e)          del rows      Thanks for your help.


title: polygon from exterior points

text: How to convert points data to polygon, ![enter image description here](http://i.stack.imgur.com/qygAy.png) so as to form polygon from exterior point as shown above


title: How can I Setup Python to recognize QGIS

text: I want to use QGIS and work with Python out of the console, but I'm having troubles letting the system recognize the paths of some DLLs. Since I couldn't find a good answer on the web, I wonder if I did something wrong. I'm working with Windows 7 64 bit version, using Python 2.7 and QGIS 1.8. In the system environment, I've created and pointed the variable PYTHONPATH to the python directory (which in my case is "C:\Quantum_GIS_Lisboa\apps\qgis\python"). Then I've modified the "Path" variable adding the address where "qgis_core" and "qgis_gui" are found (in my case "C:\Quantum_GIS_Lisboa\apps\qgis\bin"). The instructions I've followed are those of the "PyQGIS Developer Cookbook" ("http://www.qgis.org/pyqgis-cookbook"). It seems the problem relies in recognizing the DLLs, which are in the folder I've pointed to for the variable "Path". Here is the error I have in the Shell when I try to import the module "qgis.core":               Traceback (most recent call last):       File "<pyshell#0>", line 1, in <module>          import qgis.core     ImportError: DLL load failed: Impossibile trovare il modulo specificato.      Moreover, if I import the sys module and print the path to see what's there, I'm not finding what I expect:               >>> import sys     >>> print sys.path     ['C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\ArcGIS\\Python 2.7', 'C:\\Python27\\ArcGIS10.1\\Lib\\idlelib', 'C:\\Quantum_GIS_Lisboa\\apps\\qgis\\python', 'C:\\Windows\\system32\\python27.zip', 'C:\\Python27\\ArcGIS10.1\\DLLs', 'C:\\Python27\\ArcGIS10.1\\lib', 'C:\\Python27\\ArcGIS10.1\\lib\\plat-win', 'C:\\Python27\\ArcGIS10.1\\lib\\lib-tk', 'C:\\Python27\\ArcGIS10.1', 'C:\\Python27\\ArcGIS10.1\\lib\\site-packages', 'C:\\Program Files (x86)\\ArcGIS\\Desktop10.1\\bin', 'C:\\Program Files (x86)\\ArcGIS\\Desktop10.1\\arcpy', 'C:\\Program Files (x86)\\ArcGIS\\Desktop10.1\\ArcToolbox\\Scripts', 'C:\\Python27\\ArcGIS10.1\\lib\\site-packages\\win32', 'C:\\Python27\\ArcGIS10.1\\lib\\site-packages\\win32\\lib', 'C:\\Python27\\ArcGIS10.1\\lib\\site-packages\\Pythonwin']      Hope someone could help me solving this, I'd be really thankful! I've just tried to copy and paste the whole content of Python27 folder within the main "Quantum GIS Lisboa" folder in the Python27 main folder in my hard drive C, since I saw ArcGIS and Python were working fine like that. Then I tried to launch the IDLE found in "lib/idlelib" ("idle.pyw") from the new folder but this didn't solve the problem. Everything seems to point to the right folders in the system environment. Here is the print of the sys.path after the "reverse" trick:               ['C:\\Quantum_GIS_Lisboa\\apps\\qgis\\bin', 'C:\\Quantum_GIS_Lisboa\\apps\\qgis\\python', 'C:\\Python27\\ArcGIS10.1\\lib\\site-packages\\Pythonwin', 'C:\\Python27\\ArcGIS10.1\\lib\\site-packages\\win32\\lib',     'C:\\Python27\\ArcGIS10.1\\lib\\site-packages\\win32', 'C:\\Program Files (x86)\\ArcGIS\\Desktop10.1\\ArcToolbox\\Scripts', 'C:\\Program Files (x86)\\ArcGIS\\Desktop10.1\\arcpy', 'C:\\Program Files (x86)\\ArcGIS\\Desktop10.1\\bin', 'C:\\Python27\\ArcGIS10.1\\lib\\site-packages', 'C:\\Python27\\ArcGIS10.1',      'C:\\Python27\\ArcGIS10.1\\lib\\lib-tk', 'C:\\Python27\\ArcGIS10.1\\lib\\plat-win', 'C:\\Python27\\ArcGIS10.1\\lib', 'C:\\Python27\\ArcGIS10.1\\DLLs', 'C:\\Windows\\system32\\python27.zip', 'C:\\Quantum_GIS_Lisboa\\apps\\qgis\\bin', 'C:\\Quantum_GIS_Lisboa\\apps\\qgis\\python', 'C:\\Python27\\ArcGIS10.1\\Lib\\idlelib', 'C:\\Users\\Umberto\\Desktop']          Traceback (most recent call last):       File "C:\Users\Umberto\Desktop\set_qgis_01.py", line 5, in <module>         import qgis.core     ImportError: DLL load failed: Impossibile trovare il modulo specificato.      Am I suppose to point to the Quantum GIS main folder as well as it contains a folder named "lib"?


title: Delete Records from Feature Layer using ArcGIS API for JavaScript?

text: I am trying to delete some records from a feature layer, but I kept getting the error of invalid parameters from the errback. Below is my code:               function deleteRecords()     {     var incidentId = 2;     var queryTaskDeleteRecords= new esri.tasks.QueryTask(FEATURE_SERVER+"/"+LAYER_V_RECORDS);     var queryDeleteRecords = new esri.tasks.Query();     queryDeleteRecords.outSpatialReference = map.spatialReference;      queryDeleteRecords.returnGeometry = true;     queryDeleteRecords.outFields = ["*"];     queryDeleteRecords.where = FIELD_V_RECORDS_INCIDENTID + " = " + incidentId ;      queryTaskDeleteRecords.execute(queryValveRec,deleteRecordsResults);           }          function deleteRecordsResults(results)     {              var featureLayer= new esri.layers.FeatureLayer( FEATURE_SERVER+"/"+LAYER_V_RECORDS,{             outFields:["*"]         });              for (var i = 0; i < results.features.length; i++)         {              featureLayer.applyEdits(null, null, [results.features[i]], function onComplete(adds, updates, deletes)         {              if (deletes.length > 0)              {                 alert("deletes : " + JSON.stringify(deletes));              }         },         function errCallback(err)         {             alert(err);         });              }          }      Is there sometime wrong with the querying of features and passing the features in one by one to applyEdits for deleting?


title: PostGIS intersect on insert?

text: I have a large amount of point data that I have in CSV form. I am able to insert it all into a PostGIS table no problem. What I want to do though, is split the data up on insert into multiple separate tables. The data is statewide and I would like to have separate tables for each county within the state. I know I could insert all of the points into a temp table and then INSERT INTO each county based on an ST_Intersect() but is there a better way of doing this? Some sort of trigger function that will run faster? Or is there a way to use a CONSTRAINT on each table where anything within/not within a certain polygon is rejected? Edit: Sorry for the change but we ended up changing how we wanted to store the data: One table for our county of interest and another for the rest of the data because we occasionally need it. The other answers were not quite what we were looking for, we really wanted to avoid temp tables and adding fields and I did come up with a solution for it.


title: How can I use CQL in WFS layers in openlayers

text: I've tried a lot of times to use the OpenLayers CQL example but nothing changes. Is there any way to use CQL or filter.


title: Recipes on OpenGeo Suite

text: could someone tell me how to add a recipe in OpenGeo Suite please. I would like to submit a Tree sub-layer in a geoexplorer map. Thanks Filippo


title: Mouse click event used gis application with much data

text: I will create an application that using my water pipes, electric cables, gas pipes service in a city. All of streets and roads including water pipes. My service is publishing pipes. My service like following. Pipe Service   * domain.com/arcgis/rest/services/Water/MapServer   * domain.com/arcgis/rest/services/Electric/MapServer   * domain.com/arcgis/rest/services/Gas/MapServer Feature Layers   * Pipe Lines (Polyline): domain.com/arcgis/rest/services/Water/MapServer/0   * Water Valves (Point): domain.com/arcgis/rest/services/Water/MapServer/1 I wanna show pipes on map and users can click on pipes and get features about pipe. Which way can be make sense for this solution? I think use FeatureLayers on map and on click method. How does it affect the performance. If I use ArcgisDynamicMapServiceLayer, I can not click pipes.


title: Efficient manner to buffer streams with multiple attributes?

text: I need to buffer a very large, complex hydro vector layer based on different water quality designations and surrounding slope. Different water quality classifications have different buffer requirements based on slope. For instance, a designated trout stream classification will be buffered 66' if the surrounding slope is between 6-10%, but if the stream is classified as public water supply and the surrounding slope is also 6-10% it will need to be buffered 100'. I created a field in the hydro layer with the max buffer distance required for each classification to run a buffer analysis based on the distance field. Then my thoughts are to use this as a mask for a the Euclidean Distance tool and my slope raster, which I can use conditional statements in Raster Calc to return specified distances based on slope. I feel like there may be an easier way, (vector methods?) or at the least, what would be an efficient statement to use? I am using ArcGIS 10.1. Much thanks for any guidance.


title: ShapeFile or feature class to json

text: Is there any online or desktop based tool that can convert shapefile or feature class to json and not Geojson.Is there any tool in arcgis desktop to convert shapefile or featureclass into json.


title: How to join a File Geodatabase table with only one record of Feature Class

text: I've a Geodatabase containing a Featureclass and some File Geodatabase Tables. Each File Geodatabase Table is actully about the only one record of a featurClass. Can We Join these File Geodatabase Tables with that of the records of FeatureClass respectively. In short, I want to join a complete table not with another table but with only one row of the other table. Is it possible? If yes, how?


title: Interpolation of data

text: I'm new with the program and I want to know if I can use it for my master thesis so I was trying it out and have the following question: Is it possible to interpolate data out of 5 weather stations (the data is handed in an excel spreadsheet format) to make weather maps of a whole state more accurate? Can anyone give me a hint how to start? Thanks in advance!


title: arcpy: get list of adjacent lines per line

text: I am working with polylines with hundreds of thousands of features, and would like to write a script that returns the OIDs of all lines adjacent (intersecting with) each line. I have been experimenting with the Geometry object and the shp.touches() method, but it seems as though a cursor with a nested cursor on the same feature is the only way to use it, and this takes much too long. The main goal is to perform an "Eliminate" task on a polyline, where short lines are merged to adjacent longer lines that share some unique ID. Collecting information in a dictionary has always been my technique of choice because of its speed, but dealing with geometries complicates this significantly. Unfortunately, Eliminate only works on polygons, and is quite slow itself. I have already tried to record shape geometries in a dictionary (`dict[row.OBJECTID] = [row.Shape_Length, row.Shape, row.uniqueID]`) and attempted a nested iteration, but the geometry objects don't seem to be interacting in the same way they do within a cursor iteration (shp.touches() doesn't work). Has anyone come across any techniques I could use for this problem?


title: How Can I Clip a Basemap with an ascii file?

text: I'm new here but with many doubts.I work with ArcGIS 10 and I add a basemap layer from the ArcGIS online but I just want the continent coverage to my map,and the area that I wanted I have an ascii file,like a grid.So how can I cut of the ocean part?Is it the "Clip" function the better option?Is there a script for python for this? If someone had a answer please I'll be very grateful. Thanks. Nara


title: Openlayers/Proj4js not transforming coordinates the first time

text: Something seems to be going wrong with my transformations. Before I added proj4js, transforming a coordinate went fine:               new OpenLayers.LonLat(-1.0, 52.0).transform(new OpenLayers.Projection('EPSG:4326'), new OpenLayers.Projection('EPSG:900913'))      results in proper google-coordinates:               lon: -111319.49077778     lat: 6800125.4534507      This properly set the center of my map somewhere in Europe. After adding proj4js to my project, suddenly the center of the map shifted to Africa (close to 0,0). After setting a breakpoint, I could see what happened. The resulting coordinates of the statement at the start of this question yieled this result:               lon: -1     lat: 52      So no transformation whatsoever has taken place! However, if I would execute the same statement again, still at the same breakpoint, it would start giving the right result again:               lon: -111319.49079327356     lat: 6800125.454397307      What is going on here? Do I need to initialise something before I can use proj4js properly? These are my script includes:               <script type="text/javascript" src="/OpenLayers-2.10/OpenLayers.js"></script>     <script type="text/javascript" src="/Scripts/proj4js/proj4js.js"></script>


title: "Extract by Mask" changing raster pixel values...or not?

text: I am using ArcMap 10.0 and am confused by my Extract by Mask output rasters. I hope to eliminate the black background from three Landsat ER Mapper images so that I can mosaic them. Originally I attempted to do this using the Clip function in the Raster Processing submenu, but saw via the Pixel Inspector that it was changing the raster pixel values. I then decided to use the Extract by Mask feature in Spatial Analyst, using rasters created from the original images themselves as the masks, and changing the Environment settings beforehand to use the mask raster as the Snap Raster and the output extent, and the original raster as the cell size. When the Extract to Mask is completed and the extracted raster is added to the map, I see in the TOC on the left that the minimum value is changed. Further inspection reveals that the raster histogram is in fact altered. However, when I compare the original and extracted rasters using the Pixel Inspector I see absolutely no difference, which Raster Calculator confirms when I subtract the original from the extracted raster. Furthermore, in the Attribute Table when I select the rows of the extracted raster that are below the minimum in the original raster (have no count) and find them in the map, I see that their values in the identical original and extracted raster are indeed below the minimum (see image). ![Example](http://i.imgur.com/hdcfsyq.png) I am stumped. I feel as if I am fundamentally misunderstanding something. Would anyone be so kind as to explain to me what is going on?


title: ARCGIS Integration with Adobe flex Builder

text: 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


title: Not Found proxy.cgi file

text: 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)


title: Calculate file path with field calculator

text: 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!


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

text: 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


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

text: 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?


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

text: 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.


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

text: 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.


title: Are ellipsoids a mathematical necessity?

text: 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?


title: extract elevation values along a line using Google Elevation API

text: 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.


title: Create polygon from OGREnvelope

text: 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.


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

text: 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?


title: OpenStreetView or points from CSV but not both showing?

text: 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.


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

text: 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!


title: Live updating in tilemill/tilestream

text: 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?


title: PDF Output for Manifold 8

text: 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.


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

text: 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


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

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


title: How to Match Point Data in QGIS?

text: 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.


title: Looking for a .NET Dijkstra component using Shapefile

text: 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


title: Rendering raster layer from DTED based on height color map

text: 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


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

text: 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?


title: How to avoid sharp turns in PgRouting?

text: 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.


title: PostGIS uuid type not visible in QGIS or GeoServer

text: 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


title: OpenLayers and GeoExt are displaying my lines features as point features

text: 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.


title: QGIS not Printing to PDF

text: 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.


title: Attaching files to features: File server vs SDE attachment

text: 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?


title: Split vector layer by field name

text: 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.


title: Access SQL database in postgres for routing

text: 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?


title: create polylines with different colors in leaflet

text: 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.


title: get zoom levels from mapnik xml (MaxScaleDenominator and MinScaleDenominatcanor)

text: 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!


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

text: 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?


title: order layer in QGIS with pyqgis

text: 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!


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

text: 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)