ArcGis Engine, how to zoom&pan to selected objects?

I'm writing a program using ArcGis Engine, and need to zoom&pan into the map to show the selected content. Loading and displaying the map does work using something like this:               AxMapControl _mapControl;          // in constructor:     _mapControl = new AxMapControl();          // in loading     _mapControl.LoadMxFile(@"C:\Users\me\Documents\TestProject.mxd");       Afterwards I select some objects and want to zoom into them, but I can't find a way to get the selected extent - any pointers to achieve this?


Why doesn't the "update field of selected features" tool update my TAB file layer?

I used the selection tool to select samples with toggle editing selected, and opened the tool **update field of selected features**. But the new value entered is not updated in the .Tab value. Please suggest me. before edited ![enter image description here](http://i.stack.imgur.com/QRDnd.jpg) selected to edit or update value ![enter image description here](http://i.stack.imgur.com/Dz0OE.jpg) after edited same plot ![enter image description here](http://i.stack.imgur.com/eHxsv.jpg)


The resulting maps from a r.mapcalc script is not computed properly

_This post is a continuation of my other postWhy is my controlling shell script not working?. I created another post because this contains a separate issue that I encountered with the same scripts of the previous post._ I'm trying to do the Hydrologic Simulation seen in page 10 of this document. Here is the script:               #!/bin/sh          g.region rast=elevation.dem -p          r.mapcalc "water = 120" #12 inches of water in each cell          g.copy rast=elevation.dem,elev          d.mon x0     d.rast water     i=1          while [ $i != 100 ]     do       n=1       while [ $n != 10 ]       do         r.mapcalc < water.mapcalc # run the simulation         d.rast water         n=`expr $n + 1`       done       g.copy rast=water,water.$i       i=`expr $i + 1`     done      The following is the water.mapcalc script:               water = water + eval(x = elev + water, \     if (x > (y = elev[-1, 0] + water[-1, 0]), \        -.15 * if (elev > y, water, x - y), \        .15 * if (elev[-1, 0] > x, water[-1, 0], y - x))+ \      if (x > (y = elev[1, 0] + water[1, 0]), \        -.15 * if (elev > y, water, x - y), \        .15 * if (elev[1, 0] > x, water[1, 0], y - x))+ \      if (x > (y = elev[0, -1] + water[0, -1]), \        -.15 * if (elev > y, water, x - y), \        .15 * if (elev[0, -1] > x, water[0, -1], y - x))+ \      if (x > (y = elev[0, 1] + water[0, 1]), \        -.15 * if (elev > y, water, x - y), \        .15 * if (elev[0, 1] > x, water[0, 1], y - x))+ \      if (x > (y = elev[-1, 1] + water[-1, 1]), \        -.10 * if (elev > y, water, x - y), \        .10 * if (elev[-1, 1] > x, water[-1, 1], y - x))+ \      if (x > (y = elev[1, 1] + water[1, 1]), \        -.10 * if (elev > y, water, x - y), \        .10 * if (elev[1, 1] > x, water[1, 1], y - x))+ \      if (x > (y = elev[1, -1] + water[1, -1]), \        -.10 * if (elev > y, water, x - y), \        .10 * if (elev[1, -1] > x, water[1, -1], y - x))+ \      if (x > (y = elev[-1, -1] + water[-1, -1]), \        -.10 * if (elev > y, water, x - y), \        .10 * if (elev[-1, -1] > x, water[-1, -1], y - x)))      and I used it with the Spearfish dataset. The result of the code is that the map (elevation.dem) is getting smaller every succeeding iteration. I cannot figure out why it is happening. Isn't it that the result for every iteration (using the script above) should just be the transfer of excess height and not the cropping of the edges of the map?


Web-mapping with editing capabilities?

I'm embarking on a new web map project that seeks to display simple geometries (lines, points, polygons) and rasters/basemaps. Ideally, the map will also allow authorized users to add/remove/edit geometries and their attributes. What are the available options for the storage of data (e.g. SQL Server Spatial)? What are the available options for the presentation of data (e.g. ArcGIS Server)? I'm new to web mapping and am attempting to build a solid understanding of the available options and their pros/cons. Examples would help tremendously.


Working on a new project - I am in unfamiliar territory in GIS land. The web application will have a standard data input-output frontend, however a feature needed is to display map data inside the application. We need to be able to edit map data and also display statistical information. Is it possible to incorporate a GIS editor inside of a web application? What are your recommendations as to which software is most appropriate? The map data will be open street map data.


Cannot convert dms to dd in Excel 2007 using VBA code

I am trying to convert the data in an Excel sheet from dms (degree-minute- second) to dd (decimal degree) format using the vba script available here. Here is sample data:               53° 0'  39.31"  6° 44'  50.14"     52° 59'  51.43" 6° 46'   0.02"      In the Excel sheet, this code is working:               =Convert_Decimal("10° 27' 36""")      but this is not working:               =Convert_Decimal(B3).       The error is #value! I want rows in excel in dd format. Alternatively I want to convert this Excel file into a database but the format must be dd. Any suggestions anyone?


How to loop qgis:zonalstatistics using Python?

I'm looking for some Python + QGIS foo for the following:               import processing     for i in range (1,20):         processing.runalg("qgis:zonalstatistics", "/folder/input/raster.tif",%i,         "/folder/input/poly.shp","Var_%i",True, "/folder/output/zonalpoly_%i.shp"      The above BASH like example doesn't obviously work, but if I substitute an integer in place of %i, the script runs correctly, so I know that the syntax is correct. I'm a bit fuzzy on how to properly pass a variable into a string using Python and/or how to run a QGIS plugin from the built-in Python interpreter for QGIS. Any help would be appreciated. **Bonus upvote (once I get the ability)** : qgis:zonalstatistics calculates several summary statistics (mean, stddev, maximum, etc.) with no apparent means of specifying one or a few of these. Is there a way of specifying just one, or a few? It seems like a complete waste of processing time to calculate each if I'm only interested in one or a few measures. Cheers


Why doesn't a CartoDB layer (using cartodb.js) on top of Google Map in Firefox on Ubuntu work?

I'm creating a layer using CartoDB.js and putting it on a Google Map base layer. This works on every other browser and platform I have access to (IE, Chrome, Firefox on OS X), but does not work on Firefox (31.0) using Ubuntu (14.04). I made a simple bl.ock of this. The success callback is never called, but there aren't any errors.


Tearing in ggmap (R) after using spTransform and random point generation using splancs

I am using R and the package ggmap to try and generate some random points within the city limits of Chapel Hill, NC. I have downloaded the shapefile for the town of Chapel Hill from the Orange County website: http://web.co.orange.nc.us/gisdownloads. The city limits for Chapel Hill and several other nearby cities are in the file labeled city.zip. I saved this file to my hard drive and unzipped it. My code is as follows:               library(ggmap)     library(rgdal)          map1 <- get_map(location='Chapel Hill, NC', zoom=12, maptype='roadmap')          setwd('<Path to unzipped city.zip files>')     city <- readOGR('city.shp','city')     sub.city <- city[city$CITYCODE == "CH",] # Take only the part of the shapefile we need (the area around Chapel Hill)     city1 <- spTransform(sub.city, CRS('+proj=longlat +ellps=WGS84'))      If I simply plot `city1` the polygon looks as it should:               plot(city1)      but if I try to plot it over my street map of Chapel Hill, I get some weird tearing in the northwest part of the city:               ggmap(map1)+       geom_polygon(data=city1, aes(x=long, y=lat), color='blue', fill='blue', alpha=.3)      Why is this and how could I fix it? The second thing I want to do is generate some random points within this polygon. The package `splancs` claims to do this with its `csr()` function, but so far I cannot get this to work.               library(splancs)     poly1pl <- coordinates(city1) # Extracts long and lat into a matrix     set.seed(2913)     randpoints <- data.frame(csr(poly1pl, 20))       The last command of this gives me an error: `Error in runif(ngen) : invalid arguments` I get the same error if I try using `csr()` on `sub.city` as well, so the error is not a result of using spTransform. What does this error mean and how can I get this to work? Or is there an easier way to generate these points?


Are there any Luciad Developers?

Doing a search of GIS.StackExchange, and all of StackOverflow, for the term "Luciad" will bring up zero relevant questions about the Luciad framework. From what I understand, it is comparable in many features to other libraries such as ESRI. Why is it that no Luciad/LuciadMap questions are being asked or answered on any of these sites? Are there distinct disadvantages to the Luciad framework that prevent widespread adoption, or even discussion, of this framework?


Concatenating fields with label expressions using Python

I am trying to combine three numeric fields together for a feature's label. I only want to label the feature if it is over 0. The labeled numbers need to be separated a dash ("-"). This is what I attempted to use as the label expression in ArcMap 10.2:               def FindLabel ( [a1], [a2], [a3] ):         if ([a3]) == 0 and int([a2]) == 0 and ([a1]) == 0:             label = " "         elif ([a3]) == 0 and int([a2]) == 0             label = [a1]         elif ([a3]) == 0             label = [a1] + "-" + [a2]         else:             label = [a1] + "-" + [a2] + "-" + [a3]         return label


How to create a rectangular graphic on a single mouse click?

I'm using Silverlight plugin 5.1.3 and I'm trying to create a rectangular polygon graphic based on a mappoint. For simplicity reasons, lets assume the maps spatial reference is Web Mercator WGS84 and the rectangle is 1 Meter by 2 Meters. How can I go about this?


Counting Characters using Field Calculator - Arcmap

I am trying to use field calculator to populate a column based on the the number of characters in another column. I am using the Python Parser. I am not sure if the .count() function is appropriate in this case or if I am even using it right. Thanks in advance for your help! My pre-logic script is:               def reclass(f1):          if f1.count() >= 4:              return "Yes"           else:              return "No"                    Label = reclass( !HUB! )


RDF representation of 3D-geodata?

When it comes to 2D-data it seems there are a couple standards out there to represent it in a semantic way (GeoSPARQL, NeoGeo, ...). However I couldn't really find one to do that for 3D-data. I have some CityGML-data but that does not seem to be an appropriate format to do formal reasoning of a geometry level. Do you know of any current standard or groups that work on that problem?


Overview over the current activities and results to represent GeoData semantically to allow formal reasoning?

I am currently interested in representing some geo-data in a semantic way via RDF/OWL to allow formal reasoning on a geometry level. However I am lacking a good overview on the current standards to do so and on the benefits and limitations of each. If you could recommend a good overview webpage or paper I would be very thankful!


How to select and delete past freehand features in ArcMap?

I am editing an older map in Arcmap 10.1 and want to edit a freehand drawing someone made. I cannot "select" it or find the shapefile it was made under... Any advice? (i know how to make my own freehand drawing, but I also need to delete/edit the original one) Thanks in advance!


mapbox layer in ESRI API

I am building an application primarily with the ESRI API, but would like to load a mapbox tilelayer to use as the basemap as they are just so much more pleasing cartographically. I dont want to change the actual "map", as I need many of the widgets that need this tag to load and function correctly. was thinking of simply loading the mapbox tiles and addinn them to the map. Following the mapbox API documentation, I loaded the library:               <script src='https://api.tiles.mapbox.com/mapbox.js/v1.6.2/mapbox.js'></script>     <link href='https://api.tiles.mapbox.com/mapbox.js/v1.6.2/mapbox.css' rel='stylesheet' />      I then tried to create the layer of the map box tiles and add that to the map:               var layer = L.mapbox.tileLayer('mapbox.ID');     map.addLayer(layer);      Doing this I get two related errors. 1 - GET http://a.tiles.mapbox.com/v3/mapbox.ID.json 404 (Not Found) 2 - could not load TileJSON at http://a.tiles.mapbox.com/v3/mapbox.ID.json What am I missing


ArcGIS Geoprocessing Service returning feature class?

I am pretty new to GIS world so sorry for my silly question. My problem is i am trying to send some feature classes from gp services. I have written python toolboxes which does some business logics and generates feature classes(both point and polygon for different tools). I have published these tools as geoprocessing services and want to return these feature classes.But so far i am stuck at points where my tools does all successful processing but unable to send back the feature classes. I can generate the JSON output of the result through featureset.JSON and send it across as string but i really dont know how to consume that string to render my map at the javascript client side. I tried setting the output parameter type as "feature class", "feature set", "shape file", but the services gives a "invalid return type" error. Can somebody please help me in this.


Error importing shapefile into postgreSQL using shp2psql

I've tried this a few different ways and keep getting the same error. I have a shapefile currently in WGS84 UTM Zone 15 which is SRID 32615. I used the ArcMap multipart to singlepart tool to create a singlepart polygon. I followed the instructions found at http://postgis.net/windows_downloads to install postgresql and postgis. I open pgAdmin III and select the postgis_21_sample table. Plugins > PostGIS Shapefile and DBF Loader 21. I check connection details and it connects fine. I add my .shp file. I set Schema to public and Table to postgis_21_sample. I leave geo column alone and set SRID to 3265. When I click import I get               ==============================     Importing with configuration: postgis_21_sample, public, geom, C:\GIS\forest_buffer\postgres_single.shp, mode=c, dump=1, simple=0, geography=0, index=1, shape=1, srid=3265     Shapefile type: Polygon     PostGIS type: MULTIPOLYGON[2]     Failed SQL begins: "SET CLIENT_ENCODING TO UTF8;     SET STANDARD_CONFORMING_STRINGS TO ON;     BEGIN;     CREATE TABLE "public"."postgis_21_sample" (gid serial,     "shape_leng" numeric,     "shape_area" numeric,     "orig_fid" int4);     ALTER TABLE "public"."postgis_21_sample" ADD PRIMARY KEY (gid);"     Failed in pgui_exec(): ERROR:  function addgeometrycolumn(unknown, unknown, unknown, unknown, unknown, integer) does not exist     LINE 9: SELECT AddGeometryColumn('public','postgis_21_sample','geom'...                    ^     HINT:  No function matches the given name and argument types. You might need to add explicit type casts.          Shapefile import failed.      I've also tried projecting this shapefile to WGS84 with SRID 4326 and receive the same error. Any help would be greatly appreciated. There are >100,000 features and I need to buffer, dissolve, negative buffer, and finally buffer back to the original size to fill gaps. ArcMap and QGIS fail to do it after days of waiting. Thanks


How to create a array variable containing the values of another variable in a table?

I am new to mapbasic and would like to have an array variable (sac) in order to access it through the "For variable = 1 To n" function. I would like to create a loop that only takes on the value of a variable (var) in a table and loops through all the values in that Table.               Include "Mapbasic.def"     Declare Sub Main()          Dim sac(100) As Integer     Dim var As Integer          Sub Main()          Sac(1) = 50     Sac (100) = 1200          For sac = 1 to sac(100)          Next          End Sub


How to get started GeoExt?

I downloaded GeoExt to follow the Boundless tutorials. Already have geoserver installed on my local machine running in Jetty that comes by default in the installer for Windows, with openlayers putting my pages in the `www` folder of geoserver and accessing the browser. My question is where should I unzip the GeoExt?


What is ArcGIS's lightest-weight data type for web mapping apps to minimize network io?

I am wanting to move geometries/attributes to and from arcgis server and web client. If, I've already thought through my network io vs app architecture and have concluded with architecture Z (really I just have enough time to optimize where easiest!..low hanging fruit!) My specific use case is in regard to handling feature records varyingly based on attributes which would be boolean. I will either put 1 or 0 in certain fields and do something useful for each of these? If I am doing field creation via a dbf template on ArcGIS Server with python, what should my boolean fields be if I want to minimize traffic? Text with 1 of Length 1 or Short of Precision 1 or other? Please provide some explanation/link to help or other. Thanks.


Passing reclassification values to the Reclassify tool in Model Builder in ArcGIS 10

There is a set of point features that fall within polygon features, and I want these polygon features (after converting them to raster) reclassified based on how many point features fall in them. If the reclassification method, the number of classes, and the new values remain constant, is there any way of passing these to the Reclassify tool every time I run the model?


How to get libspatialite.so file for spatialite

I am creating an application using spatialite database. I checked couple of tutorial from internet. Most of them explains the same. But the problem is I need "libspatialite.so" extension library. I do not know how to get it. So whenever i run my code it shows the following warning and error....               [Warning: SQLite3::query() [sqlite3.query]: Unable to prepare statement: 1, no such module:]     [Fatal error: Call to a member function fetchArray() on a non-object]      But my code looks OK. It looks like because of i could not load the extention "libspatialite.so" I have given bellow, my code.               <?php          $db = new SQLite3('sixcommunes.sqlite');           $db->loadExtension('libspatialite.so');           $db->exec("SELECT InitSpatialMetadata()");          $rs = $db->query('SELECT sqlite_version()');          while ($row = $rs->fetchArray()) {         print "
SpatialLite version: $row[0]
";     }          $sql = "SELECT KOM_NAMN FROM '6communes_SWEREF99TM'";          $rs = $db->query($sql);     $msg = "";     while($row = $rs->fetchArray()){             $msg = $row[0];         print "
$msg
";     }     $db->close();     ?>


How to populate From Node and To Node fields for a polyline feature class? (ArcGIS 10)

I need to populate FNODE and TNODE fields for my roads dataset. I have an intersections point feature class that has unique ids, and I need each road segment to have an FNODE and TNODE value that corresponds to the intersection id. The roads are broken into segments at each intersection so that each segment only touches 2 intersection points. I thought that maybe Network Analyst generated these, but it doesn't look like it actually writes these values. Does anyone know how to generate these? This dataset won't be used in Network Analyst - it will be used in a custom legacy add in that a client uses.


Retrieving Google Map data into Matlab to plot points

First of all, I hope this question isn't too basic, obvious or inappropriate for this forum. I'm very new to using map data. I'm working on a project on more accurate map routing using Matlab. My question is: I'm getting data from Google Map but how can I retrieve it to Matlab and plotting it?


ArcObjects SDK 10 .net framework create a Network dataset Exception from HRESULT: 0x800422D4

I am trying to work through the "How to Create a Network Dataset" using the ArcObjects SDK 10 for the .NET Framework example. but the line: Dim netDataset As INetworkDataset = CType(dsc2.CreateDataset(deND), INetworkDataset) Throws Exception from HRESULT: 0x800422D4 What am I doing wrong?               Imports ESRI.ArcGIS.esriSystem     Imports ESRI.ArcGIS.RuntimeManager     Imports ESRI.ArcGIS.Geodatabase          Partial Class Create_Network_Dataset     Inherits System.Web.UI.Page          Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load              ESRI.ArcGIS.RuntimeManager.BindLicense(ESRI.ArcGIS.ProductCode.Desktop)              Dim licenseProductCode As ESRI.ArcGIS.esriSystem.esriLicenseProductCode = New ESRI.ArcGIS.esriSystem.esriLicenseProductCode         licenseProductCode = esriLicenseProductCode.esriLicenseProductCodeAdvanced              Dim licenseExtensionCode As ESRI.ArcGIS.esriSystem.esriLicenseExtensionCode = New ESRI.ArcGIS.esriSystem.esriLicenseExtensionCode         licenseExtensionCode = esriLicenseExtensionCode.esriLicenseExtensionCodeNetwork              Dim licenseStatus As ESRI.ArcGIS.esriSystem.esriLicenseStatus         licenseStatus = CheckOutExtensionLicense(licenseProductCode, licenseExtensionCode)              ' Create an empty data element for a buildable network dataset.         Dim deND As IDENetworkDataset2 = New DENetworkDataset         deND.Buildable = True              ' Open the feature dataset and CType to the IGeoDataset interface.         Dim factoryType As Type = Type.GetTypeFromProgID("esriDataSourcesGDB.FileGDBWorkspaceFactory")         Dim gdbWSF As IWorkspaceFactory2 = CType(Activator.CreateInstance(factoryType), IWorkspaceFactory2)         Dim gdbFWS As IFeatureWorkspace = CType(gdbWSF.OpenFromFile("C:\arcgis\ArcTutor\Network Analyst\Tutorial\SanFrancisco.gdb", 0), IFeatureWorkspace)         Dim fdsGDS As IGeoDataset = CType(gdbFWS.OpenFeatureDataset("Transportation"), IGeoDataset)              ' Copy the feature dataset's extent and spatial reference to the network dataset data element.         Dim deGDS As IDEGeoDataset = CType(deND, IDEGeoDataset)         deGDS.Extent = fdsGDS.Extent         deGDS.SpatialReference = fdsGDS.SpatialReference              ' Specify the name of the network dataset.         Dim dataElement As IDataElement = CType(deND, IDataElement)         dataElement.Name = "Streets_ND"              ' Specify the network dataset's elevation model.         deND.ElevationModel = esriNetworkElevationModel.esriNEMElevationFields              ' Create an EdgeFeatureSource object and point it to the Streets feature class.         Dim edgeNetSource As INetworkSource = New EdgeFeatureSource         edgeNetSource.Name = "Streets"         edgeNetSource.ElementType = esriNetworkElementType.esriNETEdge              ' Set the edge feature source's connectivity settings.         Dim edgeFS As IEdgeFeatureSource = CType(edgeNetSource, IEdgeFeatureSource)         With edgeFS             .UsesSubtypes = False             .ClassConnectivityGroup = 1             .ClassConnectivityPolicy = esriNetworkEdgeConnectivityPolicy.esriNECPEndVertex             .FromElevationFieldName = "F_ELEV"             .ToElevationFieldName = "T_ELEV"         End With              ' Create a StreetNameFields object and populate its settings.         Dim snf As IStreetNameFields2 = New StreetNameFields         With snf             .Priority = 1 'Priority 1 indicates the primary street name.             .StreetNameFieldName = "NAME"         End With              ' Add the StreetNameFields object to a new NetworkSourceDirections object,         ' then add it to the EdgeFeatureSource created earlier.         Dim nsd As INetworkSourceDirections = New NetworkSourceDirections         Dim snfArray As IArray = New ESRI.ArcGIS.esriSystem.Array         snfArray.Add(snf)         nsd.StreetNameFields = snfArray         edgeNetSource.NetworkSourceDirections = nsd              deND.SupportsTurns = True              ' Create a TurnFeatureSource object and point it to the RestrictedTurns feature class.         Dim turnNetSource As INetworkSource = New TurnFeatureSource         turnNetSource.Name = "RestrictedTurns"         turnNetSource.ElementType = esriNetworkElementType.esriNETTurn              Dim sourceArray As IArray = New ESRI.ArcGIS.esriSystem.Array         With sourceArray             .Add(edgeNetSource)             .Add(turnNetSource)         End With              deND.Sources = sourceArray              ' Create a new TrafficData object and populate its historical traffic settings.         Dim histTraff As IHistoricalTrafficData = New TrafficData              With histTraff             ' Populate the speed profile table settings.             .ProfilesTableName = "DailyProfiles"             .FirstTimeSliceFieldName = "TimeFactor_0400"             .LastTimeSliceFieldName = "TimeFactor_2155"             .TimeSliceDurationInMinutes = 5             .FirstTimeSliceStartTime = New DateTime(1, 1, 1, 4, 0, 0) ' 4 AM             ' Note: the last time slice finish time is implied from the above settings and need not be specified.                  ' Populate the street-speed profile join table settings.             .JoinTableName = "Streets_DailyProfiles"             .JoinTableBaseTravelTimeFieldName = "FreeflowMinutes"             .JoinTableBaseTravelTimeUnits = esriNetworkAttributeUnits.esriNAUMinutes             Dim fieldNames As IStringArray = New Names             With fieldNames                 .Add("PROFILE_1")                 .Add("PROFILE_2")                 .Add("PROFILE_3")                 .Add("PROFILE_4")                 .Add("PROFILE_5")                 .Add("PROFILE_6")                 .Add("PROFILE_7")             End With             .JoinTableProfileIDFieldNames = fieldNames         End With              ' Add the traffic data to the network dataset data element.         deND.TrafficData = CType(histTraff, ITrafficData)                   Dim attrArray As IArray = New ESRI.ArcGIS.esriSystem.Array         ' Initialize variables reused when creating attributes:         Dim evalNetAttr As IEvaluatedNetworkAttribute         Dim netAttr2 As INetworkAttribute2         Dim netFieldEval As INetworkFieldEvaluator         Dim netConstEval As INetworkConstantEvaluator              ' Create an EvaluatedNetworkAttribute object and populate its settings.         evalNetAttr = New EvaluatedNetworkAttribute         netAttr2 = CType(evalNetAttr, INetworkAttribute2)         With netAttr2             .Name = "Oneway"             .UsageType = esriNetworkAttributeUsageType.esriNAUTRestriction             .DataType = esriNetworkAttributeDataType.esriNADTBoolean             .Units = esriNetworkAttributeUnits.esriNAUUnknown             .UseByDefault = True         End With              ' Create evaluator objects and set them on the EvaluatedNetworkAttribute object.         netFieldEval = New NetworkFieldEvaluator         netFieldEval.SetExpression("restricted", _                                    "restricted = False" & vbNewLine & _                                    "Select Case UCase([ONEWAY])" & vbNewLine & _                                    "  Case ""N"", ""TF"", ""T"": restricted = True" & vbNewLine & _                                    "End Select")         evalNetAttr.Evaluator(edgeNetSource, esriNetworkEdgeDirection.esriNEDAlongDigitized) = CType(netFieldEval, INetworkEvaluator2)              netFieldEval = New NetworkFieldEvaluator         netFieldEval.SetExpression("restricted", _                                    "restricted = False" & vbNewLine & _                                    "Select Case UCase([ONEWAY])" & vbNewLine & _                                    "  Case ""N"", ""FT"", ""F"": restricted = True" & vbNewLine & _                                    "End Select")         evalNetAttr.Evaluator(edgeNetSource, esriNetworkEdgeDirection.esriNEDAgainstDigitized) = CType(netFieldEval, INetworkEvaluator2)              netConstEval = New NetworkConstantEvaluator         netConstEval.ConstantValue = False 'False means Traversable (that is, not restricted).         evalNetAttr.DefaultEvaluator(esriNetworkElementType.esriNETEdge) = CType(netConstEval, INetworkEvaluator2)         evalNetAttr.DefaultEvaluator(esriNetworkElementType.esriNETJunction) = CType(netConstEval, INetworkEvaluator2)         evalNetAttr.DefaultEvaluator(esriNetworkElementType.esriNETTurn) = CType(netConstEval, INetworkEvaluator2)              ' Add the attribute to the array.         attrArray.Add(evalNetAttr)              ' Create an EvaluatedNetworkAttribute object and populate its settings.         evalNetAttr = New EvaluatedNetworkAttribute         netAttr2 = CType(evalNetAttr, INetworkAttribute2)         With netAttr2             .Name = "Minutes"             .UsageType = esriNetworkAttributeUsageType.esriNAUTCost             .DataType = esriNetworkAttributeDataType.esriNADTDouble             .Units = esriNetworkAttributeUnits.esriNAUMinutes             .UseByDefault = False         End With              ' Create evaluator objects and set them on the EvaluatedNetworkAttribute object.         netFieldEval = New NetworkFieldEvaluator         netFieldEval.SetExpression("[MINUTES]", "")         evalNetAttr.Evaluator(edgeNetSource, esriNetworkEdgeDirection.esriNEDAlongDigitized) = CType(netFieldEval, INetworkEvaluator2)         evalNetAttr.Evaluator(edgeNetSource, esriNetworkEdgeDirection.esriNEDAgainstDigitized) = CType(netFieldEval, INetworkEvaluator2)              netConstEval = New NetworkConstantEvaluator         netConstEval.ConstantValue = 0         evalNetAttr.DefaultEvaluator(esriNetworkElementType.esriNETEdge) = CType(netConstEval, INetworkEvaluator2)         evalNetAttr.DefaultEvaluator(esriNetworkElementType.esriNETJunction) = CType(netConstEval, INetworkEvaluator2)         evalNetAttr.DefaultEvaluator(esriNetworkElementType.esriNETTurn) = CType(netConstEval, INetworkEvaluator2)              ' Add the attribute to the array.         attrArray.Add(evalNetAttr)              ' Create an EvaluatedNetworkAttribute object and populate its settings.         evalNetAttr = New EvaluatedNetworkAttribute         netAttr2 = CType(evalNetAttr, INetworkAttribute2)         With netAttr2             .Name = "Meters"             .UsageType = esriNetworkAttributeUsageType.esriNAUTCost             .DataType = esriNetworkAttributeDataType.esriNADTDouble             .Units = esriNetworkAttributeUnits.esriNAUMeters             .UseByDefault = False         End With              ' Create evaluator objects and set them on the EvaluatedNetworkAttribute object.         netFieldEval = New NetworkFieldEvaluator         netFieldEval.SetExpression("[METERS]", "")         evalNetAttr.Evaluator(edgeNetSource, esriNetworkEdgeDirection.esriNEDAlongDigitized) = CType(netFieldEval, INetworkEvaluator2)         evalNetAttr.Evaluator(edgeNetSource, esriNetworkEdgeDirection.esriNEDAgainstDigitized) = CType(netFieldEval, INetworkEvaluator2)              netConstEval = New NetworkConstantEvaluator         netConstEval.ConstantValue = 0         evalNetAttr.DefaultEvaluator(esriNetworkElementType.esriNETEdge) = CType(netConstEval, INetworkEvaluator2)         evalNetAttr.DefaultEvaluator(esriNetworkElementType.esriNETJunction) = CType(netConstEval, INetworkEvaluator2)         evalNetAttr.DefaultEvaluator(esriNetworkElementType.esriNETTurn) = CType(netConstEval, INetworkEvaluator2)              ' Add the attribute to the array.         attrArray.Add(evalNetAttr)              ' Create an EvaluatedNetworkAttribute object and populate its settings.         evalNetAttr = New EvaluatedNetworkAttribute         netAttr2 = CType(evalNetAttr, INetworkAttribute2)         With netAttr2             .Name = "RoadClass"             .UsageType = esriNetworkAttributeUsageType.esriNAUTDescriptor             .DataType = esriNetworkAttributeDataType.esriNADTInteger             .Units = esriNetworkAttributeUnits.esriNAUUnknown             .UseByDefault = False         End With              ' Create evaluator objects and set them on the EvaluatedNetworkAttribute object.         netFieldEval = New NetworkFieldEvaluator         netFieldEval.SetExpression("rc", _                                    "rc = 1          'Local road" & vbNewLine & _                                    "If [FEATTYP] = 4130 Then" & vbNewLine & _                                    "  rc = 4          'Ferry" & vbNewLine & _                                    "Else" & vbNewLine & _                                    "  Select Case [FOW]" & vbNewLine & _                                    "    Case 1: rc = 2          'Highway" & vbNewLine & _                                    "    Case 10: rc = 3          'Ramp" & vbNewLine & _                                    "    Case 4: rc = 5          'Roundabout" & vbNewLine & _                                    "  End Select" & vbNewLine & _                                    "End If")         evalNetAttr.Evaluator(edgeNetSource, esriNetworkEdgeDirection.esriNEDAlongDigitized) = CType(netFieldEval, INetworkEvaluator2)         evalNetAttr.Evaluator(edgeNetSource, esriNetworkEdgeDirection.esriNEDAgainstDigitized) = CType(netFieldEval, INetworkEvaluator2)              netConstEval = New NetworkConstantEvaluator         netConstEval.ConstantValue = 0         evalNetAttr.DefaultEvaluator(esriNetworkElementType.esriNETEdge) = CType(netConstEval, INetworkEvaluator2)         evalNetAttr.DefaultEvaluator(esriNetworkElementType.esriNETJunction) = CType(netConstEval, INetworkEvaluator2)         evalNetAttr.DefaultEvaluator(esriNetworkElementType.esriNETTurn) = CType(netConstEval, INetworkEvaluator2)              ' Add the attribute to the array.         attrArray.Add(evalNetAttr)              ' Create an EvaluatedNetworkAttribute object and populate its settings.         evalNetAttr = New EvaluatedNetworkAttribute         netAttr2 = CType(evalNetAttr, INetworkAttribute2)         With netAttr2             .Name = "WeekdayFallbackTravelTime"             .UsageType = esriNetworkAttributeUsageType.esriNAUTCost             .DataType = esriNetworkAttributeDataType.esriNADTDouble             .Units = esriNetworkAttributeUnits.esriNAUMinutes             .UseByDefault = False         End With              ' Create evaluator objects and set them on the EvaluatedNetworkAttribute object.         netFieldEval = New NetworkFieldEvaluator         netFieldEval.SetExpression("[FT_WeekdayMinutes]", "")         evalNetAttr.Evaluator(edgeNetSource, esriNetworkEdgeDirection.esriNEDAlongDigitized) = CType(netFieldEval, INetworkEvaluator2)         netFieldEval = New NetworkFieldEvaluator         netFieldEval.SetExpression("[TF_WeekdayMinutes]", "")         evalNetAttr.Evaluator(edgeNetSource, esriNetworkEdgeDirection.esriNEDAgainstDigitized) = CType(netFieldEval, INetworkEvaluator2)              netConstEval = New NetworkConstantEvaluator         netConstEval.ConstantValue = 0         evalNetAttr.DefaultEvaluator(esriNetworkElementType.esriNETEdge) = CType(netConstEval, INetworkEvaluator2)         evalNetAttr.DefaultEvaluator(esriNetworkElementType.esriNETJunction) = CType(netConstEval, INetworkEvaluator2)         evalNetAttr.DefaultEvaluator(esriNetworkElementType.esriNETTurn) = CType(netConstEval, INetworkEvaluator2)              ' Add the attribute to the array.         attrArray.Add(evalNetAttr)              ' Create an EvaluatedNetworkAttribute object and populate its settings.         evalNetAttr = New EvaluatedNetworkAttribute         netAttr2 = CType(evalNetAttr, INetworkAttribute2)         With netAttr2             .Name = "WeekendFallbackTravelTime"             .UsageType = esriNetworkAttributeUsageType.esriNAUTCost             .DataType = esriNetworkAttributeDataType.esriNADTDouble             .Units = esriNetworkAttributeUnits.esriNAUMinutes             .UseByDefault = False         End With              ' Create evaluator objects and set them on the EvaluatedNetworkAttribute object.         netFieldEval = New NetworkFieldEvaluator         netFieldEval.SetExpression("[FT_WeekendMinutes]", "")         evalNetAttr.Evaluator(edgeNetSource, esriNetworkEdgeDirection.esriNEDAlongDigitized) = CType(netFieldEval, INetworkEvaluator2)         netFieldEval = New NetworkFieldEvaluator         netFieldEval.SetExpression("[TF_WeekendMinutes]", "")         evalNetAttr.Evaluator(edgeNetSource, esriNetworkEdgeDirection.esriNEDAgainstDigitized) = CType(netFieldEval, INetworkEvaluator2)              netConstEval = New NetworkConstantEvaluator         netConstEval.ConstantValue = 0         evalNetAttr.DefaultEvaluator(esriNetworkElementType.esriNETEdge) = CType(netConstEval, INetworkEvaluator2)         evalNetAttr.DefaultEvaluator(esriNetworkElementType.esriNETJunction) = CType(netConstEval, INetworkEvaluator2)         evalNetAttr.DefaultEvaluator(esriNetworkElementType.esriNETTurn) = CType(netConstEval, INetworkEvaluator2)              ' Add the attribute to the array.         attrArray.Add(evalNetAttr)              ' Create an EvaluatedNetworkAttribute object and populate its settings.         evalNetAttr = New EvaluatedNetworkAttribute         netAttr2 = CType(evalNetAttr, INetworkAttribute2)         With netAttr2             .Name = "TravelTime"             .UsageType = esriNetworkAttributeUsageType.esriNAUTCost             .DataType = esriNetworkAttributeDataType.esriNADTDouble             .Units = esriNetworkAttributeUnits.esriNAUMinutes             .UseByDefault = True         End With              ' Create evaluator objects and set them on the EvaluatedNetworkAttribute object.         Dim histTravelTimeEval As IHistoricalTravelTimeEvaluator = New NetworkEdgeTrafficEvaluator         histTravelTimeEval.WeekdayFallbackAttributeName = "WeekdayFallbackTravelTime"         histTravelTimeEval.WeekendFallbackAttributeName = "WeekendFallbackTravelTime"         histTravelTimeEval.TimeNeutralAttributeName = "Minutes"         evalNetAttr.Evaluator(edgeNetSource, esriNetworkEdgeDirection.esriNEDAlongDigitized) = CType(histTravelTimeEval, INetworkEvaluator2)         evalNetAttr.Evaluator(edgeNetSource, esriNetworkEdgeDirection.esriNEDAgainstDigitized) = CType(histTravelTimeEval, INetworkEvaluator2)              netConstEval = New NetworkConstantEvaluator         netConstEval.ConstantValue = 0         evalNetAttr.DefaultEvaluator(esriNetworkElementType.esriNETEdge) = CType(netConstEval, INetworkEvaluator2)         evalNetAttr.DefaultEvaluator(esriNetworkElementType.esriNETJunction) = CType(netConstEval, INetworkEvaluator2)         evalNetAttr.DefaultEvaluator(esriNetworkElementType.esriNETTurn) = CType(netConstEval, INetworkEvaluator2)              ' Add the attribute to the array.         attrArray.Add(evalNetAttr)              ' Create an EvaluatedNetworkAttribute object and populate its settings.         evalNetAttr = New EvaluatedNetworkAttribute         netAttr2 = CType(evalNetAttr, INetworkAttribute2)         With netAttr2             .Name = "RestrictedTurns"             .UsageType = esriNetworkAttributeUsageType.esriNAUTRestriction             .DataType = esriNetworkAttributeDataType.esriNADTBoolean             .Units = esriNetworkAttributeUnits.esriNAUUnknown             .UseByDefault = True         End With              ' Create evaluator objects and set them on the EvaluatedNetworkAttribute object.         netConstEval = New NetworkConstantEvaluator         netConstEval.ConstantValue = True 'True means Restricted.         evalNetAttr.Evaluator(turnNetSource, esriNetworkEdgeDirection.esriNEDNone) = CType(netConstEval, INetworkEvaluator2)              netConstEval = New NetworkConstantEvaluator         netConstEval.ConstantValue = False 'False means Traversable (that is, not restricted).         evalNetAttr.DefaultEvaluator(esriNetworkElementType.esriNETEdge) = CType(netConstEval, INetworkEvaluator2)         evalNetAttr.DefaultEvaluator(esriNetworkElementType.esriNETJunction) = CType(netConstEval, INetworkEvaluator2)         evalNetAttr.DefaultEvaluator(esriNetworkElementType.esriNETTurn) = CType(netConstEval, INetworkEvaluator2)              ' Add the attribute to the array.         attrArray.Add(evalNetAttr)              ' Create an EvaluatedNetworkAttribute object and populate its settings.         evalNetAttr = New EvaluatedNetworkAttribute         netAttr2 = CType(evalNetAttr, INetworkAttribute2)         With netAttr2             .Name = "HierarchyMultiNet"             .UsageType = esriNetworkAttributeUsageType.esriNAUTHierarchy             .DataType = esriNetworkAttributeDataType.esriNADTInteger             .Units = esriNetworkAttributeUnits.esriNAUUnknown             .UseByDefault = False         End With              ' Create evaluator objects and set them on the EvaluatedNetworkAttribute object.         netFieldEval = New NetworkFieldEvaluator         netFieldEval.SetExpression("h", _                                    "h = [NET2CLASS] + 1" & vbNewLine & _                                    "if h > 5 then h = 5")         evalNetAttr.Evaluator(edgeNetSource, esriNetworkEdgeDirection.esriNEDAlongDigitized) = CType(netFieldEval, INetworkEvaluator2)         evalNetAttr.Evaluator(edgeNetSource, esriNetworkEdgeDirection.esriNEDAgainstDigitized) = CType(netFieldEval, INetworkEvaluator2)              netConstEval = New NetworkConstantEvaluator         netConstEval.ConstantValue = 0         evalNetAttr.DefaultEvaluator(esriNetworkElementType.esriNETEdge) = CType(netConstEval, INetworkEvaluator2)         evalNetAttr.DefaultEvaluator(esriNetworkElementType.esriNETJunction) = CType(netConstEval, INetworkEvaluator2)         evalNetAttr.DefaultEvaluator(esriNetworkElementType.esriNETTurn) = CType(netConstEval, INetworkEvaluator2)              ' Add the attribute to the array.         attrArray.Add(evalNetAttr)              ' Since this is the hierarchy attribute, also set it as the hierarchy cluster attribute.         deND.HierarchyClusterAttribute = CType(evalNetAttr, INetworkAttribute)              ' Specify the ranges for the hierarchy levels.         With deND             .HierarchyLevelCount = 3             .MaxValueForHierarchy(1) = 2 ' level 1: up to 2             .MaxValueForHierarchy(2) = 4 ' level 2: 3 - 4             .MaxValueForHierarchy(3) = 5 ' level 3: 5 and higher (the values of h only go up to 5)         End With              deND.Attributes = attrArray              ' Create a NetworkDirections object and populate its settings.         Dim netDirections As INetworkDirections = New NetworkDirections         With netDirections             .DefaultOutputLengthUnits = esriNetworkAttributeUnits.esriNAUMiles             .LengthAttributeName = "Meters"             .TimeAttributeName = "Minutes"             .RoadClassAttributeName = "RoadClass"         End With         Dim netDirSignposts As ISignposts = CType(netDirections, ISignposts)         netDirSignposts.SignpostFeatureClassName = "Signposts"         netDirSignposts.SignpostStreetsTableName = "Signposts_Streets"              ' Add the NetworkDirections object to the network dataset data element.         deND.Directions = netDirections              ' Get the feature dataset extension and create the network dataset based on the data element.         Dim fdxc As IFeatureDatasetExtensionContainer = CType(fdsGDS, IFeatureDatasetExtensionContainer)         Dim fdx As IFeatureDatasetExtension2 = fdxc.FindExtension(esriDatasetType.esriDTNetworkDataset)         Dim dsc2 As IDatasetContainer3 = CType(fdx, IDatasetContainer3)              ' The next line throws Exception from HRESULT: 0x800422D4              Dim netDataset As INetworkDataset = CType(dsc2.CreateDataset(deND), INetworkDataset)              ' The C# sample code has an extra line but the same error is generated               'Dim deDataset As IDEDataset = CType(deND, IDEDataset)         'Dim netDataset As INetworkDataset = CType(dsc2.CreateDataset(deDataset), INetworkDataset)              ' Once the network dataset is created, build it.         Dim netBuild As INetworkBuild = CType(netDataset, INetworkBuild)         netBuild.BuildNetwork(fdsGDS.Extent)               End Sub          Public Function CheckOutExtensionLicense(ByVal licenseProductCode As ESRI.ArcGIS.esriSystem.esriLicenseProductCode, ByVal licenseExtensionCode As ESRI.ArcGIS.esriSystem.esriLicenseExtensionCode) As ESRI.ArcGIS.esriSystem.esriLicenseStatus              Dim aoInitialize As ESRI.ArcGIS.esriSystem.IAoInitialize = New ESRI.ArcGIS.esriSystem.AoInitializeClass         Dim licenseStatus As ESRI.ArcGIS.esriSystem.esriLicenseStatus = aoInitialize.IsExtensionCodeAvailable(licenseProductCode, licenseExtensionCode)              If licenseStatus = ESRI.ArcGIS.esriSystem.esriLicenseStatus.esriLicenseAvailable Then                  licenseStatus = aoInitialize.Initialize(licenseProductCode)              End If              If licenseStatus = ESRI.ArcGIS.esriSystem.esriLicenseStatus.esriLicenseCheckedOut Then                  licenseStatus = aoInitialize.CheckOutExtension(licenseExtensionCode)              End If              Return licenseStatus          End Function          End Class


Adding a point and then saving it to the server

This seems like a fairly simple thing to do, but I am not exactly sure how to complete it. I use ArcGIS for Server. I have all of my data for my feature layer on that database. The point is being added by coordinates, but it is not saving to the database. I am getting the error "An error occurred in the database" in my server logs. My code is below. Here is the log:               <?xml version="1.0" encoding="utf-8" ?>     <Msg time='2014-03-31T11:06:05,468' type='SEVERE' code='17000' target='Calvert_City_Test.MapServer' methodName='GraphicFeatureLayer.Add' machine='ARCGIS-PC' process='696' thread='3204' user='anonymous' >A database error occurred.</Msg>     <Msg time='2014-03-31T11:06:05,810' type='SEVERE' code='17000' target='Calvert_City_Test.MapServer' methodName='GraphicFeatureServer.HandleREST_ApplyEditsOperation' machine='ARCGIS-PC' process='696' thread='3204' user='anonymous' >A database error occurred.</Msg>     <Msg time='2014-03-31T11:08:49,895' type='SEVERE' code='17000' target='Calvert_City_Test.MapServer' methodName='GraphicFeatureLayer.Add' machine='ARCGIS-PC' process='696' thread='3204' user='anonymous' >A database error occurred.</Msg>     <Msg time='2014-03-31T11:08:49,965' type='SEVERE' code='17000' target='Calvert_City_Test.MapServer' methodName='GraphicFeatureServer.HandleREST_ApplyEditsOperation' machine='ARCGIS-PC' process='696' thread='3204' user='anonymous' >A database error occurred.</Msg>      Each time I add it produces two error messages. This is showing me trying to add a feature two separate times. Here is my XAML:                 <esri:FeatureLayer ID="Meters"                          Url="http://xx.xx.xxx.xx/arcgis/rest/services/Calvert_City_Test/FeatureServer/2"                         MouseLeftButtonUp="FeatureLayer_MouseLeftButtonUp"                          DisableClientCaching="True"                         OnDemandCacheSize="0"                         Mode="OnDemand"                         AutoSave="False"      C#:                private void CorrectInformationButton_Click(object sender, RoutedEventArgs e)             {                 CheckAddedPoint.Visibility = Visibility.Collapsed;                 OptionsPortal.Visibility = Visibility.Visible;                      FeatureLayer featurelayer = MyMap.Layers["Meters"] as FeatureLayer;                      double latitude = Convert.ToDouble(addLat);                 double longitude = Convert.ToDouble(addLong);                      Graphic graphic = new Graphic()                 {                     Geometry = _mercator.FromGeographic(new MapPoint(longitude, latitude)),                     Symbol = LayoutRoot.Resources["DefaultMarkerSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol                 };                  graphic.Attributes["OBJECTID"] = 244;             graphic.Attributes["PWSID"] = "55555";             graphic.Attributes["CIS_METR"] = addAccount;             graphic.Attributes["CUSTYPE"] = " ";             graphic.Attributes["SIZE"] = Convert.ToDouble(5);             graphic.Attributes["TYPE"] = " ";             graphic.Attributes["OTHTYPE"] = " ";             graphic.Attributes["MANUF"] = " ";             graphic.Attributes["MODEL"] = " ";             graphic.Attributes["YEAR"] = " ";             graphic.Attributes["TESTDATE"] = " ";             graphic.Attributes["MASTER"] = " ";             graphic.Attributes["MBOX"] = " ";             graphic.Attributes["MBOXTYPE"] = " ";             graphic.Attributes["PLACE"] = " ";             graphic.Attributes["STR"] = addStreet;             graphic.Attributes["CITY"] = addcity;             graphic.Attributes["COUNTY"] = " ";             graphic.Attributes["AGENCY_CON"] = " ";             graphic.Attributes["CONTACT"] = " ";             graphic.Attributes["LAST_UPDT"] = " ";             graphic.Attributes["XY_SOURCE"] = " ";             graphic.Attributes["XY_ISSUES"] = " ";             graphic.Attributes["COMMENTS"] = addName;             graphic.Attributes["SHAPE"] = null;                           featurelayer.Graphics.Add(graphic);                 featurelayer.SaveEdits();             }      Any help would be appreciated. Thank you in advance for your help.


How to Export/Print/Save CMYK colored map to SVG, PDF, or PRN/EPS file

I am a beginner using QGIS 2.0.1 on Windows. Following Data-defined Styles in QGIS I fill CMYK values on my map layers, but I cannot Export/Print/Save CMYK to SVG, PDF, or PRN/EPS file. I see only RGB values on exported vectors. What is the best way to export CMYK colored map to prepress software like Illustrator? Thank you all in advance for the support.


Render huge amount of points on a map

I already had a look here. My situation is, I have huge amount of points (about 1 million). I have to display these points on a map. I searched but I found arcgis solutions. I want an open source one. I started of with leaflet. In leaflet, we can cluster the points, but I cant do that, because my points represent a trend on surface of the Earth, and cluster looses that information. I am looking for options. Let me know if you need more information.


How do I use SQL in the field calculator to populate a new column?

Courtesy of Geofabrik I have a "places" point shapefile which includes in the attribute table a column named "type". As can be seen in the attached image the column contains fields such as "city", "town" and "village". For labelling purposes I wish to populate the "font" column with integers such that when "type" = 'village' then "font" will be set to (say) 7, or when "type" = 'city' then "font" will be set to (say) 12, and so on. Best wishes. ![enter image description here](http://i.stack.imgur.com/UYqXX.jpg)


Convert multiple Shapefiles in Raster in R(and then plot it)

I'm trying to convert several shapefiles in rasters at the same time. I already was able to read the shapefiles by doing this:               library(maptools)          shps <- dir(getwd(), "*.shp")     for (shp in shps) assign(shp, readShapePoly(shp))     for(j in 1:245)     {     New<-readShapePoly(shps[j])          }      But now, I don't know how to convert these to raster and then plotting it. I tried the commands on this page, but I only obtain errors


How to calculate weighted mean coordinates with negative weights in QGIS?

_Hi, I'm pretty new to prof. GIS, but have OSM experience. So if I just miss something obvious, please don't punish me :)_ I have a .CSV file with measurements of wifis along a track. I like to guess the wifi accesspoint positions by using the signal levels during the tracking. Adding the locations works fine (coloured circle markers), but applying the mean coordinates feature to the point layer results only in the usual centeroid (blue star) of the convex shape polygone(soft yellow) and seems to take not the signal level into account: ![no mean coordinates](https://f92fac806bf10a96c0b8-8a0a46e5f1a5cc9854958bc3503f0f88.ssl.cf1.rackcdn.com/media_entries/5906/qgis_poly_center.png) But I expect that the new position should be usual more close to the dark blue circles in the south. So my CSV structure looks like               trackpoint_id, lat, lon, ..., signal     1, 54... , 12... ,..., -90.0     2  54... , 12... ,..., -74.0      The signal col is recognized as double. As signal is in dbm so negativ ( **smallest negativ number is best** ) and logarithmic scale, I might need to create a new column containing a cleared signal_strength? Sadly the log doesn't tell me if the mean coordinates tool has problems with computation :(


Can I do a toggle map view with multiple layers in the cartodb UI?

I have successfully created a toggle map following the instructions in this tutorial http://developers.cartodb.com/tutorials/toggle_map_view.html. The toggle map is linked to a map in my cartodb account that has two layers in the UI - the first layer shows colored points in a choropleth view, the second layer shows a sort of cluster view so that I can have numbers appear where there are large clusters. I have have my buttons set up in the toggle map so that you can see points from different years - 2011, 2012, 2013, and 2014. When I click on a year, say 2011, all the points from the first layer (choropleth layer) that are from 2011 appear and all others disappear, so the buttons are selecting correctly for my first layer. But the buttons don't filter through any of the points in the second layer (the cluster layer with the numbers appearing for clusters). This is providing inaccurate numbers for my clusters when I'm clicking on different years. For example, in one area of the map, there are 37 points for all the years (so when all points are visible the cluster layer accurately says there are 37 points there). But when I select 2011, there are 0 points in that region for 2011, and it still says 37 on the cluster layer. Is there a separate way to set up the toggle map so that it will interact with and select from all layers in my UI?


null pointer Exception in osm2Po

I am tring to use OSM2PO on Windows 7 but nothing works. I have JAVA Already installed. When I launch the command java -jar osm2po-core-4.7.7-signed.jar prefix=at "USTHB.osm" I get this : ![Error message :](http://i.stack.imgur.com/1L1lw.png) AnySolutions ?


ST_Expand return different results depending on meters

I am very confused by getting different results from st_expand (srid 4326). I want to do a search within a bounding box, therefore I pass a point and I'd like to provide distance in meters in order to see if I will get a macht. So this query is returning a result: `select "geo_name_cities".* FROM "geo_name_cities" WHERE (name like '%Ischgl%' AND ST_Expand(ST_GeomFromText('POINT (10.3298112 46.9809071)', 4326),5000) && lonlat)` my assumption here. Make a bounding box of 5000 meters around the point. Now I increase to 6000m               select "geo_name_cities".* FROM "geo_name_cities" WHERE (name like '%Ischgl%' AND ST_Expand(ST_GeomFromText('POINT (10.3298112 46.9809071)', 4326),6000) && lonlat)      No result. Ok, I might assume that the place is not within this box, fine. BUT when I use 60000m I get a result again ????? `select "geo_name_cities".* FROM "geo_name_cities" WHERE (name like '%Ischgl%' AND ST_Expand(ST_GeomFromText('POINT (10.3298112 46.9809071)', 4326),60000) && lonlat)` So I increased the distance steadily but the results are different, how does this come?


Difference between Trip and Route in Google Transit

I am developing a transit webapp using Google Transit, while referring to documentation, i see two different datasets (trips.txt and routes.txt) but i can't clarify the difference between them.


ArcGIS rectify image with embedded colormap (clr)

When rectifying a georeferenced tif image in ArcMap 10.2 the colormap gets placed into an accompanying .clr file. Is there a way to stop this behaviour and have it embedded into the tif so it is usable in other applications? Alternatively is there a tool I can use to combine them afterwards?


How to determine soil moisture index values from reflectance values in a satellite image?

I'm working on determination of soil moisture by remote sensing. I would like to know how we can determine soil moisture index values from reflectance values in LANDSAT TM images.


How can I get nearest road to a lat lon in MSSQL?

I've updated osm data (ways) in MSSQL and got geographic objects. Now I want to get the closet road to any lat lon a user will query. Which SQL spatial statement is used for that ?


Convert X,Y State Plane coordinates to decimal degrees

I have 1000's of data point I need to convert from North Central Texas 4202 into Lat/Long decimal degrees. Can someone give me a conversion equation so I can quickly convert using excel? I have only been able to find online conversion calculator which convert one entry at a time. This is not time efficient for me. Please help!


ArcMap attribute table has disappeared

I am having the same problem discussed here:. I don't know what I did but my attribute table is now lurking somewhere but I can't find it. I use only one monitor. The previous question was resolved by right clicking on the taskbar and selecting "show windows stacked." However, I have tried right-clicking everywhere and I haven't seen an option for "show windows stacked." I've tried quitting ArcMap but nothing changed. I do not want to have to reinstall ArcGIS nor do I want to have to change the registry. Thank you for your help!


Using ArcGIS SDK or REST API to create a route

I'd like to create a route by specifying endpoints and roads to travel by. For example, I'd might want to create a route from Atlanta GA to San Diego CA, but I want to specify that the route traverse the old US Route 66. US 66 doesn't actually go through either endpoint. Is there a way to use either the Java or Javascript SDK to create such a route?


PostGIS ST_Contains Function Error

I am running the below query and try to identify the end point of a line with gid 338 on the polygon's boundary with gid 1456 but got some error message:               SELECT public.st_contains((Select public.st_EndPoint(the_geom) from lines where gid=338),(select public.st_Boundary(the_geom) from polygons where gid=1456))      The error message:               > ERROR:  function _st_contains(public.geometry, public.geometry) does     > not exist LINE 1: SELECT $1 && $2 AND _ST_Contains($1,$2)     > HINT:  No function matches the given name and argument types. You might need to add explicit type casts.     > QUERY:  SELECT $1 && $2 AND _ST_Contains($1,$2) CONTEXT:  SQL function     > "st_contains" during inlining      If I run               SELECT ST_Contains(ST_GeomFromText('LINESTRING(0 0, 5 5, 10 10)'),ST_GeomFromText('point(3 3)'));      It will return "t" as the correct value.


Adding XY data from xls to Arcmap 10

I am trying to add XY data to Arcmap 10. Coordinates are in DD but they end up in the wrong location at -1.48 0 all very close to each other (though they look like they are in the right shape just very very close to each other in the coordinate space). The points were collected by gps and initally appear in the correct location in ArcMap. I then exported them and added other data in excel and now want to import them back to ArcMap. I watched out that the names etc are in the right format (e.g. using underscores not spaces) Coordinate system appears to be correct UTM 31N but when compared to other data that I have in the same area the extend is way of When I add a field to the table in ArcGIS and let it calculate geometery it shows the right Coordinate values I added the test xls file to dropbox https://www.dropbox.com/s/yvc33zegr0l3rn3/import_test.xls


pyQgis in stand alone script, vector loading error

I am trying to use the Qgis functions in a stand alone Python script. I m running Mountain Lion OS, 2.7 Python & the Qgis 2.0.1 Dufour. My main problem is that I cannot get started - I cannot load a simple shape- file in order to buffer it. After searching the online resources quite a bit, I actually found that many people had a problem with setting the prefix path, so I ran the QgsApplication.showSettings() to identify it. The code I m running now is :                QgsApplication.setPrefixPath("/Applications/QGIS.app/Contents", True)           QgsApplication.initQgis()                   print QgsApplication.showSettings()                 #Loading a Layer           layer = QgsVectorLayer('/path/to/shapefile_folder/test.shp', 'test', 'ogr')         if not layer.isValid():               print "The layer failed to load."                   #finally I d like to apply a buffer, sth like that maybe?          buffer_Shp = layer.buffer(10, 5)       Here is the result I get:                Application state:         QGIS_PREFIX_PATH env var:                Prefix:     /Applications/QGIS.app/Contents         Plugin Path:        /Applications/QGIS.app/Contents/../PlugIns/qgis         Package Data Path:  /Applications/QGIS.app/Contents/../Resources         Active Theme Name:           Active Theme Path:  :/images/themes//         Default Theme Path: :/images/themes/default/         SVG Search Paths:   /Applications/QGIS.app/Contents/../Resources/svg/         User DB Path:   /Applications/QGIS.app/Contents/../Resources/resources/qgis.db      "The Layer Failed to load" ( _obviously_ ) bash_profile ( _in case that sth is wrong there_ )                /# Setting PATH for Python 2.7         /# The orginal version is saved in .bash_profile.pysave         /######export PYTHONPATH=/usr/local/lib/python:$PYTHONPATH         export PATH=/usr/local/bin:$PATH         export PATH=/usr/local/share/python:$PATH             /#adding Qgis libs           export DYLD_LIBRARY_PATH=/Applications/QGIS.app/Contents/MacOS/lib/:/Applications/QGIS.app/Contents/Frameworks/         export PYTHONPATH=/Applications/QGIS.app/Contents/Resources/python/         export PATH=/Library/Frameworks/GDAL.framework/Programs:$PATH         /# Added by Canopy installer on 2013-10-06         /# VIRTUAL_ENV_DISABLE_PROMPT can be set to '' to make bashprompt show that Canopy is active, otherwise 1         /# VIRTUAL_ENV_DISABLE_PROMPT=1 source /Users/george/Library/Enthought/Canopy_64bit/User/bin/activate      What the heck am I missing ? Thanks in advance... George


County-Level Ethnic Shapefile: United States

My professor usually provides the shapefiles that we deal with in our analyses of the United States--population, votes, etc., but I'd like to know how I can get these myself. I'd like, in particular, a shapefile with ethnic data listing the percent with respect to total population. I'm new to this, so keep that in mind. ![enter image description here](http://i.stack.imgur.com/zqGQ4.jpg) I'd like to make an overlay of these data with the data in the above county- level population map of the United States to make an interesting comparison with another overlay of the 2012 presidential election results.


Determine angle down to horizon from different flight altitudes

I'm a pilot, not a GIS expert. What I need is a formula or a web site that I can supply the variables to answer my question. I need to know the angle down to the horizon from different flight altitudes. This is for a specific flight over the ocean so terrain is not a factor. Knowing the angle to .1 degree will be sufficient accuracy. Knowing the angle for every 2 thousand feet from 25,000 feet to 41,000 feet will cover my needs. Thank you, Mike Wendt.


How to get accurate mile markers from DOT ShapeFile?

I'm having trouble getting accurate mile markers through route traversal using PostGIS. Based on the discussion in Geocode from mile marker/milepost to latitude/longitude?, I downloaded Texas Department of Transportation's official ShapeFile (link, see **TxDOT Roadways 2010** at right). I first imported the ShapeFile into Postgres using shp2pgsql. Then, using a C# program, I used PostGIS's ST_Line_Interpolate_Point function as the meat of my code that traverses each line one mile at a time. Here's the main part of the code:                       public SortedDictionary<int, string> GenerateMileMarkers()         {             // make the sorted dictionary             SortedDictionary<int, string> dict = new SortedDictionary<int,string>();                  // get length of route             double length = (double)(new NpgsqlCommand(                 "SELECT ST_Length('" + geometry + "')",                 connection)).ExecuteScalar();                  // find each mile marker             // note that "increment" is 1/69.17, the reciprocal of miles/degree             for (int i = 0; i <= length/increment; i++)             {                 double segmentLength = (i * increment)/length;                      string mileMarkerPosition = (string)(new NpgsqlCommand(                     // have to use ST_Linemerge to get from MULTILINESTRING to LINESTRING                     // since ST_Line_Interpolate_Point requires LINESTRING                     "SELECT ST_AsEWKT(ST_Line_Interpolate_Point(ST_Linemerge('" + geometry + "'), " + segmentLength + ")) As foo;",                     connection)).ExecuteScalar();                      dict.Add(i, mileMarkerPosition);             }                  return dict;         }      I believe the SHP's reference measurement is a degree of latitude, so I did come calculations and figured that a degree has 69.17 miles, although thanks to Nicklas Avén's comment below, I now realize this is not correct since longitudinal lines are closer together the further north one goes. Long story short, I generated serially-numbered points for each route that represent mile markers. The problem is I am coming up with significant errors. I found the error by comparing Google Maps-indicated mile markers with those at a sampling of Interstate highway (IH) intersections or IH intersections with state borders. I'm finding error between ~4% and ~22. Most errors are approx ~15% +/- 1%. Here's an example of the error: where I-30 hits the Texas/Arkansas border is officially mile marker 223 (per Google Maps), but through this method I got 260. That's an error of about 16.6%. Also, where I-30 hits I-635 in Mesquite is about mile marker 56, but I calculated 67. That's a 19.6% error. This variable error is really concerning to me. Since the errors are inconsistent, even within the same highway, it's not like I can apply a scaling factor to everything. This is a problem because I am trying to do analysis on a few million events, and these events are expressed as happening at milepost X on highway Y. Below a user rightfully questioned the projection. It appears the file may in fact have a projection, as it has a PRJ file:               GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]      Is it possible to make accurate measurements from this TxDOT-issued SHP? (NOTE: I used "linear referencing" above, but I don't think this is true linear referencing because I am not correlating a point to a location along a route. The **ST_Line_Interpolate_Point** PostGIS function just happens to be in the Linear Referencing section of the PostGIS Reference.)


how to grant permission in SDE geoDB,when layers are inside a geometric network

When I use sdetable command to grant pemission to a table that located in a SDE SQL server geodatabase it works properly,this table is a non-spatial table which is in geodatabase immediately,I mean when I open geodatabase in ArcGatalog,I can see it in the root of geodatabase. But we have a FeatureDataset named "dsDisNet" and almost all feature classes inside in this feature dataset are members of a geometric network(except one).When I use sdelayer command to grant permission for one feature class,it is done successfully but the user can't still update the table.Here is steps I do: 1.define a login in SQL Server,then define a user in geodatabase mapped to login 2.give the data_reader role to this user,so user can see all layers successfully 3.run this command sdetable -o grant -t myTable -U gisUser1 -A SELECT,INSERT,UPDATE,DELETE -s GISServer -i 5151 -D GDBase -u sa -p mypassword and it works successfully, and this user can work with that table 4.sdelayer -o grant -l myLayer,Shape -U gisUser1 -A SELECT,UPDATE -s GISServer -i 5151 -D GDBase -u sa -p mypassword this last command doesn't work properly even it is run successfully,but the user still receive this message in ArcMap(something like this" "can not edit the folder or database you selected,the user doesn't have enough permission" Anyone can help me solve this problem?Is this problem because the layer is inside a feature dataset?or member of geometric network?so how I can give update permission fot this layer? Thanks in advance


Openlayers WFS Vector Layer Rules dont get applied

i have a script which applies rules to wfs.vectors. the script works fine in firefox and all the rules get applied, but somehow when i open the same file with the internet explorer 7 / 8 , only the first rule gets appended and the other ones dont get processed. ive searched around alot and i really cant find an answer to this problem. ive included links to screenshots of the error and also the code of my rules. Firefox 3.6.13: img835.imageshack.us/img835/1070/vectorff.jpg Internet Explorer 7: img818.imageshack.us/img818/9493/vectorie.jpg               <script type="text/javascript">         var map;         OpenLayers.ProxyHost = "/proxy.php?url=";         function init(){             map = new OpenLayers.Map("map_container", {                 maxExtent: new OpenLayers.Bounds(5, 50, 15, 56)             });                  // create a new style and add rules             var defStyle = new OpenLayers.Style({                 strokeWidth: 0             });                  defStyle.addRules([                      new OpenLayers.Rule({                     symbolizer: {                         fillColor: "#ffeecc"                     },                     filter: new OpenLayers.Filter.Comparison({                         type: OpenLayers.Filter.Comparison.LESS_THAN,                         property: "order07",                         value: 04000                     })                 }),                      new OpenLayers.Rule({                     symbolizer: {                         fillColor: "ffcc99"                     },                     filter: new OpenLayers.Filter.Comparison({                         type: OpenLayers.Filter.Comparison.BETWEEN,                         property: "order07",                         lowerBoundary: 04000,                         upperBoundary: 08000                     })                 }),                 new OpenLayers.Rule({                     symbolizer: {                         fillColor: "ff9966"                     },                     filter: new OpenLayers.Filter.Comparison({                         type: OpenLayers.Filter.Comparison.BETWEEN,                         property: "order07",                         lowerBoundary: 08000,                         upperBoundary: 11000                     })                 }),                 new OpenLayers.Rule({                     symbolizer: {                         fillColor: "ff6633"                     },                     filter: new OpenLayers.Filter.Comparison({                         type: OpenLayers.Filter.Comparison.GREATER_THAN,                         property: "order07",                         value: 11000                     })                 })             ]);                            var selStyle = new OpenLayers.Style({                 fillColor: "#ffaa00"             });                  // combine styles in a style map             var myStyleMap = new OpenLayers.StyleMap({                 "default": defStyle,                 "select": selStyle             });                  // create a wfs layer with the style map             var states = new OpenLayers.Layer.WFS(                 "Deutschland",                 "http://--------:8080/geoserver/wfs",                 {typename: "someName:someLayer"},                 {isBaseLayer: true, extractAttributes: true, styleMap: myStyleMap}             );                  map.addLayers([states]);                  // create a select control             var select = new OpenLayers.Control.SelectFeature(states, {                 hover: true             });             map.addControl(select);             select.activate();                  // listen for feature selection and update stats             states.events.on({"featureselected": function(evt) {                 var feature = evt.feature;                 $("state_name").innerHTML = feature.attributes.order07;                 $("state_pop").innerHTML = feature.attributes.name;             }});                  map.zoomToMaxExtent();         }     </script>      So as you can see theres nothing big with this rules. I hope someone can help with this problem, because i cant really see where tjhe rpoblem is coming from. Could it be a deviant comma somewhere ?? eventhough i have searched for one throughout the code.


common task in mapping applications

Two friends and I are developing a series of web mapping applications, only with some basic tasks (measure tools, identify polygons, and others). We are looking for suggestions on what to implement to make our applications better. So, my question is: ¿What tasks do you add to your maps to add something extra? As an example, we recently added a tool that get the distance between the selected points in a polygon, the selection is made by drawing a polygon in the map. We are using ArcGIS Server 9.3.1 with .NET, but the tools listed in the answers could be implemented in any framework. EDIT. This is not only for us, everyone here could benefit of each idea/answer.


QGis Plugin Licence

I would like to create a plugin using commercial software. Does the QGis licence permit this? Are there any restrictions on the licence I can choose to apply to my plugin?


Osm2pgsql style file question

I have a question about the style files used for osm2pgsql. These files have a structure as follows:               # OsmType  Tag          DataType     Flags     node,way   access       text         linear     node,way   addr:housename      text  linear     node,way   addr:housenumber    text  linear     node,way   addr:interpolation  text  linear     node,way   admin_level  text         linear     node,way   aerialway    text         linear     node,way   aeroway      text         polygon     node,way   amenity      text         polygon      My question is this, how do I know if I should use polygon, linear, hstore, etc.. for the Flags values? The style file gives a brief explanation, but I am looking for further information.


Getting the depth of properties in ArcGIS

Is there a way to get the depth of a parcel in ArcGIS Basic (or QGIS)? Depth meaning the distance from the road (frontage) to the rear of the property. I should also mention that not all parcels are rectangular or square, many parcels are irregular shapes.


Validate coordinates in DMS format in a Textbox

I have to validate a textbox which is taking coordinates in Degree Minutes and Seconds or Degree and Minutes or in Degrees format divided by a space between them.


Delete Custom Menu

How is it possible to delete a custom root menu developed in VS? I have gone through some walkthroughs and added an add-in that includes a button like so:                   <AddIn language="CLR" library="CustomUIElements.dll" namespace="CustomUIElements">         <ArcMap>           <Commands>             <Button id="CustomUIElements_ZoomToLayerButton"                class="ZoomToLayerButton"                message="Zoom to selected layer"                caption="ZoomToLayer"                tip="Zoom to default extent"                category="Add-In Controls"                image="Images\ZoomToLayerButton.png">               <Help heading="Zoom To Selected Layer">Set's the extent of selected layer</Help>             </Button>                   </Commands>           <Menus>             <Menu id="CustomUIElements_Zoom_Commands" caption="Zoom Commands" isRootMenu="true">               <Items>                 <Button refID="CustomUIElements_ZoomToLayerButton" />               </Items>             </Menu>           </Menus>         </ArcMap>       </AddIn>      Now ArcMap has the menu "Zoom Commands" but how do I remove it?


python crashes creating many Feature Classes in multiple Feature Datasets

I'm trying to populate a Geodatabase with roundabout 60 Datasets with a new Featureclass for each Dataset. To do this, i wrote a python-standalone-script that loops through these datasets and creates a new Featureclass with the "CreateFeatureclass_management"-Tool and do some stuff with this Featureclass afterwards. This works for the first Dataset, but when my script reaches this command for the next Dataset, the processing of my script is interrupted. I don't get a Traceback, instead an Windows-Error-message pops up, saying smth. like "pythonw.exe registered an error and has to be cancelled" (Maybe the wording is a bit different, since i translated it from german). So, this Problem always occures for the second Featureclass that should be generated. If i extract the first Dataset with the correct generated Featureclass from my Geodatabase and start the script again, again the Featureclass will be added to the first Dataset (the former second), but not to the following. So it's not a question of my Data. I also doubt if it's something in my scriptcode itself, since i wrote a very simple Testscript afterwards, that is able to create 4 Featureclasses in ONE Dataset, but isn't able to create Featureclasses in more than one Dataset. I really dont see any reason for my script to not create these Featureclasses. If you demand it, i can definitely post some scriptcode. Anyway, i fear that it has smth to do with my cache or so. Thank you very much, Sebastian Here is the code of my testsript: ( It actually breaks at the first AddField_management instead of my CreateFeatureclass_management, after I changed it a bit)               import arcpy, os          Geodatabase = r"D:\GIS\STK\124_NDS\STK_124_NDS.gdb"     arcpy.env.overwriteOutput = True          def CreateFeatureclasses(workspace):         arcpy.env.workspace = Geodatabase         listDatasets = arcpy.ListDatasets("", "Feature")         for dataset in listDatasets:             datasetPath = workspace + os.sep + dataset             arcpy.env.workspace = datasetPath                  print "Dataset: " + dataset             out_name = "BF_Stao_Bodenprofil_P_" + dataset[9:]             Bohrpunkt_fc = arcpy.CreateFeatureclass_management (datasetPath, out_name, "POINT")             fcList = arcpy.ListFeatureClasses()             for fc in fcList:                 if fc[:10] == "Bohrpunkte":                     Punkteliste = []                     zeilen = arcpy.SearchCursor(fc)                     for zeile in zeilen:                         Bohrkreisgeometrie = zeile.getValue("Shape")                         Bohrpunkt = Bohrkreisgeometrie.trueCentroid                         Punkteliste.append(Bohrpunkt)                     del zeilen                     rows = arcpy.InsertCursor(Bohrpunkt_fc)                     for Punkt in Punkteliste:                         feature = rows.newRow()                         feature.shape = Punkt                         rows.insertRow(feature)                     del rows, Punkteliste                     print "Die Punkt-Geometrien fuer die Featureclass 'BF_Stao_Bodenprofil_P'      wurden erstellt."                     Liegenschaftsnummer = dataset[1:8]                     arcpy.AddField_management (Bohrpunkt_fc, "Lgs_Nummer", "TEXT", "", "", 7)                     arcpy.AddField_management (Bohrpunkt_fc, "Profil_ID", "TEXT", "", "", 12)                     arcpy.AddField_management (Bohrpunkt_fc, "Profil_Nr_alt", "TEXT", "", "", 4)                     arcpy.AddField_management (Bohrpunkt_fc, "Profiltyp", "SHORT", 1)                     arcpy.AddField_management (Bohrpunkt_fc, "Standortseinheit", "TEXT")             del Bohrpunkt_fc                 del listDatasets          CreateFeatureclasses(Geodatabase)      * * * ## EDIT I had some tries to solve my Problem: First, I made a Batch-Script-tool out of my standalone Script. As before, the script is processed for my first Dataset, but not for the following. Now I get a "serious application error" and the script is interrupted. So, my second try was to discard the idea of processing my Data in all Dataset by looping through them/ using a Batch and instead using a simple script-tool, where i have to set the workspace individually for every dataset. After using the script for the first dataset, I open it again, set the workspace to the second an start it again, and -what a surprise - the same error occurs again. I first have to close ArcCatalog before i can start the script again.... Can this indicate, that there is some lock remaining, after the script is terminated? I delete every single reference before the script ends and delete temporary featureclasses. Any advice? Or has someone else experienced this before?


GeoServer Exception: No such operation WMS 1.1.0 GetFeature

I'm using GeoExt, OpenLayers and GeoServer. I've added a checkbox to my layer tree which, when clicked, activates a "select feature" control such that when a user clicks on the map, the feature clicked on is highlighted. My code is:               'checkchange': function(node, checked) {                      if (checked === true) {                         app.mapPanel.map.addLayer(node.attributes.layer);                         mySelectLayer = new OpenLayers.Layer.Vector("Selection", {                             styleMap: new OpenLayers.Style(OpenLayers.Feature.Vector.style["select"])                         });                         app.mapPanel.map.addLayer(mySelectLayer);                              myLayerCtrl = new OpenLayers.Control.GetFeature({                             protocol: OpenLayers.Protocol.WFS.fromWMSLayer(node.attributes.layer),                             box: true,                             multipleKey: "shiftKey",                             toggleKey: "ctrlKey"                         });                         myLayerCtrl.events.register("featureselected", this, function(e){                             mySelectLayer.addFeatures([e.feature]);                         });                         app.mapPanel.map.addControl(myLayerCtrl);                         myLayerCtrl.activate();                          } else {                         app.mapPanel.map.removeLayer(node.attributes.layer);                         app.mapPanel.map.removeLayer(mySelectLayer);                         myLayerCtrl.deactivate();                     }                 }      However, when a user clicks on the map the following exception is thrown by GeoServer:               org.geoserver.platform.ServiceException: No such operation WMS 1.1.0 GetFeature      I've found a number of posts on this, but no solutions. Any idea about what is causing this problem? Thanks in advance. **UPDATE:** I've read that this error is as a result of the request being sent to WMS, as opposed to WFS service. My assumption, however, is that it should be possible for OpenLayers to deduce the WFS service. From the OpenLayers documentation here, the `protocol` parameter kind of takes care of ensuring WFS, and not WMS, is used, in my opinion. Any idea is welcome.


Is there an automatic function in QGIS to package all shapefiles in a project for transferability?

In my project, I use a lot of geodata from different directories. Now I want to give the QGIS project to a colleague (eg on a CD). Is it possible to copy the shapes from different directories automatically to one directory? I am grateful for any help. Thanks Hendrik


Get tile URL with projection different than 900913

I have the following code, which should display a slippy map showing tiles producted by me with mapnik:               Proj4js.defs["EPSG:31258"] = "+proj=tmerc +lat_0=0 +lon_0=13.33333333333333 +k=1 +x_0=450000 +y_0=-5000000 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m +no_defs";     var latLonProj = new OpenLayers.Projection("EPSG:4326");     var salzburgProj = new OpenLayers.Projection("EPSG:31258");     var bounds = new OpenLayers.Bounds(426249,294999,426251,295001);     var maxZoom = 19;     var minZoom = 11;          var map1 = new OpenLayers.Map({                    div: "map1",                    allOverlays: true,                    maxExtent: bounds,                    maxResolution: "auto",                    projection: salzburgProj,                    displayProjection: salzburgProj,                    allowSelection: true,                    units: 'm',                    controls: [new OpenLayers.Control.PanZoomBar(), new OpenLayers.Control.Navigation()]         });          var layer1 = new OpenLayers.Layer.XYZ(                      "layer",                      "tiles/",                      {                          sphericalMercator: true,                          crossOriginKeyword: null,                          buffer: 1,                          getURL: get_my_url                      });          map1.addLayer(layer1);     var center = bounds.getCenterLonLat();     map1.setCenter(center, minZoom);          function get_my_url (bounds) {         var z = this.map.getZoom();             var x = long2tile(bounds.transform(salzburgProj,latLonProj).left, z);         var y = lat2tile(bounds.transform(salzburgProj,latLonProj).top, z);              var path = z + "/" + x + "/" + y + ".png";          var url = this.url;         if (url instanceof Array) {             url = this.selectUrl(path, url);         }         return url + path;             }          function long2tile(lon,zoom){         return (Math.floor((lon+180)/360*Math.pow(2,zoom)));     }          function lat2tile(lat,zoom){     return (Math.floor((1-Math.log(Math.tan(lat*Math.PI/180) + 1/Math.cos(lat*Math.PI/180))/Math.PI)/2 *Math.pow(2,zoom)));     }      I have taken get_my_url() from here (and customized it) and long2tile and lat2tile from here. The problem is that I do not get the correct tile urls, probably because long2tile() and lat2tile() refers to projection 900913 and not to my salzburg projection 31258. How can I modify these functions in order to get correct tile urls? Maybe can I use some tuning parameter given in 31258 definition at the top of my source? Thanks in advance.


Contour Lines Raster Extraction

I've been playing with Mapbox's blog post about converting heat maps to contour lines, and I'm stuck at the extraction part of this process. I used the CSV plugin to create a vector layer of points, then a heat map raster layer based on that, but I can't seem to be able to see the contour lines based on that raster layer after that. When I looked at the properties and selected categorized, it didn't seem to have any symbols listed. I'm guessing this is probably some kind of type error since I had to create the raster layer based off of map units and not meters, but I don't know how to correct it. What am I missing? Here's a screenshot. It's a map of racially charged geographic locations based on their name. The main difference being that I've stripped any instances of Arroyo Negro, but left in more explicit cases. ![qgis screenshot](http://i.stack.imgur.com/x2pcK.png)


Can I set the units for item properties scale field in composer?

This question is about the scale field in item properties, it's NOT about scalebars on a map. I'd like to be able to set the scale to something that is readable without using a calculator. So let's say I want a map that's 1" to 5 miles, I could set the scale to 316,800, but that's not very intuitive. Is there any way to tell composer that scale is in inches per mile, or any other (sane) pairing of units? qgis 2.01 64 bit   Windows 7


Can I offset the map frame in the composer?

I have a map frame in a layout in which the map fills the frame. If I check the frame property checkbox, there is no whitespace between the contents and the frame. Is there a way to offset the frame? I know I can draw a rectangle around the frame and center the objects, but it's hard to get the aspect ratios identical.   qgis 2.01 64 bit   Windows 7


help identifying the right spatial analysis tool

Let's say I have a set of N towns and a road network that connects the towns. I think some towns might an influence on other towns because they meet some criterion. I have a binary indicator of this criterion (e.g., crit==1 or crit==0) for each town. I want to construct a new variable that is a measure of how much each town might be influenced by it's neighbors, giving more weight to closer towns with a value of crit==1. I could define neighborhood as all towns within D km driving distance or R km radius. What is the best tool in this case? Conceptually, I thought a spatial weights matrix might be useful, but I don't want a NxN matrix. I want a Nx1 matrix where the vector of values is a measure of how much each town might be influenced by its neighbors. I created a toy example on GitHub.


What are the background/geography and foreground/data parts of a map called?

Consider a geographical map, e.g. a street map or satellite map, overlaid with some data, e.g. crime density or distance to closest voting booth. The former part is only used to orient the reader, so that he knows which part of the map corresponds to which geographical location. The latter part contains the actual data that the author wishes to visualize. What are these two parts called?


GEOS assertion failed

The following script fails, if I import the 'rasterstats' library.               import rasterstats     import ogr          geom1 = ogr.CreateGeometryFromWkt('POLYGON ((415924.806155724043492 4489457.402624096721411,416359.905146608769428 4489457.402624096721411,416359.905146608769428 4488983.206433195620775,415924.806155724043492 4488983.206433195620775,415924.806155724043492 4489457.402624096721411))')     geom2 = ogr.CreateGeometryFromWkt('POLYGON ((415924.806155724043492 4488989.295723957009614,416795.004137493495364 4489457.402624096721411,416784.428755077067763 4488509.010242293588817,415924.806155724043492 4488989.295723957009614))')          print geom1.Intersection(geom2)      The error I get is:               Assertion failed: (pts), function testInvariant, file ../../include/geos/geomgraph/Edge.h, line 88.      The line causing the problem is `geom1.Intersection(geom2)` Unfortunately there is not more error code to it. If I don't import `rasterstats`, then I don't get the error. What could be the reason for that behavior? * * * Line 88 in Edge.h in GEOS is the following function:               void testInvariant() const {         assert(pts);         assert(pts->size() > 1);     }      What does this function test for? * * * GDAL Version 1.10.0100 Rasterstats Version 0.3.3 GEOS Version 3.4.2-3 * * * Edits: Originally I thought it is related to Flask, but I was able to isolate the problem, and figured it is not related to Flask. OGR exceptions doesn't give any additional error.


Should I query the tab/shp file or SQL (mapserver or geoserver)?

I have tab files (or shp) with information like residents , buildings etc... I need to be able to click a point in web map and query all data that fall in certain radius. I didn't decide yet which WMS I'll use because my web apps are .net and although geoserver seems more popular , I have zero experience with java. Let's say I chose a WMS. Should I use it's sdk (if it has any , currently using mapxtreme to query map data on server side) to query files directly or should I import all to SQL 2008 and work with it (not sure how to search within polygon or in radius yet) Tips , opinions will be welcome


Is there a limit to the amount of data in a spatial join in QGIS?

I am using Quantum GIS and trying to spatially join a point grid with polygons that are overlapping. If I get the sum of intersecting features, then I can get a good raster value. Well, every time I attempt the spatial joing with the summary, I get the following python error: > An error has occured while executing Python code: > > Traceback (most recent call last): File > "/usr/share/qgis/python/plugins/fTools/tools/doSpatialJoin.py", line 99, in > accept res = self.compute(inName, joinName, outPath, summary, sumList, keep, > self.progressBar) File > "/usr/share/qgis/python/plugins/fTools/tools/doSpatialJoin.py", line 214, in > compute if k == "SUM": atMap.append(sum(numFields[j])) TypeError: > unsupported operand type(s) for +: 'int' and 'QPyNullVariant' > > Python version: 2.7.4 (default, Sep 26 2013, 03:23:21) [GCC 4.7.3 Any idea why I may be getting this error? I am trying to join 65,527 points to 121 polygons in this case. Thanks for the help!


How do I set the composer layout units to inches?

I open an new composer and select ANSI A for my paper. The notation after the name is "Letter; 8.5inx11in", but the width and height are displayed in mm, and the units selection is grayed out, so I can't change it. The rulers at the top and left of the layout are in mm, and the parameters for "Snap to grid" are also in mm. If I then select "Custom", I can select inches for units, and the Width and Height display as 8.5 and 11. However the rulers in the layout are still in mm, as are the units for the grid. Can the entire composer project be converted to inches? qgis 2.01 64 bit   windows 7, 64 bit


How to derive GetFeature URL from capabilities document?

Given this capabilities definition how can I compose a _GetFeature_ request that downloads the actual geodata? I came up with the following URL refering to WFS 2.0.0:               http://fbinter.stadt-berlin.de/fb/wfs/geometry/senstadt/re_umweltzone2007? \       request=GetFeature&service=WFS&version=2.0.0&typeNames=fis:re_umweltzone2007       &outputFormat=GML2      For some reason it does not accept `&srsName=EPSG:4326` as a parameter. Is it possible to create a download URL such as `&outputFormat=shape-zip` which I saw elsewhere? By now I use `wget` to trigger the download.


Use selected value in postgis function

How can I use the selected value from a `SELECT` statement in a PostGIS function. e.g. using the `geom_way` from `SELECT geom_way FROM osm_2po_4pgr ORDER BY ST_Distance(ST_GeomFromText('POINT(21.323329 39.948928)', 4326), geom_way) ASC LIMIT 1;` in `SELECT ST_Line_Interpolate_Point(geom_way, ST_GeomFromText('POINT(21.323329 39.948928)'));` EDIT: I know this has errors, but what I really want to know is how I could refactor a super long statement like this: `SELECT ST_AsText(ST_Line_Interpolate_Point((SELECT geom_way FROM osm_2po_4pgr ORDER BY ST_Distance(ST_GeomFromText('POINT(39.948928 21.323329)', 4326), geom_way) ASC LIMIT 1), ST_Line_Locate_Point((SELECT geom_way FROM osm_2po_4pgr ORDER BY ST_Distance(ST_GeomFromText('POINT(39.948928 21.323329)', 4326), geom_way) ASC LIMIT 1), ST_GeomFromText('POINT(21.323329 39.948928)',4326))));` To be manageable enough to fit into a `Java` `PreparedStatement`


How can I draw georeferenced WGS84 grid on Android?

I'm planning to display a grid which is georeferenced and show the lat/long of the particular location depending on zoom level. I want to display something similar to what MOBAC has as an option called 'enable wgs grid'. Could anyone help me get started? Or any idea how can I draw georeferenced grid?


leaflet - The marker and center map are not in the right place

I'm starting use the Leaflet. I put a marker to test but neither the marker nor the center are in the right local I set. example: I put the marker inside a stadium and it appear outside stadium. There are something I can do to correct this?               var mapquestUrl = 'this is not a link', mapquestAttribution = "Data CC-By-SA by http://openstreetmap.org/' target='_blank'>OpenStreetMap, Tiles Courtesy of http://open.mapquest.com' target='_blank'>MapQuest", mapquest = new L.TileLayer(mapquestUrl, {maxZoom: 18, attribution: mapquestAttribution, subdomains: ['1','2','3','4']});          map = new L.Map('map', { center: new L.LatLng(-8.842, 13.269), zoom: 15, layers: [nexrad], zoomControl: true });          L.marker([-8.815, 13.227], {icon: greenIcon}).addTo(map) .bindPopup('ooooo') .openPopup();


GPS data cleaning - Sampling of track data

I have gotten a fairly large polyline-dataset of GPS-recorded tracks. I'd like to have a sample along the tracks for different variables. The problem is that the data has overlapping tracks. This type of situation occures in example when same track has been walked (recorded) back and forth: ![example](http://i.stack.imgur.com/nUL5z.png) Points in the picture are 3 m apart from one another (measured along the polyline). As you can see, there are duplicate observations, which would corrupt my sample. So the question is, what is a convenient way of moving points (=observations) that are too close to each other? and most importantly, how do I keep one observation and delete the other? I think I should clean the polyline data first and then take the sample, but I'm still figuring out how to do this... Cheers!


Query Layer with user-defined (dynamic) parameters in ArcGIS 10.1

I have prepared and published with ArcMap 10.1 to my ArcGIS Server a Query Layer to access some information in my database. My output map represents the European Union states and using annotations, the number of cities and villages each country has. Now, I would like to go a step further and try to specify some parameters in the WHERE clause of the SQL query that defines my query layer. Therefore the user in my web application can select from a drop-down list box simple parameters like filtering just by "Cities" or "Villages" or by population number. I just would like to know if it is possible to configure ArcGIS to **expect some input parameters** coming from the web and **execute the SQL query with these parameters** once they have been received. Is there a way of injecting those parameters back to the ArcGIS Server and make it calculate the data I need? Please, could you provide any ideas or guidelines about how this would be done? Thanks for your help,