title: How to force RGB in a raster in QGIS?

text: I have rasters in 1 band 64bits float that represent real data values and for which I can set min and max using the stretch to min and max option in QGIS. I would like to convert these rasters to RGB 8 bits with a greyscale and with the min and max that I have set. It is easy to do in ArcGIS as it can be seen in this other subject: Is there a way to programatically force RGB (3 bands) in a raster with arcpy? I am looking for a way to do the same thing in QGIS. I do not need a script, I just need to be able to do the conversion. Does anyone know a way to dot it in QGIS? * * * Thank you very much. I have found this plugin and tried to install it. I edited my first post but when I finished, it gave me a message saying the edit had to be reviewed and it has not been updated yet. I am having an error message when I try to execute the plugin related to the Python code                   An error has occured while executing Python code:          Traceback (most recent call last):       File "C:/Users/user/.qgis//python/plugins\bccAddRColor\bccAddRColor.py", line 140, in DoWork         cplArray, nod )       File "C:/Users/user/.qgis//python/plugins\bccAddRColor\qml2gdal.py", line 599, in rasterOPal         tif_ds.GetRasterBand(1).SetRasterColorTable( ct )     AttributeError: 'NoneType' object has no attribute 'GetRasterBand'          Python version:     2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)]               QGIS version:     1.8.0-Lisboa Lisboa, 6416f38          Python path: ['C:\\Users\\user\\.qgis\\python\\plugins\\GeoCoding', 'C:\\Users\\user\\.qgis\\python\\plugins\\GeoCoding', 'C:/OSGeo4W/apps/qgis/./python', 'C:/Users/user/.qgis//python', 'C:/Users/user/.qgis//python/plugins', 'C:/OSGeo4W/apps/qgis/./python/plugins', 'C:\\Windows\\system32\\python27.zip', 'C:\\OSGeo4W\\apps\\Python27\\DLLs', 'C:\\OSGeo4W\\apps\\Python27\\lib', 'C:\\OSGeo4W\\apps\\Python27\\lib\\plat-win', 'C:\\OSGeo4W\\apps\\Python27\\lib\\lib-tk', 'C:\\OSGeo4W\\apps\\qgis\\bin', 'C:\\OSGeo4W\\apps\\Python27', 'C:\\OSGeo4W\\apps\\Python27\\lib\\site-packages', 'C:\\OSGeo4W\\apps\\Python27\\lib\\site-packages\\PIL', 'C:\\OSGeo4W\\apps\\Python27\\lib\\site-packages\\win32', 'C:\\OSGeo4W\\apps\\Python27\\lib\\site-packages\\win32\\lib', 'C:\\OSGeo4W\\apps\\Python27\\lib\\site-packages\\Pythonwin', 'C:\\OSGeo4W\\apps\\Python27\\lib\\site-packages\\wx-2.8-msw-unicode', 'C:\\Users\\user\\.qgis\\python\\plugins\\mmqgis/forms', '/usr/share/qgis/python', 'C:\\OSGeo4W\\apps\\qgis\\python\\plugins\\fTools\\tools',      I have tried to reinstall it and I checked the repository but there is no change. I documented the problem sending it to the user-list specified on the plugin's webpage and I am waiting for the answer.


title: How to style a shapefile in GeoServer?

text: I have a shapefile data of buildings. I added it to GeoServer and serve it as a WMS layer. When I check my own maps in the browser my polygons of building appear black color and I want to change it's color. What am I supposed to do ??


title: Problem with identify task in ArcGIS JavaScript API 2.8

text: I found interesting issue while using the “identify task” tool to display information at a point. Situation: I am displaying records by Type (A, B, C etc). When I display Type "B" records and I click on anywhere on map, it shows attributes of other records (either "A", "C", or "D") How is this possible? Please see the screenshots for further illustration. I also have added the code to JS Fiddle (I changed the server name). Is this a bug, showing attributes of a hidden record? Please check this and let me know. Thanks in advance : ) The first screenshot shows all features and an "identify" popup. The second shows only "C"-type records with an identify popup at a location of a different record type. ![map showing records of all Types with an identify popup](http://i.stack.imgur.com/9UKD3.png) ![map showing only "C"-Type records with an identify popup on a different record Type](http://i.stack.imgur.com/9By21.png) **Update:** I am using single layer and using the combo box to display particular layer. I researched on Google and ESRI forums Looks like its bug and its ID NIM042441 also it can be resolve according to ESRI forum so working on the same issue.. So thanks to all : )


title: Adding X,Y data and viewing with existing shape file

text: Excuse me for a simple question. I have CSV files of X,Y data (in decimal degrees) that I want to add to a map and view with a shapefile of level III ecoregions that I downloaded from the USGS website. Seemingly very simple I know, but when I add the points using "Add delimited text layer" and used the closest coordinate system I could find to the USGS shapefile the two layers do not line up. In argis I remember when adding X,Y data you could define the coordinate system of the new file based on the coordinate system of another existing shapefile rather than selecting from a list and hoping that the right one is there. Is there a way to do this in QGIS? I obviously dont know much about GIS software, and this is the #1 biggest problem I have with getting started on any project - making the coordinate system of two files match up! I would so appreciative if someone could help get me started! Thanks in advance. Sorry if my question is unclear or jumbled.... again the novice thing.


title: ARCMAP ERROR 000464: Cannot get exclusive schema lock

text: I am trying to run the "Near" tool in Arcmap. Both my layers involved are on a SDE database. When I run the tool I get the following error...               ERROR 000464: Cannot get exclusive schema lock.  Either being edited or in use by another application.      I do not:   * Have an edit session open.   * Have another application open. I saw this Link but I do not have ArcSDE installed locally so cannot execute "sdemon -o kill" to locally kill all connections... How can I get an exclusive schema lock and/or bypass this error? **Windows 7, ArcGIS 10, Versioned SDE GeoDatabase** **UPDATE:** Still-Not working After reading this: "In the Windows File Explorer, I looked at the properties of the folder where my script was putting its data. I saw that the folder was set to READ ONLY." Source I trying running the cmd command to set turn off read-only still no luck.               attrib -r pathTofolder      After further reading found that the read-only attribute in windows 7 is normal, and has more to do with windows system files then ability to write to the file folder. **UPDATE 2:** Still-Not working Today after reconciling, thinking that all locks on the database world have been removed from the previous day. Tried running the "Near" tool again, but still no luck still gives the schema lock error...


title: Why don't my polygons from MSSQL2008 display in QGIS?

text: I have imported a polygon shape file in MSSQL2008 using Shape2SQL loader without any issue. When I import the loaded polygon file in QGIS, I can't see it ! When I import other point or line features (previously loaded in MSSQL2008), I can see a few polygons from my file but not all of them. At first I thought that the geometry of the poly file was not complete, so I repaired the geometry using ArcGIS 10.1 and reloaded the ""fixed geometry" file in MSSQL2008, and still am running in the same problem when I import the layer in QGIS. One thing I have noticed in QGIS: when I connect to my MSQL2008 database, the points and line features have the geometry and SRID already determined but the polygon file requires the user to define the geometry type and SRID. I have tried selecting polygon and multipolygon type and set the SRID to 0 (like the other features in the DB) and still am running into problems viewing my poly file in QGIS. My original poly file has 1285 polygons in it. I have tried using a subset of my original file and still am running into problems in QGIS.


title: How to extract a WCS layer with gdal_translate?

text: There is a certain WCS layer that I'd like to save it to my local computer for analysis. According to GDAL WCS driver  draft: "Accessing a WCS server is accomplished by creating a local service description xml file looking something like the following, with the coverage server url, and the name of the coverage to access. It is important that there be no spaces or other content before the element.               <WCS_GDAL>        <ServiceURL>http://laits.gmu.edu/cgi-bin/NWGISS/NWGISS?</ServiceURL>        <CoverageName>AUTUMN.hdf</CoverageName>     </WCS_GDAL>      I tried to create the xml file but I was unsuccessful. Does anyone has any experience about extracting WCS layers? Are there any pointers (sites, tutorials, tips) on how to create the xml file? **EDIT:** The xml file im using to grab the first layer for a specific time is the following:               <WCS_GDAL>        <ServiceURL>http://dmcsee.org/cgi-bin/mapserv?map=/var/www/tmp/dmcsee_wms/dmcsee_wcs.map</ServiceURL>        <Version>1.1.1</Version>        <CoverageName>SPI6</CoverageName>        <supportedCRSs>EPSG:4326</supportedCRSs>        <PreferredFormat>gtiff</PreferredFormat>        <GetCoverageExtra>&BBOX=10.0,31.995,48.005,50.0&time=19900101</GetCoverageExtra>     </WCS_GDAL>      But for somereason returns an error


title: Filter by specific amenity in OSM

text: I'm new to maps, and have been searching for the past couple of hours how to get started with OpenStreetMaps without much success. What I would like is a spreadsheet with the coordinates, names and addresses of all the fast food restaurants in Dublin, Ireland which I could then paste into something like batchgeo and explore. I initially tried to go to openstreetmaps and restrict what it showed to just the Tag:amenity=fast_food but I couldn't see a way to do that. So I've now downloaded the osm file from cloudmade and opened it in JOSM, but I'm not seeing how to remove the layers. Could one of you guys tell me the simplest way to achieve what I'd like? Thanks. An update for those keeping score, I've now got the file into osmosis and am trying to filter it that way.


title: How can I convert from EUREF-FIN coords to Lat/Long?

text: See question title, how can I Translate EUREF-FIN coords to Lat Long?


title: How can I parse the SLD file that sits in Geoserver so that I can apply the styling to WFS layer?

text: I have a layer that can be configured to render as WFS or WMS. I want to apply the same sld styling that I have defined in Geoserver to make it consistent. But when I try to get the SLD text from geoserver I get an empty text. I use the following code to get the style from geoserver:               void init()     {        OpenLayers.Request.GET({             url: "http://localhost:8080/geoserver/rest/styles/general.sld",             success: complete         });     }          function complete(req) {         var format = new OpenLayers.Format.SLD();              sld = format.read(req.responseXML || req.responseText);              setLayerStyles();     }      The req.responseXML and req.responseText is always empty. However, if I copy the sld file locally and then try to do a get I will successfully get the text from the sld file. If I try to open the link on the web browser using the geoserver sld link then the browser attempts to download the file instead of viewing it. This could be the reason why the text returned is empty. If I try to open the sld link locally that I copied across from geoserver then the file would open up in the web browser. Any one know how to solve this?


title: joining a table from zonal statistics as table with a layer, problem with reserved names

text: I have a raster file (percentage of total forest killed) and a shapefile with polygons (municipalities). I thought as a first step I would like to find out which municipality shows the greatest percentage of forest kills (along with other stats). So I ran a Zonal Statistics as Table, with the idea that I can join the table after with the polygons, so that I can color them accordingly. I have done that several times before but I keep having to do the same annoying steps and I wonder if there is a smarter way around it. All the stats names form the Zonal Statistics as Table output are reserved words and cause the join to fail, so I always have to copy and rename all the fields (min, max, count, sum ..) and delete the old ones. Which is not too bad but I was wondering if someone has figured out a way around this? I am using ArcMap10


title: Where can I download 1 arc-second elevation data for Canada other than Geobase?

text: Can someone suggest a source for Canadian elevation data better or equivalent to 1 arc-second? I have a good data source for Ontario but for other provinces folks often recommend Geobase which claims that their elevation data ranges between 0.75 arc seconds to a maximum 3 arc seconds depending on latitude. However, I find that i cannot successfully generate shaded relief from the geobase data in ArcGIS. I've followed their instructions but the results are consistently un-usable. SRTM data from either cgiar.org or usgs.gov are good but I would like more detail. ![alt text](http://i.stack.imgur.com/DAwpA.jpg) _Response from GeoBase: Thank you for contacting GeoBase for a follow up on improvements to avoid 'stair stepping' effects found in certain CDED data sets. Presently there is no change attributed to the status of CDED specification requirements. CDED data originates from multiple partners and data sources which make it difficult to manage a homogeneous product throughout. As you may now be aware the Z resolution in CDED files is causing the stair stepping effect. According to CDED specification standards for this scale, all elevations readings are rounded to the nearest meter of elevation for the entire Canadian coverage with approximately an elevation point every 23 metres by 16-11metres for the 1:50K scale. In flat areas, the rounding effect of the elevations causes homogeneous elevation plateaux instead of having a very gentle slope because the grid height values varies just a few centimetres. It's these adjacent plateaux that cause the stair stepping effect.   In certain cases some smoothing effect may be achieved by using the Focal Statistics tool in ArcMap Spatial Analyst toolbox, neighbourhood tools before processing CDED files. Depending on this software application you may be able to adjust viewing features with the tool menu for '' Neighbourhood=Circle, Radius=5, Units=Cell and Statistics Type=MEAN''. But I don't think there is a perfect setting for all CDED files. There is a part of trial and error in the settings for each tile. Because of this situation and the software you are using you may need to request assistance for your software provider to smooth out the look of you files. Because no perfect solution was arised from our tests, GeoBase did not provide a universal user guide for smoothing out CDED elevation data, in the Frequently Asked Question segment._


title: When will ArcGIS 10.0 SP1 be released?

text: vote to close. ~~I'm accumulating a nice collection of msp files and I figure a service pack can't be far off.~~


title: psexec remote file execution with ArcGIS Server

text: This is perhaps going a bit out of bounds, so i'm not confident I'll get an answer. The short of this is that I've created a python script which leverages psexec to start a bat file on a remote server. This works superb until I publish it. Fortunately I do know where the scripts and models get uploaded to the GIS server after publishing which can help a great deal with diagnostics. Prior to the psexec line in the script, I'm copying a file from one location to another, and I can see that is successful because of the time stamp of the copied file. So, i'm fairly confident that the server is getting hung up on the psexec portion. Here is what the _published_ script looks like. ![enter image description here](http://i.stack.imgur.com/xm8Tm.jpg) The ArcGIS account does have read/execute access to the psexec.exe folder. When the GP service is run, it just hangs until it times out. So, since I need to define a question: has anyone used psexec in the arcgis server environment? This should be a lot easier than it is. Is there a way to see if the process is hanging on the remote end?


title: Is there free desktop WFS client with BBOX support?

text: To troubleshoot WFS server (geoserver) with big dataset (global OSM btw) I have tried number of free GIS desktops which work on Mac: QGIS (1.8, 1.9dev), uDig, gvSIG - none of them seems to support WFS request filter for currently visible area. Which makes them quite unusable for any bigger work datasets. QGIS used to have "Only request features overlapping the current view extend", which should be exactly what I'm looking for, but this seems to have disappeared.


Is there a best practices guide for adding bike infrastructure data to OSM? Not simply how to add a bike path, but a list of best practices for actually fleshing out sometimes disjointed bike infrastructure information for a city. Some big issues: * How to split road segments to mark on-road cycling infrastructure and when it's appropriate and when it's not. How to deal with streets with a separated cyclepaths that becomes a bike lane and then sharrows.  * How to mark separated Sidepaths, shared use bike / pedestrian paths, paths through parks, different surface types (such as unpaved rail trails)  * How to denote official US federal / state / county / local bike routes.  * When is it appropriate to add mountain bike trails and how to mark them and differentiate them from commuter trails. I'm looking for any official or unofficial guides to point people to that will help map editors fill in this information. If this is more suited to multiple questions, I'm more than willing to have this closed and reopen separate questions.


title: Getting "Failed to open tool" message when trying to run geoprocessing tool from C# code

text: I've been experimenting with the Military Aspects of Terrain Template, which has a toolbox associated with it. I've been using the following WPF Runtime code, which should open a tool in the associated toolbox . . .               private void RunToolButton_Click(object sender, RoutedEventArgs e)     {             ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Desktop);             //Set a reference to the IGPCommandHelper interface.             IGPToolCommandHelper pToolHelper = new GPToolCommandHelperClass() as IGPToolCommandHelper;                  //Set the tool you want to invoke.             string toolboxName = @"C:\ArcGISForDefense\Intelligence\MilitaryAspectsOfTerrainTemplate\Maps\Toolbox\Military Aspects of Terrain Toolbox.tbx";             pToolHelper.SetToolByName(toolboxName, "CoverFromFlatTrajectoryWeapons");                  // Generate the array of parameters.             IArray parameters = new ArrayClass();             parameters.Add(@"C:\ArcGISForDefense\Intelligence\MilitaryAspectsOfTerrainTemplate\Maps\OperationGDB.gdb\BrigadeAOI");             parameters.Add(@"C:\ArcGISForDefense\Intelligence\Operational_Environment\Data\MAoT\MAoT.gdb\CombinedVegetationCoverage");             parameters.Add(@"C:\ArcGISForDefense\Intelligence\MilitaryAspectsOfTerrainTemplate\Maps\OperationGDB.gdb\CoverAreas");                  //Invoke the tool.              pToolHelper.Invoke(parameters);     }      When I try to run the code, I get the following error message, then it crashes at the "invoke" method . . . "Failed to open tool CoverFromFlatTrajectoryWeapons (Military Aspects of Terrain Toolbox.tbx)" Am I using the right syntax for opening a tool that is in the "Cover and Concealment" toolset, which is in the "Military Aspects of Terrain Toolbox.tbx" toolbox? Am I doing anything wrong that would prompt this error message? I would appreciate any help. I also wrote the following routine as an alternative, but this also bombs when it gets to the last line of the routine . . .                public void Run_CoverFromFlatTrajectoryWeapons_Tool()         {             // Initialize the geoprocessor.             //Insert this line before invoking any ArcObjects to bind Engine runtime.              ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Engine);             GeoProcessor gp = new GeoProcessor();                  // Add the toolbox.             gp.AddToolbox(@"C:\ArcGISForDefense\Intelligence\MilitaryAspectsOfTerrainTemplate\Maps\Toolbox\Military Aspects of Terrain Toolbox.tbx");                             // Generate the array of parameters.             IVariantArray parameters = new VarArrayClass();             parameters.Add(@"C:\ArcGISForDefense\Intelligence\MilitaryAspectsOfTerrainTemplate\Maps\OperationGDB.gdb\BrigadeAOI");             parameters.Add(@"C:\ArcGISForDefense\Intelligence\Operational_Environment\Data\MAoT\MAoT.gdb\CombinedVegetationCoverage");             parameters.Add(@"C:\ArcGISForDefense\Intelligence\MilitaryAspectsOfTerrainTemplate\Maps\OperationGDB.gdb\CoverAreas");             // Execute the model tool by name.             gp.Execute("CoverFromFlatTrajectoryWeapons", parameters, null);         }      By the way, the above mentioned tool does run well with the specified parameters when running it in ArcMap. Thanks, Renee


title: "Request contains a format not offered by the server." Error when using CRS transformation with WMS in QGIS

text: When I try to load a WMS layer which has a WSG84 as a default projection and use a CRS transformation on it, it gives this error message:               Request contains a format not offered by the server.     The WMS vendor also reported:      Parameter 'width' contains unacceptable value.      The default projection I use for my project is S-JTSK Krovak (Greenwich) projection with WGS84 correction:               +proj=krovak +lat_0=49.5 +lon_0=24.83333333333333 +alpha=30.28813972222222      +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +pm=greenwich +units=m +no_defs      +towgs84=570.8,85.7,462.8,4.998,1.587,5.261,3.56      At a zoomed-out view (whole Czech Republic displayed), it displays correctly, but when I zoom in, the error above occures and the layer fails to display. Any advise on what should I do? Also, the WMS layer I use is http://geoportal.gov.cz/arcgis/services/CENIA/cenia_rt_II_vojenske_mapovani/MapServer/WMSServer Thanks.


title: ArcMap's "Join Field" tool takes so long when just "Joining" works instantly. Help?

text: I'm using ArcMap and I'm trying to write a script that automates a join and then does some reporting. I'm not very experienced with joins and I'm running into a problem. When I do a join manually (right clicking the shapefile and specifying the join) it does the join seemingly automatically. However, when I try and do a "Join Field" in ModelBuilder it takes a really long time. Minutes. Is there a different method of automating a join using python or Model Builder that runs faster? Thanks for any help.


title: ArcObjects bug in OID field duplication while duplicating feature class?

text: I have a shapefile with a column of type esriFieldTypeOID with the name FID and numbers from 0 to 5 (the first odd think is that ArcMap does not show a * next to the column name in the table view even if its of the OID type) After duplicating the whole FeatureClass I have my FID column in the new FeatureClass but this time I have the numbers from 1 to 6! If I use another file were I have the number from 1 to 6 I have also 1 to 6 in the copy. According to the doc the OID is an integer and not null, therefore the 0 to 5 should not be a problem. Thats the code I use:               // get FeatureClassName for input             IDataset inDataset = inFeatureClass as IDataset;             IFeatureClassName inFeatureClassName = inDataset.FullName as IFeatureClassName;             IWorkspace inWorkspace = inDataset.Workspace;                  // get WorkSpaceName for output             IDataset outDataset = outWorkspace as IDataset;             IWorkspaceName outWorkspaceName = outDataset.FullName as IWorkspaceName;                  // Create new FeatureClassName             IFeatureClassName outFeatureClassName = new FeatureClassNameClass();             // Assign it a name and a workspace             IDatasetName datasetName = outFeatureClassName as IDatasetName;             datasetName.Name = newName == String.Empty ? (inFeatureClassName as IDatasetName).Name : newName;             datasetName.WorkspaceName = outWorkspaceName;                  // Check for field conflicts.             IFieldChecker fieldChecker = new FieldCheckerClass();             IFields inFields = inFeatureClass.Fields;             IFields outFields;             IEnumFieldError enumFieldError;             fieldChecker.InputWorkspace = inWorkspace;             fieldChecker.ValidateWorkspace = outWorkspace;             fieldChecker.Validate(inFields, out enumFieldError, out outFields);             // Check enumFieldError for field naming confilcts                  //Convert the data.             IFeatureDataConverter featureDataConverter = new FeatureDataConverterClass();             featureDataConverter.ConvertFeatureClass(inFeatureClassName, null, null,             outFeatureClassName, null, outFields, "", 100, 0);                  IFeatureWorkspace pFeatureWS = (IFeatureWorkspace)outWorkspace;


title: How to create complex legends in Mapserver?

text: I want to create a color legend on mapserver. It is working but now I have to group several classes together like a heading with a group of color in it and so on. I have 10 such groups of classes. I tried using the concept of classgroup and group in a class, but now it only returns the last classgroup with no label/heading. I want an ordered hierarchy showing group and contained classes. Please, it would be really helpful if somebody could help me as to how to display all the groups of classes.


title: What's the difference between US Census DMA and MMA?

text: `DMA` and `MMA` are commonly used to denote a large, metropolitan municipal entity. Is there a difference between the two? Is there a certified definition to these terms? Google is a bit inconclusive about the issue.


title: How to make zooming for OpenStreetMap in OpenLayers more sensitive to mouse wheel scrolling?

text: I have been testing OpenLayers for a while and I notice that the scrolling on OpenStreetMap layer does not make the map zoom in or out as much as I would like it to be. On most occasions, I am only able to zoom in or out by only one level at a time, regardless of the scroll clicks. However, when the base layer is switched to Google Maps, I am able to zoom in and out more with more scroll clicks. You can see the difference with this example. At first, I thought this could be due to some inherent problem with OpenStreetMaps, but after testing its own map on the main site, there seem to be no problem with zooming through multiple levels with a mouse scroll. Am I missing something in the OpenLayers control setting to enable such responsive scrolling behaviour?


title: Google map V3 marker setting orientation

text: I am using the markers to position on the map accordingly. The issue now I want the marker to be set based on certain orientation value. I dont see any option for it and how best to achieve this in google map V3?


title: Is it possible to convert from Geography to Geometry in PostGIS?

text: I have a shp file that has geography types, Can I convert it with a tool like shp2pgsql? or is there a postgis function to do that?


title: Why does ST_Area(g.geom) + ST_Area(p.geom) - ST_Area(ST_Union(g.geom,p.geom)) produce negative result when using ST_Overlaps(g.geom, p.geom) = true?

text: I have two set of shape data. Let's say file gov.shp contains list of post codes and their boundaries. File post.shp contains list of government area name and their boundaries. I want to find out the the union (may not be the correct word here) between two files (i.e. post code 1, 2 and 3 overlaps with government area a; post code 1 also overlaps with government area b). Bear in mind that government area is bigger than post code area. So I have a query like below:               select  g.id, g.name, p.id, p.code     from    gov g     inner join             poa p     on      ST_Overlaps(g.geom, p.geom) = true      However if I apply this where clause, to my surprise the count(*) actually returns results. I am confused by why total area of g + p - union_area of(g,p) can be negative...               where   ST_Area(g.geom) + ST_Area(p.geom) - ST_Area(ST_Union(g.geom, p.geom)) < 0      Am I using the wrong function (ST_Overlaps)? Should I be using ST_Intersecs/ST_Equals/other functions? I am new to this area so I am not too sure what the differences are in terms of solving my particular problem. I imported shape file as **geometry and MULTIPOLYGON object** and I tried different results in both PostGIS and SQL Server 2008 R2 and both produced slightly different results. The above sql query syntax is in PostGIS though. \--SQL Server 2008 \-- STOverlaps \-- DIFF < 0 = 27 \-- DIFF > 0 = 1646 \--SQL Server 2008 \-- STEquals() \-- 42 \--PostGIS \-- DIFF < 0 = 730 \-- DIFF > 0 = 5312 \--PostGIS \-- STEquals() \-- 0 SQL Server 2008 syntax               select  g.id, g.name, p.id, p.code     from    gov g     inner join             poa p     on    g.geom.MakeValid().STOverlaps(p.geom.MakeValid()) = 1     --for some reason I had to use *.geom.MakeValid()     where g.geom.MakeValid().STArea() + p.geom.MakeValid().STArea() - g.geom.MakeValid().STUnion(p.geom.MakeValid()).STArea() < 0      I used Shape2SQL to import into SQL Server 2008, Planer Geometry, didn't check SRID, create spatial index. And I used PostGIS Shapefile Import/Export Manager which came with PostGIS 2.0 to import into PostGIS, and all default settings.


title: Bug in ArcGIS  Spatial Adjustment with Geometric Networks?

text: I am trying to do spatial adjustment between two datasets as shown in the the figure below. The Pipe line(selected(green color)) is part of a Geometric Network. It has three vertices. ![Before Spatial Adjust](http://i.stack.imgur.com/qocZo.png) When I perform the spatial Adjustment(tried Similarity and Affine transformation..), the Two end vertices goes where they should go but the middle vertex stays where it was before. In some other cases i observed, the entire segment stayed in its initial place without making a movement. ![After Spatial Adjust](http://i.stack.imgur.com/0cBDy.png) Is this a normal scenario while spatial adjusting features with Geometric Networks in ArcGIS? I am using ArcGIS 9.3. The spatial adjustment preview window shows data in the coorrect location as it should be.


title: How do I get the upstream distance to all points in a DEM from a single downstream point?

text: I want to get the upstream distance to all points in a DEM from a single downstream point. The goal is to create a "downstream distance to a point grid". This then would allow me to create "distance" contours upstream from a point in the watershed. I tried using the Raster Calculator with this equation:               Outras = Con("Fdr" == 1,16,Con("Fdr" == 2,32,Con("Fdr" == 4,64,Con("Fdr" == 8,128,Con("Fdr" == 16,1,Con("Fdr" == 16,1,Con("Fdr" == 32,2,Con("Fdr" == 64,4,Con("Fdr" == 128,8)))))))))      This "reverses" the flow direction in the `Fdr` grid, but doesn't really work. Any suggestions?


title: MMqgis geocode addresses as intersections

text: I'm using the plugin mmqgis to geocode some addresses. But in my database has some registered addresses as intersections, eg Av Av Test 1 & Test 2 Tested directly in Google Maps and did not work, are addresses of Brazil. Has anyone used the cruzamenos mmqgis plugin?


title: Assign projection to a satellite image

text: Today I stumbled upon a picture taken from the ISS looking down Europe and it is really beautiful. ![ISS picture](http://i.stack.imgur.com/7Qwxn.jpg) So, I started thinking I could add more to the picture. Like world borders, cities, road network, everything. For fun. The problem is that I know next to nothing about the azimuth or height of the sensor used proj4 satellite projection **Can you can help me assign a projection that image**? Here's the source (it's big!)


title: WMS layer is not overlaying exactly when zooming out. How to add WMS layers to google map layer in openlayers?

text: My openlayers code is as follows. But there is shift in between both the layers. How to rectify it?               map = new OpenLayers.Map( 'map_element',{} );                        var gsat = new OpenLayers.Layer.Google(                 "Google Satellite",                 {type: G_HYBRID_MAP,                   numZoomLevels: 22,                   isBaseLayer: true,                   'displayInLayerSwitcher':false},                   {sphericalMercator: true}                 );             var roads = new OpenLayers.Layer.WMS(             "Roads", "http://localhost:8088/geoserver/cite/wms",             {layers: 'cite:viz_roads',                          isBaseLayer: false,                          transparent: true,                           opacity: 1.0}              );                  var org = new OpenLayers.Layer.WMS(             "points of interest", "http://localhost:8088/geoserver/cite/wms",             {layers: 'cite:organisations',                           isBaseLayer: false,                          transparent: true, opacity: 1.0}              );             map.addLayers([gsat,roads,org]);             map.addControl(new OpenLayers.Control.LayerSwitcher({}));          if(!map.getCenter()){     map.setCenter(new OpenLayers.LonLat(83.324947,17.732909), 14);     }         }      This is the snapshot of the map: ![enter image description here](http://i.stack.imgur.com/WlYCl.jpg) Observe the shift from position 1 to 2. 1 is the actual position where the feature should be. It is rectified automatically when I turn layer off and on. But how to rectify this error while zooming?


title: ImageMosaic-JDBC Error

text: I'm trying to get postgis raster layers in geoserver-2.3.1, with postgresql-8.4, postgis-2.0 and gt-imagemosaic-jdbc-9.1.jar support. I'm going through the tutorial with a PNG raster that i have. In the last step i'm stuck with a java exception...can't really understand what is it!? I've tried other jdbc-postgresql driver and less tiles but the error seems to come up everytime. Here is the output! Any interpretations? Every help is welcome. Thanks               java -jar ~rdfs_run/geoserver/geoserver-2.3.1/webapps/geoserver/WEB-INF/lib/gt-imagemosaic-jdbc-9.1.jar import -config ~rdfs_run/geoserver/geoserver-2.3.1/data_dir/coverages/postgis/aveiro.postgis.xml -spatialTNPrefix tileaveiro -tileTNPrefix tileaveiro -dir tiles -ext png     Apr 28, 2013 8:50:34 PM org.geotools.gce.imagemosaic.jdbc.Import logInfo     INFO: Truncating table : tileaveiro_0     Apr 28, 2013 8:50:34 PM org.geotools.gce.imagemosaic.jdbc.Import logInfo     INFO: Number of tiles to import: 48     Apr 28, 2013 8:50:34 PM org.geotools.gce.imagemosaic.jdbc.Import logInfo     INFO: Inserted tile AveiroRDFS_rgb_5_8.png : 1/48     ...         INFO: Inserted tile AveiroRDFS_rgb_3_8.png : 48/48         java.sql.BatchUpdateException: Batch entry 0 INSERT INTO tileaveiro_0 (location,geom,data) VALUES  ('AveiroRDFS_rgb_5_8.png',geomfromwkb(?,4326),?) was aborted.  Call getNextException to see the cause.             at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2746)             at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1887)             at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:405)             at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2893)             at org.geotools.gce.imagemosaic.jdbc.Import.sqlCommit(Import.java:1026)             at org.geotools.gce.imagemosaic.jdbc.Import.fillSpatialTable(Import.java:856)             at org.geotools.gce.imagemosaic.jdbc.Import.start(Import.java:401)             at org.geotools.gce.imagemosaic.jdbc.Toolbox.main(Toolbox.java:46)


title: Merge attribute of points into a polygon : Arcmap 10

text: I have points layer which the attribute looks like this:               FID Shape ID   Lat       Long     0   Point 2065 -5.51666  106.48333     1   Point 2319 21.93333  120.73366      I also have polygons layer :               FID Shape ID        0   Polygon 0       1   Polygon 0      Question : How could I join both attribute file so that it become               FID Shape ID   Lat       Long          FID2    Shape          0   Point 2065 -5.51666  106.48333     1       Polygon     1   Point 2319 21.93333  120.73366     1       Polygon     2   Point 2304 22.93333  129.73366     3       Polygon      The actual case is, there are points that fall within one polygon. Thanks in advance.


title: Import raster into PostGIS using Python

text: I am trying to import information from a Bathymetric Attributed Grid (BAG) file into PostGIS using Python and psycopg2. I'm working, for now, on a Windows box with pre-compiled packages, so I don't have `GDAL`, `osgeo`, or `ogr` support for BAGs directly. I can open and parse the BAG with `h5py` and `ElementTree`, no problem. I can add simple geo objects (e.g., bounding box as box2d) with no problems. I can't figure out how to add the BAG values. I'm trying to add the elevation and uncertainty arrays as two bands in a raster. relevant, non-working code extract:                elevation = hierarchy["/BAG_root/elevation"]      width = len(elevation)      height = len(elevation[0])      uncertainty = hierarchy["/BAG_root/uncertainty"]      el_array = elevation[0:][0:]      un_array = uncertainty[0:][0:]           update_string = "UPDATE %s SET el_un = ST_SetValues(ST_AddBand(ST_MakeEmptyRaster( %%s, %%s, %%s, %%s, %%s), ARRAY[ %%s, %%s ]::addbandarg[])) WHERE filename = %%s;" %(tablename, )      print cursor.mogrify(update_string, (width, height, left, top, 1.00, el_array, un_array, basefn))      This gives a `can't adapt type 'numpy.ndarray'` error. I've tried several variations on this (without the slices, with `tolist()`, explicitly using numpy, etc., and all have had similar errors. I hope I'm missing something simple, due to my lack of PostGIS familiarity. For that matter, I may be able to copy the `raster2pgsql` output for another file type, suitably modified, but don't know how to encode the `VALUES( '...'::raster)` data value - is there some documentation for that I haven't been able to find? I hope to soon move to a Linux box where I can add formats and recompile `GDAL` and other packages if needed, so answers using GDAL in Python or executables that are made with additional supported formats are welcome. I'd use `raster2pgsql.exe`, but it doesn't support the BAG format, at least as is. Is there an easy way to write out one of the formats it _does_ accept by default?


title: What is the simplest way to write data to CartoDB using Python?

text: I'm trying to write a function in Python that will use the CartoDB API to write data to one of my tables. Does anyone have a simple example that shows how to do this that I can use to start?


title: Problem saving added point to GeoServer WFS-T via OpenLayers?

text: I want to add a point and then with `WFS-T`, save this to db. I work with Openlayers and GeoServer.               saveStrategy = new OpenLayers.Strategy.Save();          wfs = new OpenLayers.Layer.Vector(     "WFS Vectore",     {         strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],         projection: new OpenLayers.Projection("EPSG:4326"),         protocol: new OpenLayers.Protocol.WFS({             version: "1.1.0",             srsName: "EPSG:4326",             url: "http://localhost:8080/geoserver/iran/wms?service=WFS",             featureType: "population_utf-8",             featureNS: "http://iran.kadaster.org",             geometryName: "geom"         })     });      I add point with two methods: 1.               wfs.addFeatures([new OpenLayers.Feature.Vector(         new OpenLayers.Geometry.Point(             (Math.floor(Math.random() * 360) - 180),             (Math.floor(Math.random() * 180) - 90)         )     )]);     saveStrategy.save();      2.               var drawFeatureController = new OpenLayers.Control.DrawFeature(wfs, OpenLayers.Handler.Point);      And then add a point with the mouse:               saveStrategy.save();      The second method works but the first method doesn't. I need the first method. How can I do this? update: ![enter image description here](http://i.stack.imgur.com/5je8J.png)


title: Sort polygons from north to south in QGIS using 'graphical modeler'?

text: I'm building a model in 'graphical modeler' in QGIS 2.2. I want my model to clip a polygon layer and give the polygons coordinates so that I could sort them geographically from north to south. After sorting them, I want to add a number to each polygon to be able to save the sorted order. I have, with some help from this forum, been able to add coordinates to the polygons using the modeler. So far, everything is good. My next step would be to get the polygons sorted from north to south. I have done these last few steps manually, sorting the polygons in the attribute table, added a column with "sorting number", and then saving the sorted order using MMQGIS - 'Modify' - 'Sort'. Is it at all possible to do something similar inside the graphical modeler? I'm going to do this mulitple times, so it would be a real timesaver to get as many steps as possible inside the modeler.


title: App for collecting points with hierarchical legend encoding

text: In the frame of a field campaign for land cover mapping, we try to develop an App which allows for the collection of points on a base map and fill a set of attributes. So far, our best solution is to use ArcGIS Collector because we often need to work offline. Using the domain, the attribute table is filled with pre-encoded values. The problem is that we have a hierarchical legend with three levels. There are less than ten items at the first legend, then around 25 at the second level and more than 50 at the third. The drop down list is therefore very long at the third level, and if everything is possible we could have inconsistent labels between two levels. (e.g. grassland then cereals instead of grassland then graminaceous plant). So, the question is : how can we filter the lists proposed to the field collector based on his previous choices ? In other words, how can we adapt the domain to the values of another field. For instance, after selecting "forest" in the first drop down list, a new drop down list should be available with only "mixed forest", "broadleaved forest" and "needleleaved forest". EDIT: there was already an ArcGIS Idea on this topic, so the question probably doesn't have a built in solution. Any workaround with ArcGIS or similar capabilities to ArcGIS collector with another app would be worth the bounty (as long as it works). To sum up, here are the main features : 1) provide a base map (high resolution image) 2) works offline (GPS but no Internet) 3) point capture tool with colour symbol 4) when a choice has been made based on a drop down list for the first field, a second drop down list becomes available **conditionnally to the first choice** , then a third drop down list becomes available **conditionnally to the second choice** 5) If possible not specific to a single mobile device I can already do 1,2,3, and 5 with arcgiscollector. So my question is: how to get conditional drop down list (point 4).


title: Adding tracks to gps with QGIS feature attributes as name

text: I am attempting to send a vector layer to a garmin gps in QGIS. I am using the GPS Tools extension and have created a new GPX layer. I can add waypoints without any issues, but when I copy features from a line layer onto the track gpx layer, it will not save. I can save this layer in a gpx format and open it with MapSource, but I'd like to set one of the attribute as the track name automatically as I have over a thousand. Any help would be helpful. Also, if anyone could explain why the gpx layer won't save when I paste features into it that would be great.


title: Sextante and qgis for hotspot analysis

text: I want to analyze time series data for hotspot analyis. May i know whether sextante and qgis are able to generate any spatial statistics similar to Getis-O-ord in ARCGIS.Or R is required for hotspot analysis. As i am new to R language, i just need hotspot analysis using clusters.which one is better.


title: Error with "lowess" function in R

text: I have a problem with lowess function to smooth NDVI as a time in R. Here is the scripts I run:               #Create a time vector to act as x     time<-sort(sample(97:297, nlayers(ndvi2000crop1)))          #locally-weighted polynomial regression of ndvi ~ time     t.lowess <- function(x,...) { if (is.na(x[1])) {NA} else {lowess(x,y,...)$y } }      f.pred <- calc(ndvi2000crop1, t.lowess)      When I calculate the function on image, an error appeared something like this "Error in .calcTest(x[1:5], fun, na.rm, forcefun, forceapply): cannot use this function". Can you tell me where this error comes from in this part? Thank you


title: Creating custom CRS for India toposheets using QGIS?

text: Indian toposheets (pre-2000 series) of 1:50k scale are in Polyconic projection, with Everest 1956 spheroid and India-nepal datum. How do I create a custom CRS in QGIS to represent this, so that I can then reproject the topo corners (tic points) to UTM-WGS 84 and then geo-reference the toposheet.


title: upload data to geoserver with gxp upload panel

text: I installed geoserver in my computer. I use wampserver (php, apache), and when i use the examble "layer-upload.html" then i have the erro 405: **Failed to load resource: the server responded with a status of 405 (Method Not Allowed)**


title: geos_ts_c.cpp + spatialite Error

text: select distance(T1.Geom,T2.Geom) as Distance, T1.POI_ID, T2.LINK_ID from temp1 as T1, temp2 as T2 where T1.POI_ID = T2.POI_ID AND Distance < 100 temp1 having point geometry temp2 having line geometry While I running above query through C# program I am getting Error :: Assertion failed ! Program: ... File: geos_ts_c.cpp Line : 3472 (look attached snapshot) I am having database in .db format. I am using SQLlite and spatialite for gis functionality. From code :: I am loading spatialite.dll and then with sqllitecommand running query.. ExecuteStatement("select load_extension('spatialite.dll')", con); SQLiteCommand selectCommand11 = new SQLiteCommand(selectSQL10, con); SQLiteDataReader dataReader10 = selectCommand11.ExecuteReader(); anybody have idea why I am getting this error ? and how can i resolve this ?


title: Is there raster equivalent to vector Intersect?

text: The intersect tool that is used on vector data cannot be used on raster data. What tool can I use for my two rasters that does the same as the Overlay > Intersect tool?


title: How to convert a double field to a string?

text: I would like to convert a column in a spreadsheet from a double to a string so I can join the data with a shp file. What is the easiest way to do it?


title: How to view locally generated XYZ map tiles?

text: Is there an easy way to test (view on a map) my locally generated XYZ map tiles? I've used OpenLayers and Leaflet to display non-local XYZ map tiles, and I could conceivably push these tiles to a remote server and test them that way. It just seems to me there should be an easier way...


title: How to add X/Y data from Excel file (saved as CSV) on shapefile?

text: I need to add my X/Y coordinate data as points from my Excel I need help with adding points (using X/Y coordinates). Can anyone help?               import arcpy        from arcpy import env          env.workspace = "C:/myFolder"     env.overwriteOutput = True     out_path = "C:/myFolder"          out_name = "X_Y_Points.shp"     geometry_type = "MULTIPOINT"     has_m = "DISABLED"     has_z = "DISABLED"


title: Why doesn't copying values from MapInfo info tool boxes work properly?

text: As above. When I press ctrl + c, it doesn't always copy the value, I usually end up pressing ctrl + c 5 times to ensure it copies. Is there a way to fix this?


title: ArcSDE 10 and PostgreSQL 8.3 vs 8.4

text: We have recently upgraded our ArcSDE 9.3 instance to ArcSDE 10. I was hoping to upgrade postgresql 8.3 to 8.4 at the same time. Although ArcSDE 10 supports 8.4, it turns out that the ArcSDE wizards do not. Everything must be done via the command line. I made the call to stick with 8.3 just to keep things easier. Am I missing out? Does anyone have any experiences with 8.3 vs 8.4 in ArcSDE, if so, what are your thoughts?


title: Projected layer misaligned with Mapserver

text: I have a couple or raster files in epsg:23031 reference that i want to reproject to other reference systems (epsg:4326 and google projection) using the 'on the fly reprojection' of Mapserver. No problems using the default projection. But when i try to overlap my layer (in epsg:4326) with google earth there is a 100m misalignment between the two of them. Any ideas? Here is the map file:               MAP      NAME topo      IMAGECOLOR 125 125 125           SIZE 600 400      RESOLUTION 96      RESOLUTION 300           MAXSIZE 4096          STATUS ON           PROJECTION       "init=epsg:23031"      END           OUTPUTFORMAT       NAME png       DRIVER "GD/PNG"       MIMETYPE "image/png"       IMAGEMODE RGB       EXTENSION "png"      END           OUTPUTFORMAT       NAME GEOTIFF_RGB       DRIVER "GDAL/GTiff"       MIMETYPE "image/tiff"       IMAGEMODE RGB       EXTENSION "tif"      END           EXTENT 443275 4647717 488074 4691799           WEB       IMAGEPATH "C:\OSGeo4W/tmp/ms_tmp/"       IMAGEURL "/ms_tmp/"       METADATA       "wms_srs" "EPSG:4326 EPSG:900913"       END      END      LAYER       NAME orto       PROJECTION        "init=epsg:23031"       END       TYPE RASTER       DUMP TRUE       STATUS ON       TILEINDEX "orto.shp"       TILEITEM "LOCATION"        EXTENT 443275 4647717 488074 4691799        END     END      I'm using mapserver 5.6.4 that comes with osgeo4w tools


title: Is there a smartphone app for mobile asset logging?

text: I'm after a recommendation for a smartphone app (iPhone or Android) to log asset information for litter bins. I need the following features   * GPS   * geotagged photos   * Form with drop down menus for user definable attributes, e.g. construction material,classification, condition etc   * export to csv or shp Many thanks Matt


title: can I extract overlap of polygons within the same layer?

text: I am trying to extract the overlap of polygons that are within the same layer in 10. The layer came from a buffered street centerline and I'm trying to extract and delete the intersections from the layer. I have tried 'intersect' but it's virtually impossible to tell which records are an overlap and which ones are not. We are trying Shape tools but so far the computer gave an 'overflow' error.


title: Go from multiple rasters to R compatible table

text: I have a set of geocoded, pixel-aligned rasters which I would like to use in a model in R. I would like to produce a table of data that can be imported to R, in which there are as many columns as rasters, and as many rows as points at which data is extracted from the rasters. Say I have 3 rasters: r1, r2, r3. I would end up with a table that has r1, r2, r3 as the column headers. The rows would be point1, point2, point3 - and there would be as many rows as points in the layer used to define which points to extract data from. Forgive the bad table: \------r1---r2---r3 point1-1----4---2 point2-4----3---1 How can I do this? I've tried some Arc tools but they have failed or hung. I can use QGIS, Arc or Idrisi. Is the Raster package for R a good approach?


title: Splitting loop links in ArcGIS

text: How do you automatically split all loop links in a table with line objects? A loop being one where first and last coordinate is the same. Should be split at 50%.


title: Where to install python plugins without internet access?

text: I have a problem where I have no internet access. In the thread regarding a similar subject, it was mentioned that the plugin .zip file should be extracted to the ".qgis/python/plugins" in the home directory. Where would I find the "home" directory.


title: calculating zonal statistics of raster data in multiple overlapping zones and combining them into one table

text: The aim here is to calculate the max, min, mean, range, sum, count and std of raster data contained in areas delimited by polygons (much like what the Zonal Statistics as a Table tool from Spatial Analyst does). The difference being that many of my zones overlap (they are hydrological servicesheds, based on watersheds among other factors), and that I would like to have as output a table with the basic stats for the data within each polygon (one row per polygon). Double counting is not an issue. Below is the code I have for the moment, which defines a function through which zonal stats are run and the results put into a table. This is run using a cursor which goes through every row in the dataset which contains every serviceshed (one on each row, 3897 in total). The code does not work, and I was hoping to get guidance from the GIS SE community! any input, be it on method or the code, is greatly welcomed! I'm using ArcMap 10.2 and have access to an advanced license.               import arcpy     arcpy.env.workspace='C:\\Users\\frederichoffmann\\Desktop\\ESRI_summer2014'     import arcpy.sa     import arcpy.da     import os     arcpy.env.overwriteOutput = True     arcpy.CreateTable_management('C:\\Users\\xxx\\Desktop\\ESRI_summer2014\\zonaldata.gdb', 'sshed_nxport90')     sattable = 'C:\\Users\\xxx\\Desktop\\ESRI_summer2014\\zonaldata.gdb\\sattable'     def zonalstatsfun(row,start,end):         zone_field="FID"         value = 'C:\\Users\\xxx\\Desktop\\ESRI_summer2014\\invest_workspace\\nut_ret_1990\\output\\n_export_1990.tif' #raster dataset holding values to be extracted         arcpy.sa.ZonalStatisticsAsTable(row, zone_field, value, sattable,"","ALL")         arcpy.Append_management(stattable,sshednutret90)         arcpy.DeleteRows_management(sattable) #cleanup         print 'done serviceshed FID {0}'.format(int(in_field)) #to keep track while it is running          fc='C:\\Users\\frederichoffmann\\Desktop\\ESRI_summer2014\\servicesheds_2014-06-24\\servicesheds_v0.shp'     cursor=arcpy.da.SearchCursor(fc, "FID")     for row in cursor:         zonalstatsfun(row,0,3896)      **MORE RECENT VERSION OF CODE BELOW***               #the aim of this code is to extract data from a raster for each polygon in a feature class where polygons overlap     #this will permit the user to aggregate raster data to overlapping subwatershed or serviceshed level          import arcpy     arcpy.env.workspace='C:\\Users\\frederichoffmann\\Desktop\\ESRI_summer2014'     import arcpy.sa     import arcpy.da     import os     arcpy.env.overwriteOutput = True          sattable = 'C:\\Users\\frederichoffmann\\Desktop\\ESRI_summer2014\\zonaldata.gdb\\sattable'     #sshed_nxport90=arcpy.CreateTable_management('C:\\Users\\frederichoffmann\\Desktop\\ESRI_summer2014\\zonaldata.gdb','sshed_nxport90', sattable)     def zonalstatsfun(row,start,end):         value = 'C:\\Users\\frederichoffmann\\Desktop\\ESRI_summer2014\\invest_workspace\\nut_ret_1990\\output\\n_export_1990.tif' #XXXX = raster dataset holding values to be extracted         table='C:\\Users\\frederichoffmann\\Desktop\\ESRI_summer2014\\zonaldata.gdb\\sshed_nxport90'         FID=("FID")         arcpy.sa.ZonalStatisticsAsTable(fc, FID, value, sattable,"DATA","ALL")         arcpy.Append_management(sattable,table,'TEST')         ##arcpy.DeleteRows_management(sattable)          print 'appended'          fc='C:\\Users\\frederichoffmann\\Desktop\\ESRI_summer2014\\servicesheds_2014-06-24\\servicesheds_v0.shp'     cursor=arcpy.da.SearchCursor(fc, "FID")     for row in cursor:         zonalstatsfun(row,0,5) #til total 2896      ****FURTHER UPDATE****** the follow code gives good results, but repeats itself indefinitely and it seems the (row, start, end) statement is useless. even with values (row, 0,0) it will repeat until I force quit arcmap. Can anyone see a mistake in the code I have missed?               import arcpy     arcpy.env.workspace='C:\\Users\\frederichoffmann\\Desktop\\ESRI_summer2014'     import arcpy.sa     import arcpy.da     import os     arcpy.env.overwriteOutput = True          def zonalstatsfun(FID,start,end):         value='C:\\Users\\frederichoffmann\\Desktop\\ESRI_summer2014\\invest_workspace\\sedimentretention1990\\output\\rkls_1990.tif' #XXXX = raster dataset holding values to be extracted         table='C:\\Users\\frederichoffmann\\Desktop\\ESRI_summer2014\\zonaldata.gdb\\sshed_rkls90'         FID="FID"         arcpy.sa.ZonalStatisticsAsTable(fc, FID, value, statable,"DATA","ALL")         arcpy.Append_management(statable,table,'NO_TEST')         print 'appended'     statable=arcpy.CreateTable_management('C:\\Users\\frederichoffmann\\Desktop\\ESRI_summer2014\\zonaldata.gdb','statable', 'C:\\Users\\frederichoffmann\\Desktop\\ESRI_summer2014\\socioecon_settlements.gdb\\USLE_sshed90')     sshed_rkls90=arcpy.CreateTable_management('C:\\Users\\frederichoffmann\\Desktop\\ESRI_summer2014\\zonaldata.gdb','sshed_rkls90', 'C:\\Users\\frederichoffmann\\Desktop\\ESRI_summer2014\\zonaldata.gdb\\statable')     fc='C:\\Users\\frederichoffmann\\Desktop\\ESRI_summer2014\\servicesheds_2014-06-24\\servicesheds_v0.shp'     cursor=arcpy.da.SearchCursor(fc, "FID")     for FID in cursor:         zonalstatsfun(FID,0,0) #til total 2896      **_\-----------ANOTHER EDIT------------_** here is a new version of the code, which runs MUCH faster and gets the job done. Only one issue with it: It runs infinitely (until arcmap crashes). I've tried implementing a range in many different ways but none seem to work. Anybody have an idea of how I could limit the FIDs to either run all once or manually set the range to `FID range(0,3896)`?               import arcpy     from arcpy import da, sa, os     arcpy.CheckOutExtension("spatial")     arcpy.env.overwriteOutput = True          workdir = r'C:\Users\frederichoffmann\Desktop\ESRI_summer2014'     zonaldb = workdir + r'\zonaldata.gdb'     tab_template = workdir + r'\zonaldata.gdb\template_sum'          statable=arcpy.CreateTable_management(zonaldb,'statable', tab_template)     values=arcpy.CreateTable_management(zonaldb,'sshed_rkls90', statable)     fc='C:\\Users\\frederichoffmann\\Desktop\\ESRI_summer2014\\servicesheds_2014-06-24\\servicesheds_v0.shp'     cursor=arcpy.da.SearchCursor(fc, "FID")          for FID in cursor:         0<=FID<=5         value=workdir + r'\invest_workspace\sedimentretention1990\output\rkls_1990.tif' #XXXX = raster dataset holding values to be extracted         table= zonaldb + r'\sshed_rkls90'         FID="FID"         arcpy.sa.ZonalStatisticsAsTable(fc, FID, value, statable,"DATA","SUM")         arcpy.Append_management(statable,table,'NO_TEST')         print 'appended'


title: How do I determine the projection of a paper map?

text: If I'm reading a paper map how do I determine what projection was used to draw the map if such information is not explicitly labelled on the document? Online it is easy to find resources (for example, Wikipedia or GIS Wiki) that describe and classify the various projections in use. However, as a non-expert map user I find it difficult to use the construction details in reverse, to determine what projection has been used to draw a particular map. I thought perhaps there might be a flow chart or other classification process that could help a map user determine the projection in use? For example, at my local library and archives there is a copy of a map lithograph from the Dominion Lands Office (Canada) dated 1878. The map has curved parallels and meridians that are wider at the bottom than the top (the top being closer to the pole in this case). I think this makes the map a conical projection, but I'm not sure. And, if that is correct I am interested in learning if it is possible to classify the projection more precisely (e.g. Lambert conformal). I have made a partial scan of this 1878 map (it is too large to scan the whole thing with the equipment I have available) in case that helps anyone answer my question. ![Bottom Left Hand Corner of referenced map](http://i.stack.imgur.com/HdSYl.jpg)


title: How to overlay WMS layer on OSM maps?

text: I am using OSM/Google maps and WMS Layers. Now I want to know how my WMS will overlay on this map. I am using the following code for that:               function init()                  {                     map = new OpenLayers.Map('map');                          layer = new OpenLayers.Layer.OSM( "OpenStreet Map");                     map.addLayer(layer);                     layer = new OpenLayers.Layer.Google( "Google" );                     map.addLayer(layer);                          var jpl_wms = new OpenLayers.Layer.WMS("Administrative Layer",                     "http://localhost:8080/geoserver/test/wms",                      {layers: "maharashtra_administrative",transparent: true,visibility: false},{isBaseLayer:false});                     map.addLayer(jpl_wms);                      map.addControl(new OpenLayers.Control.LayerSwitcher());                     map.setCenter(new OpenLayers.LonLat(8461018,2120810),6.75);                     map.addControl(new OpenLayers.Control.MousePosition({}));                     map.addControl(new OpenLayers.Control.OverviewMap());                     map.addControl(new OpenLayers.Control.ScaleLine());                 }      Can anybody guide me for the same as this overlay does not appear in the map.


title: How do I retain transparency in graphics with exporting on the web?

text: At 10 and 10.1 you can make use of arcpy.mapping to publish a gp service to do printing with. This is a sample that does this: ![enter image description here](http://i.stack.imgur.com/10XaX.png) As you can see, transparency is respected with the arcpy approach. We have an application where the end-user can choose nearly any style they want for graphics.   * All Simple/Text/MarkerSymbols   * Any transparency or colour   * Any fill or line style   * etc We hit limitations with trying to carry across these graphics across into an ArcPy service. So we have been testing out the new 10.1 Export Web Map tool from the PrintingTool toolbox. With some investigation on another question, we determined that it was not a python script behind this tool, but appears to be using ArcObjects. From initial tests, it has the benefit over ArcPy in that whatever is in my graphics layer in our web client, gets thrown across and drawn ok in the output PDF (using the draw toolbar and default OOTB print service with Flex 3.0 API). However, transparency gets stripped out: ![enter image description here](http://i.stack.imgur.com/PZAgE.png) I was looking at the ExportWebMap input parameter for the Export Web Map Tool, and trying to find out if there was something I could do to try and retain that transparency. It does mention being able to set opacity on a layer, but I am unsure on how to manipulate one of the existing Flex samples to achieve this. **Can someone provide a solution (any API) to retaining transparency using the new ExportWebMap tool at 10.1?** Or is it a limitation?


title: Subtypes in ArcGIS

text: I've created a subtype field in my attribute table, but now I want to change the codes. How do I do that? ArcCatalog doesn't enable editing my subtype. Thanks for help.


title: What projection is this

text: > **Possible Duplicate:**   >  QGIS - Hell of time with CRS and vector intersect The tax assessor parcels layer I referred to in my first post gives this as its projection: +proj=lcc +lat_1=37.06666666666667 +lat_2=38.43333333333333 +lat_0=36.5 +lon_0=-120.5 +x_0=2000000 +y_0=500000.0000000001 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs In the "Project Properties" window, it is listed under the heading "User Defined Coordinate Systems". What is it? And how can I get it to jive with the USGS NED data (which is, I think, unprojected and based on datum NAD83)? Is "projection" in this QGIS usage the same as CRS? Thank you.


title: Looking for location intelligence tools and user experience reports

text: I am looking for location intelligence tools (= combination of business intelligence + GIS). I had a look at several options: SpagoBI, Microstrategy + VisualCrossing, Yellowfin, and Map Intelligence. Can anyone tell me about their experience using these tools? Or maybe I missed some other options? Kind regards, Dirk Daems


title: How to improve performance on OD Cost Matrix for 200.000 origins and 1000 destinations

text: First of all this is my first question on this site :) And I am really happy to be within the community. I have no programmer's background therefore, I try to avoid use python scripting, however If I there is no other choice I am willing to improve my skills. My question is as stated on the title, finding a way to improve the performance on OD cost matrix analysis on ArcGIS 10.0. I use ArcSDE with postgresql and keep my origins and destinations on the database. I have uploaded 200.000 origins in about 75 minutes and it took minutes to load the destinations. Currently I have waited around half an hour and my work seems to progress around 0%. However It is not crashed yet and according to the status bar it jumps to another location every 5-10 seconds. As I try to follow "one cup of coffee rule", It seems to be I am doing something very wrong. Do you have any advises to improve performance or at least make sure that my calculations will not crash? I can only divide origins to smaller parts, I will have to keep my destinations all together. Kind Regards, Anil.


title: How to cancel the edit session?

text: I want to prevent the user from starting an edit session under certain conditions. How can I do that?               void m_editEvents_OnStartEditing()                  {                 // Code             }


title: help displaying jpg in openlayers?

text: I am trying to overlay a jpg image over an openlayers map. I have been to the example on their site and looked all over for a solution with no luck. So I am guessing that their are rules for setting an openlayers.layer.image as an overlay layer. I have tried jpg, png, gif. They all work fine as a base layer with the following code:               var image_layer = new OpenLayers.Layer.Image( 'Wallpaper', 'images.png', new      OpenLayers.Bounds(-90,-45,90,45), new OpenLayers.Size(318,159), {numZoomLevels:7,     maxResolution:.625} );      But once I include:               var image_layer = new OpenLayers.Layer.Image( 'Wallpaper', 'images.png', new      OpenLayers.Bounds(-90,-45,90,45), new OpenLayers.Size(318,159), {numZoomLevels:7,      maxResolution:.625, **isBaseLayer: false**} );      the layer is grey out within the layer switcher I did figure out that if I include 2 different image layers - I can specify the second as an overlay. However, once I add a WMS, that overlay greys out! What am I doing wrong - or better yet - what is openlayer doing wrong? Thanks!


title: ESRI 3D Analyst: Which Graphics card?

text: in order to make the most of ESRI´s 3D analyst I would like to order an appropriate graphics card. I have been recommended the AMD FirePro V5900 2 GB by someone who doesn´t know much about GIS hence my question here. Does anyone have any experience with 3D Graphics programs and decent hardware? Would this card be suitable for 3D Analyst? What is the most important factor to consider when buying graphics cards for 3D visualization? thanks for any comments, Robert


title: How to label every point  in a dynamic  feature layer?

text: How do I label the feature layer in a ArcGIS map with the data associated with the feature layer? I want to place the label bottom right corner of the marker symbol in the feature layer(lat-long position) in the appropriate position on the map. I want to do it dynamically by adding feature layer and ArcGISTiledMapServiceLayer from code-behind.


title: Delete all fields from feature class with arcpy

text: I want to delete all of the fields from a feature class in a simple tricky way, I don't want to loop over the fields because this method is very slow in arcpy. I'm using a polygon feature class, I tried `arcpy.MultipartToSinglepart_management` but the feature class result saved all the fields. Does anyone have any ideas?


title: When was the Google Earth API launched?

text: Do you know the date when google launched that API: https://developers.google.com/earth/


title: How to select by polygon in PostGIS with misaligned layers?

text: I have two polygon layers, one which defines subregions of the other. However, the layers do not line up exactly, so there are minor discrepancies along the edges. I would like to select all minor polygons which lie within the major polygon layer. What is the best way to do this in PostGIS? Sample of map below. You can see the blue subregions on top of the larger yellow region, with seemingly exact "jigsaw" edging. I have tried using `ST_Within` to select polygons, with the result being the purple polygons. These are clearly a subset of what I am looking for. ![enter image description here](http://i.stack.imgur.com/Ykr5S.png) Zooming in, you can see that the edges do not align properly. ![enter image description here](http://i.stack.imgur.com/60TKZ.png) What is the best way to select under these circumstances?


title: imposm: Failing to import OSM data to PostgreSQL

text: Somehow I can't import OSM data to my database. I'm using Debian, PostgreSQL 9.1 and PostGIS 1.5. The user `root` has been granted all privileges for the database `osm`. Input:               imposm -U root -d osm -m imposm-mapping.py --read --write --optimize sweden-latest.osm.pbf      Output:               Enabling Shapely speedups.     loading imposm-mapping.py as mapping     password for root at localhost:     [16:35:06] ## reading sweden-latest.osm.pbf     [16:35:07] coords: 11724k nodes: 234k ways: 1674k relations: 11k (estimated)     [16:39:56] coords: 17332k nodes: 75k ways: 1445k relations: 7k     [16:39:57] reading took 4 m 51s     [16:39:57] ## dropping/creating tables     Traceback (most recent call last):       File "/usr/bin/imposm", line 9, in <module>         load_entry_point('imposm==2.4.0', 'console_scripts', 'imposm')()       File "/usr/lib/python2.7/dist-packages/imposm/app.py", line 231, in main         db.create_tables(tag_mapping.mappings)       File "/usr/lib/python2.7/dist-packages/imposm/db/postgis.py", line 129, in create_tables         self.create_table(mapping)       File "/usr/lib/python2.7/dist-packages/imposm/db/postgis.py", line 160, in create_table         pg_geometry_type=mapping.geom_type))     psycopg2.ProgrammingError: permission denied for relation spatial_ref_sys     CONTEXT:  SQL statement "SELECT SRID         FROM spatial_ref_sys WHERE SRID = new_srid"     PL/pgSQL function "addgeometrycolumn" line 75 at SQL statement     SQL statement "SELECT AddGeometryColumn('',$1,$2,$3,$4,$5,$6)"     PL/pgSQL function "addgeometrycolumn" line 5 at SQL statement      **EDIT:** And this is what I get when I use the user `postgres` instead:               [13:36:35] ## dropping/creating tables     [13:36:36] ## writing data     Traceback (most recent call last):       File "/usr/bin/imposm", line 9, in <module>         load_entry_point('imposm==2.4.0', 'console_scripts', 'imposm')()       File "/usr/lib/python2.7/dist-packages/imposm/app.py", line 243, in main         writer.relations()       File "/usr/lib/python2.7/dist-packages/imposm/writer.py", line 52, in relation                                    s         cache = self.cache.relations_cache()       File "/usr/lib/python2.7/dist-packages/imposm/cache/osm.py", line 59, in relat                                    ions_cache         return self._x_cache(self.relations_fname, RelationDB, mode, estimated_recor                                    ds)       File "/usr/lib/python2.7/dist-packages/imposm/cache/osm.py", line 68, in _x_ca                                    che         cache = x_class(x, mode, estimated_records=estimated_records)       File "tc.pyx", line 104, in imposm.cache.tc.BDB.__init__ (imposm/cache/tc.c:12                                    63)     IOError: 3


title: How to select features in layer using dataset statistics (stdev and mean) and ModelBuilder?

text: I am trying to solve following problem. I need to select features from the shapefile by attribute in Model builder. The attribute should be a statistics which you can calculate by the tool :"Summary statistics". This creates new table with mean and stdev from the original shapefile attribute table. I need to use those numbers in the selection of features of the original layer. Is there some way, how to do this? Practically I am trying to do a very easy procedure, a lot of people do in the ArcMap regullarly. To classify feature by the standard deviation. Take the range of features above the specified stdev level and make a new layer of this. Shame that there is not such tool like Reclassify for rasters which would work for the features as well where the only thing you should do is to load layer symbology and say that one of the classes is preserved and the others are lost.


title: How to remove the border of a symbol?

text: I have a point layer in QGIS. I have created a graduated color scheme, but it doesn't look good because the border of all the symbols is showing and are overlapping (so you hardly see the color of the marker itself anymore). Is there a way to remove the border of a standard symbol (symbol layer type: simple marker)? The only thing I found with google was http://lists.osgeo.org/pipermail/qgis- user/2012-March/015778.html, but that was not very helpfull for me (I don't find the Outline option to set to None) I am using QGIS 1.7.4 **UPDATE: summary possible answers (thanks to @Marty and @SS_Rebelious):**   * Change the "Symbol layer type" from "Simple marker" to "Font marker" (in symbol selector window), select the '.' symbol and change the color.   * You can set the border color to the same RGB value as the fill color (but this is a lot of manual work if you have a graduated color scheme => you have to do it manually for each class).   * Another option is to use Old Symbology where you have the option to set the 'outline' to 'None'. However, the graduated color scheme is not as advanced as in the New Symbology (no color ramp to choose) and you have to set the outline for each class manually. I used the first option, as this is the most automated way.


title: PostGIS: Merge multiple table with same GID

text: I just imported some shapefiles with the PostGIS importer. Because several errors and issues I had to split my shapefile in multiple parts. Then I imported them one by one. I thought I can easily merge them later on. But now there is a problem. The import tool created a primary key called GID. And these identical PKs prohibit the merge. Doeas anybody know how to delete these GIDS, merge all the tables and create new PKs? I'm thankful for any answer.


title: Render Google Fusion Tables Layer Tiles in OpenLayers

text: I would like to know if there is a way now to include Google Fusion Table Layers Tiles in OpenLayers, and **if yes, is it possible to use the dynamic styling just like in Google Maps?** I know you can use Vizualisation or FusionTableAPI to render Fusion Table Layers in geoJSON, but tiling is much more performant. This example is it valid? I dont understand how it mixes Fusion Table Layers Tiles and OpenLayers.


title: Extra detailed bounding polygon from many geometric points

text: I have a database of around 100,000 postcodes each with lat/lon which I have converted to geom type in PostGIS. Each postcode also has one of 5 "regions". I wish to generate an accurate bounding polygon for each region, and have attempted to query it as so: ` select region, count(*), ST_AsGeoJSON(ST_ConvexHull(ST_Collect(geom))) from postcode group by region; ` Despite the counts all being above 10,000 each, the resulting polygons are disappointingly simple and broad (e.g. around 10 sides only), with lots of overlaps. Is there any way in PostGIS or other where I can achieve this goal of extracting highly detailed polygons? I need to do this because unfortunately the government body in question does not publish open data for these respective regions they have defined.


title: Globe on my Qgis doesn't work.

text: OS : osx 10.9.2 * I just operated a clean osx installation. Globe have never worked since I started to learn QGIS. When I tried globe, it terminated QGIS then a message(see below) occurred. ![enter image description here](http://i.stack.imgur.com/j4RT6.png) Any Idea? Thanks.


title: How to manipulate lidar map using sun azimuth

text: Hi I am VERY new to QGIS and am struggling. I have a Lidar map and want to change the view so that the ground shadow is manipulated (looking for archaeological anomalies). I think it is the sun angle that I need to alter but don't know how. I am running on Windows 7 with QGIS 2.4 downloaded


title: How can I customize 'Feature Edit Popup' in Community OpenGeo's GeoExplorer

text: I am running with Boundless Opengeo Suite on Linux based server to create a WebGIS application in forestry management. Everything is working fine (at least to this step that I am being stuck here). In GeoExplorer, the default popup window for Editing (modify or create) is working well, but I want to customize it to attach another PostgreSQL referenced table within this popup windows, to attach files to the feature (something like the functionality in ArcGIS) using PHP (or Javascript). I have googled for several weeks, but still no luck. It is highly appreciated if anyone can show me which file(s) (in GeoExplorer and/or in Geoserver) to be customized, or let me know if other open source alternatives are available on the earth. Thank you very much.


title: Connect to remote Sqlserver using arcobject

text: I want to connect to a database assigned to a vps with an ip address.I used this string to connect to Database when it was on localhost. how I change it to connect to remote one?                           IPropertySet propertySet = new PropertySetClass();             propertySet.SetProperty("INSTANCE", "sde:sqlserver:CRAZYVIRUS-HP");             propertySet.SetProperty("DATABASE", "land_gis");             propertySet.SetProperty("USER", "LandManagment");             propertySet.SetProperty("PASSWORD", "pass");            // propertySet.SetProperty("VERSION", "dbo.DEFAULT");             //propertySet.SetProperty("authentication_mode", "OSA");                       workspace = workspaceFactory2.Open(propertySet, 0);      I use arcobject 10.2.1 version and C# thanks


title: Merging Raster: ImportError: No module named _gdal_array

text: When I try to merge rasters I got following error message: > _gdal_array = swig_import_helper() File > "C:\PROGRA~1\QGISDU~1\apps\Python27\lib\site-packages\osgeo\gdal_array.py", > line 18, in swig_import_helper import _gdal_array ImportError: No module > named _gdal_array I tried to update Qgis to 2.2 and did a the whole OS4GEOW installation, as recommended in an other thread. Greatful for any recommendations Thanks, JS


title: Openlayer function(mergeNewParams) is overwriting previous function call

text: I am trying to parse both the values to the corresponding words to fetch data from GeoServer and return me the value, like this:               route.mergeNewParams({viewparams: "'word1:+source;word2:+target"});      But its not working. In fact no values(source and target) are being assigned to the respective words(word1, word2). I have also tried it to do this way:               route.mergeNewParams({viewparams: "word1:"+source});     route.mergeNewParams({viewparams: "word2:"+target});      But in this case last 2nd call of function is overwriting the 1st call.


title: ArcGIS 10.2.1 crashes during connection with ArcSDE 10.0 inside PostgreSQL 8.0.1

text: I'm currently working in an infrastructure built with ArcGIS 10.0 (Desktop and Server) [SP2 build 3200] and because for some functionalities (ArcGIS for Desktop extensions) I need to use a newer version I'm testing how the ArcGIS for Desktop 10.2.1 copes with infrastructure built with 10.0. And so far it goes quite poorly... I guess my biggest problem is following: there's and ArcSDE geodb (10.0) set- up in PostgreSQL 8.0.1 which works perfectly with the 10.0 version. However if I want to access (through a direct connection) any raster stored in the geodb from the ArcGIS for Desktop 10.2.1 (ArcMAP, ArcCatalog) it crashes without any warning or error. Has anyone encountered such behaviour? The weird part is that I can list the ArcSDE db and use tables and vector layers without any problems. The problem starts when I want to access any rasters in ArcCatalog or ArcMap. The rasters which are stored are standard rasters like orthophotomap, dem, The operating systems are: Windows 7 SP1 x86 for the 10.0 version and Windows XP SP3 for the 10.2.1 version. I have PosgreSQL client files installed. I've tried 9.0.5 client files, as it's the oldest version of postgresql which shows under client files for 10.2.1 version and also old 10.0 client files, which I have for 10.0 ArcGIS version. I do not have RDBMS files installes as I'm not sure what are they for.


title: Web API for reverse geocoding geographic features

text: Is there a free web API that can reverse geocode geographic feature names? I'm currently using the Google API, which will return political and street address info, but I would like to return the names of mountains, islands and especially bodies of water for a given lat/lng pair.


title: How to use custom map tiles with the Google Map API V2 for Android.?

text: I'm looking for a way to use custom map tiles with the Google Map API V2 for Android. I'm writing an application that will create it's own maps in real time with data that are comming from a robot. The application need to show to the operator this map. The operator need to interact with this map, letting way points, etc. I want to use the GoogleMap engine in order to do the same that this page : **http://cdn.mikecouturier.com/blog.mikecouturier.com/tilesgenerator/index.html** The problem is, this guy use the **Javascrip API** But me, I want to use the **Android API** Are there any way to use Custom tiles map on android with the GoogleMap Engine ? Thank's a lot _PS : I'm already looking how to use ArcGIS. But, i prefer using API without paying license, thanks_


title: Invalid geometry

text: I'm working on some shapefiles in both ArcGIS 10.2 and QGIS 2.0. I have 3 files which I have cleaned of self intersections in ArcGIS using Repair Geometry. I have also checked for Overlaps using the Analysis tool. A complication is that I have a few “correct” overlaps I need generated from a powerline tenement crossing mining tenements which need to be in the same file so it’s going to be a bit of a pain to pull out the “errors”. I assume overlaps are not part of a “geometry” issue. I understand from other articles that the best way to get rid of overlaps, etc is to convert the shape files to file-geodatabase and build the topology in ArcGIS for "Must Not Gaps" and "Must Not Overlap". However this may cause problems with the polygons that I need to overlap. I'll experiment with this. When I bring the shapes into QGIS and use the Topology Checker I get 3 Invalid Geometry messages related to a whole lot of exploration track polygons. I also use the No Overlap and this works fine in picking up the overlaps . My question relates to the issues with the geometry differences as nothing is obvious and it's not related to things such as overlaps/gaps. I’m a bit puzzled about this invalid geometry error which is apparently NOT picked up by the ArcGIS check. If I can’t work this out I may post this for people to look at and maybe give me some idea as to what is going on. Tolerance differences between the algorithms in the respective programs have been mentioned as important and I’ll look at this as well. Thanks PS I have also used the QGIS Check Geometry Validity tool. This gives 2 duplicates (none flagged using the Must Not Have Duplicates in the Topology Checker), as well as a number of intersects. Are these real as I thought I had removed these with ArcGIS. Ahhh...no wonder this gives people headaches.


title: MySQL+GDal+MapServer+OpenLayers WebMercator problem

text: I have a problem/question what is the most efficiant way to go from WGS84 (epsg:4326) to webmercator. Outline of the structure right now:   1. **MySQL Database** : with point Latitude/Lontiude Data [~200 million points] these points i bin myself with a SQL query, right now I just bin them with (I insert into separate table for convenience):                   SELECT          (FLOOR((longitude/100000)/(360/(POWER(2,16))))*(360/(POWER(2,16)))) AS pixel_X,              (FLOOR((latitude/100000)/(180/(POWER(2,15))))*(180/(POWER(2,15)))) AS pixel_Y,         count(*) AS Amount         FROM PointData         GROUP BY pixel_X, pixel_Y         ORDER BY pixel_X ASC, pixel_Y ASC;         I think this should give me a raster in EPSG:4326.   This is where I think would be the best place to introduce a change to bin into EPSG:3857 (webmercator, epsg:900913). I bin the information here because it's impossible to send 200-300 million points to GDAL so I have to give up some correctness.   2. **GDAL_grid** that creates a raster img-file from the data in the Database (the DBConnection.vrt is just a database connection).                    gdal_grid -of HFA -a nearest:radius1=0.0054931640625:radius2=0.0054931640625 -outsize 65536 32768 -l layer DBConnection.vrt Rasters/output.img --config GDAL_NUM_THREADS ALL_CPUS       right now this creates a img in EPSG:4326. The nearest algorithm is used to keep the binned raster from mySQL as unchanged as possible.   3. **MapServer** reading the img raster                     MAP             NAME "TestMap"             PROJECTION                 "init=epsg:4326"             END             STATUS OFF             EXTENT -180 -90 180 90             UNITS DD             SHAPEPATH "./layers"             WEB                 IMAGEPATH "/ms4w/tmp/ms_tmp/"                 IMAGEURL "/ms_tmp/"                 METADATA                     "wms_title" "Test Server"                     "wms_onlineresource" "http://localhost/cgi-bin/mapserv?map=/ms4w/apps/TestMaps/TestMap.map&"                     "wms_enable_request" "*"                 END             END                      [...]                LAYER                 NAME TestLayer                 STATUS OFF                 TYPE RASTER                 DATA "Rasters\output.img"                 METADATA                     "wms_title" "output"                     "wms_transparent" "true"                 END                 PROJECTION                     "init=epsg:4326"                 END                 CLASSITEM "pixel"                 PROCESSING "SCALE=0,1000"                 PROCESSING "SCALE_BUCKETS=100"                 CLASS                     [...] (just some coloring to give a makeshift heatmap)                 END             END         END            4. **OpenLayers** connects to Mapserver and shows the map in the browser.                    function init() {         map = new OpenLayers.Map("Map", {                 [...]             ]         });         [...]         var TestLayer = new OpenLayers.Layer.WMS(             "TestLayer",              "http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/TestMaps/TestMap.map",              {layers:                  'TestLayer',                 transparent: 'true'             }, {                 isBaseLayer:false,                 visibility: true             }         );         [...]      So at this point the maps show up fine in a EPSG:4326 projection, no problem at all, I have EPSG:4326 country polygons that I use as a base layer right now. ![Result in epsg:4326](http://i.stack.imgur.com/ehF5T.png)      The problem is I would like to have a webmercator map, street map and so on, but I cant get the projection to change. So far I've tried   * changing the Projection "init:epsg:4326" in MapServer to epsg:3857 but to no avail, the layers are not recognized by open layers any more and I just get picture not received error.   * using gdal_warp on the output.img and change to epsg:3857, didn't work either, same problem, also this is really time inefficient because warp takes forever and I might aswell put it into the right projection right away in the Database or in the GDAL_GRID. I have probably been misunderstanding projections and GIS terms so if so let me know, this is the first time I do anything like this, only worked with the Google Maps API before with small amounts of Lat/Lng points where you just send the latlng to Google and it does the rest. I tried to include as much information as I could, if anything is missing or unclear let me know.


title: What is the best way to take a WKB value in SQL Server Management Studio and create a PostGIS geometry in PGAdmin III?

text: Normally, I would just use WKT strings but I'm investigating some possible geometry weirdness with the Text methods in SQL Server. I would like to copy/paste the WKB values from the SQL Server Management Studio data grid and paste into PGAdminIII SQL Editor.   ![enter image description here](http://i.stack.imgur.com/uKcWB.png)


title: hosting a map created using mapserver

text: I have a mapserver running. I can access the map by typing the below url ->               http://localhost/cgi-bin/mapserv?map=/home/mwh/osm-demo/basemaps/osm-google.map&mode=browse&template=openlayers&layers=all      Now I want to access it using a different URL such as "mapserv.com" how can I achieve this? I've seen in various forums that I can do it by changing .htaccess file. But I can not find such file in here. Please help me to figure this out. Thanks...


title: How to handle licenses when reinstalling ArcGIS 10.1 after computercrash?

text: In our student organisation we are having some issues with ArcGIS 10.1. When a computer crashes with ArcGIS 10.1 and with a valid student license for one year, is it possible to reinstall it after the crash with the same license number? A lot of our students had some real troubles with it because it says it's already installed on a machine, and the only thing our university gives as an answer is: "just come and swap your license with a new one". Even in the ArcGIS Support Center I can't find a good solution for this. Hopefully someone here got a solution for this or know a way-around for the problem, because a lot of valid licenses were already thrown away.


title: Using Unique Values Symbology in ArcPy?

text: I am using ArcGIS for Desktop 10.1 and Server 10.1 on my machine Windows 7. I am newbie in python & running simple python script for UniqueValuesSymbology it running fine if I use mxd as “current” but if I update with full mxd path then it’s not updating the layers symbology and did not show any error. JSFiddle code 1 (using mxd path as current)               import arcpy     mxd = arcpy.mapping.MapDocument("current")     lyr = arcpy.mapping.ListLayers(mxd, "Population")[0]     if lyr.symbologyType == "UNIQUE_VALUES":       lyr.symbology.valueField = "SUB_REGION"       lyr.symbology.addAllValues()     arcpy.RefreshActiveView()     arcpy.RefreshTOC()     del mxd      JSFiddle code 2 (using complete mxd path )               import arcpy     mxd = arcpy.mapping.MapDocument("D:\\ArcGIS_Data\\data\\y1.mxd")     lyr = arcpy.mapping.ListLayers(mxd, "Population")[0]     if lyr.symbologyType == "UNIQUE_VALUES":       lyr.symbology.valueField = "SUB_REGION"       lyr.symbology.addAllValues()     arcpy.RefreshActiveView()     arcpy.RefreshTOC()     del mxd      I researched on Google, web help and ArcPy syntax for mxd_path still not getting any clue & Python path is perfect in environmental variables **The reason of using mxd path** is that I want to make this script automatic using windows scheduler. So any help regarding will be great !! thanks in advance


title: Digital Elevation Model Algorithms

text: Can anyone suggest best Suitable Algorithm for Digital Elevation Model Generation? Currently I am working on Literature survey of DEM creation so i need to show comparison of 3-4 Algorithmic Methods used to create DEM & Best suitable method among them.


title: django floppy forms geospatial widgets error

text: I'm trying to define a view that lets the user edit the data in the database, I'm using floppyforms, because of its geodjango widgets which is part of the form that i would want the user to use for adding and editing/updating their data so this here's the code:               def editPath(request, path_id, template_name="routes/path_form.html"):         if not request.user.is_authenticated():             return redirect('/login')     else:         try:             path = Path.objects.get(pk=path_id)         except Path.DoesNotExist:             raise Http404         if path_id is not None:             if request.method == "POST":                 form = PathForm(request.POST, instance=path)                 if form.is_valid():                     s = form.save()                          return redirect("/route#paths")             else:                 form = PathForm(instance=path)         else:             form = PathForm()              return render_to_response(template_name, locals(), context_instance=RequestContext(request))      but when i save it, i get this type error that says: > _strftime() argument 1 must be string or read-only buffer, not tuple_ I think the error is with the floppyforms geodjango widget for the path field, am i missing something? or did i get my view wrong? thanks in advance. I'm using the widgets for linestrings from floppyforms


title: Problem with Python codeblock recognizing a field

text: '<'First Post Alert> I've been through multiple iterations / gyrations, and while there may be multiple problems here (and I'll appreciate feedback on all of them), the recurring issue is that the codeblock does not identify the existence of any syntax errors, but when it hits the first instance of drawing a value from a field, I get an error like "FACIL_ID" not defined. Here's my most recent code:               import arcpy     from arcpy import env     env.workspace = "K:/Geobase/S-file/Floor Plans/GIS/SHP/Workspace"     expression1 = '"' + str(FACIL_ID) + "-" + str(SPACENAME) + "-001" + '"'     expression2 = '"' + str(FACIL_ID) + "-" + str(SPACENAME) + '"'     MyLength = len(str(SPACENAME))     if MyLength ==4:       arcpy.CaluclateField_management("88888F10_SPACE_J2.shp","BSPACE_ID",expression1)     else:       arcpy.CalculateField_management("88888F10_SPACE_J2.shp","BSPACE_ID",expression2)


title: GPS Monitoring of navy traffic and areo traffic

text: Some time ago I've seen two web application that monitoring in real time navy traffic and aero traffic. I haven't found it googling, can someone help me.


title: Using ArcGIS with dual/multiple monitors?

text: ArcGIS doesn't seem to have much support for dual monitors. Maybe I'm missing something, but as far as I can tell you can't have the data view and layout view open at the same time on the two monitors, nor can you expand the map view to fill one monitor and have the toolbars and such on the other. How do you take advantage of dual monitors?


title: How to randomize colors by class in QGIS new symbology?

text: As a new user of QGIS, one of the tasks I frequently perform is creating a layer where polygons are colored by class, classified by some nominal field in the attribute table. I have developed a habit of switching to the old symbology, because it makes this task easy for an arbitrary number of classes and I can re-randomize the colors until I'm happy with the results. I haven't found any way to do the same thing with the new symbology. The closest I've found is to select "categorized" in the new symbology and select a color ramp, which works well for ordinal data but not so much for nominal categories. I presume that such an important function was not lost in the design of the new symbology, but that I've simply been unable to find it in the manual. I'd prefer to work with the new symbology, simply because that's the direction that QGIS development is going. Can someone explain or direct me to appropriate documentation of how to accomplish this? Thanks in advance.


title: How to batch generate thumbnails of raster layers with R?

text: I have been using R to maintain a rather large stack of raster layers (over 700 layers of data for sub-Saharan Africa). Each layer looks as follows http://hcapi.harvestchoice.org/v2.0/core/?varCode=SALUM&format=tif I need to batch generate PNG images for print media, as well as thumbnails of the layers. Using R raster package, I can easily plot each layer and apply custom color tables and legends. I run into problems when trying to generate small thumbnails with no title and axis (see an example below). I cannot find any option to have the raster plot occupy the full size of the graphic device, regardless of any graphic parameter I pass to par(). Here is reproducible code:               library(rgdal)     library(raster)          url <- "http://hcapi.harvestchoice.org/v2.0/core/?varCode=SALUM&format=tif"     download.file(url, "./r.zip", "curl")     unzip("r.zip")     r <- raster("./SALUMSSAtif.tif")     cc <- c("#AFF1E9", "#9ddfa3", "#87CD58", "#CDAF19", "#761200", "#94725F", "#D61F00")          png("./SALUMSSAtif.png", width=200, height=200)     par(mar=c(0,0,0,0), oma=c(0,0,0,0), xaxs="i", yaxs="i")     plot(r, col=cc, main=NULL, legend=F, axes=F)     dev.off()      This produces the attached plot that's badly off-center and too small. Any idea how to remove all the plot margins using raster::plot or another method? ![thumbnail](http://i.stack.imgur.com/SZRH7.png) Thanks, --Mel.