title: How to get WGS84 lat lon bounds from a VRT file

text: I have vrt files generated using gdalbuildvrt that reference GeoTiffs referenced using the NZTM coordinate system. Is there an easy way to determine the bounds as WGS84 latitude longitude coordinates? I assume this should be possible with a few GDAL commands from the command line prompt? Example vrt file:               <?xml version="1.0" encoding="UTF-8"?>         <VRTDataset rasterXSize="11340" rasterYSize="8505">            <SRS>PROJCS["New Zealand Transverse Mercator 2000; NZGD 2000",GEOGCS["unknown",DATUM["unknown",SPHEROID["GRS 1980",6378137,298.2572221010002,AUTHORITY["EPSG","7019"]]],PRIMEM["Greenwich",0],UNIT[,0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",173],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",1600000],PARAMETER["false_northing",10000000],UNIT["metre",1,AUTHORITY["EPSG","9001"]]]</SRS>            <GeoTransform>1.0839978833333333e+006, 4.2333333333333298e+000, 0.0000000000000000e+000, 4.9020021166666662e+006, 0.0000000000000000e+000,-4.2333333333333298e+000</GeoTransform>            <VRTRasterBand dataType="Byte" band="1">               <HideNoDataValue>1</HideNoDataValue>               <ColorInterp>Red</ColorInterp>               <SimpleSource>                  <SourceFilename relativeToVRT="1">CF04_GeoTifv1-02.tif</SourceFilename>                  <SourceBand>1</SourceBand>                  <SourceProperties RasterXSize="5671" RasterYSize="8505" DataType="Byte" BlockXSize="5671" BlockYSize="17" />                  <SrcRect xOff="0" yOff="0" xSize="5671" ySize="8505" />                  <DstRect xOff="0" yOff="0" xSize="5671" ySize="8505" />               </SimpleSource>               <SimpleSource>                  <SourceFilename relativeToVRT="1">CF05_GeoTifv1-01.tif</SourceFilename>                  <SourceBand>1</SourceBand>                  <SourceProperties RasterXSize="5671" RasterYSize="8505" DataType="Byte" BlockXSize="5671" BlockYSize="17" />                  <SrcRect xOff="0" yOff="0" xSize="5671" ySize="8505" />                  <DstRect xOff="5669" yOff="0" xSize="5671" ySize="8505" />               </SimpleSource>            </VRTRasterBand>            <VRTRasterBand dataType="Byte" band="2">               <HideNoDataValue>1</HideNoDataValue>               <ColorInterp>Green</ColorInterp>               <SimpleSource>                  <SourceFilename relativeToVRT="1">CF04_GeoTifv1-02.tif</SourceFilename>                  <SourceBand>2</SourceBand>                  <SourceProperties RasterXSize="5671" RasterYSize="8505" DataType="Byte" BlockXSize="5671" BlockYSize="17" />                  <SrcRect xOff="0" yOff="0" xSize="5671" ySize="8505" />                  <DstRect xOff="0" yOff="0" xSize="5671" ySize="8505" />               </SimpleSource>               <SimpleSource>                  <SourceFilename relativeToVRT="1">CF05_GeoTifv1-01.tif</SourceFilename>                  <SourceBand>2</SourceBand>                  <SourceProperties RasterXSize="5671" RasterYSize="8505" DataType="Byte" BlockXSize="5671" BlockYSize="17" />                  <SrcRect xOff="0" yOff="0" xSize="5671" ySize="8505" />                  <DstRect xOff="5669" yOff="0" xSize="5671" ySize="8505" />               </SimpleSource>            </VRTRasterBand>            <VRTRasterBand dataType="Byte" band="3">               <HideNoDataValue>1</HideNoDataValue>               <ColorInterp>Blue</ColorInterp>               <SimpleSource>                  <SourceFilename relativeToVRT="1">CF04_GeoTifv1-02.tif</SourceFilename>                  <SourceBand>3</SourceBand>                  <SourceProperties RasterXSize="5671" RasterYSize="8505" DataType="Byte" BlockXSize="5671" BlockYSize="17" />                  <SrcRect xOff="0" yOff="0" xSize="5671" ySize="8505" />                  <DstRect xOff="0" yOff="0" xSize="5671" ySize="8505" />               </SimpleSource>               <SimpleSource>                  <SourceFilename relativeToVRT="1">CF05_GeoTifv1-01.tif</SourceFilename>                  <SourceBand>3</SourceBand>                  <SourceProperties RasterXSize="5671" RasterYSize="8505" DataType="Byte" BlockXSize="5671" BlockYSize="17" />                  <SrcRect xOff="0" yOff="0" xSize="5671" ySize="8505" />                  <DstRect xOff="5669" yOff="0" xSize="5671" ySize="8505" />               </SimpleSource>            </VRTRasterBand>            <VRTRasterBand dataType="Byte" band="4">               <ColorInterp>Alpha</ColorInterp>               <ComplexSource>                  <SourceFilename relativeToVRT="1">CF04_GeoTifv1-02.tif</SourceFilename>                  <SourceBand>1</SourceBand>                  <SourceProperties RasterXSize="5671" RasterYSize="8505" DataType="Byte" BlockXSize="5671" BlockYSize="17" />                  <SrcRect xOff="0" yOff="0" xSize="5671" ySize="8505" />                  <DstRect xOff="0" yOff="0" xSize="5671" ySize="8505" />                  <ScaleOffset>255</ScaleOffset>                  <ScaleRatio>0</ScaleRatio>               </ComplexSource>               <ComplexSource>                  <SourceFilename relativeToVRT="1">CF05_GeoTifv1-01.tif</SourceFilename>                  <SourceBand>1</SourceBand>                  <SourceProperties RasterXSize="5671" RasterYSize="8505" DataType="Byte" BlockXSize="5671" BlockYSize="17" />                  <SrcRect xOff="0" yOff="0" xSize="5671" ySize="8505" />                  <DstRect xOff="5669" yOff="0" xSize="5671" ySize="8505" />                  <ScaleOffset>255</ScaleOffset>                  <ScaleRatio>0</ScaleRatio>               </ComplexSource>            </VRTRasterBand>         </VRTDataset>      Any advice / pointers is greatly appreciated.


title: Get and compare area of arcpy geometry from extent object

text: I'm trying to get a numerical value for the area of a polygon that I am generating from an extent object. In this case, I am using the "onRectangle" function in the python addins for arcpy. The problem starts when using the getArea method on the polygon geometry. I have no intention of writing this polygon to disk. Ultimately, I want to be able to compare the extent of a user drawn rectangle to the dataframe extent. Here's what I've got so far.               def onRectangle(self, rectangle_geometry):         frameExtent = rectangle_geometry         XMAX = frameExtent.XMax         XMIN = frameExtent.XMin         YMAX = frameExtent.YMax         YMIN = frameExtent.YMin         pnt1 = arcpy.Point(XMIN, YMIN)         pnt2 = arcpy.Point(XMIN, YMAX)         pnt3 = arcpy.Point(XMAX, YMAX)         pnt4 = arcpy.Point(XMAX, YMIN)         print XMAX, XMIN, YMAX, YMIN         array = arcpy.Array()         array.add(pnt1)         array.add(pnt2)         array.add(pnt3)         array.add(pnt4)         array.add(pnt1)         rectPoly = arcpy.Polygon(array)         global rectArea         rectArea = rectPoly.getArea()         print str(rectArea)         return rectArea      The python window in ArcMap returns this error: `TypeError: Invalid geometry type for method.` Any pointers would be appreciated for both getting the area of the polygon and comparing it (percentage wise) to the full data extent would be appreciated. I'm using ArcGIS 10.2 advanced license.


title: qgis 1.8.0 crash when starting qthread

text: I am trying to update a vector layer attribute table using QThread. i connect a pushbutton click with a slot to start the thread: def EGSupdateAttributeTable(self): AttUpdateEGSThread = EGSUpdateAttThread(self.theLayerToEdit) AttUpdateEGSThread.start() and this is my thread class:               # -*- coding: utf-8 -*-     from PyQt4 import QtCore, QtGui     from qgis.utils import *     from qgis.core import *     from qgis.gui import *     import sys     import qgis.utils          #the update EGS Algorithme attribute table Class     class EGSUpdateAttThread(QtCore.QThread):         def __init__(self,theLayerToEdit):             QtCore.QThread.__init__(self)             self.theLayerToEdit = theLayerToEdit             self.LayerFeatureCount = self.theLayerToEdit.featureCount()         def run(self):             QtGui.QMessageBox.information(None, 'layer', str(self.LayerFeatureCount))             #self.editScenarioDlg.ui.PrbUpdateAtt.show()             provider = self.theLayerToEdit.dataProvider()             #allAttrs = provider.attributeIndexes()             Feature = QgsFeature()             allAttrs = provider.attributeIndexes()             provider.select(allAttrs)             iFloodProt = provider.fieldNameIndex("FloodProt")             indexStableClimate = provider.fieldNameIndex("StableClim")                   iUsableWat = provider.fieldNameIndex("usablewat")             iACRE = provider.fieldNameIndex("ACRES")             immwater = provider.fieldNameIndex("mmwater")             iCN = provider.fieldNameIndex("CN")             iCarbonFixe = provider.fieldNameIndex("CarbonFixe")             iDenitrific = provider.fieldNameIndex("Denitrific")             iWaterRetentionValue = self.editScenarioDlg.ui.leWaterRetValue.text().toInt()[0]             iStableClimate = self.editScenarioDlg.ui.leDollByCarbonValue.text().toInt()[0]             iUsableWater = self.editScenarioDlg.ui.leDollByNitrogenValue.text().toInt()[0]             while provider.nextFeature(Feature):                 if len(Feature.attributeMap())>0:                     #QMessageBox.information(self.drawShapeDlg, 'attributetable' ,  str(Feature.attributeMap()))                     dACREVal =  Feature.attributeMap()[iACRE].toDouble()[0]                     immwaterVal =  Feature.attributeMap()[immwater].toInt()[0]                     #QMessageBox.information(self.drawShapeDlg, 'iWaterRetentionValue' ,  str(iWaterRetentionValue))                     dCNValue = Feature.attributeMap()[iCN].toDouble()[0]                     dCarbonFixeValue =  Feature.attributeMap()[iCarbonFixe].toDouble()[0]                     dDenitrificValue = Feature.attributeMap()[iDenitrific].toDouble()[0]                     dFloodProtVal = iWaterRetentionValue * (dACREVal * 43560) * immwaterVal *  0.00328084                     dStableClim = dCarbonFixeValue * iStableClimate                     dUsableWater = dDenitrificValue * iUsableWater                          self.theLayerToEdit.changeAttributeValue(Feature.id(), iFloodProt, QVariant(dFloodProtVal) )                     self.theLayerToEdit.changeAttributeValue(Feature.id(), indexStableClimate, QVariant(dStableClim))                     self.theLayerToEdit.changeAttributeValue(Feature.id(), iUsableWat, QVariant(dUsableWater))      i cannot identify the cause of this crash


title: CQL_FILTER not liking '%' wildcards

text: I am setting up a query against a layer on my GeoServer instance. My query string can become quite complex, and some statements require using multiple '%' wildcards. For starter's here's an example: Search for Property Owner: **___ __ ___ __ ___ ____** If the user types in 'Smith', I need to find values that meet the following criteria:               CQL_FILTER=Owner ilike '%Smith%'      However, this is returning all features in my layer. In fact, when I use just one wildcard, ex. 'Smith%', I still get all features. What makes this even more difficult is when my query string becomes quite lengthy:               CQL_FILTER=Owner ilike '%Smith%' AND Address ilike '%Main%' AND Value < 100000      Reading the GeoServer docs, I see the wildcard is supported in CQL/ECQL. The syntax is very close to SQL which I have used in the past to do the very same queries. Anyone have an idea what may be causing this issue? Anyone else have much luck using wildcards in their CQL filters? Thanks in advance!


title: geospatial libraries like postgis

text: I'm pretty comfortable with postgis, but I realized that for part of my application, having a database is pretty heavy. I'd like to be able to take a stream of Point objects and check against an in memory collection of Polygon objects for intersection. With postgis, this would be accomplished with ST_Contains(). The biggest reason for moving away from a database is I need real time analysis of the Points as they come in. Right now, I collect a series of Points then do batch work on them, but I find my system struggles to keep up with the input sometimes, mostly because of the I/O associated with accessing the database rather than handling the Points in real time. I've come across GEOS, but I'm not really sure how to get started using that library. I'm on a Mac but also have access to a Windows machine if there is a C# solution out there. **EDIT** It's been wisely pointed out that it might be more beneficial to state my problem with my current setup before trying anything too radical. We collect 1,000 points per second of x,y coordinates. We map these coordinates to zones (polygons) based on which zones a point intersects with (we can have overlapping zones, and thus a point can belong to more than one zone). Once we've established which zone a point is in and which sensor reported that point, we apply our business logic to determine if any actions need to take place. My first approach was to use the database (Postgres 9.3/postgis 2.1) to check every point as I received it. So I would get a reading from a sensor, figure out which sensor sent me the reading, then figure out which zones that point was in, then apply my logic. I could check a point in about 3 miliseconds and was therefore behind the 8 ball when collecting 1,000 points/second. My next approach was to batch these zone checkings and business logic interpretations. Now, I grab whatever new data the sensors have produced (usually 5-10 points), figure out which zone each point is in in parallel using the database, then apply my business logic to all those points, again in parallel thanks to the database. Then I poll for new data and repeat. This approach seems to work well, but is a hog on the system and very fragile. I'm barely keeping up with the data. Someone on the postgresql IRC channel pointed out I'm seeing a lot of overhead writing points to my database just to pull them out miliseconds later to do calculations on those points. They suggested I look at real time steam processing, and that's what I'm trying to investigate now. I'm thinking if I can read the raw sensor data and clean it before inserting it into the database (identify which zone the point is in and which sensor sent me the reading), I can then apply my business logic in the way I currently do, I should just have more wiggle room.


title: Do you use a proven workflow to edit and document ArcGIS ModelBuilder models?

text: Do you have any reference to best practice examples , or can you share your expertise on how to keep track of edits to ModelBuilder models , track changes between model/tool versions and maintain model stability, robustness and function? I am aware of the ESRI guidance to managing, copying and naming models **here**. I would be interested if anyone has established practices, or specific expertise in the use of version tracking, archiving, editing of ModelBuilder tools that they successfully use to track model development and checking and to maintain models in a stable condition.


title: How to smoothly join two rectangles

text: I am looking for the Math and steps involved not using a tool. We have PostGIS but its an old version so we are working with the data in Python. Given three coordinates:   * -107.37, 52.46   * -103.24, 52.62   * -101.09, 53.97 I then join them to form a line. I then build buffered polygons around each line segment (20NM) - resulting in two rectangles. If there was another coordinate I would have 3 rectangles and so on. This is what the output looks like when the rectangles are assembled: ![Joined rectangles](http://imgur.com/uABkups.png) However, what I really want is to have that triangular gap - sealed up with a curve. Like this (did it by hand): ![with curve](http://i.imgur.com/dPbvLhP.png) So I have everything working just fine and dandy, but I have no idea how to properly join these rectangles so that they have a nicely fitted curve to fill in that triangular gap. Any help would be greatly appreciated. Edit: Since I am assembling the polygon data myself I can easily identify the points that need to be connected. Is there a way to join two points with a curve? Thanks!


title: OpenLayers layer mergeNewParams handle event or callback

text: I am changing the CQL filter of my WMS layer.                var layer = new OpenLayers.Layer.WMS(         "MyLayer",         "url",         { layers: "PGSA:myLayer", transparent: true },         { isBaseLayer: false }     );      When I call **ChangeCql** function, it takes a little time. So I need to show a loding message to user.               function changeCql(){         layer.mergeNewParams({'CQL_FILTER': "name = 'foo' "});     }      How can I handle the event of layer for **mergeNewParams**?


title: Point features disappear when moved using QGIS 2.0

text: When I move, either by the node or the move function, a feature symbol on the map canvas, it simply disappears, not just the label, the whole thing. CTRL-Z brings it back. I'm using a MAC OS-X. I've re-loaded QGIS 2.0 as well as GDAL to no avail -- same problem. Thanks. For instance, here's the canvas with the "Boy Scout trailhead": ![Before](http://i.stack.imgur.com/p5YhK.jpg) and after moving the trailhead symbol just a bit to the left. (Using the node tool.) ![After:](http://i.stack.imgur.com/MxaAr.jpg) The feature also disappears from the attribute table as well.


title: What's the purpose of the reference latitude in Lambert Conformal Conic?

text: Going through flight school I got acquainted with the Lambert Conformal Conic projection, as it's the common projection for VFR sectional charts, and I think I have pretty good grasp of it, geometrically. However, trying to wrap my head around the mathematics behind it I browse around on Wikipedia and on MathWorld which both more or less simply list the formulas, not really diving into the mathematics behind it. It appears to have 4 parameters:   * The two standard parallels,   * reference longitude, and reference latitude What is the purpose of the reference longitude/latitude? Do they affect the actual projection, or will they simply shift the result to let the reference coordinates result in (x,y)=(0,0)?


title: Is there an explanation of Root-Mean-Square-Error (RMSE) for Dummies available?

text: Having an all-round expertise in GIS is sometimes not enough to fully understand some concepts of GIS Science. To add to this, I am also not a mathematician. Considering this, would anyone be able to offer a child's explanation of **Root-Mean-Square-Error (RMSE)** whilst georeferencing an image onto a basemap? Having done this operation a thousand times, my only concern has been to firstly find locations in the target map which are also in the base map. Using common sense as a tool, I would usually find churches, old buildings, and similar objects which are very stable structures and would not have moved in the time difference between the basemap and the target image. After placing as many passpoints as possible, I would then look at the statistics table and either re-do passpoints with a high RMSE or delete them so that the overall RMSE score becomes as low as possible. Now I know that the rmse is a statistical error calculation, but what has always bugged me, is that sometimes I am 100% sure that the passpoints are placed very accurately on the images...eg. on a church steeple, or another stable structure which is present in both the target image and basemap, but the rmse is still high. Therefore, I would be able to change the passpoints to a location which is further away from the reference structure (ie make the visual transformation less accurate) in order to decrease the rmse! This appears to me to be a paradox, because I would be decreasing the visual accuracy of the operation in order to increase the statistical accuracy. Sometimes, I ignore the rmse completely because I can SEE that that after the georeferencing operation, the reference map and the target image line up very well...ie all the pass-points are in exactly the right place on both maps. Could anyone please offer me a better simple explaination as to whether I am doing something fundamentally wrong here?


title: 16bit grayscale raster displays all black in Geoserver

text: I have a 16-bit raster (MrSID) that I want to display in Geoserver 2.0.2 but it is displaying as all black. If I create a new style similar to the default raster.sld but with graychannel element the image displays correctly. My question: Is there a way to modify the default raster.sld so that it handles BOTH RGB and grayscale images (8 and 16-bit)? Thanks


title: Finding nearest point in SpatiaLite without GEOS

text: I want to find the nearest point having latitude and longitude stored as Point in SpatiaLite. I read this and it has this example:               SELECT feature_name, feature_class,           ST_Distance(Geometry, MakePoint(-70.250, 43.802)) AS Distance FROM XYGNIS      WHERE distance < 0.1 AND ROWID IN      (SELECT ROWID FROM SpatialIndex        WHERE f_table_name = 'XYGNIS' AND search_frame =        BuildCircleMbr(-70.250,    43.802, 0.1))      ORDER BY distance LIMIT 10      I cannot use it, however, since ST_Distance requiring compiling SpatiaLite with GEOS, which is in LGPL, which I cannot use. Is there a way I can do arithmetics to calculate distance and set that to a "variable" and then find the one with the minimal distance?


title: How to find the nearest single point?

text: I have two shapefiles containing each one set of points, set A and set B. One set is my random selection (set A), the other is a list of communities (set B). For each point of the random selection (set A) I want to find the nearest point pertaining to


title: One Polygon Joining to Database with Many matching records

text: Using ArcMap 10.1. Is this possible to have one polygon and join to a database/excel with many matching records? I would like to have 1 polygon but match to 100 corresponding records in a table. When I use the identify tool or select this polygon all 100 matching records would display?


title: How to join two polygon layers into a resulting layer with overlapping polygons merged together (including attributes)

text: I am trying to find a method (in QGIS and/or GRASS) to join two layers of polygons into a resulting layer with merged overlapping polygons. It's hard to explain in words, so I've drawn a simplified graphic ![enter image description here](http://i.stack.imgur.com/hGme9.png) Has anyone come up with a working solution for this need?


title: How can I label edges of polygons?

text: How would I label polygon features, such as Counties, by its edge in ArcMap 10.1. This is similar to what one might find in a street atlas. For instance, have there are two counties (Lamb and Castro), at the same spot I want the labels to be inside along the boundary in the respective counties. How do I create this effect?


title: Convert a List to a file list to use in an arcpy tool

text: I just can't figure out how to feed a list of files into an arcpy tool... I have                List_tif.append(os.getcwd()+"\\Stage1\\"+name+"\\GeoTif\\"+name+"_"+str(ddp.pageRow.PageName) + ".tif;")      That generates the list and then I try to feed it into arcpy               arcpy.MosaicToNewRaster_management(List_tif,os.getcwd()+"\\Stage2\\jp2", name+"_tif.jp2", "90019.prj", "", "", "3", "LAST","FIRST")      but I get an error as the tools is expecting file1.tif; file2.tif etc but is getting a List > > 'P:\2012\183_TownPlanning_Symbology\Working\Raster_Layer_Creation\Stage1\LS\GeoTif\LS_O10.png;', > 'P:\2012\183_TownPlanning_Symbology\Working\Raster_Layer_Creation\Stage1\LS\GeoTif\LS_O11.png;', > 'P:\2012\183_TownPlanning_Symbology\Working\Raster_Layer_Creation\Stage1\LS\GeoTif\LS_O12.png;', > 'P:\2012\183_TownPlanning_Symbology\Working\Raster_Layer_Creation\Stage1\LS\GeoTif\LS_O13.png;'] I tried               PNGList=string.split(List_png, ";")      but this doesn't work either. This should be simple (:- **EDIT 1:** Thanks guys...I tried the list rasters as well but it doesn't even generate the list               >>> rasters=arcpy.ListRasters('*')     >>> rasters     >>> files=arcpy.ListFiles()     >>> files     >>> import glob     >>> rasters=glob.glob('*.png')     >>> rasters     ['BA25k_A2.png', 'BA25k_A3.png', 'BA25k_A4.png', 'BA25k_A5.png', 'BA25k_A6.png', 'BA25k_A7.png', 'BA25k_A8.png', 'BA25k_B10.png', 'BA25k_B11.png', 'BA25k_B2.png', 'BA25k_B3.png', 'BA25k_B4.png', 'BA25k_B5.png', 'BA25k_B6.png', 'BA25k_B7.png', 'BA25k_B8.png', 'BA25k_B9.png', 'BA25k_C10.png', 'BA25k_C11.png', 'BA25k_C12.png', 'BA25k_C2.png', 'BA25k_C3.png', 'BA25k_C4.png', 'BA25k_C5.png', 'BA25k_C6.png', 'BA25k_C7.png', 'BA25k_C8.png', 'BA25k_C9.png', 'BA25k_D10.png', 'BA25k_D11.png', 'BA25k_D12.png', 'BA25k_D13.png', 'BA25k_D2.png', 'BA25k_D3.png', 'BA25k_D4.png', 'BA25k_D5.png', 'BA25k_D6.png']     >>>       I didn't mean to ask this specifically for the arcpy mosaic tool as passing the list of files is important for lots of other tools as well such as creating a mosaic dataset, filling a gdb etc. I also tried your vtab example               vtab = arcpy.ValueTable(1)     for tif in List_tif:         vtab.addRow(tif)          print "Generating jp2 from png tiles @"+str(datetime.datetime.now())     ##PNGList=string.split(List_png, ";")     arcpy.MosaicToNewRaster_management(vtab,os.getcwd()+"\\Stage2\\jp2", name+"_tif.jp2", "90019.prj", "", "", "3", "LAST","FIRST")      but I still get the bands error.


title: How to use model-builder iterator with a custom bit of arbitrary code?

text: How do I integrate a in-line variable from modelbuilder into a python script? Specifically, I'm using an iterator, and I'm trying to include the 'name' variable in a python script. I believe the problem is on step four, when I add it to the model as a a script (as shown here). Script code I'm trying to include looks like this:               pop_rank = 1     rows = arcpy.UpdateCursor ("path_to_dataset", "", "", "", "pop A")     for row in rows:         row.setValue("RANK", pop_rank)         pop_rank += 1         rows.updateRow(row)      Specifically, I'd like to make the "path_to_dataset" into the 'Name' variable from the iterator. I can pull the path using the 'parse path' model builder only tool, but I'm not sure how to feed that into the Python Script.


title: Use Values from Raster Statistics (e.g. sum of all cells) in Raster Calculator

text: I need to do calculations on raster layers which require the sum of all cells of the raster. I've used the zonal statistics tool for that but it gets a little annoying to do those extra steps (run the plugin, open the Attribute table, copy the sum...). Is there a way I can calculate and use the values of raster statistics directly inside a raster calculator? Even better would be to calculate those values from a raster created in the same step: > A*B*C / Sum (A*B*C)


title: Click to Openlayers shows blank pop up - All Formats for Images Works

text: I am totally new to GeoServer and all this WebServer stuff, so please understand that all the gray hairs on my head over the last 2 weeks are from trying to get this all set up and working. When I select my layer to preview with OpenLayers, I get a pop up that opens and is blank, except for the bounding box and the text to the bottom left and right. Not sure how to fix this so I click and have it show the map item, which in this case is a shapefile. I should note that I can select the 'All Formats' form the Layer Preview and if it is an image, I can see and/or download the shape as a jpg, pdf, tiff, gif, so I know the data is being read, just not displayed. Anyone else have this issue and resolved it? Thanks.


title: Is there a way to run a python script on opening a QGIS project?

text: I have a .csv file containing financial data which is generated on a regular basis outside QGIS. Then I want to create a PyQGIS script that will add the .csv file as a layer in my project. (The idea here is I want to have the up- to-date financial data as attributes data for one of the shapefiles in the project). Is there a way to run the script automatically as soon as I open the QGIS project. Thank you


title: How can i change the geometry of an existing layer?

text: I work with Qgis, v. 2.0.1. I have a point layer in which I have structures that could be represented as lines or polygons, but at the moment they are represented as a group of points. I know I can create new layers with different geometry but if I do this, I don't have the attribute table of the origianl point layer attached to the new line/polygon layer. And if I copy the point layer, I have the attribute table but it's not the right geometry. Can I change the geometry afterwards? I could do a table join, right? But I don't have a common attribute and the table join is not permanent is it? Thanks - G.H.


title: Distort image to Mercator Projection view

text: i have an image that rendered from data i have on my DB. i need to convert this image, with Mercator Projection method, to distorted image that when i'll wrap a 3d sphere with it it'll looks realistic. do anyone know what are the formulas i need to use to make the distorted image? P.S. i'm using PHP with GD. **update:** > in which format is your original data? my data is saved as XML, but we'll do here some optimizations after that so save it compressed with some binary algo. the rendering process has already done and i already have the rendered image as 2d view but without the distortion that should be in images that under Mercator Projection. to explain more about my needs, i attached link to album 2 photos i uploaded: '2dBefore.jpg' is an example images that show how it's looks like after the data rendering but before the Mercator Projection distortion, and '2dAfter.jpg' show how the image should be looks like after the Mercator Projection distortion as i understood, the distortion being worse as much as your going north or south from the equator and i need to know how to do that with code (and not with Gimp as i did now) I'll also explain you generally about my project: it's a game that each user on it should locate on specific location against a planet (sphere). in the game, there are 2 modes: 1. 2d mode - that show maps on 2d view with the users' data on it. 2. 3d mode - that show a sphere with the users' data on it. it's like takes Google maps and Google earth together on the same application. when a player zoom out/in he'll pass between the modes. i already mapped the world by longitude and latitude and each user have his own coordinate, the rendering of the data on the 2d maps (using PHP and GD) working fine (I'm consider the world like that: http://www.dsscentral.info/dishtips/world105.gif) but in the 3d map i have some hard-times to understands how i should distort it, as you probably understand from the above.


title: Geometryutil, simplify polygon, querytask and query fault error

text: One of the tools in my app is to draw freehand polygons (counties) to show points (companies) in each county. Everything works great but if the user creates an intersecting polygon then I have a problem. To try to fix that I am working with the Geometryutil class to simplify the polygon and I am using this example on this link http://help.arcgis.com/en/webapi/fle...0000063000000/ However the example is creating polygons to show polygons and I need to show points, howevert after I draw the polygon I get an error and the points appear on the map. The error says RPC Fault Faultstring="Unable to complete query operation" faultCode="400" faultDetail="Unable to perform query operation. I have been trying everything to make it work for the past few hours and cant't find a solution. Could anybody help me with what I need to change in my code? I really appreciate your help! Here is the code snippet               // This is an event listener function added on the init function when the drawtool settings are set after the drawtool is created outside the function                  import com.esri.ags.utils.GeometryUtil;             public var drawPolygon : Graphic = new Graphic();               private function onDrawEnd(event:DrawEvent):void             {                 drawToolbar.deactivate();                  myGraphicsLayer.clear();                 freehandbutton.selectedIndex = -1;                 multipointbutton.selectedIndex = -1;                 myMap.panEnabled = false;                      var geometry:Geometry = event.graphic.geometry;                      if (geometry is Polygon && GeometryUtil.polygonSelfIntersecting(geometry as Polygon))                 {                     // Note: As of version 2.0, GeometryService returns geometries (instead of graphics).                     myGeometryService.simplify([ geometry ]);                 }                      if (geometry is Polygon && !GeometryUtil.polygonSelfIntersecting(geometry as Polygon))                 {                               drawPolygon.geometry = event.graphic.geometry;                     drawPolygon.symbol = fillSymbolcounty;                     drawPolygon.autoMoveToTop = false; //keep graphics from moving to top                        //to not draw a polygon when I use the freehand polygon select tool I uncomment the next line, but right now I have this uncommented and on the zoomtorow function                      // I have this  myPolygonGraphicsLayer.remove(drawPolygon) uncommented, so the polygon disappears when we zoom in and does not darken the view (it darkens the view                     //if I dont have the drawpolygon.symbol as fillSymbolcounty which is transparent inside                     myPolygonGraphicsLayer.add(drawPolygon);                      runQueryTask(event.graphic.geometry);                     // If using point draw tool then run querytask3                 } else{                     //Must be multipoint                          runQueryTaskcounty(event.graphic.geometry);}                       }                                                import com.esri.ags.events.GeometryServiceEvent;             import com.esri.ags.geometry.Geometry;                  import com.esri.ags.utils.GeometryUtil;                  import mx.rpc.events.FaultEvent;                  private function myGeometryService_simplifyCompleteHandler(event:GeometryServiceEvent):void             {                 // Note: As of version 2.0, GeometryService returns geometries (instead of graphics)                      doQuery(event.result[0] as Geometry);             }                                      private function doQuery(geom:Geometry):void             {                 try                 {                               queryTaskintersectingpolygon.showBusyCursor = true;                     var queryintersectingpolygon:Query = new Query();                     queryintersectingpolygon.spatialRelationship = "esriSpatialRelIntersects";                     queryintersectingpolygon.returnGeometry = true;    //set to true because we want to place points on the map                     queryintersectingpolygon.outSpatialReference = myMap.spatialReference;                     queryintersectingpolygon.outFields = ['*'];                           queryintersectingpolygon.geometry = geom;                     queryintersectingpolygon.returnGeometry = true;                     queryTaskintersectingpolygon.execute(queryintersectingpolygon, new AsyncResponder(onResult, onFault));                          function onResult(featureSet:FeatureSet, token:Object = null):void                     {                         if (featureSet.features.length > 0)                         {                             for each (var myGraphic:Graphic in featureSet.features)                             {                                      //graphic.symbol = resultsSymbol;                                 //myGraphicslayerpolygon.add(graphic);                                    myGraphicsLayerintersectingpolygon.add(myGraphic);                             }                         }                         else                         {                             Alert.show("No parcels were found", "Try something else");                         }                     }                     function onFault(info:Object, token:Object = null):void                     {                         Alert.show(info.faultString + "\n\n" + info.faultDetail, "queryTask fault " + info.faultCode);                     }                 }                 catch (error:Error)                 {                     Alert.show(error.toString(), "myGeometryService_simplifyCompleteHandler error");                 }             }                  protected function queryTask_faultHandler(event:FaultEvent):void             {                 Alert.show(event.fault.faultString + "\n\n" + event.fault.faultDetail, "QueryTask Fault " + event.fault.faultCode);             }


title: How to put more than one overlay label in Openlayers layerswitcher?

text:
I have two set of layers like 'Public' and 'Private'.Each set has 3 layers. My requirement is, Layer switcher has to show the first set of layers with check- box under the label name 'Public' and second set of layers with check-box under the label name 'Private'. [Not with Option button]. I have tried as shown below: In Design:

              In Javascript:                //Layer Switcher     var layerSwitch = new OpenLayers.Control.LayerSwitcher({         div: OpenLayers.Util.getElement('layerswitcher')     });     osMap.addControl(layerSwitch)          layerSwitch = osMap.getControlsByClass("OpenLayers.Control.LayerSwitcher")[0];     layerSwitch.dataLbl.innerText = "Public"      ![enter image description here](http://i.stack.imgur.com/zv8KM.png) In that above list I need to add 'Private' label and layers. Please suggest me to implement this.Thanks in advance.


title: interfacing multiple gps

text: I am trying to interface NMEA output of multiple GPS units transmitting wirelessly to a single PC, each GPS position can then be shown on georefance map of that area. My question 1.) How to interface multiple GPS data with one PC, since one GPS is interfaced automatically in QGIS? 2.) How to display each GPS position simultanously on one map? Thanks


title: produce images with shapefiles and OpenStreetMap

text: I have a python file http://pastebin.com/jzwE6c6P which iterates over the features of a shapefile and renders a simple image by zooming to the bounding box of each feature. What I need is OpenstreetMap as a basemap. I have OpenStreetMap successfully loaded in a postis database. I can produce an OpenStreetMap with the mapnik example generate_image.py, but I have no idea how to call the osm file. http://svn.openstreetmap.org/applications/rendering/mapnik/generate_image.py Any help would be greatly appreciated


title: Best practices and examples of web maps of polar regions

text: I am looking for examples of web maps focusing on polar regions (Arctic or Antarctic) preferably using a polar projection. What could be best practices to follow for such web mapping applications? Any advise on the polar projection and tiling scheme to choose would be welcome!


title: Network Analyst: (1) disaggregating route cost by segments and (2) showing level of service

text: _For the record, I also posted this onreddit.com/r/gis_. I've been playing around with Network Analyst (in 10.2) for the first time in a long time, never really had to use it much but I want to learn it some more. I'm (think I'm) fine with the standard applications of it (routing, service areas). I'm curious if it has the functionality to do the following workflow. **Here's the setup/idea:**   * assume a single road with multiple segments, let's pretend I split it into equal segments of 100 meters.   * each segment has varying capacity, defined by either lanes/width or a discrete number of people.   * all my cars start on the same point, and all of them are going to the same end point.   * imagine that halfway through the road, there's a toll booth. for this one segment, where speed/capacity slows down. if there's only one car on the road, it doesn't matter. if there are 1000 cars, it becomes a problem. **My question is:** Can I get an output, showing increased time/costs to travel along each segment ~~and not just for the route as a whole~~ as I vary the amount of cars passing along the road? ~~(Using the Vehicle Routing Problem method only gives one accumulated cost for the whole route.)~~ _I found the Copy Traversed Source Features tool to solve this problem of how to see the time on each segment, but I still have the question about how to, generally, model different capacities on the same route_ That way, I could basically color-code the different segments for their level of service depending on different capacities. Maybe with one car on the road, everything is green. With 100, it's mostly green, red at the tollbooths and yellow just behind them. With 1000 cars, the red extends further back on the road. I'm sure there are whole traffic modeling programs that can do this, but I'd like to know if it could be done with just Network Analyst. Forgive me if this is really rudimentary. Trying to search for anything ArcGIS with "flow" or "capacity" tends to yield a lot of ArcHydro stuff! I found ArcCASPER, but I'm not entirely sure if I can use this to get the "itemized" cost/time values along each segment.


title: ST_Touches function in Spatialite

text: I'm a newbie to Spatialite so forgive me if the answer to my question is obvious...(I tried looking online but couldn't find the answer to this question). I am trying to use the function ST_touches in Spatialite Gui but it says it does not recognize that function. Is there anything I need to install in order to use this function? And how? Thanks so much, Ana


title: Can I Rotate SVG symbol counter clockwise in Quantum GIS? (Direction East 0 - counter clockwise)

text: I'm working in a road signs project. I need the signs layer symbol to rotate according to the value in the angle field, so they could be represented facing the correct orientation. However, the angle field values refer to a CAD file originally designs with drawing units configuration where the angle value rotates counter clockwise, from East (Direction 0). Example: A sign with rotation angle value of 90º will be facing north in a clockwise rotation, or will be facing south in a counter clockwise. (East as 0º) I have altered the CAD file drawing units configuration to rotate clockwise and the angle value has changed on the CAD blocks. But when converted back to shape they still return the original counter clockwise rotation angle value.


title: Are there any open source tools for the processing of UAV images?

text: I have aerial photographs taken by a Unmanned Aerial Vehicle (UAV). I want to do ortho mosaicing and DEM creation to do volumetric analysis. Are there any open source tools that process the UAV images? Any help would be appreciated.


title: Showing map in Grass Layer Manager/Map Display via Python

text: I've created some raster(tif) maps using Grass libraries in Python. I want to opem them automatically in Grass GIS Map Display or Layer Manager after creation. I don't want to use GUI for this. What commands I need to use for this? I'm using GRASS GIS 6.5.svn over Windows 7. Thansk in advance..


title: gdal ImportError in python on Windows

text: Trying to import gdal for Python 2.7.3 on Windows XP:               >>> import gdal     Traceback (most recent call last):       File "<stdin>", line 1, in <module>       File "C:\Python27\lib\site-packages\gdal.py", line 2, in <module>         from osgeo.gdal import deprecation_warn       File "C:\Python27\lib\site-packages\osgeo\__init__.py", line 21, in <mo         _gdal = swig_import_helper()       File "C:\Python27\lib\site-packages\osgeo\__init__.py", line 17, in swit_helper       _mod = imp.load_module('_gdal', fp, pathname, description)     ImportError: DLL load failed: The specified procedure could not be found.      Following suggestions from How to install GDAL with Python on windows? and elsewhere, here's what I've done so far:   * removed all versions of python and started with a clean install of 2.7.3   * installed gdal with the OSGeo4W installer   * installed the native Win gdal binaries from http://www.lfd.uci.edu/~gohlke/pythonlibs/   * added `C:\OSGeo4W\bin;` first in my `Path` variable   * tried `from osgeo import gdal`   * launched python from within the OSGeo4W Shell   * run the procedure outlined in http://cartometric.com/blog/2011/10/17/install-gdal-on-windows/ The result is the same. Any other ideas about how to troubleshoot this?


title: How do I set the projection and coordinate system for a TIFF file?

text: I have a topographic map of California (obtained from CAL-Atlas) as a TIFF file. I tried importing it into QGis, but it displays the map using a pixel based coordinate system rather than latitude/longitude (the `.prj` file indicates that it uses NAD83 Albers projection). How can I rectify the coordinate system for this raster file in QGis? I'm using QGis 1.8 for this project, but also have 2.0 if necessary.


title: How to count the number of lines connected to a point?

text: I have a water network which and I need to install elbows and Tees (T). When 2 lines connect to a point, I want to install an elbow, when 3 lines connect, I want to install a Tee. How do I get ArcGIS or QGIS to determine how many lines are connected to a point and designate an elbow or a tee based on that criteria? ![enter image description here](http://i.stack.imgur.com/GTFWAm.jpg)


title: How do I download tracks from Garmin GPSmap 62 using GPS utility?

text: I think I have to open files from windows file manager and then save these, rather than the autoconnect facility available between other Garmin devices and GPS utility.. Is this correct or is there a way to get it to open the GPS transfer window automically on connection with this device model as this has the tick options for tracks download too? If I have to go via windows file manager, how do I differentiate tracks from waypoints and is there an easier way please?


title: How to find if a lat/lon point is on a street?

text: Are there any services to determine whether or not a give lat/lon point is on a street? I am working on an app that uses user entered lat/lon points but it only really makes sense if its on a street. I want to generate a bunch of points for testing but the points need to be on a street. Any input is appreciated!


title: How to add labeling to a polygon layer?

text: I'm trying to add labeling to a polygons vector layer called "myVectorLayer". It does not give me an error but the labeling does not appear.               palyr = QgsPalLayerSettings()     palyr.readFromLayer(myVectorLayer)          palyr.enabled = True     palyr.fieldName = 'name'     palyr.placement= QgsPalLayerSettings.OverPoint     palyr.setDataDefinedProperty(QgsPalLayerSettings.Size,True,True,'8','')          palyr.writeToLayer(myVectorLayer)       Thanks for your help


title: How to link R script to Algotithm output in QGIS modeler?

text: I constructed a simple R script for QGIS modeler (.rsx) that calculates groupwise summary statistics of a vector layer table (sum by field "subject" and "FRC"). The script correctly works. When executed, a windows is opened and you can manually choose the vector layer and the other parameters. However, if I insert this script in the graphical modeler I am able to choose the output of a previous Algorithm as input to my script, nevertheless I cannot select fields from its attribute table, as requested by my script. How can I do that? ----Edit----- As an example, consider I want to construct a model that calculates the % of different land use types inside polygon buffers constructed around some street addresses. The model represented in the picture below intersect the buffers with a polygon layer representing land use areas, then calculates the area of each new feature in the intersection layer. ![model](http://i.stack.imgur.com/VdKre.jpg) Now I want to link my R-script to the output layer "Intersection_with_area" to summarize the total area for each address and for each land use type. Here below the .rsx code:               ##intersection=vector     ##address=field intersection     ##soiltype=field intersection     ##area=field intersection     ##folder=string     ##filename=string          library(doBy)     setwd(as.character(folder))          inters_df=as.data.frame(intersection)          summ=summaryBy(list(area,c(address,soiltype)),FUN=sum, data=inters_df, keep.names=T)     write.csv(summ,as.character(nomefile))      I am unable to select the fields "address", "area" and "soiltype" from the vector layer "Intersection_with_area" that is in my model.


title: Date Time Format output in REST API in 10.1

text: It looks like the output format for dates is in ticks. Has this always been the case? Can it be changed at the server level or the request level?


title: OpenLayers WFS filter by DATE?

text: Using openlayers, I would like to create a temporal filter to query a GeoServer WFS service. There is a WFS filter example here without the temporal (date) portion that i need: http://openlayers.org/dev/examples/wfs-filter.html My dates on GeoServer are stored in the following format: "2010-09-12 08:10:40+00" Any links or code snippets that might help me would be greatly appreciated.


title: Is there lat/lon grid option in QGIS?

text: For example, I have georeferenced layer loaded and I want lat/lot grid or at least some ruler in QGIS display canvas, to suite me as a helper.   It looks like only reference is cursor tracking in status bar, which is not what I'm after. Is there such option, or a plugin?


title: PostGIS ERROR: could not load library "/usr/lib/postgresql91/lib64/postgis-2.0.so"

text: OS is openSUSE 12.1, PostgreSQL - 9.1, PostGIS - 2.0. Postgre/PostGIS are installed from Application:Geo repository. After recent updates when I try to connect to my database I get the following error:                   ERROR:  could not load library "/usr/lib/postgresql91/lib64/postgis-2.0.so":      /usr/lib/postgresql91/lib64/postgis-2.0.so: undefined symbol: pj_get_spheroid_defn      I searched the web for this error (hint-1, hint-2) and seems that it may have something to do with ld.so.config (or ldconfig command). But I can't figure out what I have to do in my case.


title: Is it possible to automate creating an image pyramid store with Geoserver?

text: Geoserver has a REST API to automate Geoserver commands, however I do not see any examples of how to automatically create an Image Pyramid store and associated layer. Is that possible? Can anyone provide me sample code?


title: How to Group By with Summarize on alphanumeric field in ArcGIS?

text: Is it possible to create from Summarize option, a new table with the COUNT of a string field and the code of municipalities, in my case, like that:               +-------------------+--------------+     | id_municipalities | string_value |     +-------------------+--------------+     | 1                 | A            |     | 1                 | A            |     | 1                 | C            |     | 2                 | A            |     | 2                 | B            |     | 3                 | D            |     +-------------------+--------------+      And the result table, like that:               +-------------------+--------------------+---------------+     | id_municipalities | COUNT_string_Value |  string_value |     +-------------------+--------------------+---------------+     | 1                 | 2                  | A             |     | 2                 | 1                  | B             |     | 3                 | 1                  | D             |     +-------------------+--------------------+---------------+      Thanks in advance


title: What is generally faster in OpenLayers: WMS or GeoJSON?

text: I work both with WMS (connection with postgres) and GeoJSON in OpenLayers. I have the impression that a WMS is faster when more feature need to be loaded. And I have the impression that GeoJSON is fast when there are only a small amount of feature. When more features need to load the application is much slower with GeoJSON What is generally faster in OpenLayers? And is there way to make a GeoJSON file load faster.


title: How to build a relational database system with 4 tables in arcgis desktop?

text: I have been given data from an working online application which consists of a relational model. My aim is to recreate the model using Arcgis Desktop. I have the table "elements" containing Point geometry with the attribute element_id as the primary key. In the table Aspects, Types and media. The tables "Aspects" and "Media" have a 1:1 relationship with "elements" and media has a 1:m relationship. It is possible to build these multiple relationships in ArcGIS Desktop?


title: Is there a difference between ESRI's NAD83 Indiana SPW and QGIS's?

text: It seems ESRI and QGIS don't have the same definition for my most commonly used projection, NAD83 StatePlane Indiana West (US ft). When I create data in an ESRI product the projection shows up in QGIS as: > USER:100001 - * Generated CRS (+proj=tmerc +lat_0=37.5 > +lon_0=-87.08333333333333 +k=0.9999666666666667 +x_0=900000 +y_0=250000 > +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs) When I create data in QGIS the projection information shows up under the Custom folder as:               NAD83_Indiana_West_ftUS     Authority: Custom          Projection: Transverse_Mercator     false_easting: 2952750.0     false_northing: 820208.333     central_meridian: -87.08333333333333     scale_factor: 0.999966667     latitude_of_origin: 37.5     Linear Unit: Foot_US (0.3048006096012192)          Geographic Coordinate System: GCS_North_American_1983     Angular Unit: Degree (0.0174532925199433)     Prime Meridian: Greenwich (0.0)     Datum: D_North_American_1983       Spheroid: GRS_1980         Semimajor Axis: 6378137.0         Semiminor Axis: 6356752.314140356         Inverse Flattening: 298.257222101      ESRI's normal entry is:               NAD_1983_StatePlane_Indiana_West_FIPS_1302_Feet     WKID: 2966 Authority: EPSG          Projection: Transverse_Mercator     False_Easting: 2952750.0     False_Northing: 820208.3333333333     Central_Meridian: -87.08333333333333     Scale_Factor: 0.9999666666666667     Latitude_Of_Origin: 37.5     Linear Unit: Foot_US (0.3048006096012192)          Geographic Coordinate System: GCS_North_American_1983     Angular Unit: Degree (0.0174532925199433)     Prime Meridian: Greenwich (0.0)     Datum: D_North_American_1983       Spheroid: GRS_1980         Semimajor Axis: 6378137.0         Semiminor Axis: 6356752.314140356         Inverse Flattening: 298.257222101      How big of a deal is this? The only difference I can see is in the precision of the scale factors. Is there another difference I missed? Is it worth worrying about?


title: How to draw a polygon with preset length in OpenLayers?

text: For a project I am working on, I need to be able to put a polygon on a map using OpenLayers, based on a variable point that can be set by a user. The polygon is an isosceles triangle of which two legs should be exactly 1 kilometer and should originate from a point set by the user under an angle of 90 degrees. Does anyone know how this can be done?


title: Using Natural Earth Dataset As WMS

text: This Question is about Natural Earth Project. I tried to do some research about creating my own WMS and came across this project. The web page says : > Natural Earth is a public domain map dataset available at 1:10m, 1:50m, and > 1:110 million scales. Featuring tightly integrated vector and raster data, > with Natural Earth you can make a variety of visually pleasing, well-crafted > maps with cartography or GIS software. How can I harvest the data for my WMS So that it can be used with Mapinfo or Other software?


title: Shorcut to apply selected shapefile projection to the data frame in arc gis

text: What is the shortcut to apply selected shapefile or the newly added data's projection to the data frame in arc gis, well not the traditional way of Dataframe--->Properties--->CS system _"This could be a silly question yet a very useful one seen some person using it long ago, if there isn't any shortcut, then sincere apology"_


title: Creating database for climate data with MySQL

text: I'm working on a project using climate data and MySQL. Before I start to work, what's your advice on the best way to complete this task. I plan on using the following workflow: >   1. Analyse the climate-data, creating a mysql database-schema that could > hold the data. (all tables should use UTF-8 as charset). >   2. Download all the raw-data from worldclim.org, using the 30 arc-seconds > (~1 km) resolution. >   3. Import the data. Providing a dump > I have already downloaded the data for Min.Temperature, and it looks like this when I open one of the folders ![enter image description here](http://i.stack.imgur.com/nsH3g.jpg) The data is in .adf format: how can I insert that format into MySQL? Also, what do you think is the best way to organize the database in MySQL for that kind of data? Thank you. _UPDATE_ I explored and found out that is option in AutoCAD Map 3D (FDO) where I can insert shapefiles in MySQL. Maybe then is the best way to convert coverages to shapefiles and then in Autocad Map 3D to MySQL? * * * I need to use MySQL. So I'll download . bil files. gissolved said I can save it in a blob field in my database and KevinMayall said I should convert it to ASCII and then to MySQL. These are raster files. What is the best way to import .bil files to database then?


title: How to create GRASS scripts in C# in Windows

text: Most of the tutorials that I have seen are under Python and Linux. Is it Possible to create GRASS scripts in C# or atleast in Windows. I can create scripts using a different language as a compromise but at least it must run in C# because I am currently using C# for my GUI of the simulation system that I am making. Thanks!


title: How to resolve GRASS error "Execution failed: 'gproj -p' "?

text: I installed the WinGRASS-6.4.0-1-Setup.exe 55M from http://grass.osgeo.org/grass64/binary/mswindows/native/. I'm using a x64. After installation, I tried opening the demoLocation but it failed and displayed the error: Execution failed: 'gproj -p'. How do I resolve it?


title: Using ArcPy, is there a way to change the color of a symbol in a UniqueValuesSymbology object?

text: I have an template mxd I reference with several pre-defined layers. The only variable I need to modify is the color of certain symbols in the layer. I have tried to modify and dig around the Symbology Object but I cannot access the colors of each Unique Value Symbol. Any help is appreciated. Thank you all. -- edit This is how I am accessing the the Symbology of the individual layers. There doesn't seem to be and option to change the color a value.   * I am using ArcGIS 10.2.1              mxd_file = r"some\path\file.mxd"     mxd = arcpy.mapping.MapDocument(mxd_file)          # getting data frame        df = arcpy.mapping.ListDataFrames(mxd)[0]          # getting street layer     street_layer = arcpy.mapping.ListLayers(mxd, 'Street', df)[0]          if street_layer.symbologyType == 'UNIQUE_VALUES':         # trying to access all possible properties of the symbology object         street_symbology = street_layer.symbology         desc = street_symbology.classDescription         labels = street_symbology.classLabels         values = street_symbology.classValues         show_other_values = street_symbology.showOtherValues         value_field = street_symbology.valueField     del mxd, df          layer_file = r"some\path\file.lyr"     arcpy.SaveToLayerFile_management(path_layer, layer_file)


title: Error in r.terraflow

text: I used r.terraflow.short in GRASS, but it displayed this error:               r.terraflow.short elevation=raster_bulacanElevation \                       filled=raster_bulacanElevationFlooded1 \                       direction=raster_bulacanElevationFlowDirection1 \                       swatershed=raster_bulacanElevationSink1 \                         accumulation=raster_bulacanElevationAccumulation1 \                       tci=raster_bulacanElevationTCI1     stats.out: Permission denied     STREAM temporary files in C:/Users/Rhen/AppData/Local/Temp     (THESE INTERMEDIATE STREAMS WILL NOT BE DELETED IN CASE OF     ABNORMAL TERMINATION OF THE PROGRAM. TO SAVE SPACE PLEASE     DELETE THESE FILES MANUALLY!)      What should I do to make r.terraflow.short run? I tried deleting all the contents of the Temp folder but GRASS still displayed the same error.


title: mapserverpro.com & mapserving.com opinions?

text: Does anyone use these services? I'm trying to figure out which way to go as I embark on a mapping project, and wonder what GIS-dedicated hosting services like these are like. Thanks.


title: Why won't this simple raster layer in my mapfile show up?

text: I am trying to get a simple raster layer to work on MapServer. I am not exactly going to be using geographic data, but I want to "georeference" multiple rasters together to create a map-like interface. Unfortunately, I can't seem to get over this initial step of getting a single raster to show up using my mapfile. Mapfile:               MAP         IMAGETYPE   PNG         EXTENT      -180 -90 180 90         SIZE        400 300         IMAGECOLOR  255 255 255         UNITS       DD         STATUS      ON         DEBUG       ON                   LAYER             NAME    "base"             DATA    "Base.png"             STATUS  ON             TYPE    RASTER         END      END       My directory structure is like this: /home/username/public_html/cgi-bin/mapserv.cgi /home/username/public_html/dir/Base.png /home/username/public_html/dir/mapfile.map /home/username/public_html/dir/tmp/ When I visit the map using something like the following link, all i get is a blank image of the correct size but not the actual Base.png image. No pink tiles. No error message. What am I doing wrong? *http://myurl.com/cgi-bin/mapserv.cgi?map=/home/username/public_html/dir/mapfile.map&layer=base&mode=map


title: Create toggle buttons to activate individual query and identify tasks

text: Can you please help with toggling query and identify tasks? For example, Parcel: button Footpring: button CIP: button whenever one of the buttons is checked, all others are inactive. D.E.Wright provided a test link that is no longer active here: Toggle Toolbar Button and Activate Identify Thanks for any help! EDIT: I am attempting to build a javascript api application that involves several functionalities: draw tools, query, find, etc. Now, whenever I click on the map it evokes the identify task, whether I want to or not. I would like to control when this task in called. I am trying to figure out the best way to display all of my code for your viewing. I have an html file and a series of .js files along with the css.


title: CartoDB merge tables (column join) returns import error

text: I have been trying to merge two tables using the column join in Carto DB. The first table is a table of US counties that contains the polygon geometry and the FIPS id code. The second table contains the FIPS id as well as information about population density. The common column "FIPS" is string in both tables. There are just over 3,000 rows in each table. When I try to merge them i CartoDB it appears to begin executing successfully, then it takes me to a page that says "What a pity, the page you are looking for doesn’t exist." I am able to click back to my dashboard, and a status bar still shows that "creating table" is executing. After some time a final error appears as: "Oops! An error occured while importing your file." Has anyone experienced this? Any ideas on what is causing the error and how to get around it?


title: Can I export QGIS basemaps as raster in ArcGIS 10.0?

text: I'm mapping a National Park in Malawi using Quantum GIS as with the plugin I can get the images from G.Earth (I need to see the vegetation). Since my supervisor is using ArcGIS 10, do you know if it's possible to save the file with the maps I need (Malawi etc) so that she can open it in ArcGIS?   I'm wondering if there's a way to save the maps as raster or something...   Thank you.


title: Difference between st_length() and st_m()

text: My question is about the differences between st_length() and st_m() in postgis. The reason I ask this is because in a MultiLineString I can´t calculate st_m(), but I can st_length(). Thanks.


title: How to get mean of pixel values within a buffer zone around current mouse position in QGIS

text: for a qgis 1.8 python plugin I want to query the mean of all pixel values of a raster layer within a defined buffer around the current mouse position, not for an existing point layer. For the buffer sth like this should work:               feat.geometry().asPoint()      (3.5176e+06,5.4062e+06)          buff_geom = feat.geometry().buffer(1000, 5)          buff_geom.asPolygon()     [[(3.5186e+06,5.4062e+06), (3.51855e+06,5.4059e+06), (3.51841e+06,5.40562e+06),     (3.51819e+06,5.4054e+06), (3.51791e+06,5.40525e+06), (3.5176e+06,5.4052e+06), (3.51729e+06,5.40525e+06), (3.51701e+06,5.4054e+06),...]]      but now I try to find a solution to query all raster pixels within the buffer zone and calculate the mean, but I don't know how and if this is possible in QGIS 1.8 at all.   All I found is `QgsZonalStatistics`, but that doesn't work for my task. Does anybody have a solution for this or a better idea, how to solve this? Thanks.


title: Several algorithms done for topographic correction => black spots - how to solve?

text: I have done several algorithms for topographic correction in R including simple cosine, Minnaert, SCS. The input data aspect and slope for the hillshade raster have correctly been done in radians. The hillshade has some spots where the cos (i) is slightly below zero and these spots appear black in the corrected Landsat image. The white surroundings of the black spots are zero or slightly above. That means that cos(i) is around 90° or above in these areas. Such areas receive no direct radiation from the sun but diffuse light. Can somebody help me with this - I mean do you know an algorithm to solve this problem? Is this phenomenon called overcorrection? Thanks a lot S.


title: How to visualise "distance from amenities"?

text: I'm interested in calculating for every point the distance to the nearest amenity of each of a certain number of types (train station, supermarket and so on). I think the calculation will be straightforward, but I'm not sure how to visualise the result. A heatmap doesn't seem quite right. Things I want the visualisation to do:   * No distinction needed between a point that is near 1 supermarket vs near 2 supermarkets   * Show each attribute individually (for maybe 3 attributes)   * Use a step function for distances (eg, 0-499m is one colour, 500-999m is another...) Is there any standard kind of visualisation for this kind of analysis? My stack is Leaflet, TileMill, PostGIS, OpenStreetMap, comfortable with Python tools but would consider branching out.


title: PyQt resources file to display images on QGIS custom feature form

text: I am having issues creating a PyQt4 resources file to display images in my QGIS 2 custom feature form using Windows XP. These are the steps I followed: -Added QLabel and clicked "choose resource…" -Created my .qrc in PyQt4 designer, linked .png image file. Checked my file with notepad, and following lead of some tutorials made a few modifications (because it didn't work with the untouched resource file direct from PyQt4) My .qrc looks like this:               <!DOCTYPE RCC><RCC version ="1.0">         <qresource prefix="/">             <file>img/image.png</file>         </qresource>     </RCC>      -Saved the ui and compiled the resource file in the windows command line using:                pyrcc4 -o image_rc.py image.qrc      -I even tried compiling the ui to py and moved the import space_rc to the top               pyuic4 -o form.py form.ui      then:               import image_rc      the image is called like so:               self.label_7.setPixmap(QtGui.QPixmap(_fromUtf8(":/img/Space.png")))      my file system structure is like so:               ui/resource.qrc     ui/form.ui     ui/img/image.png      Under my layer's properties in QGIS, I chose to add custom ui and linked to the ui created in PyQt designer. When opening the feature form, I see only my frame, but no image. After reading many tutorials on what steps to follow, I can't see what I am missing.


title: How to calculate x, y, z, m in Postgis

text: Somebody know how can I calculate the **x,y,z,m** parameters from a **MultiLineStringZM** in Postgis? I would like to know **x,y,z** and **m** from the points what are made the polyline. When I try calculate it by this way "*st_x,st_y, st_z, st_m*" postgis go up an error message: ERROR: Argument to M() must be a point Any idea? Thanks, JM


title: PostGIS points to multipoint error

text: I have a table on PostgreSQL 9.2 ("POSTGIS="2.0.1 r9979" GEOS="3.3.3-CAPI-1.7.4" PROJ="Rel. 4.8.0, 6 March 2012" LIBXML="2.8.0""). This is it:               CREATE TABLE nearest_point (       id_nearest_point serial NOT NULL,       id_iri_radartec integer,       id_tramo integer,       geom geometry(GeometryZ,4326),       CONSTRAINT pk_nearest_point PRIMARY KEY (id_nearest_point)     );      ![SELECT nearest_point](http://imgur.com/ipASL2i.png) I need a geometry that represents the point set union of the Geometries. Easy.               SELECT id_tramo        ,ST_Multi(ST_Union(np.geom)) AS geom       FROM nearest_point AS np     GROUP BY id_tramo;      But I get this: ![Zoom out - 01](http://imgur.com/oAmyaEQ.png) "ST_Union GROUP BY" points in pink. And the other points? ![Zoom out - 02](http://imgur.com/8lpcrSU.png) The arrow indicates where are the points of the table nearest_point. Where is my error?


title: Creating metadata in zipped file geodatabase using FME

text: I have a workbench set up where I create a Feature Class inside a file geodatabase. the next step is to create the metadata and load it into the same Feature Class. This all works fine. I'm doing the exact same thing with a zipped file geodatabase and it's giving me errors. `Attempting to create table 'XXXXXXX' with 'geodb_type' set to 'geodb_metadata'. FME features of 'geodb_metadata' can only be written to existing tables. If intending to write metadata, please ensure the table already exists. If intending to create a new table, ensure the 'geodb_type' is set to a valid table type. A fatal error has occurred. Check the logfile above for details` I've checked all my parameters and they are the same between my zipped and non-zipped file geodatabase. Any idea why? Thanks


title: ArcSDE/SQL Server Permissions

text: I have an enterprise geodatabase with about 20 users. Each user has a corresponding schema. When in Arc Catalog, if only the owned schema box is checked in SQL Management studio I receive a permissions error in Catalog. However, if both the owned/default schema are selected in addition to the SDE schema, then I have no problem, importing/previewing data. Additionally, even if SDE is chosen, it grays out, but later becomes un- checked somehow. For database permissions I have selected create procedure, table, view, and connect. Roles for each user are configured in SQL Management Studio as db_datawriter. I am using ArcGIS 10.2.1/SQL Server 2008 R2 ![This appears when attempting to connect with a certain user where only the user name and schema are alike, no SDE schema is chosen when this message appears.](http://i.stack.imgur.com/DYHYS.jpg)


title: How to fill inn A, B, C ...Y, Z, A, B, ...Y, Z, A, B, and so on?

text: as a second part of a problem i am trying to solve. I need help to figure out how to fill in serial letters.. Starting at A.. going to Z and starting over at A again.. I have a tabel with numbers 1-600 and i want 1 to be A, 2 = B, .... 26= Z, 27 = A 28 = B and repeating like that.... I am useing field calculator in ArcGIS Alternativley... how to create the numbers 1-26 over and over.. so.. 1, 2, 3, ...25, 26, 1, 2, 3.. and so on.. THX


title: How best to share maps created in MapInfo Online

text: Does anyone know of a good free or low cost option for sharing Maps produced in mapinfo online? I would want up to 5 users to access the maps with a password and be able to turn layers / points on and off and zoom in and out. Basically I am looking to upload the Mapinfo files or Shapefiles and create thematic maps (ideally multivariate) online. I have looked at Mapinfo Stratus but costs are prohibitive for a small company (<5 people)! Many thanks for any help Kev


title: arcpy.sys versus sys

text: I just noticed that in the arcpy module (Esri) there's a sys sub-module. Does anyone know what the difference is in using one or the other? I've been looking around and can't find anyone who uses arcpy.sys, so why would it be there? edit: I wasn't clear, but arcpy.sys seems to be exactly the same as the python built-in sys module.


title: GRASS v.overlay.or Error when trying to split a polygon with a line

text: I am using the Grass plugin in QGIS for Windows (1.8.0). I am trying to split a polygon with a line feature. I am using the v.overlay.or function within the QGIS Grass plugin. I have the line layer as input vector map A, and the polygon as input vector B. When I run the function I get the following error:                v.overlay ainput=cutlines@CompTest atype=line alayer=1 binput=buildings@CompTest btype=area blayer=1 output=bldg_overlay operator=or           ￼Operator 'or' is not supported for type line      Finished with error      Any help would be appreciated, Thanks...


title: ArcGIS JS - Missing "style" when printing dynamic layer

text: Im having an issue trying to get the url of the map being printed with a dynamic layer. WIth just tiled services and basemap it prints just fine.                // USED FOR PRINTING OF MAPS         function print(map_div_id)         {             var printUrl = "http://prodgis.agriculture.purdue.edu:6080/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task/execute";         printTask = new esri.tasks.PrintTask(printUrl);              var template = new esri.tasks.PrintTemplate();              template.format = "JPG";         template.layout = "MAP_ONLY";         template.preserveScale = true;              var params = new esri.tasks.PrintParameters();         params.map = map[map_div_id];         params.template = template;              printTask.execute(params, printComplete);     }      My Error I get is               0: "Error executing tool.: Layer "prime_soil_map_graphics": Missing 'style' in symbol.↵Failed to execute (Export Web Map).↵Failed to execute (Export Web Map Task)."      Any ideas what is happening ? Here is a JS fiddle to test with just press the print button ! http://jsfiddle.net/YMzfM/1/


title: Can Vector grid shape file be clipped with Satellite image in qgis?

text: I am working in open layers plugin in Qgis . in order to project the satellite image wit respect to vector shape file i am having, Andre Joost suggested me to create a vector grid with crs sysytem of vector shape file.As suggested i created grid. now my problem is this can i able to clip the vector grid shape file with the satellite image obtained?


title: Routing and Travel Time

text: I wish to generate highways network routings and travel times from trip pairs. The trip pairs are between the centroids of UK census Lower Super Output Areas. For each trip pair (perhaps 5,000 records in a dataset) I wish to generate a polyline indicating the quickest route using the UK highway network, and return the associated journey time. I require the routing and travel time to take account of typical (or realtime?) observed traffic conditions, i.e. delay due to congestion and queuing at junctions. I use Mapinfo as my GIS. In recent months I have begun to use QGIS as a complete novice. I do not readily have access to any of the ESRI suite. I'm a fairly basic user of GIS so I'm looking for a solution that does not require proficiency in programming. I have been investigating propriety products such as Mapinfo Drive or Routefinder from routeware.dk, though i've been unable determine whether these will take account of journey delay. I have also researched the use of a routing web service. This solution appears to require much proficiency in programming. Is this right? Does anybody have experience of carrying out a similar function. I'd be grateful for any suggestions of how I can perform these analyses. Thanks for reading, Tim


title: ArcPy: Error in For loop panToExtent + export to Tiff

text: I'm trying to trouble shoot a script, which has the objective of allowing a user to input a query for selected field, use the panToExtent function to pan the data frame at the specified scale to that feature, export as tiff, and then continue until the end of the features queried. This is the code I wrote:               import arcpy          #Set Overwrite Option     arcpy.env.overwriteOutput = True               mxd = arcpy.mapping.MapDocument("C:\\temp\\Graffiti_DM1.mxd")     df = arcpy.mapping.ListDataFrames(mxd, "*")[0]     lyr= arcpy.mapping.ListLayers(mxd, "*", df)[0]          #USER INPUTS     lyr1="C:\temp\itscomplicated.shp"     query="Incident_Z" =="10006"     expdir="C:\temp\df"               for df in arcpy.mapping.ListDataFrames(query):         df.rotation = 0         df.scale = 1000         outFile = expdir + df.name + ".tif"         df.panToExtent(lyr.getSelectedExtent())         arcpy.mapping.ExportToTIFF(mxd, outFile, df)     del mxd      Here is the traceback error:               Traceback (most recent call last):       File "C:\temp\pantoextent.py", line 23, in <module>         for df in arcpy.mapping.ListDataFrames(query):       File "C:\Program Files\ArcGIS\Desktop10.1\arcpy\arcpy\utils.py", line 181, in fn_         return fn(*args, **kw)       File "C:\Program Files\ArcGIS\Desktop10.1\arcpy\arcpy\mapping.py", line 1478, in ListDataFrames         result = mixins.MapDocumentMixin(map_document).listDataFrames(wildcard)       File "C:\Program Files\ArcGIS\Desktop10.1\arcpy\arcpy\arcobjects\mixins.py", line 727, in listDataFrames         return list(reversed(list(self.dataFrames)))       File "C:\Program Files\ArcGIS\Desktop10.1\arcpy\arcpy\arcobjects\mixins.py", line 694, in dataFrames         return map(convertArcObjectToPythonObject, self.pageLayout.dataFrames)       File "C:\Program Files\ArcGIS\Desktop10.1\arcpy\arcpy\arcobjects\mixins.py", line 678, in pageLayout         return convertArcObjectToPythonObject(self._mxd._arc_object.pageLayout)     AttributeError: 'bool' object has no attribute '_arc_object'      Any help would be MUCH appreciated!


title: Incorrect GeoCoordinate at Random

text: Sometimes when the device is pulling coordinates with the GeoPositionAccuracy set to High and the MovementThreshold set to 0, the GeoCoordinate that is captured is further away and not inline with the other coordinates. How can I prevent that or remove that GeoCoordinate from my collection of GeoCoordinates? You'll notice that in the imge below right above the second light grey 'e' and to the right on the route 11 symbol, you'll see a little jog out. The same thing under the first little grey 'e'. ![enter image description here](http://i.stack.imgur.com/x96UK.png)


title: How do I install and run SEXTANTE for QGIS 2.0?

text: I just upgraded to QGIS 2.0, and I have been unable to locate/use SEXTANTE tools. A search with the plugin installer does not turn up anything for "sextante." Any idea what is going on?


title: Tool to convert Mike Urban network (shapefiles) to EPAnet network

text: This might be a too localized question, but I hope I'm not the only one here doing pipe network analyses in Mike Urban. I have a model in Mike Urban, and the client wants it in EPAnet format (since the rest of their models are in EPAnet). The network representation is not very similar. MU uses shapefiles and EPAnet, from what I understand, uses (at least) three different tables in text file format. One for node ID's and Z coordinates, one for node ID's and coordinates and one for link ID's and their corresponding breakpoint coordinates. There's some more stuff in each of these tables, but lets not worry about that for now. Is there a tool, of any kind, that converts shapefile networks (from MU) to EPAnet style networks? If not, what could be an efficient way of extracting necessary information from the shapefile? I have no problem extracting xyz coordinates for points (eg. nodes), but how can I get the breakpoints for lines into a text file/other table? Since there will be a lot of pipes, Python solutions are preferred. Thank you!


title: How to stop QGis UUID generator from creating UUIDs that are wrapped in braces?

text: This may be a silly question, but I'm using the UUID generator in QGis. The UUIDs it generates in my DB (PostGIS) are wrapped in braces, so I see: {1f954646-0ef5-4a7e-8f2d-27415fb14f8d} instead of: 1f954646-0ef5-4a7e-8f2d-27415fb14f8d Any ideas how to stop it from doing this? Thanks


title: Best practices for PostGIS production environments?

text: What PostGIS documentation have you come across that has been helpful when tuning PostGIS for a production environment? I would like to get together with my DBA to setup a Postgresql/PostGIS installation that is fit for production. I have read that there is some tweaking involved to achieve this, and I was hoping to find the answer on the refractions web site. So far I have found some documents on the OpenGeo site helpful, like this one. And this old forum post is the kind of information I have found helpful, this is probably just basic DB stuff but to me its good stuff. I would be interested to see what resources have helped others in achieving a stable production installation of PostGIS.


title: Modify existing library from OpenLayers (ZoomToMaxExtent)

text: I would like to modify ZoomToMaxExtent.js library from openlayers so as when I click the button the map will display only Great Britain and not the whole world. I am having problems creating the library. The boundaries of Great Britain is “Bounds(-16.08,49.06,6.76,58.74)” and the code from the ZoomToMaxExtent Library is the following:                 OpenLayers.Control.ZoomToMaxExtent = OpenLayers.Class(OpenLayers.Control, {         type: OpenLayers.Control.TYPE_BUTTON,         trigger: function() {             if (this.map) {                 this.map.zoomToMaxExtent();             }            },         CLASS_NAME: "OpenLayers.Control.ZoomToMaxExtent"     });      I know that I need to change the coding within the trigger function. Can actually someone indicate how I can do that? Preferably i would like to create a new library based on this code instead of modifying the existing one. Thanks * * *               var map, drawControls, selectControl, selectedFeature, select, hover, control;                  function init() {                      //set up projections                 // World Geodetic System 1984 projection                 var WGS84 = new OpenLayers.Projection("EPSG:4326");                      // WGS84 Google Mercator projection                 var WGS84_google_mercator = new OpenLayers.Projection("EPSG:900913");                      // OS British National Grid                 var os = new OpenLayers.Projection("EPSG:27700");                      //Initialize the map                 //Creates a new openlayers map in the <div> html element id map                 var options = {                     controls:[                     //allows the user pan ability                     new OpenLayers.Control.Navigation(),                     //displays the pan/zoom tools                     new OpenLayers.Control.PanZoom(),                     //new OpenLayers.Control.PanZoomBar(),                     //displays a layer switcher                     new OpenLayers.Control.LayerSwitcher(),                     new OpenLayers.Control.OverviewMap(),                     //Displays the scale                     new OpenLayers.Control.ScaleLine(),                     new OpenLayers.Control.Scale($('scale')),                     new OpenLayers.Control.Permalink(),                     //displays the mouse position's coordinates in a <div> html element with                     new OpenLayers.Control.MousePosition({                         div:document.getElementById("coordinates")                     })                     ],                          maxExtent: new OpenLayers.Bounds(-16.08,49.06,6.76,58.74),                     maxResolution: 0.00138671875,                     projection: "EPSG:4326",                     units: "degrees"                      };                 map = new OpenLayers.Map( 'map', options );                      // base map layers                 var openstreetmap = new OpenLayers.Layer.OSM();                 var cloudmade = new OpenLayers.Layer.CloudMade("CloudMade", {                     key: 'BC9A493B41014CAABB98F0471D759707'                 }                 );                 var google_maps = new OpenLayers.Layer.Google("Google Maps", {                     numZoomLevels: 20                 }                 );                 var google_satellite = new OpenLayers.Layer.Google("Google Satellite", {                     type: google.maps.MapTypeId.SATELLITE,                     'sphericalMercator': true,                     numZoomLevels: 20                 }                 );                 var bing_shaded = new OpenLayers.Layer.VirtualEarth("Bing Maps", {                     type: VEMapStyle.Shaded,                     'sphericalMercator': true                 }                 );                 var bing_hybrid = new OpenLayers.Layer.VirtualEarth("Bing Satellite", {                     type: VEMapStyle.Hybrid,                     'sphericalMercator': true,                     numZoomLevels: 20                 }                 );                 var bing_aerial = new OpenLayers.Layer.VirtualEarth("Bing Aerial", {                     type: VEMapStyle.Aerial,                     'sphericalMercator': true,                     numZoomLevels: 20                 }                 );                      // WMS Layers for the projection of the shapefiles                 var national_parks = new OpenLayers.Layer.WMS(                 "National Parks", "http://localhost:8080/geoserver/wms", {                     srs: 'EPSG:4326',                     layers: 'National_Parks',                     transparent: 'true',                     format: 'image/png',                     buffer:0                 }, {                     'wrapDateLine': false,                     'displayOutsideMaxExtent':true                 }                 );                      map.addLayers([                 openstreetmap, cloudmade, google_maps, google_satellite,bing_shaded, bing_hybrid, bing_aerial, // Display the base maps                 national_parks // Display the wms layers                 ]);                      select = new OpenLayers.Layer.Vector("Selection", {                     styleMap:                     new OpenLayers.Style(OpenLayers.Feature.Vector.style["select"])                 });                 hover = new OpenLayers.Layer.Vector("Hover");                 map.addLayers([hover, select]);                      var     controla = new OpenLayers.Control.GetFeature({                     protocol: OpenLayers.Protocol.WFS.fromWMSLayer(national_parks, {                         featureType:"National_Parks",                         featurePrefix:"protec_are"                     }),                     box: true,                     hover: true,                     multipleKey: "shiftKey",                     toggleKey: "ctrlKey"                 });                 controla.events.register("featureselected", map, function(e) {                     select.addFeatures([e.feature]);                 });                 controla.events.register("featureunselected", map, function(e) {                     select.removeFeatures([e.feature]);                 });                 controla.events.register("hoverfeature", map, function(e) {                     hover.addFeatures([e.feature]);                 });                 controla.events.register("outfeature", map, function(e) {                     hover.removeFeatures([e.feature]);                 });                 map.addControl(controla);                 controla.activate();                      // map extent                         var mapextent = new OpenLayers.Bounds(-16.08,49.06,6.76,58.74).transform(WGS84, map.getProjectionObject());                         map.zoomToExtent(mapextent);                 //map.zoomToMaxExtent()                      // 33333 Customizing the panel control buttons                 dragmouse = new OpenLayers.Control.DragPan({                     title:"Pans the map with a drag of the mouse"                 });                 var panel = new OpenLayers.Control.Panel({                     defaultControl: dragmouse                 });                 panel.addControls([                 new OpenLayers.Control.ZoomBox({                     title:"Zoom box: Selecting it you can zoom on an area by clicking and dragging."                 }),                 dragmouse,                 new OpenLayers.Control.ZoomToMaxExtent({                     title:"Zoom to the max extent"                      })                 ]);                      nav = new OpenLayers.Control.NavigationHistory();                 // parent control must be added to the map                 map.addControl(nav);                 panel.addControls([nav.next, nav.previous]);                      map.addControl(panel);                      // 33333 End                  } // End of the init function


title: Spatial queries to find co-occurrences of POIs

text: Given a POI database containing different types of points, e.g. `hospital` and `pharmacy`, how can I select the locations where a hospital and a pharmacy are closer than a certain threshold (e.g. `1000m`)? The query in natural language would be expressed as:               select points where at least a hospital occurs within 1000m from at least a pharmacy      I know that I can select all hospitals and pharmacies, and compute the distance matrix between them, but I was wondering if there is a specific spatial query/operator for this kind of queries. Ideally, I would like to express such queries in ArcGIS.


title: How to change the view from layout view to data view using c# code in ArcMap?

text: How to change the view from _layout view_ to _data view_ using c# code? * * *


title: Why is SQLite python command not working?

text: I am fairly new to python and am writing a code to read imagery and insert them into an SQLite database but I get the following error               cur.execute(statement, (index,fullpath,filename))      sqlite3.OperationalError: near "index": syntax error.      What is it that I am getting wrong? The following is the code:               for root, dirnames, filenames in os.walk(basedir):         print 'root is ' + root         for filename in filenames:             ext = os.path.splitext(filename)[1].lower() #extension as lowercase                 if ext == extension:                     index = filename[:9] #tile ID                 filebase = os.path.splitext(filename)[0] #first part of filename                     fullpath = os.path.join(root,filebase) + ext #build up path again                     statement = "INSERT INTO %s (%s) VALUES " % (table,columns) + "(%s,%s,%s);"                     cur.execute(statement, (index,fullpath,filename))                 print 'catalog entry: ' + index + ', ' + fullpath


title: Using Landsat 8 for quantitative analysis - what DNs does GRASS require?

text: Hoping someone can short circuit a lot of exploration Landsat 8 values are stored as unint16 since the sensors work on a range 0 to 4096 whereas the L7+TM was 8 bit and had a digital number range 0 to 255. USGS link Looking at the unprocessed bands in QGIS, the value tool reports values of ~8000 for band 3, whereas GRASS reports values of ~0.19 . For the same bands in L7+TM band 3 values are ~30 Understandably, the output from my old workflow in GRASS is giving nonsense. i.landsat.toar does read L8 but with the funny numbers I don't expect it is on the right track. The end use is NDVI, I don't expect a pansharpening workflow to be the same. Any tips on a new workflow?


title: WFS & Feature Access -> Database connection / Database support (ArcGIS 10.2)

text: Over the last two days I've tried to set up and to use a postgreSQL database to use WFS and Feature Access. I've also started a thread in the esri forums, but I hope that I can reach a wider audience here. Some basic information, what I've done   * ArcGIS 10.2 installed on Windows Server 2012    * PostgreSQL 9.2.2 64Bit is installed on the same server as well as PostGIS 2.0   * I've edited the pg_hba.conf to have remote access.   * I've copied the necessary 32Bit client files (libeay32.dll, libiconv-2.dll, libintl-8.dll, libpq.dll, ssleay32.dll) (which I've downloaded from the Customer Portal-> Package: PostgreSQL_Client_Libraries_for_Windows_101_130031.exe) into the \bin-Directory of my ArcGIS Desktop 10.2 installation.    * I've copied the necessary 64Bit client files (libeay32.dll, libintl.dll, libpq.dll, ssleay32.dll) (which I've downloaded from the Customer Portal-> Package: PostgreSQL_Client_Libraries_for_Windows_101_130031.exe) into the \bin-Directory of my ArcGIS Server 10.2 installation. I'm even not sure, if I need this....    * I've copied the necessary st_geometry file (stored in the Installation folder of your ArcGIS installation (D:\Programs\ArcGIS 10.2\Desktop10.2\DatabaseSupport) into the \lib-Directory of my PostgreSQL 9.2.2 installation.    * I've registered the database and the folder via the ArcGIS Server manager in the data store tab. I'm not sure if this right or necessary!?   * The connection via pgAdmin works. I can connect to the database using pgAdmin. Here I have three tables: http://imgur.com/pkY0LmV   * The connection via "ArcCatalog-> Add Database Connection" is finally working. I can connect to the database. As a database I can only select "postgis20" as a database?! Any idea, why it's like that?! http://imgur.com/rQYpjbc I think that it has to be postgres, hasn't it? From now on I don't know how, what are the next steps. Can anybody confirm that the above mentioned steps are right? And it would be awesome if someone of you could give me some tips, how I have to work on or what are the next steps. Do I have to "Enable Geodatabase"? Do I have to create an Enterprise Geodatabase with the ArcToolbox Tool? I've spent too many hours without having success :( **My goal: Enabling WFS and Feature Access.** Thanks a lot **Edit** Started from scratch regarding database. See each second comment of this post and answer. Btw:...first time for me using stackexchange.com.


title: Date Time format in ArcGIS 10.1

text: I have a Date column in my feature class and I want the date to appear in "dd MMM yyyy" format as a label to a polygon. I am using Arc Map 10.1. I tried taking Jscript.               var Dt  = new Date();     Dt = Dt.toString("dd MMM yyyy");      But it gives error. I can implement the solution in jscript ,vbscript and python if available.


title: One SelectFeature control for every Layer?

text: I would like to have one SelectFeature control for every layer so that I can have different representational behaviour for every layer. Means in one layer I want to highlight the features when the mouse hovers in the next not. When I do this, only the most upper layer is producing onSelect-Events!


title: How to Make a New Shapefile Based on Attributes of an Existing Shapefile?

text: In my last post I had an issue where I wanted to create multiple shapefiles based on only one attribute field (years). How to do it was answered in that post. I want to make that tool more dynamic so that the user can select any field and any value and make a shapefile for it. Any suggestions on how to use the tool dynamic so that fields and the operator(<,<=,=,>,>=) can also be defined by the user itself. * * * I tried the following:               import arcpy     fc = arcpy.GetParameterAsText(0)     yrs = arcpy.GetParameterAsText(1)     yrs = yrs.split(';')     subtract = ''     for yr in yrs:          where = '"arcpy.GetParameterAsText(3)" arcpy.GetParameterAsText(2) ' + str(yr) + subtract          subtract = ' AND "arcpy.GetParameterAsText(3)" > ' + str(yr)          filename = str(arcpy.GetParameterAsText(3)) + '.shp'          arcpy.FeatureClassToFeatureClass_conversion(fc, "arcpy.GetParameterAsText(4)", filename, where)          del yr      I get the following error message: : ERROR 999999: Error executing function. An invalid SQL statement was used. An invalid SQL statement was used. Failed to execute (FeatureClassToFeatureClass). Also attaching the screenshot for properties while adding the script. ![enter image description here](http://i.stack.imgur.com/g10zb.jpg) ![enter image description here](http://i.stack.imgur.com/wmpsd.jpg)


title: Geoserver SLD Line styling with external graphic instead of WellKnownName

text: I have problem with styling in geoserver. Using tutorial from http://docs.geoserver.org/stable/en/user/styling/sld-cookbook/lines.html#id7 everything is ok but when I want to use ExternalGraphic instead of WKN symbol nothing happend. My sld file look like:               <?xml version="1.0" encoding="UTF-8"?>     <sld:UserStyle xmlns:sld="http://www.opengis.net/sld" xmlns="http://www.opengis.net/sld" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc">         <sld:Name>Default Styler</sld:Name>         <sld:FeatureTypeStyle>             <sld:Name>name</sld:Name>             <sld:Rule>                 <sld:LineSymbolizer>                     <sld:Stroke>                         <sld:GraphicStroke>                             <sld:Graphic>                                 <sld:ExternalGraphic>                                     <sld:OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="http://127.0.0.1/svg2.svg" />                                     <sld:Format>image/svg</sld:Format>                                 </sld:ExternalGraphic>                                 <sld:Size>16</sld:Size>                             </sld:Graphic>                         </sld:GraphicStroke>                     </sld:Stroke>                 </sld:LineSymbolizer>             </sld:Rule>         </sld:FeatureTypeStyle>     </sld:UserStyle>      Someone of you know why it happens? BTW I try make it work because I need line on my wms looking like http://goo.gl/iQmLl5 Thanks for any help.