GeoServer , select feature , highlight it , and export it to PNG

Like any GIS Web application , You need to provide a facility to print a report with a part of map , and specially the position of a given ParcelID on the map with different zooms .. I have GeoServer , simply , i want a script that accepts a filter (something like `ParcelID='ABC123'` and returns me a PNG URL of this Parcel highlighted on the map with all the other parcels and layers .. I know the `WFS` with `GetFeature` and `Filter` return some row data about this parcel , and i know the `WMS` can return a map with `CQL_FILTER` but only for the needed parcel without any other parcels , so it's not enough for me . Would you please help ! thank you


Problem inserting Geometry into PostGIS Table

I am new to Postgis and I have imported a shapefile containing point layer into the postgis, and the SRID i had chosen was 4326. now while inserting the values into the table I am getting problem. My intension is to create a circle around that point using ST_Buffer. My Table structure is               CREATE TABLE "ankCircle"     (       gid serial NOT NULL,       id numeric(10,0),       geom geometry,       CONSTRAINT "ankCircle_pkey" PRIMARY KEY (gid),       CONSTRAINT enforce_dims_geom CHECK (st_ndims(geom) = 2),       CONSTRAINT enforce_geotype_geom CHECK (geometrytype(geom) = 'POINT'::text OR geom IS NULL),       CONSTRAINT enforce_srid_geom CHECK (st_srid(geom) = 4326)     )     WITH (       OIDS=FALSE     );     ALTER TABLE "ankCircle" OWNER TO postgres;      Query I am using is               INSERT INTO "ankCircle"(gid, id, geom)     VALUES (1, 1, ST_Buffer(ST_GeomFromText('POINT(100 90)',4326),50, 'quad_segs=8'));      error got               ERROR:  new row for relation "ankCircle" violates check constraint "enforce_geotype_geom"          ********** Error **********          ERROR: new row for relation "ankCircle" violates check constraint "enforce_geotype_geom"     SQL state: 23514


How do I assign a variable to a SQL Server ArcSDE database's feature class?

I'm using ArcGIS Desktop 10 and have no experience using Python with a SQL Server ArcSDE database. When using a shp file or file gdb it is very simple to reference a given feature class by simply typing the file path to that file or gdb. However, this seems to be much different when working with mdf files with SQL Server. I can't find any help with this in the resource center. I did read some about making a arcsde connection but I had no luck with that. Any help with the Python code to do this would be a great help.


Bertin 1953 map projection settings

I am trying to use the Bertin 1953 map projection, as described in the book "Semiology of graphics" by Jacques Bertin. But I can't find the settings in any of my GIS software. Does anybody have a solution ? Thanks, Luc


Is there a Free Aggregate Points tool out there for ArcGIS 10?

I need to do some Getis-Ord analysis but first I need to aggregate my points. I know of XToolsPro, but the aggregate points function is locked and you must purchase a license to use it. I am wondering if there is a free tool out there, or a workaround in ArcMap that I am missing to aggregate points. Some context: What I have are over 8,000 points, many of which have different attributes, but may share the same (approximate) geospatial location. For this analysis, I just need to aggregate any points overlapping one another based upon a field containing a numeric value to be summed. For example:               Point A overlaps Point B and Point C.       Point A field value = 1.4     Point B = 2.4, and      Point C = 5.2.        The Aggregate of points A,B, and C would return point D with a value of 9.0 I hope this makes sense. Maybe I could get away with using something really basic but just haven't pieced it together yet. Any help you can offer would be appreciated!


How to get an ArcGISTiledMapServiceLayer + WMSTLayer based on same service to align?

The image below can be obtained by adding WorldTimeZone layers to the JSAPI map:               wmtsLayer = new esri.layers.WMTSLayer("http://servicesbeta4.esri.com/arcgis/rest/services/WorldTimeZones/MapServer/WMTS", options);     tiledLayer = new esri.layers.ArcGISTiledMapServiceLayer("http://servicesbeta4.esri.com/arcgis/rest/services/WorldTimeZones/MapServer", { opacity: 0.5});      I believe this issue is that the WMTS scale values are based on 0.28mm/pixel instead of 96 DPI. ![EsriWmtsAlignmentIssue.png](http://i.stack.imgur.com/m60H6.png) **Is there a way to make these two layers align correctly?** Because a proxy is required I cannot provide working source but I did paste my code here.


ArcGIS Server 10 - Feature Editing Services - Best Practices

What are some best practices for editing Multi-versioned sde data through a feature service? What should I be looking into? EDIT: seeing that when publishing a feature service the service is published but does not show up on the rest page..but I can reference it through it's full url?? If this observation would best serve as a separate question..please advise.


Statistics or simple pie chart in Quantum Gis

Does anyone know how to perform pie charts based on table values within QuantumGis and include them in the print outs? thanks a lot


How to loop through an array of point features?

I have a set of point features and I wish to find the points that have common coordinates. Now I changed the code as shwon bewlo by using the IPoint and the compare method through a function. I have 2 loops with cursors. The first one should read the first point while the second loop the second point etc. How can I force the cursor of the second loop to go to the second point? I addedd another NextFeature but it did not work.The result is that all the points are the same between the 2 loops. Thanks Demetris               Set pFeature = pFCursor.NextFeature     Do Until pFeature Is Nothing     Set pPointA = pFeature.Shape               Set pFeature2 = pFCursor2.NextFeature     Do Until pFeature2 Is Nothing     'Set pFeature2 = pFCursor2.NextFeature               Set pPointB = pFeature2.Shape     CommonPoints = ComparePoints(pPointA, pPointB)     If CommonPoints = True Then     MsgBox "Yes"     End If          Set pFeature2 = pFCursor2.NextFeature     Loop               Function ComparePoints(pointA As IPoint, pointB As IPoint) As Boolean          If pointA.Compare(pointB) Then              ComparePoints = True          Else              ComparePoints = False          End If          End Function


I have a linestring in a vector layer in QGIS. How can I expot/save this linestring as a GPX file? I tried to select the linestring, then right click on the vector layer and choose "Save selection as..." and then I choosed GPX format and saved it. But I got this error message: > Export to vector file failed. Error: creation of field code_06 failed (OGR > error: Field of name 'code_06' is not supported in GPX schema. Use > GPX_USE_EXTENSIONS creation option to allow use of the element.) The GPX file is created, but it contains no coordinates. Is there any settings I should do to avoid this error? How can I export a linestring to a GPX file in QGIS?


Is it possible to reproject KML using ESRI's Javascript API?

Specifically into NAD83. Google tells me that KML only supports WGS84, but I can't seem to find much info on being able to reproject KML using ESRI's Javascript API. Basically, I've got this base map in Nad83 and I need to overlay some kml.


What is the difference between "Publish a service " and "Save the service defination file" in ArcGIS Server 10.1?

I have published few map services in which I directly publish on server and for remaining services I have created service definition file. All services are working fine but what exactly difference between "Publish a service" and "Save the service definition file" ? . In case "Publish a service " it also analyze the data and gives the warning message.. In case "Save the service definition file" we know the location of .sd file but in other case we do not.. so which one is best and why OR recommended ? Software : ArcGIS Server 10.1 and Desktop 10.1 any help/comments/important points are welcome : ) Thanks in advance : )


Using SLD to style according table column value

How to style various points with different image according to value(text) in the column of table(layer)?


How do I use the OverviewClass in ArcObjects?

I want to display an Overview map - I know how to do it using a separate PageLayout or MapControl - but I noticed ESRI has an OverviewClass \- how do I make use of this with the AxMapControl?


How to display both scalebar in kilometers and grid in lat/long degrees in Quantum GIS 1.8 Composer?

Also, how to display both scalebar in kilometers and both lat/long degrees and northings/eastings in QGIS 1.8 Composer? Layer is projected to UTM. Thank you.


Shortest Path using interpolated OSM points

I have a set of GPS points which I have snapped to the OSM network. In the below screenshot GPS points are red, snapped points are green. ![enter image description here](http://i.stack.imgur.com/Y9MC6.png) I want to calculate the shortest path that includes all of these green way points. My solution is to calculate the shortest path between each pair of points and finally concatenate the results. My problem is that dijkstra_sp will not accept arbitrary points on the OSM network. My snapped points are not necessarily in the ways table because they were calculated using the following logic. 1) Find the closest way to a given GPS point. 2) Using interpolation, find the closest point on this way to the GPS point. The snapped points are not in the ways table because they were derived by interpolation. So my question is: How do I calculate the shortest path between two points on the OSM network that are not necessarily in the ways table? Kind regards, Cathal


How to use NASA Digital Elevation model data?

I've heard it is possible to use NASA elevation model to determine approximate elevation at (lat;lng) point. This might be really useful for my upcoming project since Google Elevation API has weird limitations...and I don't really like USGS Elevation Query Web Service because of its speed. I'd want to have elevation query tool/framework on local computer, which works with local file. I did my homework, and found GeoTiff files might be downloaded with no problem. But I've failed to find any useful documentation or framework. Can somebody share a link to the specs, or example or tutorial on how to work with GeoTiff files? Is there any frameworks to get this done (.NET,Java,C++,C - doesn't really matter)? According to what I see in the GeoTiff files and its header files, I assume each tiff represents small area and pixel color (16 bit value) indicates elevation there in meters. Is that correct?


Merge GeoWebCache generated tiles from one server with tiles from another server

I have a set of tiles (millions) generated by the builtin GWC in GeoServer 2.1.2 which is stored on server A. I would like to copy all the tiles to server B containing GeoServer 2.1.3 and the corresponding builtin GWC. Server B already contains a completely different set of tiles and we want both tile sets to coexist. Copying the tile_folder in `data_dir/gwc` and the workspace seems easy enough, but are there other things we need to consider and is it at all possible to copy generated GWC tiles from one server to another? I have tried and it doesn't seem to work. So before I dig into the xml configurations, server versions and so on, I would like to know if it is possible at all?


java vividsolutions jts wgs-84 distance to meters

my (java) project uses com.vividsolutions.jts.geom, which provides a distance function. After some googling I finally found that the return value from this function is in central angle degrees, when the CRS is WGS-84 (as it is in my project). What is an easy to implement and accurate on short distances (no need for long distances) conversion from central angle degrees to meters? I tried converting by dividing by 360 (from degrees), multiplying by 2 * PI (to radians) and multiplying by 6371000 meters, but my answer is off by quite a lot (176m (QGis ellipsoidal ruler tool) vs 204m (mine)). I found that GeoTools has some conversion functions included, but I would like to not have to depend on another library, since this code is meant to run on the server and an Android client and is meant to be easy to use by other devs. EDIT: I also emailed the JTS mailing list, and established that wrapping the distance functions for every possible Geometry.distance(geometry) would be a little tedious. I decided to use the 111 111 m per degree hack described here: Algorithm for offsetting a latitude/longitude by some amount of meters Thanks for the help, though!


Accuracy issues between data in QGIS and Google Earth

Wondering if anyone can answer this question. I have a kml in Google Earth. When I import it to QGIS, and then import the Google Earth images they are in slightly different places. I used a QGIS plugin so maybe that is the issue. Potentially the plugin imports the terrain images incorrectly. Google Earth - Original Zone 18M 209551.00 m E 9131622.00 m S QGIS - First import (note, Zone 18M is not an option in QGIS...potential answer?) 209581.516575, -868393.873839 *I think the incorrect Y coordinate has to do with zone datum points, which typically have large offsets if I remember right. But look at the X coordinate, its 30 meters off! This is the main part of my question. Why are the x and y coordinates changing? QGIS - Coordinates given at bottom of screen -77.633805064386,-7.847746027456, which when plotted on Google earth line up where the original google earth point was. One last issue. I imported water data from divaGIS for rivers, and the river is definitely a km or so to the east of the google earth image river. Should I trust divaGIS data? They have a suspicious quantity available for free. http://www.diva-gis.org/gdata Thanks!


Examples of web-mapping for plantations

Is there any of you ever work to develop a web-mapping project for a plantation company? Or is there any such project published? If there is then :   1. Can you point where I can see an example of the published project?   2. What was the main goal of the application? is it only for viewing purpose or is it combined with reporting system?   3. What platform do you use? Free or Paid? Best Regards,


Local Coordinate System

I am currently evaluating the use of PostGIS (version 2.0) for:   * a project that will store 3D coordinates (x, y, z) data   * the data will have it's own local coordinate system which does not correspond to any datum (SRID) Question: Can this data be stored without any SRID? If so, can I still take advantage of the 3D spatial query capabilities in PostGIS? Thanks for you time, Craig


How to export data from QGIS to display in Google Maps?

I'm exporting layers of a project for a quantum gis postgis table and visualizing the data in gmaps, but the coordinates are very wrong. is there any special way to export the quantum gis? postgres table is using 4326 SRID like gmaps my shape in gmaps: http://i48.tinypic.com/2iay3r9.png qgis: http://i50.tinypic.com/24d28wl.png


Convert Oracle schema to GeoDatabase using Direct Connect only

Either this is a gap in the documentation or I'm really missing something! I know that I can direct connect to an SDE GeoDatabase without needing ArcSDE to be installed on the database server, but I can't figure out how I'm supposed to create a GeoDatabase or convert an existing schema to a GeoDatabase without going through the ArcSDE installation process. I'm using ArcGIS Server 10 which is installed on a web server. I don't have sufficient licensing to install ArcSDE on a separate server but the license does allow me to direct connect to a GeoDatabase on a separate machine. Is the conversion accomplished through the ArcGIS Server post-install? I started testing but I don't currently have the existing SOM and SOC service passwords so I don't want to change them in the post-install and break something. I can't get to where I think the database configuration stuff is withouth setting these accounts. Is this something I would do through ArcCatalog? I can't see the relevant option.


Problems adding OSM layer

I installed OpenLayers plugin successfully in QGIS 2.2 Valmiera, but when I add OpenStreetMap layer, the following error message appear as a Python error popup window: An error has occurred while executing Python code:               > Traceback (most recent call last):   File "C:/Users/I Wayan     > Mudita/.qgis2/python/plugins\openlayers_plugin\openlayers_plugin.py",     > line 50, in addLayer     >     self.__plugin.addLayer(self)   File "C:/Users/I Wayan Mudita/.qgis2/python/plugins\openlayers_plugin\openlayers_plugin.py",     > line 202, in addLayer     >     self.__setMapSrsGoogle()   File "C:/Users/I Wayan Mudita/.qgis2/python/plugins\openlayers_plugin\openlayers_plugin.py",     > line 261, in __setMapSrsGoogle     >     extMap = coodTrans.transform(extMap, QgsCoordinateTransform.ForwardTransform) QgsCsException: forward     > transform of (-985846.534752, -198190.645686) PROJ.4: +proj=longlat     > +datum=WGS84 +no_defs +to +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs Error: latitude or longitude exceeded limits      Python version: > 2.7.4 (default, Apr 6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)] QGIS version: > 2.2.0-Valmiera Valmiera, c3a2817 Python path: > ['C:/PROGRA~1/QGISVA~1/apps/qgis/./python/plugins\processing', 'C:\Users\I > Wayan Mudita\\.qgis2\python\plugins\GeoCoding', > 'C:/PROGRA~1/QGISVA~1/apps/qgis/./python', u'C:/Users/I Wayan > Mudita/.qgis2/python', u'C:/Users/I Wayan Mudita/.qgis2/python/plugins', > 'C:/PROGRA~1/QGISVA~1/apps/qgis/./python/plugins', > 'C:\PROGRA~1\QGISVA~1\bin\python27.zip', > 'C:\PROGRA~1\QGISVA~1\apps\Python27\DLLs', > 'C:\PROGRA~1\QGISVA~1\apps\Python27\lib', > 'C:\PROGRA~1\QGISVA~1\apps\Python27\lib\plat-win', > 'C:\PROGRA~1\QGISVA~1\apps\Python27\lib\lib-tk', 'C:\PROGRA~1\QGISVA~1\bin', > 'C:\PROGRA~1\QGISVA~1\apps\Python27', > 'C:\PROGRA~1\QGISVA~1\apps\Python27\lib\site-packages', > 'C:\PROGRA~1\QGISVA~1\apps\Python27\lib\site-packages\PIL', > 'C:\PROGRA~1\QGISVA~1\apps\Python27\lib\site-packages\win32', > 'C:\PROGRA~1\QGISVA~1\apps\Python27\lib\site-packages\win32\lib', > 'C:\PROGRA~1\QGISVA~1\apps\Python27\lib\site-packages\Pythonwin', > 'C:\PROGRA~1\QGISVA~1\apps\Python27\lib\site- > packages\Shapely-1.2.18-py2.7-win32.egg', > 'C:\PROGRA~1\QGISVA~1\apps\Python27\lib\site-packages\wx-2.8-msw-unicode', > 'C:\Users\I Wayan Mudita\\.qgis2\python\plugins\DigitizingTools\tools', > 'C:\PROGRA~1\QGISVA~1\apps\qgis\python\plugins\fTools\tools'] What is wrong here? I am new to QGIS, need your help.


New line in MapInfo SQL Select

Is there a character I need to use to state a new line in the MapInfo SQL Select box (e.g like ; in SQL Management Studio) or is this not possible. The highlighted (yellow) area is where the new line begins. ![enter image description here](http://i.stack.imgur.com/N4nH9.png)


How to Add FileGDB driver to PyGDAL installation

I installed ArcGIS 10.0 and it installed Python 2.6.5 with it. Later, I installed pyGDAL using the windows installer within that Python installation. I cannot find a specific place where GDAL is installed. Is there a way to add FileGDB support to the GDAL libraries that are being referenced by my PyGDAL installation?


Clarification of Logical Operators in a PostGIS Database

The following query returns this result:               select count(*) from a , b where a.geom && b.geom;               count          -------          66514      On a postgis 2 database. What does the logical operator AND (&&) between two geometry columns return? What about the other operators? **Edit: After a quick test it seems it returns all the rows where the bounding boxes of both the geometries overlap with each other**


Create a polygon layer from point data

I'm currently using QGIS 1.8.0 I would like to create a polygon layer from a point dataset, where the size of the polygons relates to the resolution of the grid reference. The ultimate aim would be mapping species density - I have a numerous spreadsheets of species presence at certain locations but with differing resolutions (2km, 1km and 100m). So, I would like polygons of each grid square, so that the number of different species recorded within that square can be counted. I believe this is a similar method to how the NBN Gateway maps using their new interactive map http://www.nbn.org.uk/ Thanks!


How can I find the most remote spot in Eastern United States?

I have this hunch that I could travel no more than 50 miles from the most remote spot in the Eastern United States (east of the Mississippi River), in the direction of the nearest road, and find a road. **Definitions:**   Most Remote: Spot furthest from a road.   Road: Google Maps definition of a road. **Q:** How could I prove or disprove this claim? **Q:** Where is the most remote spot in the Eastern US?


ArcGIS Server REST Cache

The municipality that I work for is currently using the latest version of MSGovern CityView. For those that have never used CityView, it's a software package that helps municipalities manage their assets and perform a variety of administrative tasks. Within this software a GIS/spatial component is made available. A user can perform non spatial queries on a variety of things (e.g. Parcels, Businesses, Parks, Utilities, etc.) and if they'd like, the information can be viewed on a map. The current version of CityView uses ArcGIS Server to consume maps. The issue I’m having is an inconsistent rendering of maps once updates are made. Within ArcGIS Server Manager the updates seem to take place, however, when I go over to REST (`http://hostname/ArcGIS/rest/services/mapservicename/MapServer`) to view the metadata as well as view the actual map, I notice that the updates have not been executed. I've read through this blog, but I’m not sure if this is a task I should be caring out when I make updates to the map service. I want to say this is what's causing the CityView problem, but I'm not sure. I’ve tried deleting the service, deleting browsing history and then republishing the service, but the result within REST is a previous version of the map service. I'm using ArcGIS Desktop 9.3.1 and ArcGIS Server 10.0.


choose of java web framework for our project

We are developing java web gis application. We use geoserver, postgis, geotools(all the core code). We need to show/hide(or create/delete) **dynamically** vector layers(from shape file) and raster layers(wms layer from geoserver). Also, our shapefiles are colorized(there are about 5-10 colorized zones in one shapefile). Typical usage: user check/uncheck checkboxes -> layers are showed/hid. We used geomajas in our 0 version, but there is the critical bug for us( http://jira.geomajas.org/browse/RTC-2 ). So, could you please suggest any other java based web frameworks that can cover our needs?


How can I handle tables with 256+ variables?

I'm working with census data and downloaded several CSV files, each with with 600ish columns/variables. I'd like to store them all in a query-able database, but everything I've tried so far (MS Access, Arc geodatabase table) truncates the table to 256 columns. Are there any solutions for handling large tables that are accessible to someone who isn't a DBA?


Grid perspective tool

I'm not a cartographer, but want to use a map for my project from world atlas book. I scanned the map, but no matter how carefully it is scanned, it's perspective is slightly distorted and it's noticeable because of longitude and latitude lines present. If I could tear the page, I can get desired result, but that's not an option. Nice tool I use after scan is Scan Tailor which has "dewarp" function, that places grid on top of scanned image, and by defining and arranging arbitrary control points it can restore orthogonal transform of that grid. Here is image I found with Google, that can perhaps be more clear: ![enter image description here](http://i.stack.imgur.com/PUS7U.jpg) However I'm not satisfied with the result of this function, and can't seem to find any similar tool for the task. I expected to find Gimp plugin or standalone tool, but couldn't find it. I saw suggestion about panorama tool Hugin, but can't manage anything useful by myself. So the question, is there any preferably free tool for Windows or Linux, that can let me define grid like in screenshot above and change it to orthogonal perspective?


Unable to implement pgrouting(plugin) pgr_astar routing algorithm (shortest path)

I have been working on a project for indoor navigation. I made the floorplan of the building and road-map for routing purposes as shp files (using JOSM, making GeoJSON and then converting to shp file using http://www.mapshaper.org/) Then using POST GIS ShapeFile Loader (of pgAdmin III) I imported road-map( _route.shp)_ to the database. In QGIS, i was able to use the shortest path plugin to do the routing ![screen shot of my project, red color indicates the route](http://i.stack.imgur.com/km5lU.png) ////////////////////////////////////////////////////////////////////////////////////////// EDITED ////////////////////////////////////////////////////////////////////////////////////////// The following are screen shots of **route** ![ROUTE IN QGIS DB MANAGER](http://i.stack.imgur.com/Wt1Kb.png) ![contents of ROUTE](http://i.stack.imgur.com/pkKkj.png) ![prev](http://i.stack.imgur.com/agzLP.png) The following are screen shots of **route_vertices_pgr** ![enter image description here](http://i.stack.imgur.com/vCcHb.png) ![enter image description here](http://i.stack.imgur.com/W2uvD.png) ![enter image description here](http://i.stack.imgur.com/qLrYQ.png) When I tried to use the pgrouting plugin of QGIS , I got the below error ![error](http://i.stack.imgur.com/dvBNg.png) What am I doing wrong?


How to get the elevation of the areas in a raster file from SRTM?

I have an SRTM elevation map. How do I get the elevation of each point in the map? I am using GRASS. Is there a GRASS script to do such?


Key for a Heat Map

I have a question about heat maps and the correct way to describe the results. I have a dataset of small historic territorial units which vary greatly in size in different parts of a country. I want to demonstrate that certain areas of the country have larger territorial units than others and, rather than produce a map showing all 60000 territorial units as polygons, I think a heat map can achieve what I want. Using QGIS 2.0 I have created 60,000 points corresponding with the centroid of each territorial unit. I used the QGIS heatmap plugin, setting a radius for 5000m and no advanced features, to create a heatmap. I'm happy with the resulting raster, which I have styled as a conventional blue (low density, 0.00656748) to red (high density, 3.78287). ![Heat Map Ireland](http://i.stack.imgur.com/mbeAD.jpg) What I want to know is, when I produce the key for the map, how do I describe it? Is it 'Units per 78.5km²'- the area of a circle of 5km radius? Or 'Count of points in a radius of 5km'? Whilst my main aim is just to show that different parts of the country have different concentrations of territorial units, I want to be able to describe the results correctly. I’m sorry this is a rather basic question.


Making a georeferenced PDF or GeoTIFF from jpg+jgw using GDAL for Avenza PDF Maps

I'm trying to create georeferenced files for the mobile app Avenza PDF Maps. This app works with either GeoTIFF or georeferenced PDF. I know for sure that PDFs made with ArcMap work properly.   I'm starting with jpg+jgw, and using this:               gdal_translate -of GTiff file.jpg file.tif      gdalinfo shows that the coordinates are indeed embedded in the file. I do a similar thing for the PDF, but gdalinfo does not show any coordinate info in the file. However, this does not matter as both files do not work in Avenza PDF Maps. When loading the files, it just says that they are not georeferenced. Any ideas on how to solve it? Again, the same jpg+jgw combo, when saved using ArcMap - work.......


How do I find major locations within postal codes from GeoNames?

I'm trying to narrow down my postal code table and limit the number or rows to 1 per postal code. I've not had a problem with Canada and the USA. However with Great Britain the data from GeoNames has several location names per posta code in some areas. For instance, ZE2 in Scotland has 162 locations within it, most have the same lat & lon. Apparently it's one of the postal codes for the Shetland Isles. How do I find the major location/town within a given postal code? I've tried some sites like http://www.postcodearea.co.uk/postaltowns/shetland-isles/ze2/ but they don't have that sort of information. Where can I find that sort of information? I'm not building a geolocation map of great detail. This is for a hobby site to help people find others within a reasonable distance.


How to make my KML/KMZ accessible to the public

I created a basic web dashboard with MVC 4 that has a Google Map open on it. I have a KMZ file I made with ArcGIS desktop of a road in a Google Drive folder that i made publicly available so that i could take the URL of my file and implement that in MVC to overlay the KMZ file onto the Google Map, However when i run the process the dashboard opens up the Google Map on the correct spot however there is no shape file. The images attached show the code in MVC 4 that generates the Web dashboard, and the KMZ file sitting in the Google drive Folder. I am wondering if maybe there is not a problem with my script or if Google drive is the problem. This is the URL to the KML: https://drive.google.com/file/d/0B4_TJdssPL1RRC13MTlzbjVPWHM/edit?usp=sharing I am using MVC 4 and Google Javascript API v3 ![enter image description here](http://i.stack.imgur.com/tphMa.png) ![enter image description here](http://i.stack.imgur.com/d6Xod.png)


Why is my OnChangeFeature event not firing in my parcel fabric editor extension?

I have an edit extension that listens to events that happen during an editor session. I have wired it like so:               void Events_OnStartEditing()             {                      //Since features of shapefiles, coverages, and so on, cannot be validated, ignore wiring                  //events for them.                 if (ArcMap.Editor.EditWorkspace.Type !=                     esriWorkspaceType.esriFileSystemWorkspace)                 {                     //Wire OnCreateFeature edit event.                     Events.OnCreateFeature += new IEditEvents_OnCreateFeatureEventHandler                         (Events_OnCreateFeature);                     //Wire onChangeFeature edit event.                     Events.OnChangeFeature += new IEditEvents_OnChangeFeatureEventHandler                         (Events_OnChangeFeature);                      }                        }      The OnStartEditing event fires just fine. I want to listen for when an attribute from the row changes, so I wired an OnChangeFeature event:               void Events_OnChangeFeature(ESRI.ArcGIS.Geodatabase.IObject obj)             {                 MessageBox.Show("Event fired");             }      Every time I go in and change a feature by editing the attribute table, this should fire. But it doesn't. I am manually editing features of the table (I'm not using a cursor to programatically update the features). I will lastly mention that the feature class that I am editing is a subset of a parcel fabric. I'm not sure that this makes a difference as there is nothing in ESRI documentation that I have found that says that editing in a parcel fabric bypasses normal editing events, but I will mention it anyway. * * * **EDIT:** Ideas I have tried with no result: Implementing IObjectClassInfo2 in my extension to make sure that no store methods are being bypassed:               public class ParcelEditorExtension : ESRI.ArcGIS.Desktop.AddIns.Extension, IObjectClassInfo2                  public Boolean CanBypassStoreMethod()             {                 return false;             }                  public Boolean CanBypassEditSession()             {                 return false;             }      Running the IWorkspaceEditControl.SetStoreEventsRequired() method to enforce this rule over the entire edit session.               IWorkspaceEditControl EditControl = ArcMap.Editor.EditWorkspace as IWorkspaceEditControl;     EditControl.SetStoreEventsRequired();      * * * **EDIT 2:** It appears that the parcel fabric is, in fact, the issue. The event fires just fine when working on simple feature classes. Regardless, setting CanBypassStoreMethod() to false should fix this issue - is my implementation of this method correct?


Progressor bar for network analyst solve?

I'm using ArcGIS 10.2 and arcpy and am wondering if anyone has a method for displaying an accurate step progressor bar during a network analyst solve? As far as I know its not possible to set the number of steps beforehand, because the actual number of steps will depend on how many locations are found during the solve. Any ideas would be appreciated.


Export classified raster Class Values to DEM

I've classified an elevation raster into 4 classes. Is there a way to export these class values (0, 1, 2, 3) to a separate raster? I've tried exporting the raster to file, but this just gives the same elevation values. In other words, I want to replace the pixel values in my DEM with their class values.


How to define polygons overlapping each other?

I have a shapefile of landuse in different catchments. I want to calculate the percentage of each landuse category in each catchment using Tabulate Intersection. Before using this tool, I had dissolved the polygons in landuse shapefile using dissolve tool, dissolve field as the landuse category, checked create multipart feature, unchecked unsplit lines. After using Tabulate intersection, I found out that the percentage of total landuse in some catchments are larger than 100% (around 103%). I think this means that polygons are overlapping each others in these catchment. As a result, I'd like to identify where polygons overlap each others to fix these errors. Any suggestions would be much appreciated.


Is it possible to query raster from ArcGIS Server 10.1 REST?

I have a map service that contains a SDE raster layer and served out by ArcGIS Server 10.1. Is it possible and how to query through REST service on the raster layer? Basically what I want to do is to query the pixel value for the given x, y coordinates. Didn't find any example to do it.


Is the use of Google Earth imagery via the OpenLayers Plugin in QGIS legal?

I understand the terms and conditions WRT use of Google Earth imagery in external applications are strict. Years ago ArcBruTile offered such service in ArcGIS the legallity of which was questionable. (Google Earth is imagery option was later removed) Bing imagery is still an option but I am not sure how this is possible if ESRI states that in order to use Bing imagery the service must be purchased from Microsoft. **Where can I find the terms and conditions of use of Google Earth imagery in QGIS as provided by theOpenLayers plugin?** I like the idea, i just want to make sure it's legal. Can i produce maps for professional use and publications with this plugin, etc.? * * * ANSWER: @Andre Joost pointed me to the answer. In short, this type of use is not permitted under Google's Terms of Service: 10.1 Restrictions on How You May Use the Maps API(s). Except as explicitly permitted in Section 8 (Licenses from Google to You) or the Maps APIs Documentation, you must not (nor may you permit anyone else to) do any of the following: 10.1.1. General Restrictions. (a) No Access to Maps API(s) except through the Service. You must not access or use the Maps API(s) or any Content through any technology or means other than those provided in the Service, or through other explicitly authorized means Google may designate. For example, you must not access map tiles or imagery through interfaces or channels (including undocumented Google interfaces) other than the Maps API(s).


How to preserve text when converting from .dxf to .shp?

I have tried using dxf2shp converter in QGIS but the text in dxf file is being lost during the conversion process, despite selecting export text labels. I would be grateful if someone can help me convert the .dxf to .shp file without losing data. You can get dxf data that I am experimenting with from here


Advice on using CityGML data and GIS

I'm looking for advice on how best to use the CityGML data-structure and GIS (preferably ArcGIS/QGIS). I've read through their website and wiki and saw a list of software here that can be used to view the data, but I don't know which one works best with GIS. I have not used CityGML before (as I'm still figuring out what software to use to view the data) so I would appreciate any suggestions. My goal is to use the CityGML approach (with varying levels of detail, or LODs) to perform spatial analysis at different levels of accuracy.


How can ArcGIS Editor for OpenStreetMap preserve Unicode data?

Currently i am using ArcGIS Editor for open Street map for conversion of OSM file to file Geodatabase. But after conversion geometry is perfect but there is no Unicode data available in the attribute table. Am i missing some thing? I am particularly interested in the house numbers and buildings names. ![enter image description here](http://i.stack.imgur.com/KiIe3.jpg)


How do I teach ogr2ogr about a projection?

I have JSON generated from ArcGIS that I want to convert to GeoJSON in EPSG 4326. This fails:               $ ogr2ogr -f GeoJSON -t_srs EPSG:4326 out.geo.json in.arcgis.json OGRGeoJSON     ERROR 6: EPSG PCS/GCS code 102100 not found in EPSG support files.  Is this a valid     EPSG coordinate system?      I found a forum post that says 102100 can be changed to 3857, which is mathematically identical. So, this works, with the same error message:               $ ogr2ogr -f GeoJSON -s_srs EPSG:3857 -t_srs EPSG:4326 out.geo.json in.arcgis.json OGRGeoJSON      ERROR 6: EPSG PCS/GCS code 102100 not found in EPSG support files.  Is this a valid     EPSG coordinate system?      However, I have several files in the 102100 projection system. I'd like to teach ogr2ogr about the 102100 projection, so I can script the conversion. Is there a way to update the config so that 102100 is recognized and treated the same as 3857? _Update_ \- This data is from the REST API of ArgGIS Server 9.3.1. If I don't specify an output spatial reference, then I get 102100, which they define as the projected coordinate system "WGS_1984_Web_Mercator_Auxiliary_Sphere". A much easier way to accomplish my goal is to ask for the desired projection, with the `outSR=4326` query parameter. The question is still valid if you don't have access to original data.


How to Simulate Venn Diagram of Buffers using QGIS?

For the sake of simplicity, suppose I have only 2 points on one layer. Point A have population of 100, and point B have population of 150. I do find buffer of these 2 points and it is intersect. I want the intersect buffer (polygon C) to have number of people from A and B, according to the area of intersection. While polygon L and R, which is not intersect, have number of people minus amount of people they sent to the intersect buffer, like this ![venn diagram of ](http://i.stack.imgur.com/dgaaJ.png) My real data using polygon instead of point, and there is about 10 of them. How do I simulate this efficiently in QGIS? ### Idea #1 Random filling each buffer with points according to the number of its population. Then create heatmap from these points (why can't we create heatmap from polygon, by the way?) This method might not good enough since I want result as vector data, to let me able to use it in calculations furthermore. ### Idea #2   1. Find `area` of each buffer polygon. Calculate `population / area` and store to column `pop_ratio`.   2. Split buffer layer (now it is polygon L, R).   3. Intersect polygon L and R to get polygon C. Calculate summation of `pop_ratio` then calculate `sum_pop_ratio * area` to retrieve `population` of polygon C.   4. Difference polygon L/R with polygon C. Calculate `pop_ratio * area` to retrieve `population` for each polygon as well. But my data might form ups to 20 intersect polygon, which obviously not so much enjoy to do this by hand.


Place names on maps - why big differences between OSM, Bing and Google?

The following observations are from clicking between Chrome tabs. Managua, Nicaragua: At zoom 12 with Google Maps, I get about 40 place names. At 12 zoom on OSM, I get about 17, and only two of them - Las Colinas and the airport - are the same as Google's. At similar zoom, Bing has 11 names, and only two - the airport and Carretera a Masaya - are the same as Google's. (Yahoo's names are the same as Bing's) So the maps are giving importance to different places. Does anyone know the logic? What names should be on the map of a city at zoom 12? ==== In response to the below, I'm doing maps of cities for an on-paper publication. I always assumed that place names on maps were the major "places" in a given area, with some kind of hierarchy - like Country, state, city and City, district, suburb. Google, OSM and Bing come up with very different place names for cities I'm interested in (leaving aside names of highways/streets). So, I don't know how to represent these cities. Maybe I should just take a reputable atlas and eliminate the names in small fonts. But I'd still wonder how the mapmakers decided what should be small and what should be bigger, or there or not there.


Using handheld GPS for sub-meter precise positioning

I've heard that we could use two or more handheld GPS to get a better positioning accuracy using post processing techniques. Anybody can tell me the methodology? Also, can we program handheld GPS such that it records coordinates every second?


How can cities in a Metropolitan area share data collection costs?

Does anyone have any stories to tell (good or bad) about attempts to share the costs of data collection among cities/agencies in a metropolitan area? Aerial imagery is a primary example, but would like to hear other experiences. How can a small city justify funding a data collection effort when last year they paid for data that was made freely available? If the data is not made freely available, is there some way to recover costs through data usage?


Make a single layer multiple colors

I have a layer file that has a few polygons in it, each of these polygons is required to be a different color based a column in the DBF file. I normally color layers like this:               ISimpleRenderer simplerenderer = geolayer.Renderer as ISimpleRenderer;     SimpleFillSymbol simpleFillSymbol = simplerenderer.Symbol as SimpleFillSymbol;     simpleFillSymbol.Color = selectedColor;      But this doesn't have a mechanism to use multiple colors on the same layer. How does one accomplish this? ArcEngine 10, C#, VS2010


Do any open-source .Net libraries (commercially usable) exist for reading/writing LiDAR data?

I have a few LiDAR point data (.las files) with me. I would like to read the X,Y and Z from it using .Net. I found liblas, which is in C++ and I am not sure if it can be used commercially after reading the licensing information. Has anyone found any good ones?


shp2pgsql mangles date field -- quotes data as if it were char or varchar

I'm attempting to import a shapefile into postgis via shp2pgsql. Among the fields in the shapefile's .dbf file is a date field with format yyyymmdd, which is a valid date format for postgresql. ![The date field as seen in QGIS](http://i.stack.imgur.com/CbpbH.jpg) However, the sql generated by shp2pgsql outputs the date field with quotes: ![enter image description here](http://i.stack.imgur.com/5fLtr.png) And that means when I run the command, I get an 'invalid input syntax' error: ![enter image description here](http://i.stack.imgur.com/r2slM.png) What do I need to do to get shp2pgsql to format the value correctly so it can be loaded into my database? I need to automate this loading process, so anything that involves opening up the SQL and editing the file should be a last resort. Thanks EDIT: Turns out it was a bad record causing the error. Of course an insert statement uses quotes around the values. I get stupid after midnight :)


QGIS 2.2 expression string builder removes brackets

in QGIS 2.0.1 is used to calculate minimum building distances (Abstandsflächen in German) with an ellipse marker with data definded properties. the expression for this is quite complex: **(( _'Value 1'_ \+ _'Value 2'_ / '2' * '1,01' * '0,464' )* '0,25' + sqrt( _'Value 3'_ ^ 2 + ( _'Value 2'_ / '2' * 1.01) ^ 2))*2** When I do the exact same thing in QGIS 2.2, the expression string builder changes the expression when saving it into this: **Nabenhoehe + Rotor / '2' * '1,01' * '0,464' * '0,25' + sqrt("Nabe Turm" ^ 2 + Rotor / '2' * 1.01 ^ 2) * '2'** As you can see, the brackets are removed, therefore the result of the calculation is wrong. I have no idea why this works in QGIS 2.0.1, but doesn't in QGIS 2.2 ... any ideas? thanks in advance, greetings Gunnar


Error trapping ModelBuilder?

If you are writing a ModelBuilder model with a lot of geospatial data in it, and if one of the datasets fails or doesn't work, does the model stop and thus not produce any output?


How to get bounding box from coordinates (latitude, longitude), zoom level and size (screen)?

Is possible to get bounding box from coordinates (latitude, longitude), zoom level and size (screen)? I found only calculating bounding box from tile. I need it, because OpenStreetMap accept only bbox in export mode. I dont have any experience with this, so I will be glad for any advice. Thanks.


How to use ArcPy to iterate through each grid cell and make it the current extent?

I have a topology that covers a big area. I cannot validate all at once 'cause I get errors. So I've created a grid that covers the area. Through a script runned from my .mxd I intend to: 1\. itterate through each grid cell 2\. set it as the current extent of the map, 3\. use the tool "Validate Topology", having checked the option "VISIBLE_EXTENT". The workflow sounds correct to me, but I'm blocked at the first two steps. Here's my code:               import arcpy     mxd = arcpy.mapping.MapDocument("CURRENT")     df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]     gridLayer = arcpy.mapping.ListLayers(mxd, "Caroiaj_RO", df)[0]                # Create SearchCursor     with arcpy.da.SearchCursor(gridLayer, ("GridName2")) as cursor:          # Start a loop that iterates through all rows          for row in cursor:              # Clause to select only the current record             whereClause = ' "GridName2" = ' + str(row.GridName2)                  # Select Layer by attribute             arcpy.SelectLayerByAttribute_management(gridLayer, "NEW_SELECTION", whereClause)                  df.extent = gridLayer.getSelectedExtent(True)                  arcpy.RefreshActiveView()          del cursor, row     del mxd       Thanx a lot!


Is there a way to distinguish between digitized and pasted features?

Is there a way to tell if an added feature in QGIS is in fact a newly digitized one or a pasted feature? I think QGIS is treating both cases in the same way, emitting the same signal: `QgsVectorLayer::featureAdded(QgsFeatureId fid)` for a digitized feature as for a pasted one! Maybe there's a way to tell the difference?


What is fastest way to copy feature dataset from ArcSDE to File Geodatabase in ModelBuilder?

What geoprocessing tool is the fastest for copying feature datasets from SDE to fgdb? I want to make a model in ModelBuilder that copies an entire featuredataset from my SDE database to a file geodatabase. I don't know what the fastest tool is. I tried "Copy element" but that is painstakingly slow compared to if you copy-pasting in ArcCatalog. Featureclass to Geodatabase, only copies the featureclasses in the dataset, and places them in the root of the fgdb. Featureclass to featureclass is a lot of drag and dropping, and I don't know about the speed. I would love to know what the fastest tool for this job is.


Changing page orientation using data driven pages

Is it possible to change the page orientation of a map using data driven pages in ArcGIS 10.1? After setting up the DDP I have 80 portrait maps with all the map elements set up correctly. About 10 of the maps actually need to be in landscape, but with all the same elements, so when I am exporting them, I would like to be able to indicate that those 10 should be generated in landscape.


GeoExt2 How I make subnodes in Layer Tree

I'm loading WMS layers to OpenLayers map in the following way : Here is a JSFiddle example : http://jsfiddle.net/Alophind/9r95T/                function LoadLayers(data) {         jQuery.each(data, function (i, val) {             if (val.layer != "") {                 var layer = new OpenLayers.Layer.WMS(val.name, geoserver,                         {                             LAYERS: val.layer,                             STYLES: '',                             format: format,                             tiled: true,                             transparent: true,                             tilesOrigin: map.maxExtent.left + ',' + map.maxExtent.bottom                         },                         {                             buffer: 0,                             visibility: false,                             displayOutsideMaxExtent: false,                             isBaseLayer: false,                             yx: { 'EPSG:4326': true }                         }                     );                 arrLayers.push(layer);             }         });     }      and I instantiate a GeoExt tree like this :               mapPanel = Ext.create('GeoExt.panel.Map', {             border: true,             region: "center",             map: map,             layers: arrLayers         });              var store = Ext.create('Ext.data.TreeStore', {             model: "GeoExt.data.LayerTreeModel",             root: {                 expanded: true,                 children: [                     {                         plugins: ['gx_overlaylayercontainer'],                         expanded: true                     }                 ]             }         });              tree = Ext.create('GeoExt.tree.Panel', {             border: true,             region: "west",             title: "Layers",             width: 200,             split: true,             store: store,             collapsible: true,             collapseMode: "mini",             autoScroll: true,             //store: store,             rootVisible: false,             lines: false         });      I want to be able to put the layers in the tree as subnodes . for example :               Root     |     |-Buildings     |     |---Layer 1     |     |-Cars     |     |--- Layer 3      How can I do it ? I've managed to add the following code manullay :               tree.getRootNode().appendChild({                 text: "Root,                 group: true,                             children: [                         {                             text: "Buildings",                             layer: "MyTest:BuildingsSHP",                             leaf: true,                             checked: false,                             children: [],                             nodeType: "gx_layer"                         },                         {                             "text": "Cars",                             "layer": "MyTest:CarsSHP",                             "leaf": true,                             "checked": false,                             "children": [],                             "nodeType": "gx_layer"                         }                     ],                 expanded: true             });      And I do get new nodes in the tree... But when I click the check box , nothing happens (they don't show in map and not added to the legend panel) What else am I missing ?


QGIS georeferencer plugin not loading

Just downloaded QGIS 2.0.1. Georeferencer is an installed core plugin but I can't get it to load and appear in the Plugin menu. The "upgrade", "uninstall" and "reinstall" actions in the Plugin Manager are grayed out. New to QGIS so not sure what's happening. Thanks in advance.


Sequential numbers in a field using Python in the Field Calculator on a based on Sorted Column not FID/OID

This code below auto-increments based on the FID/OID in the attribute table. How can I auto-increment a column based on a sort of another column? I don't want it to follow the FID/OID. Please advise, thanks.               rec=0     def autoIncrement():      global rec      pStart = 1 #adjust start value, if req'd       pInterval = 1 #adjust interval value, if req'd      if (rec == 0):        rec = pStart       else:        rec = rec + pInterval       return rec


How to install PostGIS shp2pgsql-gui on CentOS 6?

I am installing PostGIS 1.5.3 on a CentOS 6.2 virtual machine to get started web mapping with Geoserver.I have successfully installed PostgreSQL 9.1, PostGIS 1.5.3 and PgAdminIII on the system. However, I am noticing that there are no PostGIS GUI's installed. I was under the impression the PostGIS includes the Shapefile and DBF loader plugin for PgAdminIII even in Linux. When I navigated to /usr/bin shp2pgsql was there but not shp2pgsl-gui. Is there anyway to install the GUI for PostGIS in CentOS 6.2? I am very new to Linux and the OSGeo Stack. I have installed the above software using YUM and the rhel-6 PostgreSQL repository. Thanks in advance for your help.


The best GIS book!

> **Possible Duplicate:**   >  GIS Pros - what lives on your bookshelf? Which book do you think is best for GIS with theoretical bases?


Book Recommendations on GIS Infrastructure

Can anyone recommend a good book that goes over the different parts of a Geographic Information System (or a GIS web mapping application like the OpenGeo Suite)? In other words, I am looking for a book that discusses spatial databases, servers, rendering of information, etc. I have a limited technical background so the book can't be too sophisticated. I want to gain more knowledge on the infrastructure of GIS. I would truly appreciate it, thanks a lot!!!


GIS - related magazines, monthly papers?

I was wondering if you can recommend some magazines or basically any other GIS-related papers (printed or digital) which are released on a monthly basis (or every 2-3 months); I am practically looking to keep in touch with the GIS fast-growing world and I would prefer something other than books or websites. Maybe some of you already have a subscription at some magazine and I would appreciate some advice/recommendation. I am quite interested in OpenSource Software but not only. This post would be the magazine equivalent to another one with useful information about books: What books, journals, electronic resources are most valuable for expanding Geographic Information knowledge? Thank you for the patience to read this post, :)


What are some options for embedding Google Maps into a WordPress site?

**Background** A non-technical user would like me to embed a Google Map into a WordPress- powered site. She needs the ability to add markers using a simple mechanism, and to link those markers to pages within the site. Ideally I (as administrator) would have the ability to   * use Styles on the basemap (eg, don't show roads)   * write JavaScript which controlled map interactions (eg, restrict zooming to just 2 levels)   * access advanced Google Maps functionality (eg, marker clustering) There is no shortage of Google Maps plugins for WordPress, so my questions are:   1. Can anyone on GIS.SE recommend any particular plugin?   2. Do any of them allow customised JavaScript to run? (they appear to be aimed a non-GIS endusers) Thanks


Highlighting and exporting raster layer based on vector polygon

I am a Quantum GIS beginner. I have a set of adjacent polygons in a vector layer that is overlaid on a raster layer of OS StreetView OpenData. I want to be able to select each of these polygons and separately export it as an image file (JPEG, PNG, whatever). In the final image, I do not want any fill colour inside the polygon, but I would like the area immediately surrounding the polygon to appear filled (perhaps with diagonal lines), to clearly mark the boundary. What is the easiest way I can achieve this with QGIS? Thanks. UPDATE: The mapbook plugins highlighted by Darren Cope provide a neat way for me to export the polygons in bulk, which is one major part of the solution. However, the other part of the problem still remains. I need to find a way to shade/fill the area outside each polygon. I am wondering whether it would be possible to programatically create a polygon layer mask on-the-fly for each polygon, using something like Vector -> Difference. Any guidance appreciated.


Simulation envelopes and significance levels

Many spatial analysis packages provide Monte Carlo techniques to simulate upper and lower “envelopes” for a summary statistic as a function of distance (e.g. K-function, nearest neighbor, etc…). I’ve sometimes seen the significance of deviation from the envelope expressed as: p = m * 1 / (n +1) Where _n_ is the number of simulations and _m_ is the rank of the largest and smallest observation from a simulation sample for each distance _r_. For example, if _m_ = 1, the first largest and first smallest values from the simulation sample are used to plot the upper and lower simulation envelopes. If _m_ = 2, the second largest and second smallest values are used to plot the simulation envelopes. My questions are: 1/ where does the **\+ 1** in the denominator originate from? For instance, if we run 39 simulations, why divide by 40? 2/ Regardless of the number of simulations performed (i.e. 39 or 9999), _m_ seems to have a disproportionate influence on the computation of the significance level. It would seem that taking the 2nd highest and lowest values of a simulation sample from 9999 simulations would have less of an impact on the width of the simulation envelope than from 39 simulations. I’m sure that there is a sound theoretical basis for this, but its logic escapes me. Is there an analogy in inferential (non-spatial) statistics that can help make this a bit more intuitive? 3/ How should one present the results of a simulation envelope? I sometimes see a _p_ value defined for a simulation, but how is one to know if the presented _p_ is for _m_ =1 or a more stringent _m_ =3? **Edit** : Per whuber's comment here is some clarification: 1/ The type of simulation pertains to testing the null hypothesis such as complete spatial randomness (CSR) 2/ Example of a package that computes simulation envelopes is spatstat (R). The function is called **envelope** and **nrank** is the parameter _m_ described in the above equation.


Html and Flex Viewer 2.5

I was wondering if it is possible to customize the interface of the flex viewer with html using the index.html file that is located in the viewer? anybody know? Thanks, Jay


How to Batch Clip in ArcGIS Desktop 10 using Python/ArcPy?

I've come across a few similar questions for older versions of ArcGIS, but haven't found a suitable answer for ArcGIS 10. I have two polygon shapefiles that cover a large area (e.g. an entire State/Province). The first shapefile represents land cover for the entire State and the second represents 50 individual watersheds. I would like to clip the land cover shapefile based on **each** watershed (each has a unique name stored in a field). I would then like to save the output clipped files (one for each of the 50 watersheds) using the watershed name. Given that there are 50 clips to be performed this process is a great candidate for batch processing.


FME Workbench: Merging Multiple Shapefiles into One Database Table

I'm new to FME Workbench, but have used Quick Translator for a while. What I have is a directory: C:\Mexico\Maps\Rural where I’ve extracted the Shapefiles for multiple states. Nothing else is in that directory, just 4 files per state (.prj, .shp, .shx, .dbf). In SSMS, I have a new database name MexicoRural. I would like to use FME to load all files from the directory into one table. ## I've tried creating multiple workspaces and the best I can get is that it will load the first Shapefile, but not the others. Any ideas how to do this? UPDATE: I modified the [FEATURE_TYPES] in Published Parameters and was able to get it to read all files, but it wrote each file as a separate table to SSMS. Below are my writer settings. ![Here are my writer settings:](http://i.stack.imgur.com/hhdvN.jpg)


Identify different networks inside a line shapefile

I'm dealing with a quite big line shapefile containing road tracks. The roads are connected to each other, creating distinct networks. These networks are independent and they are not connected to each other. I'm trying to find a way to identify these networks, count them and eventually measure their total length. I'm open to all kind of solutions, using ArcMap Network Analyst, the python library Networkx, pgRouting, GRASS, or any other solution you can suggest. So far I have explored the above possible solutions without success.


How can i create the spatial queries in QGIS?

please, Help me. i'll really appreciate your answers.


How can I make a BaseCustomLayer Draw() fire more often?

I'm experimenting with the idea of replacing my dynamic display moving graphics with the static (DynamicDisplayEnabled = false) moving graphics.               public class CustomLayer : BaseCustomLayer     {             public override void Draw(esriDrawPhase drawPhase, IDisplay Display, ITrackCancel trackCancel)             {                 int hdc = Display.hDC;                 IntPtr p = new IntPtr(hdc);                 Graphics graphics = Graphics.FromHdc(p);                 Image newImage = Image.FromFile(carImage);                 System.Drawing.Point ulCorner = new System.Drawing.Point(x, y);                 graphics.DrawImage(newImage, ulCorner);             }     }      This code draws the image, but it only invokes draw once, unless I move the map with the pan tool or change the scale. How can I make the Draw function fire multiple times a second?


Optimize GEOSGeometry's spatial operations by avoiding thread-safety checks

A ranking algorithm I'm developing for a Django webapp requires performing spatial operations (within, intersections, sym_difference, etc.) using a query against large number of geometry objects. Presently, the algorithm is very time-consuming, and the profiler reveals that the bottleneck is `django.contrib.gis.geos.prototypes.threadsafe.__call__`, which are called by virtually every methods in `GEOSGeometry`. From what I understand, `threadsafe.py` is a wrapper to the underlying GEOS's threadsafe API. In this case the threadsafe-checking presents huge overhead to the computation time. Also my computation is strictly single threaded. From these reasons, I wonder is it possible to bypass or avoid the thread-safety checking performing by Django's GEOS API?


Create Buffer in meters Spatialite query

I am new to Spatialite. I have following query: **select A.* from linka as A, pointa as B where Contains(Buffer(B.Geometry, 100), A.Geometry)** Here, > A.Geometry = LINESTRING(23.2161 69.95237, 23.21581 69.95279) B.Geometry = > POINT(23.21817 69.95177) I want to create **100 meters buffer** and get to know which are the link's are contained by point geometry. I am having coordinates of WGS 84 projection system from navigation data. The passing **100** over here, it takes as **degree** and creating buffer like that, but I actually want to specify the buffer distance as meters. (I don't want to pass the distance in degree value because on each earth pole degree's buffer cover not same range area. This is the _big_ problem of geodecy) Is there any way to satisfy my requirement in Spatialite ?


OpenLayers pan to CQL filter result

I'm new to OpenLayers and looking for some help. I would like to filter my shapefile with CQL and display the result. (that's actually working :-) The Problem is that I don't know how to pan the map to the result. So here is my code. I would be overgrateful for your help!               suche = new OpenLayers.Layer.WMS(         "nkGIS:HauptAdressen - Tiled", "http://localhost:8080/geoserver/nkGIS/wms",         {             LAYERS: 'nkGIS:HauptAdressen',             STYLES: '',             transparent: "true",             format: 'image/png',         },         {             buffer: 0,             displayOutsideMaxExtent: true,             isBaseLayer: false,             yx : {'EPSG:900913' : false}         }      );          map.addLayers([suche]);          osm = new OpenLayers.Layer.OSM();     map.addLayers([poi]);          map.addLayers([osm]);          poi.setVisibility(false);     suche.setVisibility(false);          // support GetFeatureInfo     map.events.register('click', map, function (e) {         document.getElementById('nodelist').innerHTML = "Loading... please wait...";         var params = {             REQUEST: "GetFeatureInfo",             EXCEPTIONS: "application/vnd.ogc.se_xml",             BBOX: map.getExtent().toBBOX(),             SERVICE: "WMS",             INFO_FORMAT: 'text/html',             QUERY_LAYERS: map.layers[0].params.LAYERS,             FEATURE_COUNT: 50,             Layers: 'nkGIS:HauptAdressen',             WIDTH: map.size.w,             HEIGHT: map.size.h,             format: format,             styles: map.layers[0].params.STYLES,             srs: map.layers[0].params.SRS};                  // handle the wms 1.3 vs wms 1.1 madness             if(map.layers[0].params.VERSION == "1.3.0") {                 params.version = "1.3.0";                 params.j = parseInt(e.xy.x);                         params.i = parseInt(e.xy.y);                     } else {                         params.version = "1.1.1";                         params.x = parseInt(e.xy.x);                         params.y = parseInt(e.xy.y);                     }                          // merge filters                     if(map.layers[0].params.CQL_FILTER != null) {                         params.cql_filter = map.layers[0].params.CQL_FILTER;                     }                           OpenLayers.loadURL("http://localhost:8080/geoserver/nkGIS/wms", params, this, setHTML, setHTML);                     OpenLayers.Event.stop(e);                      });             }              function updateFilter(){             if(pureCoverage)                 return;                  var filterType = "cql";             var str = "SName LIKE'" + document.getElementById('str').value +"'" + "AND " + "HNR LIKE'" + document.getElementById('nr').value +"'";                  // by default, reset all filters             var filterParams = {                 str: null,                 cql_filter: null,                 featureId: null             };             if (OpenLayers.String.trim(str) != "") {                 if (filterType == "cql")                      filterParams["cql_filter"] = str;             }             // merge the new filter definitions             mergeNewParams(filterParams);             suche.setVisibility(true)         }                   function resetFilter() {             if(pureCoverage)               return;                  document.getElementById('str').value = "";             updateFilter();         }              function mergeNewParams(params){             suche.mergeNewParams(params);         }


Convert colorized/styled vector (KML or qgis-project-origin) to raster and preserve the colorization

I can very rapidly create nice heatmaps (chloropleths actually) using qgis that I can then export as kml's that have the correct colorization when displayed on Google Earth, etc. I'm wanting to convert these stylized vector files to rasters now in order to put them up on a tile server. How might I do this without losing the colorization I've chosen? Here's what the maps look like in vector format. ![enter image description here](http://i.stack.imgur.com/ScRQP.png) I want the rasters to look exactly like this. The colorization is initially set by qgis using a float value and a color ramp, but I've further customized the colorization rules to an extent that it isn't reproducible using only code. would like to keep them without having to re-colorize the raster layer based on a number value, though I don't even know how to do that yet. PS: I do not use ArcGIS.


Mapfish printing application from Openlayers : disableScaleLocking

Mapfish printing application from Openlayers: I get the following error when I use a different scale than the scales defined in the config.yaml even though I am using `disableScaleLocking: true` > Error while generating PDF: org.mapfish.print.InvalidJsonValueException: > spec.pages[0].scale has an invalid value: 65000 I thought that `disableScaleLocking: true` would enable me to print a map at any scale and not only the ones defined in config.yaml . Did I get it wrong? Here are the first lines of my config.yaml :               dpis: [75, 150, 300]          scales:        ... (list of predefined scales)          hosts:         - !localMatch             dummy: true         - !ipMatch             ip: 0.0.0.0             mask: 0.0.0.0          disableScaleLocking: true          layouts:           ...


GeoExt showcase examples

I would like to showcase as many online GeoExt applications as possible to show a number of GIS colleagues what can be done with GeoExt and how different organisations are using GeoExt to distribute mapping information. Does anyone have any good examples of GeoExt applications which are publically available on the web for me to evaluate?


Updating Data Driven Pages in PDF format to use with ArcGIS Viewer for Flex?

I have Mapbook created on my ArcSDE data and same mapbook is used for printing maps in WebGIS application based on FlexViewer. Now the network has been updated, thus, i want to update the Mapbook as well for printing via WebGIS application. Below are the queries.   1. My doubt is that if i create new Grid and load it's data in existing grid feature class, will it work on existing setting of the Mapbook Printing in pdf format.   2. Once Mapbook is exported, can i populate URL field automatically for every exported pdf file in the Grid feature class. I am using Data Driven Pages and ArcGIS 10.2.


Calculating loss of value from a wind turbine on surrounding properties depending on distance

I have to evaluate where installing a turbine would be most efficient, depending on wind speed and price of properties surrounding each cell in a raster. The cost on value of properties is computed using some estimation based on the distance of the turbine to nearby properties. I know the price of each property in the area. I have to find a way to calculate how much each turbine would cost, in terms of loss value, on the surrounding properties. I thought of doing this by making buffers for each given distance, joining the resulting layer with the layer containing the price of properties, and then making a buffer reducing the buffer containing the value of properties to the cell (therefore, in the same, negative amount of the first buffer). However, the value of properties does not appear in the last buffer layer: (example) Cell => 600 m buffer => join buffer with layer containing value of properties => buffer - 600 m => cell Is there a way to keep information from the original cells on the buffers created? Is there an alternative way to calculate the loss of value caused by a cell on the surrounding cells? I hope my question is clear enough, thank you in advance for your help!


How to transform coordinates to location in x-y grid in R?

I have a polygon with a 40m diameter and several points that lay inside it. Now I want to reformat the point locations (projected in DHDN/GK-3, but could vary) to x-y coordinates ranging from zero to the maximal diameter of the polygon (in this case 40m). I am working in R and therefore I need a scripted solution (this is just a testing subset and many more follow, therefore "click"-solutions in Qgis/arcgis won't suffice.) Pictures say more than words: The triangle is the polygons centroid. The green dots the point locations. ![enter image description here](http://i.stack.imgur.com/Wgptp.png) I appreciate any coding assistance :-)


sqlite replace values

i have a table with two columns: one named `index` and the other is called `tilenumber` and the `tilenumber` is populated from the `index` column except that there is `_` which needs to be removed from the column. The index table has values like **2726BA_11** and the tilenumber should result in 2726BA11 but i seem not to know the way forward, to remove the space i have done the following:               select distinct replace (tilenumber,'_', '') from aug2012      and it shows that the result has been achieved but how do i incorporate the select distinct replace in the update statement which is               update set tilenumber="index"


Arcpy Insert Cursor

The below code quits at the "cur = " line. Is it an error with arcpy module, my other scripts have worked with importing arcpy. I cannot determine if it is not recognizing the 'InsertCursor'. Any idea how to get it to succeed? I have checked the links. It fails at "stop 2"               import arcpy, os     try:              arcpy.env.workspace = "H:/Documents/Exercises/Data/WildfireData/WildlandFires.mdb"              f = open("H:/Documents/Exercises/Data/WildfireData/NorthAmericaWildfires_2007275.txt", "r")              lstFires = f.readlines()         print "stop2"         cur = arcpy.InsertCursor("FireIncidents")         print "stop3"         cntr = 1         for fire in lstFires:             print "stop"             if 'Latitude' in fire:                 continue             vals = fire.split(",")             latitude = float(vals[0])             longitude = float(vals[1])             confid = int(vals[2])             pnt = arcpy.Point(longitude, latitude)             feat = cur.newRow()             feat.shape = pnt             feat.setValue("CONFIDENCEVALUE", confid)             cur.insertRow(feat)             arcpy.AddMessage("Record number " + str(cntr) + " written to feature class")             cntr = cntr + 1     except:         print arcpy.GetMessages()     ##finally:     ##    del cur     ##    f.close()


Tilestache AttributeError: Layer instance has no attribute 'palette256' error when adding Metatiles

I have Tilestache working great over apache/mod_python. All of my mapnik.xml driven layers work well until I add a 'Metatiles' directive in the layer and then i get the following error: AttributeError: Layer instance has no attribute 'palette256' Here's the tilestache.cfg: "bldglabels": { "provider": { "name": "mapnik", "mapfile": "/etc/mapxml/bldglabels.xml" }, "metatile": { "rows": 4, "columns": 4, "buffer": 64 } }, Any idea what I'm doing wrong? Thanks!


How to reference path to file that is in edit session from Python AddIn?

I am creating a Python addin button and I would like to reference the path to the layer that is currently in an edit session to the code in the addin button. This way users will be able to use the functionality of the addin in button with a variety of different named layers that have attribute tables with the same headers. My button currently uses this code.               inFeatures="m8010_seginit_061213"     fieldName="LFM"     expression=3000     arcpy.CalculateField_management(inFeatures, fieldName, expression, "PYTHON")      I would like to have "inFeatures="CURRENT"" or the path to the current layer is that is open in an edit session.


Animation and zooming in OpenLayers

I need your help. I'm learning to use OpenLayers (version 2.13.1) and I've made some custom buttons to test the controls. Now, I have a button which is bound to a simple setCenter() method that works as it should. Then I have another one that is bound to a function that looks like this (I'm using the spherical mercator):               function myFunc() {                 map.panTo(new OpenLayers.LonLat(2000000.0000, 6000000.0000));                 setTimeout(function(){map.zoomTo(15)},500);                 }      So, as you can see, what I want to achieve is that when you click on the button it should pan to the coords you pass in and, after a certain time, zoom in. And it almost work as I intend. I'm encountering some issues like these: 1) When I click on the button, it pans and zooms, but not at the coords I've passed in. When I click again, then it behaves like setCenter(), but this time it goes in the right position, how could I fix this? 2) The panTo() animation works only if the destination is in the current extent, otherwise, as I just wrote above, it behaves like setCenter(): is there a way to activate the animation even if the destination is not in the current extent? 3) The method zoomTo() zooms in too fast than I want, is there a way to regulate its speed?


SetSpatialFilter worked unexpected when using ogr by python

I am using ogr python binding to read the shapfile, this is the code:               .....     bbox="POLYGON ((20.18164062 30.63867188,20.63867188 30.63867188,20.63867188 30.18164062,20.18164062 30.18164062,20.18164062 30.63867188))";     print "fs:before:",datalayer.GetFeatureCount()     datalayer.SetSpatialFilter(bbox)     print "fs:after :",datalayer.GetFeatureCount()     for feature in datalayer:         geometry = feature.geometry().Clone()         if not geometry.Intersect(bbox):             continue             # do my job      However the above codes will give me output like:               fs:before: 156396     ERROR 1: Attempt to read shape with feature id (157823) out of available range.     ..................................     ERROR 1: Attempt to read shape with feature id (160730) out of available range.     More than 1000 errors or warnings have been reported. No more will be reported from now.     fs:after : 0      It seems that ogr try to read a feature no exist in the shapfile. Since there are no features with the id in the output. Neither for id "157823" or "160730". And if I comment line:               datalayer.SetSpatialFilter(bbox)      No errors occur. And this is a screenshot of the data and the bbox used as filter: http://pbrd.co/1kAn4R3 The green features are my data, and the red square is the bbox used to filter the features. What's the problem? * * * Update the complete codes:               def renderTile(coord,items):         bbox=create_bbox(coord,0.15)              for item in items:             datalayer,datasource=_open_layers(item)             _get_features(coord,bbox,datalayer])               def _open_layers(path):         datasource=ogr.Open(path)         datalayer = datasource.GetLayer(0)         return datalayer,datasource          def _get_features(coord,bbox,datalayer):         #print "fs:before :",datalayer.GetFeatureCount()         datalayer.SetAttributeFilter('{0} <= {1}'.format('FSCALE',coord.zoom+1))         datalayer.SetSpatialFilter(bbox)         #print "fs:after :",datalayer.GetFeatureCount()              for feature in datalayer:             #print feature.GetFID()             geometry = feature.geometry().Clone()             if not geometry.Intersect(bbox):                 continue                          geometry = geometry.Intersection(bbox)             handle_result(feature,geometry)               coord =(10,12000,2000)     items= ["/home/kk/data/shps/points.shp","/home/kk/data/shps/roads.shp"......];     renderTile(coord,items)      The above codes are served by werkzeug. The `coord` is create by http parameters, the `items` are read from configuration file.


Problem with KML in Google Earth iOS-App

I have a some what strange problem with KML/KMZ-files in the iOS google earth- app for ipad/iphone. I export my map from ArcMap to KMZ. Email myself and open the file with KMZ-loader and then open the file in Google Earth. The problem is that google earth does not draw the points in the file. It works fine with lines and polygons and I can't understand what's the problem. If I touch the "bookmarks" next to the search bar, I can see all the points and read the attributes for every point. I can even zoom to each one but nothing shows on the map. Any one have a possible solution to this? Regards/ Olof


How to split a feature and save back to database?

How to split/cut a polygon through OpenLayers split method and same editing save to the PostGIS?


OpenLayers WFS implementation in java for editing and saving data

I am new user in openlayers and want to implement WFS layer to edit and save data to postgis tables.am using netbeans as development environment and m very new in that.Can anyone to help me regarding to this?It would be good if any running example found.


Is it possible to install NVS Vector Stream Tool with ArcGIS 10.1 SP1?

I can't seem to get a response form NVS about their Vector Stream Tool add-on, but they did send me a fixed-up version that I have now been able to install. However, I cannot find any associated toolbox. I have tried System Toolbox, My Toolbox, looking in the installation directory, and searching in my default geodatabase, but I can't find a way to add this tool (or toolbox) to my GIS. Has anyone else been able to successfully install the Vector Stream Tool into ArcGIS (ArcMap) 10.1 SP1, and might anyone have suggestions? THANK YOU!


Where can I find a shapefile of the UK electricity grid network?

Does anyone know where can I download a shapefile with the UK electricity grid network?


Display Rectangular Data Grid

I'd like a _Linux_ program which displays ASCII ArcGrid files (NxM rectangular ASCII data grids which may have either integer or floating point values). There is no practical upper or lower limit to these values. I would like suggestions of a program which could read in this rectangular grid and display it in colour. The program must also have the capability to rescale the data so that I can isolate ranges of interest, it would be best if the rescaling could be nonlinear. (A nice, intuitive interface for this would be bestest.) This is somewhat of a GIS application, so answers dependent upon conversion to the GeoTIFF format are acceptable. Gimp did not work for me, so if you suggest it, you should be very specific about how to get it to display the GeoTIFF format (or a rectangular grid) Thanks!


open layers export map control not working

I need your advise once more. I'm trying to save the map as an image and I edited my code according to this example. When I test my site on Chrome the map does not render at all. Chrome's console says "Uncaught TypeError: undefined is not a function" for this line of code               exportMapControl = new OpenLayers.Control.ExportMap();      and "Uncaught ReferenceError: exportMap is not defined" for this line                <input type="button" value="Export Map" onClick="exportMap()" /> <br />      I use openlayers 2.12, geoserver, postGIS. The system is on my laptop. I dont use a proxy, I just edited the Apache's conf file (works fine). I checked this and there is nowhere an export map control. If you want to see my code, please let me know. Also, another question, how to edit the above example to make it work with WMS, WFS and Google layer? Thank you


Make Leaflet Map Background Transparent

How can i make the background of the leaflet map transparent. I see opacity controls from the layers, but not the map background. Should the be changed just with plain CSS? Thanks


How to get intersected points between polygon and line in desired order

I have polygon for example "POLYGON((5 1, 6 1, 6 5, 5 5, 5 1))" that I want to intersect with line "LINESTRING(0 2, 10 2, 10 3, 0 3, 0 4, 10 4)" and get intersection points in the order that they intersect between both geometries as if you move sequentially from the start of the line to the end. Not sure this makes sense, so here is an example:               WITH impact_zone AS (         SELECT ST_ExteriorRing(ST_GeomFromEWKT('SRID=4326;POLYGON((5 1, 6 1, 6 5, 5 5, 5 1))')) AS geom     ), line AS (         SELECT ST_GeomFromEWKT('SRID=4326;LINESTRING(0 2, 10 2, 10 3, 0 3, 0 4, 10 4)') AS geom     )     SELECT         ST_AsText(ST_Intersection(             (SELECT geom FROM impact_zone),             (SELECT geom FROM line)              )) AS iz_path_intersection_points      The result is "MULTIPOINT(5 2,5 3,5 4,6 2,6 3,6 4)" ![wrong intersection order](http://i.stack.imgur.com/3ZPgK.png) but I want to get "MULTIPOINT(5 2,6 2,6 3,5 3,5 4,6 4)" ![correct intersection order](http://i.stack.imgur.com/V1I9w.png) **How can I achieve this?** I have two ideas for now that am not sure how to implement with PostGIS:   1. Use intersection function that will preserve the order from a geometry   2. Use intersection function that will preserve M attribute of the point (I have saved there the time) Not sure if both are achievable. Any other ideas are welcome. Thanks in advance!


How to identify and simplify point clusters with regard to time in PostGIS?

I just started to work with spatial databases and I want to write a SQL(PostGIS) query for automatic generalizing of raw GPS-tracks (with fixed tracking frequency). The first thing I am wokring on is a query which identifies points of standstill in form of query like "x points within a distance of y meters" to replace massive point clouds by representative points. I already realized to snap points within a certain distance and count the snapped ones. In the picture below one can see a raw example track (small black points) and the centers of snapped points as colored circles (size = number of snapped points). ![enter image description here](http://i.stack.imgur.com/f3kzh.jpg)               CREATE table simplified AS       SELECT count(raw.geom)::integer AS count, st_centroid(st_collect(raw.geom)) AS center        FROM raw       GROUP BY st_snaptogrid(raw.geom, 500, 0.5)       ORDER BY count(raw.geom) DESC;      I would be as quite satisfied with this solution, but there is the time- problem: Imaging the track as a full-day-track in a city the person can return to places already visited before. In my example, the dark-blue circle represents the person's home which he visited twice but my query of course ignores that. In this case, the sophisticated query should only collect points with contiguous timestamps (or id's), so that it would produce two representive points here. My first idea was a modification of my query to a 3d-version (time as third dimension), but it does not seem to work. Does anybody have any advice for me? I hope that my question is clear. * * * Thank you for the line-idea. I realized to make and simplify a linestring as you can see in the screenshot below (dots are original points). ![enter image description here](http://i.stack.imgur.com/f3kzh.jpg) What I still need is to determine the places of rest (> x points in < x meters radius), ideally as one point with an arrival time and a leaving time... any other ideas?


An error in raster calculator in Arcgis

I wrote and ran this formula in raster calculator in ARCGIS. But the following error gets me into trouble. Does anyone have a suggestion to overcome this? Here is the formula I wrote and the error that appears. What is wrong with this formula? Thanks all. ![error while working in raster calculator](http://i.stack.imgur.com/NyalZ.jpg)


Why do converting GPS points to polygon using ArcObjects differ from manual converting?

I am working on a project where I have a .gpx file, convert it to a polygon and save it in a geodatabase. I wrote the code and it works fine. But when I rewrote the code in ArcMap using the gpx to feature tool, I get a different polygon with different area. Can you help me find the problem? Here I load GPX file and save its contents to a `List<IPoint>`                   public List<IPoint> loadXML(string xmlpath)         {                  List<string[]> points = new List<string[]>();                  var xmlDocument = XDocument.Load(xmlpath);                  XNamespace ns = xmlDocument.Root.GetDefaultNamespace();            var values = xmlDocument.Root                          .Descendants(ns + "trkpt")                          .Select(x => new                          {                              lat = (string)x.Attribute("lat"),                              lon = (string)x.Attribute("lon"),                              ele = (string)x.Element(ns + "ele")                               })                          .ToList();            List<IPoint> ipoint = new List<IPoint>();                  foreach (var val in values)             {                 string[] cordinates = { val.lat, val.lon, val.ele};                 points.Add(cordinates);                 IPoint apoint = new Point();                 apoint.X = Convert.ToDouble(val.lat);                 apoint.Y = Convert.ToDouble(val.lon);                 apoint.Z = Convert.ToDouble(val.ele);                 ipoint.Add(apoint);                                    }              return ipoint;                  }      then I make a polygon from points                 public IPolygon makePC(List<IPoint> pList)       {                  IGeometryBridge2 pGeoBrg = new GeometryEnvironment() as IGeometryBridge2;             IPointCollection4 pPointColl = new PolygonClass();             //TODO:             //pointCollection4.SpatialReference = 'Define the spatial reference of the new polygon.                       int numPoints = pList.Count;              WKSPoint[] aWKSPointBuffer = new WKSPoint[numPoints];             for(int i =0; i < pList.Count; i++)             {             WKSPoint A = new WKSPoint();             A.X = pList[i].X;             A.Y = pList[i].Y;             aWKSPointBuffer[i] = A;             }             pGeoBrg.SetWKSPoints(pPointColl, ref aWKSPointBuffer);             IPolygon pPointColl2 = pPointColl as IPolygon;             pPointColl2.SpatialReference = spatialrefrence;             return pPointColl2;              }      finally I save polygon to geodatabase               public void ManipluteFeature(bool isNew,int ObjID,IFeatureClass featureClass, IPolygon polygon, string gpsID, string energy, int harv, string pool, string irrigation, string Water, string variety,                 int trees, string corp_type, string utilizat, int prop_ID, int number, string address, long pool_cap, string discript, long water_hour, int owner_ID, string w_source, long w_inche)             {                 IFeature feature;                 if (isNew)                 {                     // Build the feature.                     feature = featureClass.CreateFeature();                 }                 else                 {                      feature = featureClass.GetFeature(ObjID);                      }                 //TODO here must edit polygon shape if you want to edit feature                  feature.Shape = polygon;                      // Apply the appropriate subtype to the feature.                 ISubtypes subtypes = (ISubtypes)featureClass;                 IRowSubtypes rowSubtypes = (IRowSubtypes)feature;                 if (subtypes.HasSubtype)                 {                     // In this example, the value of 3 represents the polymer vinyl chloride (PVC) subtype.                     rowSubtypes.SubtypeCode = 3;                 }                      // Initialize any default values the feature has.                 rowSubtypes.InitDefaultValues();                      // Update the value on a string field that indicates who installed the feature.                 int GPSIdFieldIndex = featureClass.FindField("GPSId");                 feature.set_Value(GPSIdFieldIndex, gpsID);                      int EnergyFieldIndex = featureClass.FindField("Energy");                 feature.set_Value(EnergyFieldIndex, energy);                      int harvestFieldIndex = featureClass.FindField("harvest");                 feature.set_Value(harvestFieldIndex, harv);                      int PoolFieldIndex = featureClass.FindField("Pool");                 feature.set_Value(PoolFieldIndex, pool);                      int irrigationFieldIndex = featureClass.FindField("irrigation");                 feature.set_Value(irrigationFieldIndex, irrigation);                      int WaterFieldIndex = featureClass.FindField("Water");                 feature.set_Value(WaterFieldIndex, Water);                      int varietyFieldIndex = featureClass.FindField("variety");                 feature.set_Value(varietyFieldIndex, variety);                      int treesFieldIndex = featureClass.FindField("trees");                 feature.set_Value(treesFieldIndex, trees);                      int corp_typeFieldIndex = featureClass.FindField("corp_type");                 feature.set_Value(corp_typeFieldIndex, corp_type);                      int utilizatFieldIndex = featureClass.FindField("utilizat");                 feature.set_Value(utilizatFieldIndex, utilizat);                      int prop_IDFieldIndex = featureClass.FindField("prop_ID");                 feature.set_Value(prop_IDFieldIndex, prop_ID);                      int numberFieldIndex = featureClass.FindField("number");                 feature.set_Value(numberFieldIndex, number);                      int addressFieldIndex = featureClass.FindField("address");                 feature.set_Value(addressFieldIndex, address);                      int pool_capFieldIndex = featureClass.FindField("pool_cap");                 feature.set_Value(pool_capFieldIndex,pool_cap );                      int discriptFieldIndex = featureClass.FindField("discript");                 feature.set_Value(discriptFieldIndex, discript);                      int water_hourFieldIndex = featureClass.FindField("water_hour");                 feature.set_Value(water_hourFieldIndex, water_hour);                      int owner_IDFieldIndex = featureClass.FindField("owner_ID");                 feature.set_Value(owner_IDFieldIndex, owner_ID);                      int w_sourceFieldIndex = featureClass.FindField("w_source");                 feature.set_Value(w_sourceFieldIndex, w_source);                      int w_incheFieldIndex = featureClass.FindField("w_inche");                 feature.set_Value(w_incheFieldIndex, w_inche);                      IArea area = polygon as IArea;                 int areaFieldIndex = featureClass.FindField("Area");                 feature.set_Value(areaFieldIndex, area.Area.ToString());                      // Commit the new feature to the geodatabase.                 feature.Store();             }      I think problem is with spatial reference. So I set polygon's spatial reference to the geodatabase spatial reference but it did not work. **Edited:**I have found a new solution into converting them to a shapefile..and It works fine.I used bellow code               enter code hereESRI.ArcGIS.ConversionTools.GPXtoFeatures gpx = new ESRI.ArcGIS.ConversionTools.GPXtoFeatures(xmlpath, path + "points.shp");             GP.Execute(gpx, null);                  ESRI.ArcGIS.DataManagementTools.PointsToLine ptl = new ESRI.ArcGIS.DataManagementTools.PointsToLine(path + "points.shp", path + "lines.shp");             GP.Execute(ptl, null);                  ESRI.ArcGIS.DataManagementTools.FeatureToPolygon ftp = new ESRI.ArcGIS.DataManagementTools.FeatureToPolygon(path + "lines.shp", path + "polygons.shp");             GP.Execute(ftp, null);             shapefile = GetFeatureClassFromShapefileOnDisk(path, "polygons.shp");      But now my problem Is it create two features sometimes..So I must join all features in a feature class to get a single feature.What is the best approach to do it? Can I add a new field to featureclass and give it same value and desolve it? If I want to do this how I get all features in a feature class?


How to get percentage coverage of raster values in an overlapping polygon?

I have an NDVI image in ArcGIS 10.1 which is from -1 to 1. I have reclassified that image in 0 (range all negative value - non-green) and 1 (all positive value - green). I have overlayed a 'fishnet' (rectangular grid) of 3 x 3 on image of 5 m resolution. In this case there are green and non green (1 and 0 values) in one fishnet cell. I want to calculate the percentage coverage of the 'green' pixels within each cell of the fishnet grid (("AREA GREEN" / "AREA of CELL") * 100).


How to get WorkspaceCategory for a given path

I need to determine the WorkspaceCategory string (IGxDialog.FinalLocation.WorkspaceCategory) for a given path. I need this to create appropriate WorkspaceFactory and finally be able to create multiple feature classes / shapefiles in a given location. Right now I'm using IGxDialog with GxFilterContainers to select final location, but when I select a file geodatabase, the pGxDialog.FinalLocation.WorkspaceCategory returns "Folder" (the parent folder of the selected container), not the category of the selected container.                Dim pGxDialog As IGxDialog = New GxDialog         Dim pFilterCol As IGxObjectFilterCollection         Dim pGxFilter As IGxObjectFilter         Dim pEnumGx As IEnumGxObject         pGxDialog.AllowMultiSelect = False         pFilterCol = pGxDialog         pGxFilter = New ESRI.ArcGIS.Catalog.GxFilterContainers         pFilterCol.AddFilter(pGxFilter, True)              If (pGxDialog.DoModalOpen(0, pEnumGx) = True) Then             sOutputPath = pGxDialog.FinalLocation.FullName             sOutputName = pEnumGx.Next.Name             workspaceCat = pGxDialog.FinalLocation.Category         End If      So, the questions are:   * how can I get the WorkspaceCategory string for a given path?   * are there any other ways of creating appropriate WorkspaceFactory for a given location (e.g. if my output location is a folder, I would need to create ShapefileWorkspaceFactory, if the output location is a file geodatabase, I would need a FileGDBWorkspaceFactory etc.). Any help would be really appreciated.