ArcMap's Join and symbology

I'm still new into the GIS World, and here's what i'm trying to achieve , i have Yemen administrative shapfile with list of governments, and districts,i also have an excel file with a list of migrants information , one of the fields in that excel file is the government where that migrant was encountered, now what i want is a way to show how many migrants were encountered in each government in the map, i could join the excel data with the shape file , but i didn't know how to count how many migrants with the same government and project it on the map using the sympology Cheers


Choosing an aggregation strategy that will be spatially represented on a google map

I'm under an NDA so I cannot really get into specifics of what I am doing. But, suffice to say, I am taking a large amount of spatially-acquired data and drawing this data onto a Google Map surface using color to represent a range of values. The main issue we are having is due to the vast amount of data collected, we cannot render this data on a map in a timely manner. I have proposed that one way to improve performance is to aggregate the data in some fashion, thus reducing the number of data points on the map. Spatially aggregating the map points are pretty easy, but the data is a whole other matter. We've tossed around simple statistics (min, max, median, mode) as well as some "made up" statistics (you don't want to know). We were going to start with a simple average, but edge effects are causing some grief as the user zooms in/out of the map. Generally, we need to maintain trends in a given area as one zooms out on the map. In other words, areas of the map with high correlation will look proportionally similar to other correlated areas at all zoom levels. **EDIT** Imagine a rigid body with up to 64 spatially oriented points where each point has some numeric value. At some interval (typically 200ms), a snapshot of this rigid body takes place and we record each point and map it. This rigid body moves in a predictable manner with some variable speed. It is possible in a given square mile that we have tens of millions of points. Spatially, correlation only applies if that point "belongs" to the same pass of data. So for instance, if this rigid body moves North for several meters, then makes a u-turn and moves South along side it's previous path, those points that belong to the North path are spatially "different" than those that belong to the South path even if a point on the North path are within inches of a point on the South path. That might be a long-winded explanation for saying we have spatial/temporal correlation. I can't really describe in great detail what the purpose of the map is due to the NDA. Essentially, the user will look at this map and understand how good or bad things went. They can see this data on a Google map from zoom level 15 and up. Rendering tens of millions of points at zoom level 15 is painfully slow. What I am looking for is a strategy to keep the same "message" at each zoom level while achieving a good performance.


How to keep unmatched records (i.e. delete matched records) in table using ArcMap

I need to drop all the records from a table with matching field values in a reference table (i.e. lookup table). Do I join the tables first and keep unmatched records? Or is there any other way to do it?


Seeing QGIS Python Commands

When learning MapBasic I found the most useful way to learn how to do certain tasks was to do them using the GUI and then watch the MapBasic window in MapInfo to see how they were achieved in code. It was also very useful for repeating repetitive tasks. I was wondering if QGIS had something similar for python?


Help required to convert georeferenced (and rectified) TIFF orthophotos to georeferenced .JPG format

I am not a GIS specialist (so patience required!) :) We work with georeferenced, rectified 1:10 000 orthophotos. I need help with the conversion of a georeferenced tiff to a georeferenced jpg. Our recently acquired JUNO (Trimble) GPS's work very well with an eventual conversion of jpg to ecw format - but I first need help in converting my tiff files to jpg. Any ideas please? Free/shareware or products for sale that you know of? thanks! Monique


Show callout when my position is clicked

I am using the Esri ArcGIS sdk on android, and I am trying to do the following:   * Get my position   * When my position is clicked, show a callout So far i've been lucky in finishing the first one, by using a `locationServ` class I've also created the callout and tested it, it's fine but my question here is how to make the map only show the callout when I click my position and not anywhere else on the map ? Here's my code:               package com.appzgate.locator;          import java.util.HashMap;     import java.util.Map;          import android.app.Activity;     import android.graphics.Color;     import android.location.Location;     import android.location.LocationListener;     import android.os.Bundle;     import android.util.Log;     import android.view.LayoutInflater;     import android.view.ViewGroup;     import android.widget.TextView;     import android.widget.Toast;          import com.esri.android.map.Callout;     import com.esri.android.map.GraphicsLayer;     import com.esri.android.map.LocationService;     import com.esri.android.map.MapView;     import com.esri.android.map.bing.BingMapsLayer;     import com.esri.android.map.bing.BingMapsLayer.MapStyle;     import com.esri.android.map.event.OnSingleTapListener;     import com.esri.android.toolkit.map.MapViewHelper;     import com.esri.core.geometry.GeometryEngine;     import com.esri.core.geometry.Point;     import com.esri.core.geometry.SpatialReference;     import com.esri.core.map.Graphic;     import com.esri.core.symbol.SimpleMarkerSymbol;          public class PlacelocatorActivity extends Activity {          MapView mMapView;     BingMapsLayer bing;     GraphicsLayer locationLayer;     LocationService loc;     private Callout m_callout;     private int m_calloutStyle;     private ViewGroup calloutContent;     Graphic graphic;     Point mLocation = null, p, mapPoint;     final SpatialReference wm = SpatialReference.create(102100);     final SpatialReference egs = SpatialReference.create(4326);     MapViewHelper mvHelper;     /** Called when the activity is first created. */     @Override     public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.main);              mMapView = (MapView) findViewById(R.id.map);         mLocation = new Point();         mMapView.enableWrapAround(true);          mvHelper = new MapViewHelper(mMapView);              m_calloutStyle = R.xml.identify_calloutstyle;         LayoutInflater inflater = getLayoutInflater();         m_callout = mMapView.getCallout();         // Get the layout for the Callout from         // layout->identify_callout_content.xml         calloutContent = (ViewGroup) inflater.inflate(                 R.layout.identify_callout_content, null);         m_callout.setContent(calloutContent);              bing = new BingMapsLayer(                 "ArUDBy4hjDCywOK-GVofer_1U6GG3GPWxaZ8zp68o01W-nQdiLgcV9MtvGEehxn5",                 MapStyle.AERIAL);         mMapView.addLayer(bing);              loc = mMapView.getLocationService();         loc.setLocationListener(new MyLocationListener());         loc.start();         loc.setAutoPan(false);         mLocation = loc.getPoint();              locationLayer = new GraphicsLayer();              mMapView.addLayer(locationLayer);         mMapView.setOnSingleTapListener(new OnSingleTapListener() {                  @Override             public void onSingleTap(float x, float y) {                 // TODO Auto-generated method stub                 // mapPoint = mMapView.toMapPoint(x, y);                 identifyLocation(x, y);             }         });     }          void identifyLocation(float x, float y) {              // Hide the callout, if the callout from previous tap is still showing         if (m_callout.isShowing()) {             m_callout.hide();         }              Point mapPoint = mMapView.toMapPoint(x, y);              checkGraphic();              if (graphic != null) {             ShowCallout(m_callout, graphic, mLocation);         }     }          private void checkGraphic() {         // TODO Auto-generated method stub         SimpleMarkerSymbol sms = new SimpleMarkerSymbol(Color.GREEN, 25,                 SimpleMarkerSymbol.STYLE.CROSS);              Map<String, Object> hm = new HashMap<String, Object>();         hm.put("NAME", "Amman");         hm.put("COUNTRY", "Jordan");         graphic = new Graphic(mLocation, sms, hm);         locationLayer.addGraphic(graphic);     }          @Override     protected void onDestroy() {         super.onDestroy();     }          @Override     protected void onPause() {         super.onPause();         mMapView.pause();     }          @Override     protected void onResume() {         super.onResume();         mMapView.unpause();     }          private class MyLocationListener implements LocationListener {              public MyLocationListener() {             super();         }              /**          * If location changes, update our current location. If being found for          * the first time, zoom to our current position with a resolution of 20          */         public void onLocationChanged(Location loc) {             if (loc == null)                 return;             boolean zoomToMe = (mLocation == null) ? true : false;             mLocation = new Point(loc.getLongitude(), loc.getLatitude());             if (zoomToMe) {                      p = (Point) GeometryEngine.project(mLocation, egs, wm);                 // graphic = new Graphic((Geometry) p, (Symbol) sms, hm);                 // locationLayer.addGraphic(graphic);                 mMapView.zoomToResolution(p, 20.0);             }         }              public void onProviderDisabled(String provider) {             Toast.makeText(getApplicationContext(), "GPS Disabled",                     Toast.LENGTH_SHORT).show();         }              public void onProviderEnabled(String provider) {             Toast.makeText(getApplicationContext(), "GPS Enabled",                     Toast.LENGTH_SHORT).show();         }              public void onStatusChanged(String provider, int status, Bundle extras) {         }          }          private void ShowCallout(Callout calloutView, Graphic graphic,             Point mapPoint) {         Log.v("call", "in the callout");         // Get the values of attributes for the Graphic         String cityName = (String) graphic.getAttributeValue("NAME");         String countryName = (String) graphic.getAttributeValue("COUNTRY");         // String cityPopulationValue = ((Double) graphic         // .getAttributeValue("POPULATION")).toString();         Log.v("call", "so far so good");         // Set callout properties         calloutView.setCoordinates(mapPoint);         calloutView.setStyle(m_calloutStyle);         calloutView.setMaxWidth(325);              // Compose the string to display the results         StringBuilder cityCountryName = new StringBuilder();         cityCountryName.append(cityName);         cityCountryName.append(", ");         cityCountryName.append(countryName);              TextView calloutTextLine1 = (TextView) findViewById(R.id.citycountry);         calloutTextLine1.setText(cityCountryName);              // Compose the string to display the results         StringBuilder cityPopulation = new StringBuilder();         cityPopulation.append("Population: ");         // cityPopulation.append(cityPopulationValue);              // TextView calloutTextLine2 = (TextView) findViewById(R.id.population);         // calloutTextLine2.setText(cityPopulation);         calloutView.setContent(calloutContent);         calloutView.show();       }          }


Zonal Statistics as table creates output but some are Null

Here is my newest issue: I have temperature as a raster file and different ecoregions of a province as polygons. What I want to do is calculate the mean temperature per ecoregion. I succeeded in doing this by Zonal Statistics which creates an output raster, but what I actually want, as I realized later, is I the temperature value per ecoregion. So how do I assign that value to the ecoregion? I thought I can do zonal statistics as table and then join this table to the ecoregion. It does work but for some reason it does not calculate values for some of the ecoregions (1400 ouf of 7400 get null values). I tried to find a pattern in the ecoregions that didn't get assigned a value, so e.g if they were too small or have a too complicated shape or if they are at the edge of the province...but no..they are just randomly distributed. Any ideas or something that I am missing?


How to use GRASS module to delineate watershed area？

Update#1：I changed to work under qgis 1.8, I only input the DEM file and run the r.watershed module, and I got this： ![enter image description here](http://i.stack.imgur.com/IgRuW.png) * * * I have a DEM file of one specified region, and I take the following steps to get files that might be used：   1. Fill Sinks(this one I use SAGA module instead of GRASS)   2. r.fill.dir After step 2, I want to get flow accumulation file, but I can not find this kind of module in GRASS, so I pass it and directly try the **r.watershed** module. There are several input options in this module, like this：![enter image description here](http://i.stack.imgur.com/Yoj4s.png) I tried any of files I have as input files, but I can't get the output files through this module, and always got this error message： ![enter image description here](http://i.stack.imgur.com/HW2Mo.png) The log below told me that **the data source is invalid** , and I go to check the sextante message log：               ERROR|Wed Jan 22 2014 12:38:01|Could not load model watersheds.model|ALGORITHM:saga:catchmentarea(parallel)      What should I do to successfully use the r.watershed module？ Thanks for giving me any suggestion!


Displaying ArcGIS Server dates without javascript localized date offset?

Esri recommends that databases are in UTC time. And if I’ve got this right, unless you set a time zone in your layer, you are entering a date in a date field as UTC. Mostly this is fine.You understand that the date refers to Pacific time for instance. You understand the date comes back to you the same value you put into the field. The problem comes when the browser or iOS or whatever device automatically localizes on initialization of a Date object. Problem: When ArcGIS Server returns a date, it sends milliseconds since epoch UTC (unix time). However, the Javascript Date object always creates a localized date when you use that to instantiate a Date object, e.g. Pacific Daylight Time, moving it back -7 hours. Thus, March 16 0:00am in the data becomes March 15 5:00pm — one day early. How do you get the actual time storedin the database?


Problems aligning layers digitized from Google earth into ArcMaps10

I'm a PhD student new to ArcGIS. I'm digitizing features from Google Earth to use in ArcGIS (I work in India, where the mapping in GIS is at best scanty). I drew along a river in Google Earth, saved the line as a .kml file and then used the 'from KML' feature in ArcMaps10 to convert to a layer file. It worked, except my line is about 270m north of where it is meant to be. I tried downloading some python scripts from the ESRI website to convert .kml to .shp - they load fine into ArcToolbox but then won't run my .kml files, citing bad magic numbers. I also tried using an online converter which still left the line north of where it is meant to be. All my inherited raster and vector files for the area should be in GCS_WGS_1984 as they were either in this format or I've converted them. I've also added XY data I took using a GPS and converted from DD.MM.MMMM to DD.DDDD which is all correctly aligned with the raster and vector files. The .kml file I converted to a layer file says it has the same coordinate system and datum (D_WGS_1984). I'm banging my head against a brick wall trying to see where the problem is! Any suggestions would be immensely valuable.


Download Dataset From ArcGIS REST Service

Looking at this information page for a dataset hosted on esri.com:   http://fema- services2.esri.com/arcgis/rest/services/2012_Sandy/ImageCat_NLT/MapServer/layers Trying to figure out how I can get access to the raw data (either raw lat/lng coordinates or SHP). It looks like the data is available, I just can't figure out how to pull it from this interface. Thanks!


--optfile not working with gdal_retile?

I have the following gdal_retile command I am trying to run, but it errors on the --optfile: `gdal_retile.py -v -r bilinear -levels 8 -ps 512 512 -co "tiled=YES" -targetDir pyramid --optfile files.txt`                  Unrecognised command option: -        Usage: gdal_retile.py             [-v] [-co NAME=VALUE]* [-of out_format]             [-ps pixelWidth pixelHeight]             [-ot  {Byte/Int16/UInt16/UInt32/Int32/Float32/Float64/                    CInt16/CInt32/CFloat32/CFloat64}]             [ -tileIndex tileIndexName [-tileIndexField fieldName]]             [ -csv fileName [-csvDelim delimiter]]             [-s_srs srs_def]  [-pyramidOnly] -levels numberoflevels             [-r {near/bilinear/cubic/cubicspline/lanczos}]             [-useDirForEachRow]             -targetDir TileDirectory input_files      Any idea why this does not work?


ArcGIS 10.1 crashes when a button in an addin invokes GDAL DLL through SWIG CSharp wrapper

I am developing an addin with a button that tries to do coordinate transformation using GDAL OSR. When I create a new CoordinateTransformation object ArcMap crashes and close. If a debug against a debug osr_csharp.dll I can see that CoordinateTransformation object is throwing an exception with this message: Unable to load PROJ.4 library (proj.dll), creation of\nOGRCoordinateTransformation failed. I have checked the addin file unziping it and I can see it contains the proj.dll and all the dependencies that osr_csharp.dll should have. The rare thing is that the same code executed inside an EXE project works without problem. Where is ArcGIS deploying addins? I cannot see the folder where ArcGIS is supposed to be uncompressing the addin file? Any ideas on this type of fail? Thanks in advance


Optimizing SLD map styling implementation

Styling a map on demand can be a great bottleneck if you don't have a good strategy to deal with it. I'm sure there is a lot of techniques to implement the styling of maps, but I would like to ask you if you know anything about the current state of research on this topic, and which are the most optimized "server" implementations of this.


How to Hide Toolbars from QGIS1.7 programmatically?

I am a beginner to QGIS 1.7 and getting problem in hiding the toolbar. I am using:               fileTB = self.iface.fileToolBar()      fileTB.setVisible(False)      This does not work but doesn't give an error either. I also tried:               self.iface.mainWindow().removeToolBar(fileTB)      This permanently removes the toolbar               fileTB.clear()      but I don't want that, because I want it to be get invisible, when the user click the 'on' button it should get displayed. Update:               def initGui(self): # I used this one          fileTB = self.iface.fileToolBar()          fileTB.setVisible(False) # As You suggested me qgis.utils.iface.fileToolBar().setVisible(False)


Better Distance Measurements in Web Mercator Projection

I am working with an ESRI stack, storing my layers in a sql-spatial-enabled- SDE- geodatabase (Geometry type, Web Mercator-3857). I am building a web mapping application, so by default, the tiles are also in web mercator, 3857. Via stored procs, i use STDistance to query distances from a user's location (Coordinates also in web mercator) to the various layers. Problem is, due to the distortion of web mercator, my distance calcs are increasingly off, the further from the equator they are made. I've thought of storing my layers in sql-spatial-geography (rather than geometry) type, but:   * I imagine my distance queries will take much longer (distance calcs on spherical surface)   * i will need to reimport a lot of data   * arcgis services won't be as fast as they will need to project on the fly If I go to Google maps, and do a distance calc, the distance returned is much more accurate, even in Nortern/southern regions, so I assume Google must be correcting for distortion caused by the web mercator projection. My question then: Is there a simple factor value that can be applied to distance calcs done in web mercator projection to get the "correct" distance?


Spatio-temporal prediction with KrigeST in R

I'm new in R and ST kriging, I've constructed a STFDF object with the first 4 hours historical data, and want to forecast the fifth hour data. By using krigeST in R, I've constructed vgm model. But after launching:               pred = krigeST(formula=values~1, data=mystfdf, newdata = My_pred, modelList=myVgm)      the pred object only contains historical data, without prediction data. Any idea? Thank you in advance.


Azimuth, Inclination

I work on a software and I want to compute Dx Dy with Azimuth, Inclination.                   MD  TVD Azimuth Inclination Relative X Increment    Relative Y Increment    X Coordinate    Y Coordinate     0.000000    0.000000    0.000000    0.000000    0.000000    0.000000     768968.880144   169501.108800     957.072021  956.919617  343.060000  2.460000    -2.438400   7.955280     768966.441744   169509.064080     1013.155212 1012.963196 101.700000  3.400000    -1.161288   8.769096     768967.718856   169509.877896     1042.111206 1041.833862 108.200000  5.400000    0.975360    8.171688     768969.855504   169509.280488     1071.067261 1070.606934 110.800000  7.400000    4.014216    7.083552     768972.894360   169508.192352     1100.023193 1099.273438 117.400000  8.800000    7.723632    5.401056     768976.603776   169506.509856      This is my input file. I tried to change the coordinate system but it didnt worked. How can I found Relative X Increment and Relative Y Increment with Azimuth et Inclination ? Thanks for your help :)


How to add header to the http response of Geoserver

Add a specific header to the http response of Geoserver, to allow cross domains request and avoid XMLHttpRequest On Load error.


QGIS2.0 plugin with freeglut

Has anyone been successful in using QGIS 2.0 plugin which uses freeglut? I have tried all of the below to import freeglut but none of the freeglut functions are recogonized in my plugin.               import OpenGL     import OpenGL.GLUT     import OpenGL.GLUT.freeglut as freeglut     from OpenGL.GLUT import *     from OpenGL.GLU import *     from OpenGL.GLUT.freeglut import *       I have also checked HAVE_FREEGLUT which always returns false. Appreciate if someone can share your experience if you have used freeglut within QGIS plugin. Thanks!


ArcPy findAndReplaceWorkspacePath not working with Raster Datasets

**Situation:** I am working on creating a Python script that will replace workspace paths for every layer in a map document in order to fix broken layers after a data migration. The script works except for when run on MXDs that have a raster dataset in them. I have isolated the problem to the code below. Specifically the .findAndReplaceWorkspacePath() method seems to be failing when attempting to perform the operation on the raster layer. **Code:**               fullPathToNewWorkspace = r"C:\GIS\New\Data" # for context, not actually used in script     fullPathToOldWorkspace = r"C:\GIS\Old\Data" # for context, not actually used in script     mxd = arcpy.mapping.MapDocument(r"Path\To\MXD")          for df in arcpy.mapping.ListDataFrames(mxd):         for lyr in arcpy.mapping.ListLayers(mxd, '', df):             if lyr.supports("DATASOURCE"):                 print lyr.dataSource # added to help troubleshoot                 lyr.findAndReplaceWorkspacePath(r"Public", r"G-DRIVE")                 print lyr.dataSource # added to help troubleshoot      **My Troubleshooting:** The troubleshooting print calls are as such:               > C:\GIS\Old\Data\VectorData1.shp     > C:\GIS\New\Data\VectorData1.shp     > C:\GIS\Old\Data\VectorData2.shp     > C:\GIS\New\Data\VectorData2.shp     > C:\GIS\Old\Data\RasterData # ArcGRID format     > # No print output for C:\GIS\New\Data\RasterData      So the script is getting caught up on trying to .findAndReplaceWorkspacePath for the raster. Furthermore, when I remove the raster dataset from the mxd and rerun the same script it works fine. **Error Message:** This is the traceback I get from running it with the raster dataset in the MXD:               "C:\Users\Chaz\Desktop\TestDataMig\Scripts\DataMigration_v1.2_RasterTesting.py",     line 1, in <module>         import arcpy       File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\utils.py", line 181, in fn_         return fn(*args, **kw)       File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\_mapping.py", line 695, in findAndReplaceWorkspacePath         return convertArcObjectToPythonObject(self._arc_object.findAndReplaceWorkspacePath(*gp_fixargs((find_workspace_path, replace_workspace_path, validate), True)))     ValueError: Layer: Unexpected error      **Question:** I was under the impression (ArcPy documentation) that raster datasets worked fine with the .findAndReplaceWorksapcePath method, yet I am still having these issues. Am I missing something? Do I need to phrase my arguments differently, or do I need to use a different method to replace a raster path? **Environment:**   * Windows 7    * ArcGIS/ArcPy 10.2   * Python 2.7.3


Performance in calculating raster statistics in PostGIS

I'm trying to calculate raster statistics (min, max, mean) for each polygon in a vector layer using PostgreSQL/PostGIS. This GIS.SE answer describes how to do this, by calculating the intersection between the polygon and the raster and then calculating a weighted average: http://gis.stackexchange.com/a/19858/12420 I'm using the following query (where `dem` is my raster, `topo_area_su_region` is my vector, and `toid` is a unique ID:               SELECT toid, Min((gv).val) As MinElevation, Max((gv).val) As MaxElevation, Sum(ST_Area((gv).geom) * (gv).val) / Sum(ST_Area((gv).geom)) as MeanElevation FROM (SELECT toid, ST_Intersection(rast, geom) AS gv FROM topo_area_su_region,dem WHERE ST_Intersects(rast, geom)) foo GROUP BY toid ORDER BY toid;      This works, but it's too slow. My vector layer has 2489k features, with each one taking around _90ms_ to process - it would take _days_ to process the entire layer. The speed of the calculation doesn't seem to be significantly improved if I only calculate the min and max (which avoids the calls to ST_Area). If I do a similar calculation using Python (GDAL, NumPy and PIL) I can significantly reduce the amount of time it takes to process the data, if instead of vectorizing the raster (using ST_Intersection) I rasterize the vector. See code here: https://gist.github.com/snorfalorpagus/7320167 I don't really need a weighted average - a "if it touches, it's in" approach is good enough - and I'm reasonably sure this is what is slowing things down. **Question** : Is there any way to get PostGIS to behave like this? i.e. to return the values of all the cells from the raster that a polygon touches, rather than the exact intersection. I'm very new to PostgreSQL/PostGIS, so maybe there is something else I'm not doing right. I'm running PostgreSQL 9.3.1 and PostGIS 2.1 on Windows 7 (2.9GHz i7, 8GB RAM) and have tweaked the database config as suggested here: http://workshops.boundlessgeo.com/postgis-intro/tuning.html ![enter image description here](http://i.stack.imgur.com/pcLuc.png)


How to import polygons from OSM to QGIS?

I am trying to import Polygons from OSM to QGIS 2.0, but so far I have no idea how to do that. E. g.: Kisterseg auf Tatabanya in HU: `http://www.openstreetmap.org/?relation=1027806` Is there any fast way to get the polygon into qgis?


VBA Code to wait until Python returns value

I have written a code in VBA, I am passing parameters to Python and creating a buffer there. After that I am passing that buffer layer and further processing in VBA again. Here is the code for reference:               'Create Buffer using Python Shell     LayerPath = ""     LayerPath = GetWorkspacePathWithLayerName(EdgeLayer) & ".shp"     Dim OutputFolderPath As String     Dim OutputFileName As String     Dim OutputPath As String     Dim BuffDist As Double          OutputFolderPath = GetPath(EdgeLayer) & "\Buffer"     OutputFileName = Replace(getUniqueFileName("Buffer_" & EdgeLayer.Name), ".", "") & ".shp"     OutputPath = OutputFolderPath & "\" & OutputFileName          BuffDist = ConverUnitsFromMetersToMapUnits(txtMinAngle)          'TRYING to CALL PYTHON and PASSING Parameters     Shell "c:\Python26\ArcGIS10.0\Python.exe " & " D:\Createbuffer.py" & " " & LayerPath & " " & OutputPath & " " & BuffDist, vbMaximizedFocus          **addToCurrentView** OutputFolderPath, OutputFileName      I want VBA to halt **addToCurrentView** till Python shell completes its process (creating buffer). Right now it is giving error as there is a lock clash for the file. Can anyone help me as to how to do that. Thanking in advance for the answers and comments


Non-Static Map ArcView 10.1

This one is new to me. This is what I received from my client: **"He needs to be able to interact with the map, enlarge certain sections, etc. Can you send this over in a non-static format?** " What does this entail as I created a standard map for the company using ArcView 10.1.


Determine the UTM zone/hemisphere in a particular datum

I'm using GDAL to convert coordinates from one system (geographic or projected) to another. Assume I want to convert geographic coordinates (latitude and longitude) in the WGS84 datum, to UTM coordinates in the Amersfoort datum (EPSG:4289). In order for GDAL to determine the UTM coordinates (easting and northing), it needs:   * the input spatial reference system: geographic, based on the WGS84 datum   * the input coordinates: latitude and longitude   * the target spatial reference system: projected - UTM -, based on the local Amersfoort datum To instantiate the target SRS, besides the datum, I need to specify the zone and the hemisphere. The question is: **How to I determine the UTM zone and hemisphere where the input geographic coordinates fall in?** I could use the Wikipedia article for that. As far as I understood, the mechanism described there works for determining the zone and hemisphere for geographic coordinates in the WGS84 datum. What is not clear to me is whether the resulting zone and hemisphere make sense only for the WGS84 datum, or if they can be used in any, local or global, datum. If the zone and hemisphere determined from geographic coordinates in the WGS84 datum only make sense for determining the UTM coordinates in that same WGS84 datum, **how can I determine the UTM zone and hemisphere in another datum - WGS72, NAD27, NAD83** etc.? Also, does it even make sense to speak of UTM coordinates in a local datum? I hope I haven't messed up the concepts too much. Anyway, any pointers will be greatly appreciated.


Defining custom projection for moving all objects on X and Y coordinates

I have a map project wih layers in WGS1984 UTM projection. I also have a bunch of layers without .prj files. When I add it on top of my layers, it's placed with a huge offset on X and Y coordinates but other than that everything is fine, features are not distorted etc. So basically I just need to "move" all the features along X and Y axes and everything will be alright. Can I define such projection using ArcGIS "Define projection" tool or something else? I need a projection that just adds a linear offset to X and Y coordinates. I know I can fix one layer by using "Spatial Adjustment" tool and it works fine, but my goal is to have a .prj-file that I can use for any such layer. I'm kinda new to ArcGIS and will give clarifications if needed. Any help would be appreciated, thanks in advance.


How to identify clusters in vector point data?

I have a vector dataset of rural broadband data-points (how fast, etc.) and I'd like to explore if there are clusters of points with similar characteristics, and to plot polygons encompassing them. For example, I may have 45,000 points in a single PostGIS dataset distributed over a landscape. I want to identify clusters which lay within x km of each other and where the speed is below y kbps, and to produce convex hulls for each qualifying cluster. Is there a simple way of doing this in QGIS, for example? Any help is very much appreciated. Adrian


How to perform a join on simultaneous spatial and attribute criteria in PostGIS

> **Possible Duplicate:**   >  How to perform a join on simultaneous spatial and attribute criteria in > ArcGIS? I have two point layers and want to perform a spatial join on nearest distance. I have a restricting condition on the spatial join. The restriction only allows the attributes to be joined if the nearest point is within the same country. Both point layers have information about the country in their attribute table (e.g., "de" for Germany). So it must be some spatial join like:               Join attribute B to layer A on nearest distance where countryID_Layer A = countryID_Layer        B.      I tried to write the SQL-Statement, but it does not work somehow. Can anybody help me with this statement?:               select distinct on (h.h_key) h.h_key, h.l_iso_a2, i.loc, i.ctry, distance     from ( select h.h_key, h.l_iso_a2, i.loc, i.ctry as country2, st_distance (h.geom,     i.geom) as distance      from hotels AS h, iata_codes AS i      where h.l_iso_a2 = i.ctry order by h.geom <-> i.geom ) as iata_codes_h_key;


How to embed images in KML balloons using FME?

I am using FME to produce a kml file with multiple placemarks. Each placemarks corresponds to a specific feature on the ground. I am creating balloons to provide some descriptive information of the feature and I want to add a couple of images within the ballon of the feature itself. Is this possible using FME?


How do I find the pgAdmin connection parameters?

I need to create a connection from arcmap to pgadmin using a python module because of an arcpy script, but I am unsure of how to get the pgadmin connection parameters. I think it may be some kind of file in a directory, but I am unsure. This pgadmin database is on a windows machine.


Change the size of an OpenLayers.Control.OverviewMap

I create my OpenLayers.Control.OverviewMap with a given size but I would like to change it when certain conditions are met. I have tried two approaches with no luck... My first try was just changing its width and height via CSS attributes:               $("div.olControlOverviewMapElement>div.olMap").css('width',320);      It does change its visual size but then the overview map doesn't work properly, the "new gained" space in the overviewmap is not usable (can't be used to drag the view rectangle) My second try was simply changing its size property:               ovMap.size = new OpenLayers.Size(320,240);      but it doesn't have any effect to the overview map. Is it possible to change its size once it's been created? Extra information: Using OpenLayers-2.10, and in both cases I have tried calling the update() method of the control.


Can't drop table with geography column

I imported shp to postgis 2.0.1 with shp2pgsql and chose to use geography instead of geometry. However, now when I try to drop the table, the pgadmin/sql console/phpPgAdmin freezes. I can't neither truncate it or change the columns. Any help would be appreciated :-).


Exporting Grid from R to use it in ArcGIS

i want to export a grid from R into format readable by ArcGIS. how can i do so? jones


How to import selected features from QGIS to PostGIS?

I am trying to import selected features from Quantum GIS to postgresql directly. I do not know how to do it. Actually, my problem is, I have full country road network. But, I need to cut road network of a small area. If i import full country road network using Quantum GIS to postgresql, I can do it. But, I can not import small area road network after extracting that small area. Something, has been change after cutting sample area. But, I do not know what it is?? It is very strange. If anyone have the solution. Please let me know.


Given long, lat, x and y, how do I find the projection?

I am using an app called farsite that outputs shapefiles that show how forest fires will grow. I am getting output in coordinates as X and Y values rather than (lon,lat) and am looking for a conversion routine to (lon, lat). If I knew the name of the coordinate system it might help my search, but I do not even know that. I have gone to google maps and have looked at the expected (lon, lat) so I have a rough translation equation, but I am sure that someone else has a better one (mine is linear with a scale and offset, which I fear is too simplistic) Here is a sample point (X, Y): 162206 386691 (Lon,Lat): -115.326662 47.582952 Can someone please steer me to a reference or conversion routine? Thanks in Advance - Steve Tufty


OpenLayers canvas renderer - redraws all features on selecting a single feature

I am currently trying to learn more about OpenLayers, and I'm coming up against performance / behaviour issues that I wouldn't expect to see. To elaborate... I have combined this example for generating lots of random points with this example on highlighting / changing the icons of features on selection. The result is available in this JSFiddle. The (very basic) application prioritises the Canvas renderer, so that the points layer is defined like this:               var layer = new OpenLayers.Layer.Vector('points', {renderers: ['Canvas', 'SVG', 'VML'],     styleMap: new OpenLayers.StyleMap({         "default": new OpenLayers.Style(OpenLayers.Util.applyDefaults({             externalGraphic: "img/marker-green.png",             graphicOpacity: 1,             rotation: 0,             pointRadius: 10         }, OpenLayers.Feature.Vector.style["default"])),         "select": new OpenLayers.Style({             externalGraphic: "img/marker-blue.png"         })     })});      The Canvas renderer is nice because zooming and panning works well with thousands of points (unlike SVG) but clicking / feature selection is much slower than SVG. I was surprised to see that all feature icons are redrawn before the selected feature's icon changes (to marker-blue.png). This is especially apparent in Firefox, but less noticeable in Chrome and too fast to see in IE9. This question on SO suggests that there could be an issue with how OpenLayers is interacting with the Canvas, but unfortunately I don't know enough about HTML5 or OpenLayers (yet) to be sure. Does anyone have experience with OpenLayers / Canvas renderer? I am interested in any ways of speeding up feature selection when there are lots of features - whether it's the time taken to figure out which feature was selected, or simply changing the selected feature's icon. Any help much appreciated.


How to Run Ad Hoc Database Queries in Open Jump?

Which plugin allows you to run ad hoc queries from postgis in Openjump? How do you install it in Ubuntu?


Tick boxes for a qgis plugin written in python

in a python plugin for qgis I want the user to be able to select one or more of several options via tick boxes. I imagine it to look like e.g. Qgis 2.2 tool "Vector" -> "Data Management Tools" -> "Join attributes by location". In the "Attribute Summary" section of this tool the user is able to tick several functions on and off: ![enter image description here](http://i.stack.imgur.com/eWgEW.jpg) At the moment I use a string input (`##options=string "option1,option2,option3"`). The user has to enter all options separated by a comma. This works but it does not look very pretty. Is this possible with Pyhton? Any suggestions? Thanks in advance.


Cache geodjango query with bounding box filter

Im using geodjango (postgis) to retrieve points contained inside a bounding box (made by leafletjs), it works so nice, but now I want to cache this query. A tipical query is one like this:               /points?xmax=193.0078125&xmin=-200.7421875&ymax=49.83798245308484&ymin=29.53522956294848      This kind of query will never be cached, is there a way to cache this?, I mean, achieve some cache hits, assuming would appear more/less points in the viewport than would strictly correspond. Some ideas...   1. removing decimal position in the numbers   2. passing zoomlevel as a param should be better/mandatory? Thanks for your thoughts. **Solved** :   1. Use https://pypi.python.org/pypi/django-geojson to make a simple view which uses (x,y,z) as params to do filter your queryset.   2. Use http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#Tile_numbers_to_lon..2Flat._5 to make the filter in the view   3. Use https://github.com/glenrobertson/leaflet-tilelayer-geojson/ for making a layer in you map which makes your tile request to the previous view.


Create custom raster pyramid using arcpy in ArcGIS 10.2

I have a arcpy script that runs the Point Density tool several times for the same extent, using the same number of neighborhood cells, but with cell size increasing at an multiple of 2 with each pass. The purpose of my point density rasters are purely data visualization, and I plan on publishing my point density visualization using ArcGIS Server 10.2. The idea is to make the point density visualization more specific as you zoom in the map, e.g switching to point density raster of ever smaller cell sizes as you zoom deeper in, and the point density rasters become less generalized. This imposes a scale limit for each of my point density raster, much the same way as pyramid levels in a raster pyramid. So my question is; is there a way I can build a custom raster pyramid and input my own point density rasters as the pyramid levels? At the moment I have 7 scales for my rasters, meaning I would need 7 layers in my map service when really only one would be needed if I could generate my own pyramid. I have tried to Google for Build pyramid tools and .ovr file management for arcpy, but so far I haven't found any solutions yet. Any tips would be greatly appreciated!


Getting an empty geometry when retrieving the envelope of a GroupElement in ArcObjects: what might be wrong?

I am working in ArcGIS 10.0 (ArcMap) and Python 2.6.5 and in the Data View. I have an IGroupElement3 to which I add a TextElement and up to several RectangleElements. I want then to retrieve the envelope of the GroupElement, recenter that envelope, and set the envelope as the new geometry of the GroupElement. The intent is to reposition (translate) the GroupElement. Here is a snippet:               pGrpElem = CType(pGroupElementFull, esriCarto.IElement)     pEnv = pGrpElem.Geometry.Envelope     pEnv.CenterAt(pCtrPoint)     pGrpElem.Geometry = pEnv      When the code runs, I get an error on the CenterAt method, saying I am performing an operation on an empty geometry. I checked, and indeed the pEnv is empty. So I have a few questions: (1) Is this a valid method for moving a GroupElement? (2) If not, how should I be doing it? (3) If so, then I have a problem elsewhere. Do I have to add the component elements - and the GroupElement for that matter - to the display's GraphicsContainer to get them to "gel" and have valid envelopes? I was trying to avoid the GraphicsContainer step, because I really don't want the graphics to draw to the screen. The GroupElement is really for loading into an annotation feature. When I use the GraphicsContainer the screen drawing can get messed up unnecessarily. The graphics draw anyway when they are added to annotation, so I don't need two copies onscreen. (4) If, as described above, I need to do something in addition to simply adding elements to the GroupElement to make their geometries visible to the GroupElement, how might I do that and avoid drawing the graphics to the screen at the same time? Thanks for the help, all.


What is the difference between DEM, DSM and DTM?

I am listing some of the acronyms used in our work and had to stop to think about whether to list these together or separately. In some circles they are synonymous, in others they have distinct meanings. What do you consider them to mean, or is there an agreed-upon definition for each?


Converting ERDAS (*.img) file into headerless binary file?

I am having trouble converting an ERDAS (*.img) file into a headerless binary file. I want to use those images in the TIMESAT program. I'm trying to do this in IDRISI 32 but there is an error saying: > minimum values exceeds maximum value during the process. What does the error mean, or how can I achieve this task using another program? For example, ArcGIS, ENVI, ERDAS, but not GDAL (with which I am unfamiliar). It seems I need to write some code to work in GDAL and I am not a coder.


Getting "Segmentation fault: 11" with ogr in Python

This is the code I'm trying to run:               In [1]: from osgeo import ogr          In [2]: datasource = ogr.Open('testdata.shp')          In [3]: datasource.GetLayerCount()     Out[3]: 1          In [4]: layer = datasource.GetLayerByIndex(0)          In [5]: layer.GetName()     Segmentation fault: 11      It doesn't matter what datasource I use. I've tried with several (even different formats) but I keep getting the same result. Anyone faced this issue before? I've tried reinstalling `gdal` (in my computer) and `GDAL` (Python bindings) but still no luck. The weirdest thing is that it was working fine 2 days ago, and suddently started failing.   * OS X v10.8.5   * GDAL==1.10.0


How to automatic reload value map attribute

I'm using the 'value map' widget and have allready load data from a layer. However i've changed the data in the layer but the values still remain the same. Is there a way to reload the data without doing it manually? Thank you, Tiago


Remove only a subset of cached tiles of a wmsLayer (GeoWebCache)

imagine a wmsLayer defined in geowebcache.xml that forwards, for instance, a STYLES parameter to the WMS service by utilizing a regex-based parameterFilter. As https://github.com/GeoWebCache/geowebcache/wiki/Metastore- removal points out, GeoWebCache generates a MetaStore for all the cached tiles generated, arranged in subdirectories (one my case for each wmsLayer-STYLES combination). I know that there is a way to drop all cached data of a specific wmsLayer. My question: Is there also a possibility to drop only the cached data for a specific STYLES value of a wmsLayer? Thanks, Peter.


Geofence routes from point A to point B

I'm working on a task where given the coordinates of a line from point A to point B, I need to create a geofence around this line (road route). ![Geofenced route from point A to point B](http://i.stack.imgur.com/3zAf0.png) But based on what I read here https://developers.google.com/maps/documentation/tracks/limits, geofence has a limit of 100 vertices per polygon. Is my understanding correct, that its not possible for me to create the polygon for geofence given all the vertices that will be generated to enclose the route above will be more than 100? Is this task achievable in Google Track API? Thank you in advance.


Set ArcGIS Tool Parameter to Obtain From it's own Source?

I am building a python tool in ArcGIS. When I build the parameters I will have 3:   1. Choose a shapefile (parameter data type = shapefile)   2. Choose an SQL query (parameter data type = SQL Expression)   3. Choose an output folder for a .xls report (parameter data type = Folder) The first 2 parameters are an either/or scenario. The user will either choose a shapefile for the input or they will build an SQL Query on a very specific feature class (I do not want them to choose both parameters). Whichever option the user choose, the parameter will be eventually used as the 'clip feature' in the arcpy.Clip_analysis function. My first question is:   1. Is there a way to limit the user from choosing both (i.e. if they choose the shapefile option, have the SQL query grey out automatically and vice versa). Maybe using the validator class?   2. I want to 'Obtain From' a very specific feature class to be used in the SQL parameter. The parameter property for 'Obtain From' only allows me to obtain from another parameter. Is there any way to 'Obtain From' it's own source? It won't allow me to enter a default datasource and choose that for the 'Obtain From'. Maybe I can also do this through the validator class as well? Any thought/comment would be welcome. Thanks, Mike


How to insert a large feature using C# and ST_GEOMETRY in Oracle

I am using the st_polyfromtext command to insert features into an Oracle database like this:               INSERT INTO polygon_test VALUES (      sde.st_polyfromtext ('polygon ((10.01 20.03, 10.52 40.11, 30.29 41.56, 31.78 10.74, 10.01 20.03))', 0) ); I am crafting the sql by hand in a C# web service and using OracleConnection and OracleCommand to execute the sql. I am using bind variables (:) and OracleParameter to bind the attribute values i send in with the spatial feature. My issue is that if the feature is very complex and has alot of vertices then i get an Oracle error about literal string too long. How can i send this coordinate string into Oracle and have it recognized as a feature when i keep hitting this cap? I have tried to assign the OracleParameter as a CLOB datatype and then bind the :SHAPE to that but it still balks.


Can Cartodb map show only United States?

I have made my map with cartodb, showing where certain work is going on throughout the United States. I want to send it out, but would prefer the map to only show the United States--whereas now it shows Canada and Mexico as well. I am using the free cartodb.


How to export a set of layers into multiple PDF(orAI)files, one layer at a time?

I am completely NEW to PYTHON(only took a 3-hr entry course in ESRI tutorial. I have a dataset contains files named as "1_A, 1_B, 1_C....12_A,12_B, 12_c,....200_A, 200_B, 200_C..etc." I need to export each feature layer, one at a time , to a PDF or AI file through a COMPLETELY AUTOMATED process. I tried to use Addlayer and Removelayer tool in Model Builder but they all run for one single feature layer once at a time. I coudl not connect the add and remove process to each other, nor could I connect the process through Iterator to the script tool anyway. This means although I use model builder or write python script, I have to change the layers (or the name of layers) hundreds of times and save every layer into a new MXD file and export then to pdfs. I was thinking about turning on one of the layers at a time, export a .ai file with that layer visible, then turn that layer off and move on to the next layer in the list. I'm wondering if you have any suggestion about building the model or the scripts? ![Pic1: I know I can iterate feature classes, but the exporting PDF only work with .mxd files, How can I save each shapefile into different mxd through iterator, before I export them to pdfs? will the export pdfs works in batch process for multiple mxd files?](http://i.stack.imgur.com/slpzp.png)


How to open, modify and save a QGIS project with PYQGIS

I need to create a stand-alone script for opening a QGIS template project, modify a layer data source, export the Composition and finally save the modified .qgs project into a new file. So far I have only found some examples for QGIS plugins, but of course they don't work for the stand-alone uses. Can anybody give me some helpful hints? Thanks!


ArcGIS 9.3 geoprocessing service output consideration

I'm developing geoprocessing service which do few processes with geographic data. I would like to get somehow geometry of those data and use it in my web aplication (JS ArcGIS API). Now I'm wondering how to (with best performance) return geometry from service to my application? Now I'm trying manually access to feature geometry, and while iterating throught it I'm concatenate it's coordinates to string. It is very slow method, because I've got about 60-90k vertex (avg) on polygon so concatenating it is taking to much of time. Can anyone see other possibilities to return geometry of features from service to JS with better performance?


Need python code example - setting a combo listbox to Null

I want to be able to set the value of a field to Null using python, but I get an error. I am using arcpy.CalculateField_management Any help would be appreciated. Rob Smith


How to mirror two geodatabases on the fly?

I'm new to arcgis and its applications. We have the full suite of arcgis solutions (arcgis server, desktop, arcgis sde) We have a requirement...   1. geodatabase (A & B)   2. A & B reside on 2 different server but connected via LAN   3. A will be updated   4. B will be a replica of A May I know what is the best solution to this issue? the geodatabase can be hosted on oracle DB, personal geodatabase or geodatabase file. I know that arcgistools has the functions to replicate and sync but according to my friend. the synchronization has to been done manually. (creeate a script and execute it periodically. Is there a way to mirror those 2 geodatabase on the fly?


What are Pros and Cons to ArcGIS Online Organizational Account?

Esri is making a big push towards ArcGIS Online as a means for map applications. They pushed it really hard at the recent Southeast User Conference and did a good job at highlighting its advantages. Primarily: Configuration over Customization I'll admit, this seems to be a significant ROI savings with as simple as some of the maps are to create with little or no programming needed. What I'm wondering is, for any of you that might have experience with ArcGIS Online, what the advantages and disadvantages are to moving towards this product? My organization is looking towards a 30 day trial of the product and want to be prepared if we decide to try and sell it to the decision makers.


How to add a polygon from PostGIS ST_AsGeoJSON into Leaflet?

I try to use the following function to add polygons to my Leaflet map.               function polygon(geojson)     {         alert(geojson); // alert for testing         layer = L.geoJson(geojson);         layer.addTo(map);     }      When I call the above function with the GeoJSON string I fetched from a PostGIS table using `ST_AsGeoJSON()`, the following string is alterted.               {"type":"Polygon","coordinates":[[[10,370],[20,380],[30,410],[-10,395],[10,370]]]}      But no polygon shows up on the map. As far as I can say, there is no error message. And I can definitely say that a polygon with the points `10 370, 20 380, 30 410, 10 395` shows up on the map, if I insert it using `L.polygon`. What's wrong?


"Failed to get property: gid" error in geoserver sql view

I have a postgis data with 777 features. In geoserver, i created a sql view with another table. In the wms request i can see all features, in qgis also i can see all features. but in wfs output as csv or geojson i only get 55 features. On doing wfs with openlayers it gives error               <ows:ExceptionReport version="1.0.0"       xsi:schemaLocation="http://www.opengis.net/ows http://localhost:8080/geoserver/schemas/ows/1.0.0/owsExceptionReport.xsd"       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ows="http://www.opengis.net/ows">       <ows:Exception exceptionCode="NoApplicableCode">         <ows:ExceptionText>java.lang.RuntimeException: Failed to get property: gid     Failed to get property: gid     java.lang.String cannot be cast to com.vividsolutions.jts.geom.Geometry</ows:ExceptionText>       </ows:Exception>     </ows:ExceptionReport>


Is it possible to force uppercase in a geodatabase string field?

I have certain string fields in my geodatabase tables with which I would like to enforce an all-uppercase rule. These fields are ones that do not lend themselves to domains (such as address fields). Is it possible to create a geodatabase string field that supports only uppercase characters inherently? I would like to be able to use the built-in ESRI tools within ArcMap to edit my tables and have them converted to uppercase on the fly. I am using ArcSDE and MS SQL-Server. Answers that utilize front end validation on ESRI's stack are preferred, but a generalized SQL solution that parses inputs on the RDBMS side with something like an INSTEAD OF trigger is acceptable as well. * * * **Edit:** As the accepted answer consists of SQL editing on an RDBMS backend of ArcSDE, Devdatta Tengshe has noted that it can be very dangerous to do this if you do not know what you are doing. It could possibly corrupt your data. If your situation is conducive, you should use BradHard's answer instead (creating a database view as your data source). ESRI does not actually discourage the usage of SQL triggers on the backend to maintain data. However, ESRI instructs in their documentation that you should **not** use SQL on your RDBMS to edit the following ArcSDE data: > **Do not use SQL to edit the following:** > >   * ArcSDE geodatabase system tables > >   * ObjectIDs (or row IDs) that are maintained by ArcSDE or the geodatabase > >   * Tables or feature classes that participate in the following geodatabase > functionality: > >     1. Annotation feature classes and feature-linked annotation > >     2. Archived data > >     3. Cadastral or parcel fabrics > >     4. Domains > >     5. Geodatabase replication > >     6. Geometric networks > >     7. Network datasets > >     8. Relationship classes > >     9. Representations > >     10. Schematic datasets > >     11. Subtypes > >     12. Survey datasets > >     13. Terrains > >     14. Topology > > As long as the fields that you want to force uppercase do not fail any of the requirements listed above, then you can safely use Devdatta Tengshe's SQL trigger method below to force uppercase on whatever individual string fields you desire.


Adding 'freehand' data to raster mapping in QGIS

Having just worked out how to import raster mapping into QGIS at the correct scale, I'd like to now add useful information to the map like marked routes, labels etc. How can I do this in a 'freehand' manner, rather than importing existing datasets?


How to remove layers of detail from an osm file?

I want to remove some layers from the osm map of an area. It has all the details like POI, offline routing and all. But I just want the map data. How can I remove this extra layer from the map?


How to set all pixels with value <= 0 to "nodata" in DEM raster?

I have a DEM raster with pixel values between about 3000 and -0.0003. I need to set all pixel with a value of 0 **and smaler** (<=0) to "nodata" (for later raster calculations and to reduce the filesize). It seems for me that this is a task for the raster calculator (set value of pixels <=0 to "nodata") or a reclassification (set value of pixels <=0 to "nodata" and keep all other values) but I dont know how.


ST_Distance Webmercator Error

I do have one more question pertaining to ST_Distance. I tried to add to my previous post but I made a new post. When applying the following query to my javascript I get this error:               SELECT c.addressno,      ST_Distance(c.the_geom,       (SELECT the_geom FROM test_alignment_poly ORDER BY the_geom <-> c.the_geom LIMIT 1))      as MinDistance FROM address_pt_subset c where c.addressno='8635'      {"error":["column \"the_geom\" does not exist"]} After some research I found cartodb projections tutorial after applying the following information I was able to get the following query to work on the map view of the dash board:               SELECT c.addressno,the_geom_webmercator,cartodb_id,ST_Distance(c.the_geom,(SELECT            the_geom FROM test_alignment_poly ORDER BY the_geom <-> c.the_geom LIMIT 1))as         MinDistance FROM address_pt_subset c where c.addressno='8635'      Though as stated above when applying the same query to the API I still get a geom error. Is the nested geom value causing the error? I have tried many variation of transforming both geom values without success. I feel like I am close but I have run out of ideas and any additional help would be appreciated.


Lots of layers in one or multiple services? (and why)

I have a conundrum that I am getting mixed advice on how to go about. Therefore id like to put it to GIS-SE for some justified answers. **Scenario:**   * Client has a web mapping application. Does not want to split into multiple smaller applications. _Although this goes against what the modern day approach is for maps on the web, (i.e. lots of focussed web-map apps over one main web-map) I strongly believe that for some users, trying to replicate a GIS application on the web is ok (sometimes)._   * Client has cached as much of his basemap layers into separate services.   * Client still requires an additional **600-700 layers** in a **dynamic** map service...   * The service will be published with all of these layers **turned off**.   * It is not anticipated that users will turn on more than 10-40 layers at a time. I imagine your initial reaction to this is similar to mine (600+?! WTF?!) However - the requirement is set in stone and why not? Their prior ArcIMS application had similar functionality, so why can't this newer ArcGIS Server product do the same? The users potentially need to be able to cross compare and perform analysis on the entire range of layers, even if the layers belong to other departments. Before you jump to conclusions, the client is a clued up ArcGIS Server admin.   They have administered the 600 layers by all of the best practice rules: e.g. scale ranges combined with definition queries; annotation over labelling; generalising complex layers at small scales; publish as MSDs; etc **Problem** : What is the best approach here?   1. Publish all 600 layers into one dynamic map service?    2. Split the layers into logical groupings (hydrology, planning, ecology, utilities, etc) If you go with #1, and you have a few complex layers turned on. If you want to turn on a simple points layer, then ArcGIS Server will still have to render the entire layers being displayed all over again. If you go with #2, each time your making a request, potentially, the web application could have to make several GET requests for ExportMaps from the individual map services (is this bad, or does it create additional load to ArcGIS Server over #1?) And then this leads to configuration & tuning to ensure everything is as quick as possible. We can scale the back end of ArcGIS Server to multiple hosts and have some good hardware to sit it on. If you go with #1, you can throw the maximum # of instances that you AGS can handle. If you go with #2, I assume you evaluate the performance of the map services (load testing and look at wait times) and address the min/max instances accordingly to ensure there is not one service that is a 'weak link'. Im currently leaning towards the #2 approach, as my head is still telling me that having 600 layers in one service is madness, but if they are all turned off by default, there really is no issue. Would love to hear your thoughts. Let me know if you need more info via the comments, but not looking for answers like 'use a desktop application' or 'educate them to do things differently' Cheers! +++EDIT+++ From discussions in comments, I failed to mention another consideration. The application that the service will be consumed within, has the ability for **layer level security** (at the application level). Therefore the group of users (that is fairly large) are assigned to a particular role, and that role will have access to the full 600 layers. Other roles will be limited.


How to suppress spaces in labels?

I want to label some lines. The labels has spaces like "label 1". I want to suppress all spaces so that the result is like "label2" without changing the attribute table. Is that possible?


How to install pgrouting on Postgresql 9.2 located at /opt/PostgreSQL/9.2/ on Ubuntu Server 12.10?

I have installed Postgresql 9.2 on Ubuntu Server 12.10 using one-click installer from the EnterpriseDB. Then using the StackBuilder I installed PostGIS. Now I also want to install the pgrouting extension to my database. So far I have found instructions on the following pages:   * http://pgrouting.org/download.html   * http://docs.pgrouting.org/2.0/en/doc/src/installation/index.html#ubuntu-debian   * http://workshop.pgrouting.org/chapters/installation.html#pgrouting              sudo add-apt-repository ppa:georepublic/pgrouting-unstable     sudo apt-get update     sudo apt-get install postgresql-9.1-pgrouting      But the last command try to install postgresql-9.1 from the apt repositories:               # sudo apt-get install postgresql-9.1-pgrouting     Reading package lists... Done     Building dependency tree            Reading state information... Done     The following extra packages will be installed:       libboost-thread1.49.0 libcgal9 libgeos-3.3.3 libgeos-c1 libproj0 libqt4-dbus libqt4-declarative libqt4-designer       libqt4-help libqt4-network libqt4-opengl libqt4-script libqt4-scripttools libqt4-sql libqt4-sql-mysql       libqt4-sql-sqlite libqt4-svg libqt4-test libqt4-xml libqt4-xmlpatterns libqtcore4 libqtgui4 postgis       postgresql-9.1 postgresql-9.1-postgis postgresql-common proj-data qdbus     Suggested packages:       proj-bin libqt4-declarative-folderlistmodel libqt4-declarative-gestures libqt4-declarative-particles       libqt4-declarative-shaders qt4-qmlviewer libqt4-dev qt4-qtconfig oidentd ident-server locales-all osm2pgrouting       pgrouting-workshop     The following NEW packages will be installed:       libboost-thread1.49.0 libcgal9 libgeos-3.3.3 libgeos-c1 libproj0 libqt4-opengl postgis postgresql-9.1       postgresql-9.1-pgrouting postgresql-9.1-postgis postgresql-common proj-data     The following packages will be upgraded:       libqt4-dbus libqt4-declarative libqt4-designer libqt4-help libqt4-network libqt4-script libqt4-scripttools       libqt4-sql libqt4-sql-mysql libqt4-sql-sqlite libqt4-svg libqt4-test libqt4-xml libqt4-xmlpatterns libqtcore4       libqtgui4 qdbus      I want to install pgrouting on my existing Postgresql which is located at:               /opt/PostgreSQL/9.2/      I have also downloaded the source code. Following these instructions:               mkdir build     cd build     cmake -DWITH_DD=ON ..     make     sudo make install      When I run               # cmake -DWITH_DD=ON ..     -- PGROUTING_GIT_TAG: pgrouting-2.0.0     -- PGROUTING_GIT_BUILD: 0     -- PGROUTING_GIT_HASH: f26831f     -- PGROUTING_GIT_BRANCH: master     -- PGROUTING_VERSION_REVISION_NAME: f26831f master     -- PGROUTING_VERSION_REVISION_HASH: f26831f     -- UNIX=1     -- WIN32=     -- POSTGRESQL_EXECUTABLE is POSTGRESQL_EXECUTABLE-NOTFOUND     -- POSTGRESQL_PG_CONFIG is POSTGRESQL_PG_CONFIG-NOTFOUND     -- PostgreSQL not found.     CMake Error at CMakeLists.txt:122 (message):        Please check your PostgreSQL installation.               -- Configuring incomplete, errors occurred!      I cant figure out a way to tell cmake to locate my existing PostgreSQL installation. Any suggestions are very welcome.


Copy Domain and Subtype from File Geodatabase

Is there a way to copy the domain from one Dataset to another? I have a series of layers in Dataset A and I want to split the layers in to tiles using the Intersect tool; saving them in Dataset B. When I do this, all the domain information is lost. I assume there is an option to do this. Any help would be appreciated. Thanks....


How to create a Typographic Map with Mapnik

So i am trying to make a typographic map using mapnik. I want the street names along a particular street not to overlap, but I want an intersection between two streets to over lap. Currently![enter image description here](http://i.stack.imgur.com/wTrqf.jpg) some streets don't have repeating labels. see attached image for whats happening. How do I accomplish this?               labelStyle = mapnik.Style()     text = mapnik.TextSymbolizer(mapnik.Expression("[FULL_NAME]"), "DejaVu Sans Book", 2,     mapnik.Color("#171717"))     text.label_placement = mapnik.label_placement.line     text.label_spacing = 2     text.force_odd_labels = True     text.min_distance = 0     #text.max_distance = len((mapnik.Expression("[FULL_NAME]"))     text.character_spacing = 1     text.minimum_path_length = 0     text.label_position_tolerance = 100     text.allow_overlap = 1     text.avoid_edges = 0     r.symbols.append(text)     #labelStyle.rules.append(r)     s.rules.append(r)     m.append_style('Text',s)


Creating a openlayers enabled web project in eclipse

I'm brand new to creating gis map applications and I am trying to get a web project that uses               function init(){                 map = new OpenLayers.Map( 'map' );                 layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",                          "http://vmap0.tiles.osgeo.org/wms/vmap0",                         {layers: 'basic'} );                 map.addLayer(layer);                 map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);                 var featurecollection = {                   "type": "FeatureCollection",                    "features": [                     {"geometry": {                         "type": "GeometryCollection",                          "geometries": [                             {                                 "type": "LineString",                                  "coordinates":                                      [[11.0878902207, 45.1602390564],                                      [15.01953125, 48.1298828125]]                             },                              {                                 "type": "Polygon",                                  "coordinates":                                      [[[11.0878902207, 45.1602390564],                                        [14.931640625, 40.9228515625],                                        [0.8251953125, 41.0986328125],                                        [7.63671875, 48.96484375],                                        [11.0878902207, 45.1602390564]]]                             },                             {                                 "type":"Point",                                  "coordinates":[15.87646484375, 44.1748046875]                             }                         ]                     },                      "type": "Feature",                      "properties": {}}                   ]                };                var geojson_format = new OpenLayers.Format.GeoJSON();                var vector_layer = new OpenLayers.Layer.Vector();                 map.addLayer(vector_layer);                vector_layer.addFeatures(geojson_format.read(featurecollection));                  }      I've included the OpenLayers.js with the img and theme folders under the WEB- IMF. When I run it only the text shows, not the map. Is there something I'm missing.


How to count number of polygons inside another polygon layer?

I am looking for a tool in arcgis 10.1 Qgis or R that allows me to count the number of polygons that are inside specific areas (defined also as polygons). My data consists in: 1 shape file with multiple polygons with different shapes and sizes 1 shape file with the zone/areas


How to Export Datalayer to Access 2010?

I'm working with ArcGIS v10.1 and MS Access 2010. Can you export a datalayer directly into Access 2010 (.accdb)? This was possible under using older versions of ArcGIS with Access 2003. I created a DataBase Connection using ArcCatalog to reference the Access 2010 database and I can successfully import a table from Access into ArcGIS. However, when I try to export and point back to the same Access 2010 database using the same DataBase Connection, the .ODC I created is not available. I can work around this by exporting the data into a spreadsheet and then importing the spreadsheet into Access.


Python Error in QGIS Ubuntu 13.10 while trying to join .csv tables

Using the mqgis plugging in QGIS I cant join my csv file... This is what QGIS returns me: An error has occured while executing Python code: Traceback (most recent call last): File "/home/elisabet/.qgis/python/plugins/mmqgis/mmqgis_dialogs.py", line 217, in run joinattribute, outfilename, notfoundname, 1) File "/home/elisabet/.qgis/python/plugins/mmqgis/mmqgis_library.py", line 516, in mmqgis_attribute_join if duplication[0] != '_': IndexError: string index out of range Python version: 2.7.5+ (default, Sep 19 2013, 13:52:09) [GCC 4.8.1] QGIS version: 1.7.5-Wroclaw Wroclaw, exported Python path: ['/usr/share/qgis/python', '/home/elisabet/.qgis/python', '/home/elisabet/.qgis/python/plugins', '/usr/share/qgis/python/plugins', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist- packages/PILcompat', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client', '/usr/lib/python2.7/dist-packages/ubuntuone-client', '/usr/lib/python2.7/dist- packages/ubuntuone-control-panel', '/usr/lib/python2.7/dist- packages/ubuntuone-storage-protocol', '/home/elisabet/.qgis/python/plugins/mmqgis/forms', '/usr/share/qgis/python/plugins/fTools/tools']


How to use variable field name in arcpy.SearchCursor?

I have code that says               fld = fieldName      rows = arcpy.SearchCursor(fc)     for row in rows:         x = row.fld      How do I use a variable for my field name in python ArcGIS 10 on windows? Thanks.


QGIS 1.7.1 and PyQT4 conflict: what am I doing wrong?

I've just started playing with QGIS with a view to eventually developing a few simple plugins in Python. I downloaded `QGIS 1.7.1` for Windows and started working through these workshop notes. If I've understood correctly, developing plugins often uses `QT Designer` and something called `pyuic4`. These don't seem to be included in the QGIS install, so I downloaded PyQT4 separately. This enabled me to finish working through the workshop, but now when I start QGIS I get the following error:               Traceback (most recent call last):       File "", line 1, in      RuntimeError: the PyQt4.QtCore module is version 1 but the qgis.core     module requires version -1      If I uninstall PyQT4, the problem goes away, but then I don't have `QT Designer` or `pyuic4`, so how do I develop plugins? I'm not sure what `version -1` of PyQT4 is. Does anyone have any suggestions, please? I'm obviously doing something daft, but I'm not sure what. Perhaps QT Designer _is_ actually included somewhere with QGIS 1.7.1, but if so I can't find it... Thanks!


Adding Python Script to Custom Tool

I am probably making a simple mistake but can't seem to figure it out, only a beginner.The Select By Location Script is working and it exports to excel when it is run from Python GUI, it also works in ArcGIS when i use the Pyton Shell but when i try to make a tool out of it in ArcGIS it does not work. The error was ERROR 000714, which the help says there is an error in the script. If it works in Python GUI and in ArcGIS Python Shell (picture below) , why does this error appear when i try to run the custom tool? any ideas? ![enter image description here](http://i.stack.imgur.com/DxTMP.png)               import arcpy          arcpy.env.workspace = "Z:\GIS TEST\Select_by_Location"     BOL='Breakout_Location.shp'     arcpy.MakeFeatureLayer_management('Bld_Locations.shp', 'Bld_Locations_lyr')     arcpy.SelectLayerByLocation_management('Bld_Locations_lyr', "WITHIN_A_DISTANCE", 'Breakout_Location.shp', "2000 Meters", "NEW_SELECTION")     arcpy.SetParameterAsText(0, BOL)          arcpy.MakeFeatureLayer_management('Bld_Locations.shp', 'Bld_Locations2_lyr')       arcpy.SelectLayerByLocation_management('Bld_Locations_lyr', "WITHIN_A_DISTANCE", 'RiversITM.shp', "100 Meters", "ADD_TO_SELECTION")          CSVFile = 'Z:\\Excel.csv'          fields = [f.name for f in arcpy.ListFields('Bld_Locations_lyr')]          for i,f in enumerate(fields):         if f == 'Shape' or f == 'Shape_Length' or f == 'OBJECTID':         del fields[i]          with open(CSVFile, 'w') as f:         f.write(','.join(fields)+'\n') #csv headers         with arcpy.da.SearchCursor('Bld_Locations_lyr', fields) as cursor:             for row in cursor:                 f.write(','.join([str(r) for r in row])+'\n')      There will only be one input into the Custom Tool, that is why i only used one parameter.


help writing a python script

Hi I need help with writing a script: The task I have a point feature class of graffiti incidents and a polygon feature class of patrol zones with some empty attributes already created for you. I must write a script that updates the attributes of the patrol zones with:   * The number of graffiti incidents falling within the patrol zone. This is an integer that goes in the INCIDENTS field.   * The priority ranking for the patrol zone. This is a string that goes in the PRIORITY field. You will derive this string using some simple math that compares the number of incidents in the zone with the area of the zone. Patrol zone priority rankings I then will calculate a priority ranking for each zone by dividing the number of graffiti incidents in the zone by the area of the zone. My script should then examine the result and assign the appropriate priority ranking (PRIORITY). These are the priority rankings:   * TOP CONCERN—15 or more incidents per square mile   * HIGH CONCERN— At least 12 but less than 15 incidents per square mile   * SOME CONCERN— At least 6 but less than 12 incidents per square mile   * LOW CONCERN—Fewer than 6 incidents per square mile Here's what I have so far:               import arcpy     arcpy.env.overwriteOutput= True          # layer that we are changing     patrolZone= "C:\\...\\PoliceData.gdb\\PatrolZones"     # the layer we are selecting from     graffiti= "C:\\...\\PoliceData.gdb\\GraffitiIncidents"     nameField= "NAME"     graffitiField= "OBJECTID"     incidentsField= "INCIDENTS"               # sits above the first row, starts the cursor     patrolRows= arcpy.UpdateCursor(patrolZone)          # tells it to go to the first row     patrol= patrolRows.next()     # now were in the first row doing looping          while patrol:     arcpy.MakeFeatureLayer_management(graffiti, "GraffitiLayer")          zones= patrol.getValue(nameField)     #print incidents     queryString = '"' + str(nameField) + '" = ' + "'" + str(zones) + "'"     print str(queryString)          arcpy.MakeFeatureLayer_management(patrolZone, "PatrolLayer", queryString)     arcpy.SelectLayerByLocation_management("GraffitiLayer", "CONTAINED_BY", "PatrolLayer")          numGraffiti= arcpy.GetCount_management("GraffitiLayer")     print numGraffiti          patrol= patrolRows.next()      I'm stuck on updating the INCIDENTS field


GeoServer users can edit SLD styles in GeoExplorer

I have just gone through the Boundless tutorial on creating users in GeoServer (much easier to understand than the official GeoServer Doc). This works I have granted write access to a certain layer and user. However this user can edit the layer SLD if I login via GeoExplorer. Under my **Role Services: Default** there is a role **X-Write**. Under **user group services: default** there is a user **myuser** **Myuser** has the role **X-Write** assigned And I have granted write permission to this role for my selected layer. This link suggests that only users with admin privileges can edit a style. However I have not assigned the admin privileges to that role. The only role linked to my user is **X-Write** , which is under the **default role service**. Any suggestions?


What is the best practice for editing feature class?

I am working with some feature classes. I create those feature classes using my add-in. User can add/ delete features from these feature classes clicking on "add", "delete" buttons and selecting features. I added features using following code:               void AddFeature(IFeatureClass featureClass, IGeometry geometry)     {         IFeature feature = featureClass.CreateFeature();         feature.Shape = geometry;         feature.Store();     }      And deleted features using following code:               void DeleteFeaturesWithinPolygon(IFeatureClass featureClass, IPolygon polygon)     {         List<IFeature> features = GetFeaturesWithinPolygon(featureClass, polygon);         foreach (var feature in features)             feature.Delete();     }      Thing is, I did not use editor session. And actually, I did not think about it earlier. but today seeing this question, I think about edit session. I know can do these edits, without edit session. Actually I am doing it right now. But I want to know what is the best practice to do these edits.


Source for ArcGIS Layout Templates?

I am running v10 of ArcGIS for Desktop.   I am aware of the OTB templates provided with ArcGIS.   - However, I would like to supplement these layouts with additional layouts. ![enter image description here](http://i.stack.imgur.com/kkK6x.png) I am also aware of the Map Template Gallery, but this seems to be more around data models and I am after the actual **print layout templates.** In particular I am looking for Local Government style templates, but the only downloads I can find seem to be again around the data model side of things as opposed to the actual print templates. Has anyone seen (perhaps on ArcScripts) a bundle of templates that I can add to ArcGIS Desktop so that I can switch to them in my Layout View?


Map doesn't appear with custom CartoDB query

I'm trying to use CartoSQL from CartoDB.js to create a layer. Here is the SQL query I am trying to make:               SELECT        rpa_nj_hsip_hospitals_compressed.flood,        rpa_nj_hsip_hospitals_compressed.the_geom      FROM        rpa_nj_hsip_hospitals_compressed       All the columns are in the table –– I checked. This is the query string and you should see the same error I am seeing. What am I doing wrong?


How can I edit spatial data automatically on postgis and check for topology errors on said data whitout using shapefiles?

So, I have spatial data stored in postgis (points, lines and polygons) and would like to edit and update those in an Open Source software (quantum GIS, grass, etc.) to check for topologic errors, among others stuff, (arc-node- polygon topology) in an automatic way. So when I edit or update this data it would automatically be saved in the geodatabase whithout using the import from DB -> edit -> create shapefile -> import shapefile to DB routine. I know the ArcSDE can do all of this, but I need it done with Open Source software alone. Is there a way to do it? Ps: It would be best if those editions and updates would respect my database relationships between tables, but if not, the problem can be solved using triggers on postgis. Thanks in advance!


Qgis - Couldn't load plugin 'processing' - name 'QsciLexerCustom' is not defined - Manjaro

UPDATED I receive the following error when I start Qgis:               Couldn't load plugin 'processing' from ['/usr/share/qgis/python', '/home/v/.qgis2/python', '/home/v/.qgis2/python/plugins', '/usr/share/qgis/python/plugins', '/usr/lib/python27.zip', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/lib/python2.7/site-packages', '/usr/lib/python2.7/site-packages/gst-0.10', '/usr/lib/python2.7/site-packages/gtk-2.0', '/usr/lib/python2.7/site-packages/wx-3.0-gtk2', '/home/v/.qgis2/python/plugins/mmqgis/forms', '/usr/share/qgis/python/plugins/fTools/tools']          Traceback (most recent call last):     File "/usr/share/qgis/python/qgis/utils.py", line 182, in loadPlugin     __import__(packageName)     File "/usr/share/qgis/python/qgis/utils.py", line 453, in _import     mod = _builtin_import(name, globals, locals, fromlist, level)     File "/usr/share/qgis/python/plugins/processing/__init__.py", line 29, in      from processing.tools.general import *     File "/usr/share/qgis/python/qgis/utils.py", line 453, in _import     mod = _builtin_import(name, globals, locals, fromlist, level)     File "/usr/share/qgis/python/plugins/processing/tools/general.py", line 29, in      from processing.core.Processing import Processing     File "/usr/share/qgis/python/qgis/utils.py", line 453, in _import     mod = _builtin_import(name, globals, locals, fromlist, level)     File "/usr/share/qgis/python/plugins/processing/core/Processing.py", line 55, in      from processing.r.RAlgorithmProvider import RAlgorithmProvider     File "/usr/share/qgis/python/qgis/utils.py", line 453, in _import     mod = _builtin_import(name, globals, locals, fromlist, level)     File "/usr/share/qgis/python/plugins/processing/r/RAlgorithmProvider.py", line 34, in      from processing.gui.EditScriptAction import EditScriptAction     File "/usr/share/qgis/python/qgis/utils.py", line 453, in _import     mod = _builtin_import(name, globals, locals, fromlist, level)     File "/usr/share/qgis/python/plugins/processing/gui/EditScriptAction.py", line 29, in      from processing.gui.ScriptEditorDialog import ScriptEditorDialog     File "/usr/share/qgis/python/qgis/utils.py", line 453, in _import     mod = _builtin_import(name, globals, locals, fromlist, level)     File "/usr/share/qgis/python/plugins/processing/gui/ScriptEditorDialog.py", line 42, in      from processing.gui.ScriptEdit import ScriptEdit     File "/usr/share/qgis/python/qgis/utils.py", line 453, in _import     mod = _builtin_import(name, globals, locals, fromlist, level)     File "/usr/share/qgis/python/plugins/processing/gui/ScriptEdit.py", line 36, in      from processing.gui.LexerR import LexerR     File "/usr/share/qgis/python/qgis/utils.py", line 453, in _import     mod = _builtin_import(name, globals, locals, fromlist, level)     File "/usr/share/qgis/python/plugins/processing/gui/LexerR.py", line 34, in      class LexerR(QsciLexerCustom):     NameError: name 'QsciLexerCustom' is not defined          Python version:     2.7.6 (default, Feb 15 2014, 23:06:13)      [GCC 4.8.2 20140206 (prerelease)]               QGIS version:      2.3.0-Master Master, ccde1d4          Python path: ['/usr/share/qgis/python', u'/home/v/.qgis2/python', u'/home/v/.qgis2/python/plugins', '/usr/share/qgis/python/plugins', '/usr/lib/python27.zip', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/lib/python2.7/site-packages', '/usr/lib/python2.7/site-packages/gst-0.10', '/usr/lib/python2.7/site-packages/gtk-2.0', '/usr/lib/python2.7/site-packages/wx-3.0-gtk2', '/home/v/.qgis2/python/plugins/mmqgis/forms', '/usr/share/qgis/python/plugins/fTools/tools']      First, I don't know anything about python, so forgive me if the information I provide is a bit random and don't hesitate to ask more. I also do not know how to define something in python but at first sight and from my limited understanding, it seemed pretty well defined: Indeed, in /usr/share/qgis/python/plugins/processing/gui/ the LexerR.py file specifies:   from PyQt4.Qsci import * In /usr/share/sip/PyQt4/Qsci/ there is a qscilexercustom.sip file specifying:   '#include' and the file qscilexercustom.h exists in the /usr/include/qt4/Qsci/ folder. I had Qgis 2.0 before, with the same issue, and installed this development version with the faint hope that it might solve my problem.   Would you have any idea how to solve this issue? Thanks! * * * UPDATE Thanks for the tip!   Here is what I get when I try to import PyQt4.Qsci: RuntimeError: the sip module implements API v11.0 but the PyQt4.Qsci module requires API v10.1 So I guess now I'll try to downgrade sip, though I had to install sipdev to compile Qgis. I'll let you know what comes up.   Thanks, * * * UPDATE 2 Downgrading sip wasn't such a good idea since it is required by PyQt4. Here's is what I get when I try to launch qgis:               Couldn't load PyQt4.     Python support will be disabled.               Traceback (most recent call last):     File "", line 1, in      RuntimeError: the sip module implements API v10.0 to v10.1 but the PyQt4.QtCore module requires API v11.0      Same when I try to import PyQt4.Qsci from python:                 RuntimeError: the sip module implements API v10.0 to v10.1 but the PyQt4.QtCore module requires API v11.0      Note that python-qscintilla, python-qscintilla-common, python2-qscintilla and qscintilla are all installed in version 2.8-1.   Any ideas? Thanks!


using SPOT Messengers in a corporate environment

We're looking into using SPOT Messenger GPS devices in a corporate setting for our wilderness field staff. GlobalStar, who operates Spot, has a commercial XML data push service which will dump incoming messenger reports to a specified server we own, which we can then process and redirect as we like. Is anyone out there using this service? Perhaps you've built a _spotxml-to- gis_ program or script you can share? (in python?) Any other thoughts on the service and its utility?


What Type of GIS Powers Automobile Navigation Systems

My sister-in-law was inquiring about where she can buy updated DVD's to load into her car's system. Obviously I know the dealer/OEM would love to rip her off for such data, and I knew of no alternatives off the top of my head. Being a GIS professional, the wheels started turning... Does anyone know anything about: a) the GIS software that is powering automobile navigation systems. Are there any published specs, or are they completely proprietary implementations? b) what is the format of the street/network datasets? I dont have such a fancy contraption in my vehicle, so I can't investigate for myself. Not sure if the specific make/model makes any difference here, but I am specifically asking about a 2009 Toyota Venza.


datum conversion with GDAL

I run gdaltransform like so:                gdaltransform -s_srs nad27 -t_srs wgs84      -104.5 39.5      -104.5 39.5 0           gdaltransform -s_srs wgs84 -t_srs nad83      -104.5 39.5      -104.5 39.5 0           gdaltransform -s_srs nad27 -t_srs nad83      -104.5 39.5      -104.5 39.5000000009262 4.23276796936989e-005      In other words, if gdaltransform nad27 -> wgs84 -> nad83, the lat/lon do not change. If, however, I transform nad27 -> nad83, my latitude is ever-so-slightly different. Why, please? What is the correct process for transforming coordinates? I have a legacy application that only saves the datum name (e.g. NAD27, WGS84, etc) and the lat/lon. In its processing, when trying to find the lat/lon in NAD83, which is the projection defined in a 1 sec FLT .HDR file, it calls (an old DLL implementation of) CS-Map cs_cnvrt, passing in nothing more than these datum strings, and it gets an output lat/lon that are different than the input lat/lon. When updating this code, I have this crazy idea that I'll keep all coordinate internally in WGS84, and transform them as needed by the output plane. So my code reads the NAD27 coordinates, converts to WGS84 using GDAL. It later asks GDAL to transform WGS84 to the spatial reference system (SRS) in the FLT file (i.e. NAD83). The transform results are exactly the same as the input. This makes sense to me, but I can't understand why the two methods above are so different. Thanks. -reilly.


How to download GeoTIFFs using the REST API in GeoServer 2.2?

I am using GeoServer (Version 2.2 Git Revision f5b5c35076b52d02eb9cca3fa3232bc17b5f6d80 Build Date 19-Sep-2012 18:33 GeoTools Version 8.2 (rev 704570474295e339c08d1ca140d884f23a8a03a3)) and I've got workspace with name `myTestWorkspace` and store with name `test` and type `GeoTIFF`. This store has URL connection parameters as follows: `file:coverages/test.tif`. I would like to download `*.tif` file by GeoServer REST API. I found in documentation that it is possible using URL `/workspaces/<ws>/coveragestores/<cs>/file[.<extension>]` So in my case it will be `/workspaces/myTestWorkspace/coveragestores/test/file.geotiff` (am I right?). But when I paste this URL I've got `HTTP status 404`. In documentation above is information that in this case (getting 404) are two options:   > Exceptions: > > GET for a data store that does not exist -> 404   > GET for a data store that is not file based -> 404 My data store exists (if for example I paste `/workspaces/myTestWorkspace/coveragestores/test/file.tif` then I've got `Unsupported format: tif` in response - this is ok, because `tif` is not valid format, so it means that GeoServer can see my store).   But is my data store file based? I thought that if data store has type `GeoTIFF`, then he is file based - am I right?      Any ideas why I cannot download TIFF file?   Thanks, Arek


Why is pgrouting astar not consistent?

I route from 1 end of a circular route to the opposite end. Visually it is obvious that going clockwise is shorter, however shortest_path_astar sometimes picks clockwise and sometimes anti-clockwise. ![astar messing up](http://i.stack.imgur.com/ukmJM.png) I narrowed down the amount of edges it may route on and it seems that the order in which the selected edges appear in the result set make a difference in the outcome of astar (which should not happen in my opinion). Set1:               SELECT e.id, e.source_id::integer as source,    e.target_id::integer as target, (SELECT SUM(n.shape_leng::float) FROM netwerk n    WHERE e.source_id = n.source_id    AND e.target_id = n.target_id) as cost,    ST_X(source.the_geom) as x1, ST_Y(source.the_geom) as y1, ST_X(target.the_geom) as x2, ST_Y(target.the_geom) as y2 FROM edges e JOIN knooppunten source    ON source.gid = e.source_id JOIN knooppunten target ON target.gid = e.target_id where e.id in (127,757,471,286,579,601,760) or not exists (SELECT * FROM netwerk n    WHERE e.source_id = n.source_id    AND e.target_id = n.target_id);      Result1:                id  | source | target |       cost       |        x1        |        y1        |        x2        |        y2              -----+--------+--------+------------------+------------------+------------------+------------------+------------------      127 |    459 |    460 | 1166.62881971498 | 178418.026099999 |      593089.0845 | 179488.144699998 | 592656.112100001      286 |    457 |    373 | 2701.89635124091 | 177301.707899999 |      593119.0339 | 177093.187399998 | 590500.850200001      471 |    457 |    458 | 229.123075139216 | 177301.707899999 |      593119.0339 | 177516.643399999 | 593197.757599998      579 |    371 |    373 | 1291.71083699618 | 178363.840300001 |      590548.6774 | 177093.187399998 | 590500.850200001      601 |    460 |    371 | 2456.81983676712 | 179488.144699998 | 592656.112100001 | 178363.840300001 |      590548.6774      757 |    459 |    458 | 919.539772037522 | 178418.026099999 |      593089.0845 | 177516.643399999 | 593197.757599998      760 |    372 |    373 | 805.921542501888 |      176324.6664 | 590358.514199998 | 177093.187399998 | 590500.850200001      (7 rows)      Set2:               SELECT e.id, e.source_id::integer as source,    e.target_id::integer as target, (SELECT SUM(n.shape_leng::float) FROM netwerk n    WHERE e.source_id = n.source_id    AND e.target_id = n.target_id) as cost,    ST_X(source.the_geom) as x1, ST_Y(source.the_geom) as y1, ST_X(target.the_geom) as x2, ST_Y(target.the_geom) as y2 FROM edges e JOIN knooppunten source    ON source.gid = e.source_id JOIN knooppunten target ON target.gid = e.target_id where e.id in (127,757,471,286,579,601,760);      Result2:                id  | source | target |       cost       |        x1        |        y1        |        x2        |        y2              -----+--------+--------+------------------+------------------+------------------+------------------+------------------      579 |    371 |    373 | 1291.71083699618 | 178363.840300001 |      590548.6774 | 177093.187399998 | 590500.850200001      760 |    372 |    373 | 805.921542501888 |      176324.6664 | 590358.514199998 | 177093.187399998 | 590500.850200001      471 |    457 |    458 | 229.123075139216 | 177301.707899999 |      593119.0339 | 177516.643399999 | 593197.757599998      286 |    457 |    373 | 2701.89635124091 | 177301.707899999 |      593119.0339 | 177093.187399998 | 590500.850200001      127 |    459 |    460 | 1166.62881971498 | 178418.026099999 |      593089.0845 | 179488.144699998 | 592656.112100001      757 |    459 |    458 | 919.539772037522 | 178418.026099999 |      593089.0845 | 177516.643399999 | 593197.757599998      601 |    460 |    371 | 2456.81983676712 | 179488.144699998 | 592656.112100001 | 178363.840300001 |      590548.6774      (7 rows)      Above 2 result sets are identical apart from the ordering of the rows. When i use shortest_path_astar on these 2 result sets i get different results:               select * from shortest_path_astar('<select Set1>', 460, 373, false, false) astar;      vertex_id | edge_id |       cost            -----------+---------+------------------            460 |     127 | 1166.62881971498            459 |     757 | 919.539772037522            458 |     471 | 229.123075139216            457 |     286 | 2701.89635124091            373 |      -1 |                0          select * from shortest_path_astar('<select Set2>', 460, 373, false, false)      vertex_id | edge_id |       cost            -----------+---------+------------------            460 |     601 | 2456.81983676712            371 |     579 | 1291.71083699618            373 |      -1 |                0      In this example Astar gives different results for an identical set of rows. Other things i noticed:   * If i route from endpoint to startpoint (373 -> 460) shortest_path_astar gives the correct answer.   * If i use shortest_path instead of shortest_path_astar this particular problem does not occur.   * If i change the type of x1,x2,y1 and y2 to double precision or float8 (what it should be according to docs) shortest_path_astar still is incorrect   * If i change the type of x1,x2,y1 and y2 to int or bigint shortest_path_astar gives the correct answer My best guess is that the heuristic function in the underlying Boost library is messing up because of how it interprets the incoming x1,x2,y1 and y2. Chances that the boost library is wrong seem slim so it might be the transfer of the data i feed it. Does any of you have experience with this behaviour of shortes_path_astar or knows what/if i am doing wrong? -