Change Detection ArcGIS with multiple dates

I'll explain my aim first: I am trying to create a single raster to represent vegetation resilience, I am doing this via change detection. So far I have created 5 Change detection images, where 2000 is a reference image. I have done nothing to these except to display them with the classify tool with 1 st dev. My problem is what is the best way to combine these images to demonstrate resilience. I'm assuming it's just a raster calculation.


What software to use for political analysis?

Years ago, in the 1990s, I used MapInfo to do political analysis, voting histories and trends and the like. My knowledge is two decades old at this point, though. What are the tools I should be using today? What I need to do is to find out how particular districts voted in the past, taking redistricting into account. Which means that I need to get old precinct data, allocate the vote to census blocks, and then reassemble the results by figuring out which new districts the blocks belong to. This will require direct database access, SQL queries, and the ability to draw boundaries and lasso the blocks within a polygon. (I am a software developer, and can write code, but I'm on a short timeline and would prefer to avoid a big learning curve.) Does Google Maps have the ability to do this? Is there something online I can use? Or do I have to spend a lot of money and buy something?


Why don't they use cell towers like GPS satellites?

If my understanding is correct, a GPS satellite produces a pretty simple signal which is basically composed of its location and its time. Given 4 of these signals, then one can uniquely solve for the X,Y,Z position (and as a by product, time) of the hand-held GPS unit. **Question:** Why don't we use use cell towers like we use GPS satellites? It's much more easy to tell the position of a cell tower than a satellite (they don't move). And they can be given atomic clocks just like GPS satellites are given. Then we would have more redundancy, more availability, and more accuracy in determining location. Note: I know that the E911 service uses cell tower to triangulate the position of cell phones, but this technology is based upon measuring the signal strength of the tower and is therefore nowhere nearly as accurate as GPS.


GWT-Openlayers WMS layer problem

I use GWT-Openlayers and i want to add a WMS layer to my Map. Here is the code:                   ...         MapOptions defaultMapOptions = new MapOptions();         defaultMapOptions.setNumZoomLevels(7);              //Create a MapWidget         MapWidget mapWidget = new MapWidget("700px", "700px", defaultMapOptions);              GoogleV3Options gSatelliteOptions = new GoogleV3Options();         gSatelliteOptions.setIsBaseLayer(true);         gSatelliteOptions.setType(GoogleV3MapType.G_SATELLITE_MAP);         GoogleV3 gSatellite = new GoogleV3("Google Satellite", gSatelliteOptions);              mapWidget.getMap().addLayer(gSatellite);              //Create a WMS layer as base layer         WMSParams wmsParams = new WMSParams();         wmsParams.setFormat("image/png");         wmsParams.setLayers("topp:tasmania_state_boundaries");         wmsParams.setStyles("");         wmsParams.setParameter("transparent", "true");              //create a WMS layer         WMSOptions wmsLayerParams = new WMSOptions();         wmsLayerParams.setUntiled();         wmsLayerParams.setTransitionEffect(TransitionEffect.RESIZE);         wmsLayerParams.setIsBaseLayer(false);              String wmsUrl = "http://demo.opengeo.org/geoserver/wms";              final WMS wmsLayer = new WMS("Basic WMS", wmsUrl, wmsParams,                                      wmsLayerParams);              //Add the WMS to the map         Map map = mapWidget.getMap();         map.addLayer(wmsLayer);              //Lets add some default controls to the map         map.addControl(new LayerSwitcher()); //+ sign in the upperright corner to display the layer switcher         map.addControl(new OverviewMap()); //+ sign in the lowerright to display the overviewmap         map.addControl(new ScaleLine()); //Display the scaleline         map.addControl(new MousePosition());               //Center and zoom to a location         LonLat lonLat = new LonLat(146.7, -41.8);         lonLat.transform(new Projection(ProjectionCode.LONGLAT.getEpsgCode()).getProjectionCode(),                 map.getProjection()); //transform lonlat to OSM coordinate system         map.setCenter(lonLat, 6);         ...      I used the example codes i found on this site: http://demo.gwt- openlayers.org/gwt_ol_showcase/GwtOpenLayersShowcase.html Anyone can try out because the wmsUrl points to the demo site. The problem is that the WMS layer only appears when i zoom out to the outermost zoom level. Than if i try to zoom in, it disappears again. Any idea?


How does GeoMedia know what feature classes are in a database?

I've got a set of tables that have been migrated over from one GeoMedia database (Oracle) to another (Oracle); in different schema's of course. I can't see the relevant Feature Classes when I look at the destination database (I can only see the pre-existing ones). How does GeoMedia know which Feature Classes are available in the database? Can I just add the relevant Feature Classes to some fixed table name or is it more involved than that?


Access Personal geodatabase using java

Following example through ESRI is to access the features of file geodatabase (GDB) , http://resources.arcgis.com/en/help/arcobjects- java/concepts/engine/index.html#/Access_file_geodatabase/00010000061v000000/ i would like to know that is there a similar way to do this with personal geodatabase (MDB) using java . I am quite new to arcObjects so if anybody could point me to right direction. Thanks in advance///


mod_tile to armhf architecture

I've a machine that has armhf architecure and I need to install a tile server. The machine can't be connected to the internet. For development purpose I installed mod_tile on my other pc (i386 architecture) (following that guide http://switch2osm.org/serving-tiles/building-a-tile-server-from-packages/). I just figured out that the packages avalable on the repo (manually downloaded) are not compatible with the target machine. My question is: There's a tile server easily installable on armhf machine? Or there's an automatic system to chache tiles generated on my other pc? Eventually I could create a little server that provides those tiles (I've to chache a small area).


Can I automate using different reference grids in a data driven map

I am trying to create a data driven layout that includes an overview map, at 1:15000, and a number of inset maps, at 1:4000. I need to have two reference grids for the layout since the map scales are different and I'm trying to figure out if there is a way to switch between the two grids automatically. Right now I am manually switching between the reference grids and then manually cycling through the pages to print them out. Is this something that can be automated through the data driven pages UI or would I need to do some scripting?


How to perform a "vertical integration" using FME?

I am not a GIS person, but I need to understand an aspect of the project I'm working on. We are taking an ArcSDE layer, and importing it into FME. I now need to do some checking of the data. In ArcSDE I did topological checks to find if the layers were "vertically coherent". How would I do this in FME?   * Vertical coherence: to me vertical coherence is that the boundaries of one polygon is within a certain tolerance level of another in a different layer that "overlaps". The boundary lines are the same.


Is there geocoding "undo" button in CartoDB?

Here's the map in question: https://mwhite.cartodb.com/tables/where_good_neighbors_work Our map had been working beautifully for several months, but when updates were attempted recently, all of our locations were somehow changed to the same longitude/latitude point. Basically, I want to know if we need to go in and fix all of them by hand (I cannot get geocoding to work anymore using any of my table's location criteria, though it worked fine before. I strongly suspect using geocoding might have caused this problem in the first place, but I can't say for sure as I was not the one who used it this time). Anyway. If there is some way of automating the long/lat fix, or possibly using a proverbial “back button” to restore the geodata we had before, I would like to try those options before going through the labor-intensive process of correcting them all by hand.


Python/GDAL get unique values in discrete-valued raster

I would like to get some advice on the most efficient way to return a list of unique values of a discrete-valued raster using Python and GDAL. I had thought that the most obvious way would be to examine the raster's attribute table, but if I do `band.GetDefaultRAT()` on the band of a raster dataset that contains an attribute table (the table is visible in ArcCatalog, anyway), the result is always `None`:               >>> rat = band.GetDefaultRAT()     >>> rat == None     True      In that case, I end up having to scan through each cell of the raster and build a list of unique values manually. Is this the only way to do it? Or is there a way to build an attribute table with Python and GDAL, then query it for a list of unique values?


Is it possible to get full path for broken data source to repair broken data link?

This question links back to an old question of mine: Convert shapefiles in nested folder to geodatabase I am attempting to find a **permanent** solution to fixing the broken maps, and in such a way that they can easily be fixed if the maps documents get broken again. As stated previously, I have hundreds of map documents all with broken data sources. It is not feasible to use findAndReplaceWorkspacePaths because the data is in a multitude of nested folders, not kept in one folder or geodatabase. To complicate things further, many of the shapefiles used have the same name, but are located in a different folders. arcpy.mapping.ListBrokenDataSources returns a list of the names of the layers that have a broken data source in the map document, but only the name. Within the map document, if I click on the Source tab of the Layer Properties it shows the 'location' of where the data should be. I have a copy of all the GIS data from the old computer, so ideally I would be able to do something like OldDataSource.replace ('n:/', 'c:/users/athom/oldGIScomputer/') Is it possible to use python to get the full 'location' + 'name' of the data in a broken data source? Does anyone have any suggestions?


How to save a 3-D map without it becoming distorted

I'm currently working on creating a 3-D map of a watershed. Within ArcScene I've used an elevation raster as the base map and included the streams within a watershed. When I originally create the map, it looks terrific, just the way I want it. I then save the work into a properly connected folder. Here's where the problem starts, when I attempt to reopen the document, ArcScene opens properly but the map is displayed in a very distorted manner; unrecognizable as a 3-D map of the watershed. Has anyone had any similar experiences and found a solution? I've checked the coordinate systems of the raster and streams along with the scene layer properties and everything matches up. The computer I'm using is not much to speak of; essentially standard college library equipment. I'm wondering if the computer I'm using just doesn't have the power to regenerate the 3-D image. Any help or information would be greatly appreciated.


Creating a fly through video of a 3-D map

I'm currently working on creating a 3-D map in ArcScene of a watershed proximal to my college campus. I've had trouble saving the work (outlined in a previously posted question) but am capable of creating the map relatively quickly now, just not able to save it. My ultimate goal is to create a video of the map as it is flown through. I'm wondering: does anyone know of a reputable program to download that can create a video of what ever is on the computer screen? I've attampted to download some software of such nature from the internet only to have an anti-virus program on the computer I'm using throw a royal fit and prohibit such action. (College owned computer). I realize this is not a GIS specific question but feel that someone may have worked on a similar project and used a similar piece of peripheral software with some sucess. Any information, assistance or guidance is greatly appreciated.


ArcGIS data capacity

For any ArcGIS users, how large of a dataset (in terms of number of records) can ArcGIS comfortably render on the screen at once? For example, if I have an excel spreadsheet with 15k records, will ArcGIS Desktop be able to easily render 15k items with maps underneath (I don't have Arc, which is why I'm asking) without freezing up or getting too choppy? If yes, has anyone really hit a capacity where they've had problems with the data rendering? thanks, Jeff


How to hide popup template in arcgis javascript api

I am creating a Custom Popup template as follows:               countyPop = new PopupTemplate({                 title: "County: {NAME}",                 fieldInfos: [{                      fieldName: "POP2000",                     label: "2000 Pop",                     visible: true                 }, {                     fieldName: "POP2010",                     label: "2010 Pop",                     visible: true                 }]             });      This popup works fine and is firing when I click the layer. However, I have some javascript to switch out the layers and when I hide this layer and show a different shape layer the popup still hangs around. How can I stop displaying this popup when I switch to a different layer? I tried               countyPop.hide();       It states there is a hide method in infoWindow but that does nothing. No error is produced and the popup is still there. Any help would be appreciated.


Rendering and Labeling Shapefile with PyQGIS

I've been running into a few problems working with the QGIS API for python. I've gotten more comfortable working in the python console in QGIS but I run into problems when I try to run the code outside of QGIS. Basically I want to take a shapefile, label it based on the specified attribute name, and render an image. The code works in QGIS, but does not work outside of of QGIS. So where is my problem coming from?               import sys     import qgis     import PyQt4          from qgis.core import *     from qgis.utils import *     from qgis.gui import *               from PyQt4.QtCore import *     from PyQt4.QtGui import *          #initialize QGIS     QgsApplication.setPrefixPath( r"C:\OSGeo4W64\apps\qgis", True )          QgsApplication.initQgis()          #Add layer to instance     file = QgsVectorLayer("Good Shape File", "BMAS", "ogr")     QgsMapLayerRegistry.instance().addMapLayer(file)               #Adjust layer Settings     #Code sample from http://gis.stackexchange.com/questions/77870/how-to-label-vector-features-programmatically     palyr = QgsPalLayerSettings()      palyr.enabled = True      palyr.fieldName = 'Attribute'      palyr.placement= QgsPalLayerSettings.OverPoint      palyr.setDataDefinedProperty(QgsPalLayerSettings.Size,True,True,'8','')      palyr.writeToLayer(file)          if file.isValid():       print "File is valid."               mapRenderer = iface.mapCanvas().mapRenderer()          lst = [file.id()]     mapRenderer.setLayerSet(lst)          mapRenderer.setLayerSet( lst )     c = QgsComposition(mapRenderer)     c.setPlotStyle(QgsComposition.Print)     x, y = 0, 0     w, h = c.paperWidth(), c.paperHeight()     composerMap = QgsComposerMap(c, x,y,w,h)     c.addItem(composerMap)     composerLabel = QgsComposerLabel(c)          composerLabel.adjustSizeToText()     c.addItem(composerLabel)     composerLabel.setItemPosition(20,10)     composerLabel.setItemPosition(20,10, 100, 30)          legend = QgsComposerLegend(c)     legend.model().setLayerSet(mapRenderer.layerSet())     c.addItem(legend)          #set image sizing     dpi = c.printResolution()     dpmm = dpi / 25.4     width = int(dpmm * c.paperWidth())     height = int(dpmm * c.paperHeight())     img = QImage(QSize(width, height), QImage.Format_ARGB32)     img.setDotsPerMeterX(dpmm * 1000)     img.setDotsPerMeterY(dpmm * 1000)     img.fill(0)     imagePainter = QPainter(img)     sourceArea = QRectF(0, 0, c.paperWidth(), c.paperHeight())     targetArea = QRectF(0, 0, width, height)          #renders image     c.render(imagePainter, targetArea, sourceArea)     imagePainter.end()     img.save("E:/QGisTestImages/out.png", "png")      I'm able to do the simple rendering example in the python cookbook, so I think my paths are set up correctly. "Good Shape File" should be replaced with a good path location if you want to run this. And palyr.fieldName = 'Attribute' should be set to a valid field name for that shapefile. Edit: I have gotten rid of iface and inserted code for the extent between the mapRenderer initialization and the lst declaration.               mapRenderer = QgsMapRenderer()          rect = file.extent()     mapRenderer.setExtent(rect)     mapRenderer.setLabelingEngine(QgsPalLabeling())     lst = [file.id()]      Edit: I added               app = QgsApplication([], True)      after               QgsApplication.initQgis()      and the code worked.


How to find the watershed for each outlet point and sum values within it?

I have the following files to work with:   1. Stream network of a basin;   2. Outlet points for each segment* of the network and    3. Points which represent water withdrawals along of the stream, which are not located in the stream, but near of segments. *segment = a line with a start point and an outlet point. My goal is to calculate the sum of withdrawals located upstream of each outlet points. My first attempt was using model builder, iterating over each outlet point. For each of them, I delineated the watershed and calculated the sum using Zonal Statistics (summing withdrawals contained by the watershed). But it didn't work well because ArcGIS aren't calculating watershed properly. I do not know why... I'm wondering if I can figure out how to select directly upstream watersheds each iteration, assuming I've already obtained a feature containing the watersheds for each segment. NOTICE: I don't want to find the watershed for each segment. I want to find the watershed for each outlet point. That's more comprehensive. I really need a solution..=( .... I'm exhausted... Thanks.


Select by "Not-in" Location

I have a point layer of students, and a polygon layer of district boundaries. How can I select those students who are not in the district boundaries, a Select By "Not-in" Location, so to speak. Thanks for help provided. -chris


ArcGIS - How to export only map borders to a transparent .png file?

Is there any easy way of doing it?


Is good database design less important for a spatial database

I have a strong feeling that database design and normalisation often comes in second hand when dealing with spatial data.   With software costing a fortune and databases with over 100 fields tables I have to ask:   Is there good reasons for taking other considerations than normalisation when designing a spatial database? I guess people will ask for examples, but that I can not give here, so my question is maybe more aimed for those who means that 100 fields is no problem and easier to maintain than a proper normalized design. What is the arguments? **Edit:** Ok, I have got two answers pointing in the same direction as my own belief. But why is that often not followed? I will give some of my own thoughts that maybe someone can deny or verify. Is it the software that forces people to work in a special way? Or is it just that the software hides the database behind the desktop GIS? One theory is that in education and organizations there is that the database part is kept away from GIS part. That there is different people running tools on geometries from the people knowing the database. Can that be the case? if so: Is it a lack in the education of GIS-professionals to get to understand the relational database concept? Regards Nicklas


How to sort by multiple fields at the same time?

Is it possible to sort multiple fields at the same time in QGIS? For example, I'd like to sort a table by state name, and then within each state, sort by county name. This would be the same as the Advanced Sort option available in Arcmap. Thanks!


Is there a free tool for configuring WMS configuration xml?

Instead of writing WMS xml file from scratch with notepad , is there a tool that is easy to create/configure such a file (or convert a GIS workspace - MapInfo / QGIS into WMS file) ?


Read an ArcGIS Feature dataset using GDAL

I am new to GDAL in Python and would like to use it to create a list of populated layers in a ArcGIS mdb Feature datasets. I have the code below that provides a list of all the populated layers but it returns a list for all the datasets in the database. The database has Feature datasets for municipal water systems, sewer systems, transportation systems, etc. How can I return only the layer counts for one of these Feature datasets and all of its layers; i.e Feaure dataset = water_systems and returns layers of Water_lines, Fire_Hydrants, Water_Valves, etc.? Thanks in advance.               import osgeo.ogr as ogr     driver = ogr.GetDriverByName('PGeo')     ds = driver.Open(database)     numLayers = ds.GetLayerCount()     for layerNum in range(numLayers):         layer = ds.GetLayer(layerNum)         if layer.GetFeatureCount() > 0:             print '%s features: %s' % (layer.GetName(), layer.GetFeatureCount())      [Edit: Additional Info] When running OGRINFO -al on the data base I get a lot of information but was able to pull out the following:               OGRFeature(GDB_Items):70         ObjectID (Integer) = 70         UUID (String) = DB50B2B0-9DC6-4492-9CAD-4162580231B6         Type (String) = 70737809-852C-4A03-9E22-2CECEA5B9BFA         Name (String) = WaterV         PhysicalName (String) = WATERV         Path (String) = \Water_Sys\WaterV         DatasetSubtype1 (Integer) = 1         DatasetInfo1 (String) = SHAPE         ...      Further down the massive list was:               OGRFeature(GDB_Items):827         ObjectID (Integer) = 827         UUID (String) = 22CAD8B9-DBBE-44A6-9D8C-86896CC23B72         Type (String) = 70737809-852C-4A03-9E22-2CECEA5B9BFA         Name (String) = Signal_3         PhysicalName (String) = SIGNAL_3         Path (String) = \Trans\Signal_3         DatasetSubtype1 (Integer) = 1         DatasetInfo1 (String) = Shape         ...      Note the Path parameter contains the ArcGIS Feature Dataset Name!!! How can I read this using GDAL in Python?


How to import Osmosis DB schemas into PostGIS DB

I'm trying to import `Osmosis` schema into into a `PostGIS` DB. I followed this article. I created a DB:               createdb osm_schema      Then I executed the following command:               osmosis --write-pgsql host="localhost" database="osm_schema" pgsimple_schema_0.6.sql       `pgsimple_schema_0.6.sql` is the basic schema I found in `Osmosis` tarball inside Script directory. The command above fails to execute. I got the following error: > Nov 16, 2012 6:51:39 PM org.openstreetmap.osmosis.core.Osmosis run INFO: > Osmosis Version 0.40.1 Nov 16, 2012 6:51:41 PM > org.openstreetmap.osmosis.core.Osmosis run INFO: Preparing pipeline. Nov 16, > 2012 6:51:41 PM org.openstreetmap.osmosis.core.Osmosis main SEVERE: > Execution aborted. org.openstreetmap.osmosis.core.OsmosisRuntimeException: > No default pipes are available as input for task 1-write-pgsql. at > org.openstreetmap.osmosis.core.pipeline.common.PipeTasks.retrieveTask(PipeTasks.java:150) > at > org.openstreetmap.osmosis.core.pipeline.common.TaskManager.getInputTask(TaskManager.java:165) > at > org.openstreetmap.osmosis.core.pipeline.v0_6.SinkManager.connect(SinkManager.java:50) > at > org.openstreetmap.osmosis.core.pipeline.common.Pipeline.connectTasks(Pipeline.java:74) > at > org.openstreetmap.osmosis.core.pipeline.common.Pipeline.prepare(Pipeline.java:116) > at org.openstreetmap.osmosis.core.Osmosis.run(Osmosis.java:86) at > org.openstreetmap.osmosis.core.Osmosis.main(Osmosis.java:37) at > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:601) at > org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:328) > at > org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238) > at > org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:408) > at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:351) > at org.codehaus.classworlds.Launcher.main(Launcher.java:31) What am I doing wrong?


How does an underscore change leaflet layer behavior?

I'm not sure how the underscore affect leaflet layers. I've seen it used to bind a popup to a sidebar click. How does "map._layers" work? I can't find anything in the documentation about using an underscore to select a layer differently.               geojson.eachLayer(function (layer) {                 var id = layer._leaflet_id;                 var name = layer.feature.properties.NAME;                 var coords = layer.feature.geometry.coordinates;                 var lng = layer.feature.geometry.coordinates[0];                 var lat = layer.feature.geometry.coordinates[1];                      // Populate features array and build autocomplete                 features.push({id: id, label: name, value: name, lat: lat, lng: lng});                 $( "#search" ).autocomplete({                     source: features,                     minLength: 3,                     select: function( event, ui ) {                         map.setView([ui.item.lat, ui.item.lng], 18);                         map._layers[ui.item.id].openPopup();                     }                 });                 // Populate sidebar table with clickable feature links                 $("#featurelist table").append('
'+name+'
');                 // Add features to zoom dropdown                 options += '<option value="' + lng + "," + lat + '", id="' + id + '">' + name + '</option>';             });


How to get Python script tool to take list of variables?

I am looking at making a Python script script tool that requires the user to input a series of attributes into a list, which is then used to build a query, to select multiple polygons (i.e. "abc, 123"; "def, 456"). I understand how to script this, but how do I get the script tool to take the arguments?


When do GeoJSON feature collections need feature ids?

I've seen feature collections with feature ids for each feature. I've seen others with no featureid. When do you need it?


How do I make text show up on top of Markers using Carto in TileMill

I'm attempting to place intersection markers on a trail map. Each intersection has a number. I can't seem to get the text show up above the marker. If I use the opacity, I can see the text is underneath. Is there an option I'm missing? Here's the output: ![enter image description here](http://i.stack.imgur.com/iIgq2.png) And here's the Carto:               #intersections {       text-name: "[Name]";       text-placement: point;       text-fill: black;       text-face-name: @labels;       text-size: 12;       marker-width:10;       marker-fill:#fff;       marker-line-color:#333;       marker-allow-overlap: true;       marker-placement: point;       marker-opacity: 0.75;     }


How can I show both Base and Overlay layers in Layer Panel in GeoExt 2?

I have layer panel I load from Postgres using ajax call. This is the Store:               Ext.define('GIS.store.Layers', {         extend: 'Ext.data.TreeStore',         autoLoad: false,         model : 'GIS.model.Layers',         proxy: {             type: 'ajax',                     url: 'resources/service.asmx/GetLayers',             reader: {                 type: 'json'                         }         }     });      This is the Model:               Ext.define('GIS.model.Layers', {         extend: 'Ext.data.Model',         fields: [                         { name: 'text', type: 'string' },                         { name: 'id', type: 'string' },                         { name: 'leaf', type: 'boolean' },                         { name: 'expanded', type: 'boolean', defaultValue: false },                         { name: 'checked', type: 'boolean', defaultValue: false }                 ]     });      This is the View:               Ext.define('GIS.view.Layers', {         extend: 'GeoExt.tree.Panel',         border: true,         region: 'center',         width: 200,         split: true,         iconCls: '',         title: '',         autoScroll: true,         rootVisible: false,         lines: true,         useArrows: true,         initComponent: function () {             this.store = Ext.create('GIS.store.Layers', {                 storeId: 'myStore'             });             var oncheckchange = function (node, checked, options) {                 node.cascadeBy(                         function (n) {                             n.set('checked', checked);                             if (n.data.leaf)                                 map.getLayersByName(n.data.text)[0].setVisibility(checked);                         });             };                  this.on('checkchange', oncheckchange, null);             this.callParent(arguments);         }     });      From postgres currently I bring only the overlayeas which their parents and my layer tree has only checkboxes. How can I add Base layers to the layer tree with checkboxes ?


How to create a hyperlink in one point?

I started to use Quantum GIS 2.0.1 Dufour and I'm still trying to understand how to work with it. I have a shape layer in QGIS made of points, and I want to attach a different hyperlink to each of the points. Is that possible? For now, I have only accomplished attaching several hyperlinks, but to the entire shape layer.


Geoserver - Disallowing unauthenticated user from using getLegendGraphic Service

I created a geoserver rule as `ADMIN and *.*` for allowing an authenticated admin to see all services and functions. Why does Geoserver allow Geoexplorer to retrieve the legend images for saved maps even if I haven't authenticated yet? Is this not how service rules work? Is this a bug? I was looking through the Geoserver JIRA and could not find any mention of this. My current authentication chain does not allow for anonymous authentication. I'm using Geoserver 2.5.1 as a WAR with Tomcat7. Simple request params `http://domain.com/geoserver/wms?request=GetLegendGraphic&width=20&height=20&layer=layer&transparent=true&format=image%2Fpng&legend_options=fontAntiAliasing%3Atrue%3BfontSize%3A11%3BfontName%3AArial&SCALE=2179976.903424944`


How to determine elevation drop along a stream with ArcGIS?

I need to calculate(estimate) hydraulic head(elevation drop) along a single river stream in order to find potential site for small hydropower plant. I have a DEM with 20m resolution and raster and vector format of the stream. Can anybody help me how can I do that with ArcGIS tools or in some other way? Thanks in advance. Subija.


Interpolate undulations for given points using a geoid model

I have two databases, the first one (F.tsj) contains gps points: coordinates and ellipsoid heights and the second one is simply a geoid model where every line stores latitude, longitude, and undulation. My simple program retrieves four adjacent points from the geoid grid database for every point stored in the first databse. Both databases store coordinates in decimal degrees.   Here's my code to build geoid file database from csv file:                 import csv,sqlite3     '''this script inserts data stored in csv file into sqlite database'''          coordinates= csv.reader(open("geoid.csv"))          database = sqlite3.connect("geoid.db")     cursor = database.cursor()     database.execute("create table coords(name, lat INTEGER, lon INTEGER, und INTEGER);")     database.executemany("insert into coords(name,lat,lon,und) values (?, ?, ?, ?)",coordinates)     database.commit()     database.close()         Here's example input csv file, that contains ID,Latitude,Longitude,Undulation:   000001,54.9666669,18.7,28.442   000002,54.9166669,18.6833331,28.512   000003,54.9,18.6833331,28.523   000004,54.8833331,18.6666669,28.572   000005,54.8666669,18.6666669,28.585   000006,54.85,18.6666669,28.6   000007,54.8333331,18.0666669,29.891   000008,54.8333331,18.0833331,29.855   000009,54.8333331,18.1833331,29.637   000010,54.8333331,18.25,29.488   000011,54.8333331,18.2666669,29.45   000012,54.8333331,18.2833331,29.413   000013,54.8333331,18.3,29.376   This is numeric geoid model stored in ASCII csv file.   Now I would like to find four adjacent points for our example point:               import sqlite3     #find four adjacent points     def find_adjacent_coords(db, lat, lon, step=0.041667):         coords_range = lat-step, lat+step, lon-step, lon+step         return db.execute("""select lat, lon, und from coords where     lat > ? and lat < ? and     lon > ? and lon < ?""", coords_range).fetchall()     #connect database with gps points     database = sqlite3.connect('F.tsj')     cursor = database.cursor()     cursor.execute("select C1, C2, C3 from tblSoPoints")     #C1 is latitude     #C2 is longitude     #C3 is ellipsoid height     results = cursor.fetchall()     for line in results:         B = line[0]         L = line[1]         ellps_height = line[2]     #connect to geoid database         db = sqlite3.connect('geoid.db')         n = (find_adjacent_coords(db, a, b))         Example gps point:               54.4786674627, 17.0470721369, 86.5003132338      and adjacent points from geoid:               [(54.5, 17.041667, 31.993), (54.5, 17.083333, 31.911), (54.458333, 17.041667, 31.945), (54.458333, 17.083333, 31.866)]<br>      Then I would like to interpolate undulation for our point using these four adjacent points with known undulations to calculate orthometric height.   ## Edit Solution No 1                 from __future__ import division          def bilinear_interpolation(x, y, points):         points = sorted(points)               # order points by x, then by y         (x1, y1, q11), (_x1, y2, q12), (x2, _y1, q21), (_x2, _y2, q22) = points              if x1 != _x1 or x2 != _x2 or y1 != _y1 or y2 != _y2:             raise ValueError('points do not form a square')         if not x1 <= x <= x2 or not y1 <= y <= y2:             raise ValueError('(x, y) not within the square')              return (q11 * (x2 - x) * (y2 - y) +                 q21 * (x - x1) * (y2 - y) +                 q12 * (x2 - x) * (y - y1) +                 q22 * (x - x1) * (y - y1)                ) / (x2 - x1) * (y2 - y1)          n = [(54.5, 17.041667, 31.993),              (54.5, 17.083333, 31.911),              (54.458333, 17.041667, 31.945),              (54.458333, 17.083333, 31.866),     ]          B = 54.4786674627     L = 17.0470721369     print bilinear_interpolation(B, L, n)     import doctest     print doctest.testmod()         ...and here's the solution No 2:                 from __future__ import division     import doctest     def bilinear_interpolation(x, y, points):          # http://en.wikipedia.org/wiki/Bilinear_interpolation         points.sort()               # order by x, then by y         xs, ys, zs = zip(*points)     # verify it is a square         assert xs[0] == xs[1] and xs[2] == xs[3]         assert ys[0] == ys[2] and ys[1] == ys[3]         x1 = xs[0]         x2 = xs[2]         y1 = ys[0]         y2 = ys[1]     # verify interpolation versus extrapolation         assert x1 <= x <= x2, (x1, x, x2)         assert y1 <= y <= y2              q11, q12, q21, q22 = zs         return (q11 / ((x2 - x1) * (y2 - y1)) * (x2 - x) * (y2 - y) +                 q21 / ((x2 - x1) * (y2 - y1)) * (x - x1) * (y2 - y) +                 q12 / ((x2 - x1) * (y2 - y1)) * (x2 - x) * (y - y1) +                 q22 / ((x2 - x1) * (y2 - y1)) * (x - x1) * (y - y1)                )     B = 54.5     L = 17.061667          n = [(54.5, 17.041667, 31.993),          (54.5, 17.083333, 31.911),          (54.458333, 17.041667, 31.945),          (54.458333, 17.083333, 31.866),     ]     print doctest.testmod()          print bilinear_interpolation(B, L, n)         Credits for these solutions goes to: Raymond Hettinger


arcpy.MakeFeatureLayer in-memory layer still exists when subsequent step fails during testing

When I used arcgisscripting to create in-memory output layer with gp.makefeaturelayer, I would put it in a try/except block and delete the gp object in the except piece when the makefeaturelayer would fail. Now when I am using arcpy, it looks like I need to close the idle window and open again in order to get the in-memory output layer to get deleted. How could I have the output layer from my makefeaturelayer tool get deleted in a try/except block? Thanks.


SRTM elevation data question

I have a question concerning the SRTM elevation data (http://srtm.usgs.gov/). As a little thought experiment, assume I want to build a 3D model of the earth's surface as a point cloud. The earth's center is at position (0, 0, 0). For each latitude/longitude position for which elevation data is available, I want to find the Cartesian coordinates of the point on the earth's surface. It says on the SRTM website "Heights are in meters referenced to the WGS84/EGM96 geoid". I'm not 100% sure if I understand this correctly. From what I understand, the meters in the SRTM data are above sea level with respect to the EGM96 geoid. So for certain coordinates (latitude, longitude) I first need to find the Cartesian direction vector for these coordinates (let's call it **d** ). Then I need to find the sea level at these coordinates with respect to the EGM96 ellipsoid (let's call it s) and then the height above sea level for these coordinates from the SRTM data (let's call it h). Then the position of the surface point would be (h + s) * **d**. Is this correct or did I misunderstand something? If this is in fact correct, I have two more questions:   * How can I find the Cartesian direction vector from the latitude/longitude?   * How can I find the sea level with respect to the EGM96 geoid at a certain latitude/longitude coordinate?


How do I access layer attributes from within QGIS' manageR plugin?

This is probably a fairly basic question, but searches for manageR come up with a lot of noise, and there's no manageR tag. What I'd like to do is load the attributes from a particular field of a layer in QGIS into a vector in manageR (equivalent of `x <\- c(1,2,3,4)` if it was done manually). I can find a button to import layer attributes (when I press it, it shows `> manageR import function`), but I have no idea how to access them from within manageR thereafter. If it matters, the layer in QGIS is called `Aspalathus` and the field I'd like to access from R is called `mean`.


QGIS strongly offsetted symbols for categorized layers not visible on layer list (layer panel)

I am constructing a symbology for telecom analysis, which so far is mainly point and line features. So far it is working very well except that I have to offset the symbols to be able to avoid superposition and cluttering, and that also is OK except that the offset has to be of such a magnitude that the symbols are not longer visible on the layers panel. Since there are many symbols, it is very very important that the user of the map can see quickly the meaning of the symbols but since the spacing is fixed on this panel all that is visible in layer panel are the names of the categories and blanks where the symbol should be visible. Is it possible to modify (increase) the spacing between categories in the layers panel?? I am using QGIS 2.2 Thank you Yuliana


Can QGIS automatically load an SLD with a Shapefile?

I have SLD's/lyr files with my shp/gdb files. They all have the same name except for the extension. Is it possible for me to force qgis to load the sld with the shp so that I don't need to manually go to properties, load style and ok it? In arcmap I can just open the lyr instead of the .shp -is there a similar process for qgis?


Google Geocoder Lookup get postal code by country and city

I'm currently using Google Geocoder API to determine location data for my web service. It's important for me to get the postal code for a given country and city, but it's look like that Google is limiting the result. Here's the API call: http://maps.googleapis.com/maps/api/geocode/json?address=deutschland,+saarlouis&language=de&sensor=false The result is like that:               {        "results" : [           {              "address_components" : [                 {                    "long_name" : "Saarlouis",                    "short_name" : "Saarlouis",                    "types" : [ "locality", "political" ]                 },                 {                    "long_name" : "Landkreis Saarlouis",                    "short_name" : "Landkreis Saarlouis",                    "types" : [ "administrative_area_level_3", "political" ]                 },                 {                    "long_name" : "Saarland",                    "short_name" : "SL",                    "types" : [ "administrative_area_level_1", "political" ]                 },                 {                    "long_name" : "Deutschland",                    "short_name" : "DE",                    "types" : [ "country", "political" ]                 }              ],              "formatted_address" : "Saarlouis, Deutschland",              "geometry" : {                 "bounds" : {                    "northeast" : {                       "lat" : 49.36187570,                       "lng" : 6.815549499999999                    },                    "southwest" : {                       "lat" : 49.26046930,                       "lng" : 6.67501510                    }                 },                 "location" : {                    "lat" : 49.31346060,                    "lng" : 6.752286499999999                 },                 "location_type" : "APPROXIMATE",                 "viewport" : {                    "northeast" : {                       "lat" : 49.36187570,                       "lng" : 6.815549499999999                    },                    "southwest" : {                       "lat" : 49.26046930,                       "lng" : 6.67501510                    }                 }              },              "types" : [ "locality", "political" ]           }        ],        "status" : "OK"     }


Mobile offline mapping and editing of shapefiles

I've got a client that wants to create a mobile app that can view and edit shapefiles stored locally on the device to enable it to work offline. There is a possibility of converting the shapefiles to KML or other format if needed. It would need to work on Android, iOS and Blackberry so a HTML5/Phonegap solution is preferred. Does anyone have any recommendations?


POSTGIS SQL - How do I remove (defined) sliver polygons

I would like assistance in writing SQL (for POSTGIS in postgresql) to remove sliver polygons (including long narrow slivers and some small irregular polygons that were erroneous 'gaps' in the original dataset) from my dataset by merging with an adjacent polygon with the longest edge. I have a dataset (tablename: "Vegetation" containing several thousand polygons identified as either a sliver or a 'real' polygon in a description column (column name: "desc") as "sliver" or "main". [edit: Prior to importing my dataset into PostGIS I cleaned it up by importing into GRASS (which is also how I converted all the gaps into small polygons, which I subsequently merged with the main dataset. I found if I increased the snapping tolerance and minimum area past '1' in the GRASS import, I started loosing desired features.] My understanding is that I may need the following steps:   1. Identify the polygon (Vegetation.desc="main") adjacent to each sliver (Vegetation.desc="sliver") sharing the longest edge.   2. Identify the edge between each sliver and it's adjacent main polygon sharing the longest edge identified in Step 1. (Possibly using ST_Relate)   3. Remove the edge between each sliver and it's adjacent main polygon sharing the longest edge using the edge identifier returned in Step 2. (Possibly using ST_RemEdgeModFace) I have only a very basic understanding of SQL and the above process is beyond my ability. I would greatly appreciate any assistance in designing the above SQL Function. Thank you.


Using the jQuery UI Slider to control layer opacity in OpenLayers

> Added some bounty so more people take a look at my question. Thank you. I have been trying to utilize the jQuery UI Slider to control layer opacity in OpenLayers but I have an issue when trying to set the "value" option to anything other than the "max" value. What I would like to see is the setOpacity method change my layer's opacity to 20% onload. However, the slider is shown in the correct position but the layer displays the "max" value of opacity (100%/opaque). Currently, a slide event triggers a change in opacity. I need to force the opacity of my WMS layers to be that of the manually set "value" options when the page loads. Removed the any unnecessary code. One slider shown below. Your help is much appreciated!               <body onload="init()">       <script type="text/javascript">       $(document).ready(function(){       $(function() {           $( "#slider1" ).slider({           range: "min",           min: 0,           value: 20,           slide: function(e, ui) {               hii_1.setOpacity(ui.value / 100);               $( "#amount1" ).val( ui.value );               }           });           $("#amount1" ).val($( "#slider1" ).slider( "value" ) );       });       });       </script>     </body>


Can I take an intersection for polygons WITH A COMMON ID?

I have a thiessan polygons for a bunch of cell towers, and need to cut them when they extend more than 12 miles from a cell tower. What I was thinking of doing is taking a buffer from each point, and taking an intersection of each tower's thiessan polygon and its buffer, but I don't know how to take an intersection BY A UNIQUE ID (the tower name). Can anyone help? (I have ARCinfo 10, for what it's worth) Thanks! Nick


Adding a graphic line element to open mxd using python comtypes to access ArcObjects

I attended a pretty awesome demonstration from Jeffrey Barrette at the Esri UC a few weeks ago on creating dynamic tables in ArcMap. This functionality will greatly benefit the aviation department at my firm. I have got the scripting all taken care of for creating the dynamic tables in the Layout (using graphic and text elements). However, this works by cloning a horizontal line, vertical line, and two text elements. I have already got a working function to add a text element to a map layout via comtypes and ArcObjects, but I cannot seem to get the graphic line part correct. I am using some of the basic functions from a modified version of Snippets (from https://bitbucket.org/maphew/canvec/src/eaf2678de06f/Canvec/Scripts/parco.py). Here is my function for adding a horizontal line:               def add_horizontal_line():         GetDesktopModules()         import comtypes.gen.esriFramework as esriFramework         import comtypes.gen.esriArcMapUI as esriArcMapUI         import comtypes.gen.esriSystem as esriSystem         import comtypes.gen.esriGeometry as esriGeometry         import comtypes.gen.esriCarto as esriCarto         import comtypes.gen.esriDisplay as esriDisplay         import comtypes.gen.stdole as stdole              # set mxd         pApp = GetApp()  #current open mxd         pDoc = pApp.Document         pMxDoc = CType(pDoc, esriArcMapUI.IMxDocument)         pMap = pMxDoc.FocusMap         pAV = CType(pMap, esriCarto.IActiveView)         pSD = pAV.ScreenDisplay              # set coords for elment         pFact = CType(pApp, esriFramework.IObjectFactory)         pEnv = pAV.Extent         x = (pEnv.XMin + pEnv.XMax) / 2         y = (pEnv.YMin + pEnv.YMax) / 2              # from point         pUnk_pt1 = pFact.Create(CLSID(esriGeometry.Point))         pPt = CType(pUnk_pt1, esriGeometry.IPoint)         pPt.PutCoords(x, y)              # to point         pUnk_pt2 = pFact.Create(CLSID(esriGeometry.Point))         pPt2 = CType(pUnk_pt2, esriGeometry.IPoint)         pPt2.PutCoords(x + 500, y) # next point 500 units east to form straight line              # line (from point - to point)         pUnk_line = pFact.Create(CLSID(esriGeometry.Line))         pLg = CType(pUnk_line, esriGeometry.ILine2)         pLg.PutCoords(pPt, pPt2)              # preset color according to RGB values         pUnk_color = pFact.Create(CLSID(esriDisplay.RgbColor))         pColor = CType(pUnk_color, esriDisplay.IRgbColor)         pColor.Red, pColor.Green, pColor.Blue = (0,0,0) #black line              # set line properties         pUnk_line = pFact.Create(CLSID(esriDisplay.SimpleLineSymbol))         pLineSymbol = CType(pUnk_line, esriDisplay.ISimpleLineSymbol)         pLineSymbol.Color = pColor              # create the actual element         pUnk_elm = pFact.Create(CLSID(esriCarto.LineElement))         pLineElement = CType(pUnk_elm, esriCarto.ILineElement)         pLineElement.Symbol = pLineSymbol         pElement = CType(pLineElement, esriCarto.IElement)         pElement.Name = 'horizLine'         pElement.Geometry = pLg              # add to map         pGC = CType(pMap, esriCarto.IGraphicsContainer)         pGC.AddElement(pElement, 0)         pGCSel = CType(pMap, esriCarto.IGraphicsContainerSelect)         pGCSel.SelectElement(pElement)         iOpt = esriCarto.esriViewGraphics + \         esriCarto.esriViewGraphicSelection         pAV.PartialRefresh(iOpt, None, None)         return       I am getting an Error (parameter is incorrect) in this line:               pElement.Geometry = pLg      However, from the API reference it says the ILine2 interface PutCoords method can be used to set coordinates of the line using a FromPoint and ToPoint (IPoint objects). My understanding of ArcOjbects is not very strong, but it seemed from help docs that this would work. I even tried to explicitly set the pLg.FromPoint and ToPoint passing in the appropriate coordinates and that did not work either. Does anyone know what I'm doing wrong here?


interpolation methods in qgis

I have a points layer and I want to create an interpolation grid with QGIS 2.0. If I use `Raster -> Analysis -> Interpolation` the extent of the output raster is good (rectangular shape) but it doesn't reflect the original values of the points layer in input. The values of the raster are the result of interpolation calculations.   ![enter image description here](http://i.stack.imgur.com/ZMswA.png) If I use `Raster -> Interpolation` the output file reflects the original values of the input points layer, but its shape is not what I'm looking for. ![enter image description here](http://i.stack.imgur.com/losto.png) I don't see options to get the "original values" with the first method or to choose the extent of the area with the second one. So, how can I choose the shape-extent of the interpolated raster and, at the same time, be sure that it will reflects the values of the input layer?


Overview map openlayers

I am using openlayers to display 3 layers, a google base layer, and 2 layers that i call from Geoserver. The projection i am using is EPSG:3857. My problem is ...... My overview map location does not tally with the location on my main map. So for instance if i scroll on my main map to north Africa, my overview map shows Australia. The overview map moves when the main map moves but the location is completely different. I tried all sorts of code but i cannot solve the problem. Does anyone know how i can solve my problem? One of my codes is below....               map.addControl(         new OpenLayers.Control.OverviewMap({             autoPan:true,             maxExtent: new OpenLayers.Bounds(10264212.20144042, -1368478.0758595483, 17758023.6939145, 3318388.9003530084),             restrictExtent: new OpenLayers.Bounds(10264212.20144042, -1368478.0758595483, 17758023.6939145, 3318388.9003530084),             maxResolution: 29272.70114247687,             //projection: "EPSG:3857",             projection: new OpenLayers.Projection("EPSG:3857"),             units: 'm',             numZoomLevels: 5         })     );


Is SRTM 3 second arc free of non-terrain features?

I made an elevation map of my study area in Macapa, Brazil. But the region has the average elevation lesser than 30 m as I can see from my map derived from SRTM 3 second arc. According to my knowledge some parts of the region has trees taller than 30 meter and I am afraid that my elevation map shows tree canopy elevation instead of bare land elevation. My questions are:   1. Is any correction implemented on SRTM 3 second arc images to remove trees and non-terrain features?    2. I found a tree height map from NASA. Can I do: SRTM 3 second arc minus elevation height map?


Problem with WFS-T save strategy in Openlayers

In my web map application, I have added the editable wfs vector layer for feature editing. But in save strategy method, Insert and Update Geometry is working fine.But Update Attributes is not saved in transaction. Did I miss anything to include while adding editable layer? Please suggest me to fix this problem.               var saveStrategy;     function init(){      format = 'image/png';          bounds = new OpenLayers.Bounds(                 -288161.9289062237, -435.65815425360597,                 949406.755566389, 1300000             );     var options = {     controls: [],     maxExtent: bounds,     maxResolution: 5079.826789665053,     projection: "EPSG:404000",     units: 'm'     };           osMap = new OpenLayers.Map('map', options);          //Setup Base layer     tiled = new OpenLayers.Layer.WMS(                 "Oxford_Map", "http://xxx.xx.x.xx:8080/geoserver/cite/wms",                 {                     LAYERS: 'Oxford_Map',                     STYLES: '',                     format: format,                     tiled: true,                     tilesOrigin: osMap.maxExtent.left + ',' + osMap.maxExtent.bottom                 },                 {                                             buffer: 0,                     displayOutsideMaxExtent: true,                     isBaseLayer: true,                     yx: { 'EPSG:404000': false }                 }                               );          untiled = new OpenLayers.Layer.WMS(                 "Oxford_Map", "http://xxx.xx.x.xx:8080/geoserver/cite/wms",                 {                     LAYERS: 'Oxford_Map',                     STYLES: '',                     format: format                 },                 {                                             singleTile: true,                     ratio: 1,                     isBaseLayer: true,                     yx: { 'EPSG:404000': false }                 }                                 );           osMap.addLayers([untiled, tiled]);           //set up a save strategy     saveStrategy = new OpenLayers.Strategy.Save();     saveStrategy.events.register("success", '', ChangesSuccess);     saveStrategy.events.register("failure", '', ChangesFailed);          wfs = new OpenLayers.Layer.Vector("ODC_Private_Graphics_Data", {         strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],              projection: 'EPSG:27700',         protocol: new OpenLayers.Protocol.WFS({             version: '1.1.0',             url: 'http://xxx.xxx.x.xx:8080/geoserver/wfs',             featurePrefix: 'cite',             featureNS: 'http://www.opengeospatial.net/cite',                                     featureType: 'ODC_Private_Graphics_Data',              geometryName: 'the_geom',                        extractAttributes: true,             srsName: 'EPSG:27700',             isBaseLayer: false,             visibility: true,             schema: 'http://xxx.xxx.x.xx:8080/geoserver/wfs/DescribeFeatureType?version=1.1.0&;typename=cite:ODC_Private_Graphics_Data',         });               osMap.addLayers([wfs]);     }              //This function will be invoked when I click on save image in web map application       function saveFeature() {        for (var ss = 0; ss < wfs.selectedFeatures.length; ss++) {           var selFeat = wfs.selectedFeatures[ss];                selFeat.attributes.FeatureName = 'Test';            selFeat.state = OpenLayers.State.UPDATE;       }            saveStrategy.save();      }               function delFeature() {     if (wfs.selectedFeatures.length > 0) {     for (var dd = 0; dd < wfs.selectedFeatures.length; dd++) {          var selFeat = wfs.selectedFeatures[dd];          if (selFeat.fid == undefined) {              this.wfs.destroyFeatures([selFeat]);             } else {             selFeat.state = OpenLayers.State.DELETE;             this.wfs.events.triggerEvent("afterfeaturemodified", { feature: selFeat });             selFeat.renderIntent = "select";             this.wfs.drawFeature(selFeat);             }         }         }            function ChangesSuccess() {       alert('Done');      }           function ChangesFailed() {       alert('Failed');      }


How to use PROJ4 to reproject a file

Unfortunately, GDAL does not support a particular projection I am trying to achieve (the ob_tran rotated pole projection), so I am trying to use PROJ4 to convert a geotiff file to the projection I want. However, I am not sure what the correct syntax for such an operation is. Using the command:               invproj -m 57.2957795130823 +proj=ob_tran +o_proj=latlon +o_lon_p=20 +o_lat_p=20 +lon_0=180 input.tif      I get only a lot of gibberish in the console, such as:               133d13'9.044"E  62d0'32.793"N  <Item name="missing_value" sample="0">-32767</Item>     133d13'9.044"E  62d0'32.793"N  <Item name="NETCDF_VARNAME" sample="0">Band1</Item>     133d13'9.044"E  62d0'32.793"N</GDALMetadata>     133d13'9.044"E  62d0'32.793"N     133d13'9.044"E  62d0'32.793"N� �D�k�����������k�R�f�����P�w��B�����|�[�=�$      This is not due to the particular projection I am trying to use. Trying a normal Mercator projection with the command:               proj +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +units=m +k=1.0 +nadgrids=@null +no_defs input.tif      I also get a lot of gibberish.               0.00    -0.00�4�L�}�z���`����)�,�$��������     0.00    -0.00��6�������G�R�f�@�     0.00    -0.00     0.00    -0.00�     0.00    -0.00���������3���<�����;     0.00    -0.00�����      What am I doing wrong? From looking at the manual, I thought I need to put the name of the file(s) at the end of the command line, but apparently, that is wrong? How do I convert a file to another projection with PROJ4?


How to get OS Mastermap data into QGIS?

I have been tasked with getting OS Mastermap topography data into QGIS system to compliment our other map layers. The data comes in .gz format. Which I am told needs to be decompressed before I can do anything further? After decompressing it using WINRAR it turns it into a file which has no file type? I assume it is supposed to be .gml? I have read I then need to convert it into shape file format so that QGIS can read it, so I use OS GML to OGR python plug in. Which seems to do nothing...or says "processing stage failed with code 1". Can anyone give me any advice or a brief walkthrough on how to get OS Mastermap data into QGIS? Thanks


Verifying the number of times a line crosses other lines

I have a series of lines that represent streams. I have a stream line and two flowpath lines in one feature class and two banklines in another feature class. Total of five lines. I then have a feature class with cross-section lines that intersect these lines. These are all in a personal geodatabase. ![See picture below](http://i.stack.imgur.com/rwDvf.png) I need the cross-sections to intersect each line only once. Because the five lines can be convoluted, sometimes a cross-section will cross one of the five stream lines more than once. Is there a way to identify which cross-section lines cross more then five lines? It's a big data set so sifting through each cross-section individually is not optimal.


Are there any code examples of plotting pgRouting on Google Maps available?

Does any colleague know about a code example of plotting pgRouting on Google Maps?


Issue with a point insertion into a Geoserver points layer. WFS-T

How is the best way to insert a feature from the client side into an existing GeoServer layer? Maybe using an ajax call and JSONP? Or OpenLayers (i can't figure out how to have the proxy working)? If someone have an example, i'll be very grateful **UPDATE** Actually what i'm trying is: 1- Build WFS-T formatted string in this way (reduced version):               <wfs:Transaction      <wfs:Insert>       <sde:uruguayos>        <sde:the_geom>          <gml:Point srsDimension="1" srsName="http://www.opengis.net/gml/srs/epsg.xml#3857">            <gml:coordinates decimal="." cs="," ts=" ">-33.7291,-56.3353820</gml:coordinates>          </gml:Point>        </sde:the_geom>       <sde:Name>Uruguayo Nuevo</sde:Name>      </sde:uruguayos>     </wfs:Insert>      After that, i'm sending a POST with the data above via ajax to GeoServer and now i fall out into a cross-domain-issue (and make sense).               jQuery.ajax({       async: false,       dataType: 'text/xml',       type: "POST",       url: wfs,       data: postData,       //TODO: Error handling       success: function(xml) {           //TODO: User feedback         alert("Ready...");       },       failure: function (xml) {               alert("Something went wrong in the request");       }     });      **UPDATE 2** I could solve the Cross domain issue. And now i'm with a strange problem making the insertion over my postgis Layer (through GeoServer). As i said, i have this xml string:               var wfs = "http://"+ip+":"+port+"/geoserver/ows?service=wfs&request=Transaction";     var wfsEncoded = encodeURIComponent(wfs);          // INSERT point          var postData =          '<wfs:Transaction service="WFS" version="1.0.0" xmlns:wfs="http://www.opengis.net/wfs"     '+       'xmlns:sde="http://geoserver.sf.net" '+       'xmlns:gml="http://www.opengis.net/gml" '+       'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" '+       'xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd '+'http://www.openplans.org/topp '+ wfsEncoded +'/DescribeFeatureType?typename=sde:uruguayos">'+       '<wfs:Insert><sde:uruguayos><sde:geom> '+             '<gml:Point srsDimension="1" srsName="http://www.opengis.net/gml/srs/epsg.xml#3857"> '+              '<gml:coordinates decimal="." cs="," ts=" ">-33.7291,-56.3353820</gml:coordinates> '+               '</gml:Point> </sde:geom> <sde:Name>Uruguayo Nuevo</sde:Name> </sde:uruguayos>          </wfs:Insert> '+         '</wfs:Transaction>';      I make two tries with a different wfs var (url in the code) var wfs = "http://"+ip+":"+port+"/geoserver/ows?service=wfs&request=Transaction"; And var wfs = "http://"+ip+":"+port+"/geoserver/wfs"; The first one got a response that says:                <ows:ExceptionReport xmlns:ows="http://www.opengis.net/ows/1.1"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0.0" xsi:schemaLocation="http://www.opengis.net/ows/1.1 http://192.168.38.229:8080/geoserver/schemas/ows/1.1.0/owsAll.xsd">       <ows:Exception exceptionCode="MissingParameterValue" locator="request">         <ows:ExceptionText>Could not determine geoserver request from http request org.geoserver.platform.AdvancedDispatchFilter$AdvancedDispatchHttpRequest@1d08ec4</ows:ExceptionText>       </ows:Exception>      </ows:ExceptionReport>      And the second response from Geoserver is like that:                <ows:ExceptionReport xmlns:ows="http://www.opengis.net/ows/1.1"         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0.0"      xsi:schemaLocation="http://www.opengis.net/ows/1.1     http://192.168.38.229:8080/geoserver/schemas/ows/1.1.0/owsAll.xsd">        <ows:Exception exceptionCode="NoApplicableCode">          <ows:ExceptionText>Could not find request reader (either kvp or xml) for: net.opengis.wfs20.TransactionType</ows:ExceptionText>        </ows:Exception>      </ows:ExceptionReport>      The URL encoding tip was taken from Data request to GeoServer: "Could not determine geoserver request from http request GET /geoserver/ows?service=WFS HTTP/1.1"


Help making the DARP example run

I've compiled and installed DARP branch. Is there any data example to test it?. I've used some data based on document instructions http://www.pgrouting.org/docs/1.x/darp.html but no results return.   * What's the difference between depot_id and depot_point_is?    * In distance query i don't understand fields from_order and to_order.    * If i add a request for going from point A to point B, is necesary to add in distances table the cost of going from point B to point A?.    * The field values in distances query, what time units should be?, minutes?, seconds?, miliseconds?.    * Where do darp.c and darp_solver.c leave log messages?.  I know that maybe darp branch is a RC version, but please could you help me with this?.


duplicate polygons once for each point inside

I have a set of feature classes: points representing addresses, and polygons representing buildings. Sometimes there are more than one addresses per building. ![enter image description here](http://i.stack.imgur.com/JZcTMm.jpg) I use Maplex to generate and place labels. Instead of labeling the points with the address, I would like to take advantage of the Maplex "building labels" features to place the address labels nicely within the polygon boundaries. I need to create a polygon for each of the points, using the geometry of the polygon that the point is within, with the attributes of the point. Thus far I have able to use the spatial join tool to create a set of polygons with the attributes of one point within them, or a set of all the points with the attributes of the polygon they are within.... neither solution is quite what I'm looking for.


Openlayers Overview and OpenLayers versions

I have installed OpenLayers and the Openlayers Overview plug-ins but I am not sure if they are working. I can create new 'open' layers from the Openlayers plug-in drop down, but when I try to add a map from the 'Openlayers Overview' window it gives an error stating that ' _The version of Openlayers Plugin is 0.93, need be version 0.42!_ '. Does this 'Overview Add map' do the same thing as the plugin menu options, in which case I guess there is no problem, I just won't use it or should it something else? Also, the layers don't have a properties dialog. Is that right?


Tree structure for a muticolored region quadtree

Is a B+ tree suitable for a multicolored region quadtree (for example, one segmenting a plot of land into several crops)? I recently purchased a copy of Samet's 'Foundations of Multidimensional and Metric Data Structures,' which, while containing a vast amount of insight, is more annecdotal than a Family Guy episode. What I've read through has not specifically stated that the B+ tree can only be used for binary images, but that has been the case of each of his examples. If this structure is not a viable option, what would be a good alternative(s) to start reading up on? I'm less intersted in spatial efficiency and more concerned with update/retrieval speed and neighbor finding, if not implicit to the structure. If you have multiple suggestions, kindly do a brief compare/contrast? Thanks!


How to select the vertices from a polygon?

I am writing some VBA code to extract vertices from a polygon. I would like to ask, how to select the vertices from a polygon ? Regards Gary


Targeting capital cities only in Tilemill/CartoCSS

At a specific zoom level in my Tilemill map, I want to **only** show capital cities, and hide all other cities. What data set could I use which will provide me with information oh whether a city is a capital city or not, so that I can hide/show based on that attribute?


QGIS on Android: Access files on Google Drive

I have a set of shape files that I keep updated on Google Drive. I have just installed QGIS on an Android tablet but I can not figure out how to get access to the google drive from the file menu. Any ideas? Russell


Geo server using bbox and cql filter

i want to get the data within BBOX and form the cql query url is following http://[localhost]:8080/geoserver/mymap/ows?service=WFS&version=1.0.0&request=GetFeatur e&typeName=layer:layername&outputFormat=json&BBOX=-70.95699,50.89799,-71.17946,52.04493,EPSG:4326&cql_filter=(name+like+%27%25h%25%27%29


how do I install QGIS for Android?

I am new to Android (just brought a Nexus 7) and I am trying to get QGIS onto it but I can not find any installation instructions. I have found http://android.qgis.org/download/qgis-installer.apk and when I click on the link I get the warning that "such files may damage my computer", I click "continue" and there is a brief popup "downloading..." and that is it. Nothing else happens. I have only ever installed apps from the "play store" in the past. I am still coming to grips with computers that don't have a command line shell ;) Russell


Create a closed polygon from a series of edges given a point

I have a series of points fed into a voronoi graph class that returns a series of edges defining the bounds between these points, the process works it returns a series of edges. I now need to do a ray/fill using the points and these edges to build polygons around each point.... for the life of me I can't seem to figure out a process of doing this or a code sample... C# code or thought process would be great .... maybe ray collision? ![Sample Voroni](http://i.stack.imgur.com/1BIfi.jpg)


Reproject WKT Polygon with Javascript

I have a polygon in WKT in EPSG:4326:               polygonWKT = 'POLYGON((13.215179443359373 52.588032137196755,13.42803955078125 52.592620721000365,13.454132080078125 52.46897854656702,13.347015380859375 52.45893824522763,13.215179443359373 52.588032137196755))';      How can I reproject this to EPSG:3857 with Leaflet or any other Javascript Library?


Command-line tool for writing a print-composer to file?

I'm looking for a command-line tool, to write a previously generated print- composer to an image-file. The following resources I already saw:   * Related questions (1, 2)   * A gist Nevertheless, all them are not doing, what I'm intending. I'm looking for a tool which looks like               qgisPrintComposer --print-composer 'my-composer1' --output image.png project.qgs      A starting point is here.


Does "size scale field" in QGIS actually work?

I'm having mixed results with the 'size scale field' aka graduated symbols in QGIS. Some forum posts out there say this feature is broken - others can get it to work.


What units are used in GRASS Rasterize?

What units are used in **GDAL Proximity** or **GRASS Rasterize?** - 'new size' parameter


Add more info in the attribute table after executing "Line intersection" in QGIS

I have executed the "Line intersection" tool on a road shapefile. This is under `Vector > Analysis Tools > Line intersections`. I get an output with attribute table having just two columns: `type_1` and `type_2`. Is it possible to get more info/attributes out of this? For example, the `node_ids` of the intersections and perhaps their location (latitude and longitude)?


Can't open Spatialite plugin in QGIS

After installation, I got the error messages below when I click the Spatialite (V.7) Plugins:               --------------------------------------------------------------------------------------     An error has occured while executing Python code:          Traceback (most recent call last):       File "C:\Users\uqipurna/.qgis2/python/plugins\QspatiaLite\qspatialite.py", line 68, in run         dlg = QspatiaLiteApp(self.iface)       File "C:\Users\uqipurna/.qgis2/python/plugins\QspatiaLite\QspatiaLiteApp.py", line 80, in __init__         self.changeDb(max(0,self.connections['idx']))       File "C:\Users\uqipurna/.qgis2/python/plugins\QspatiaLite\QspatiaLiteApp.py", line 146, in changeDb         self.drawTreeView()       File "C:\Users\uqipurna/.qgis2/python/plugins\QspatiaLite\QspatiaLiteApp.py", line 151, in drawTreeView         model=self.db.createTreeModel()       File "C:\Users\uqipurna/.qgis2/python/plugins\QspatiaLite\Classes\Database.py", line 107, in createTreeModel         self.getTables()       File "C:\Users\uqipurna/.qgis2/python/plugins\QspatiaLite\Classes\Database.py", line 81, in getTables         header,data=self.executeQuery(query)       File "C:\Users\uqipurna/.qgis2/python/plugins\QspatiaLite\Classes\Database.py", line 46, in executeQuery         cursor.execute(query,params)     DatabaseError: file is encrypted or is not a database          --------------------------------------------------------------------------------------      What is going on with my installation. Thank you for your help. Regards Gus


Can you print cross-hatch area fills like they appear on screen?

I'm trying to use a cross-hatch symbol on polygons in QGIS. When displayed on screen, they look just fine - both in the map and in the composer. The problem is when they are rendered to an image and/or printed, the hatching is much smaller in size (between the hatches) than on screen. The result is a much darker looking polygon that simply looks black, rather than a cross-hatch pattern that can be seen through to the colours below. There is a print resolution setting (DPI) that when changed to 96dpi, it will render as it does on screen. But how to fix for 300dpi printed maps? Thanks!


How to make it clickable kml file that has been google maps

I have uploaded a kml file into google maps. Now i need to make it clickable. Can there is a way to do this. or I need to upload by code only?


How to write a new layer to PostgreSQL from QGIS plugin

The PyQGIS cookbook states that QgsVectorFileWriter can write vector layers to any format supported by OGR: https://www.qgis.org/en/docs/pyqgis_developer_cookbook/vector.html#writing- vector-layers However when I try this I get an error (based on the .source() of an existing layer):               error = QgsVectorFileWriter.writeAsVectorFormat(layer, u'dbname=\'snorf\' host=localhost port=5432 user=\'snorf\' sslmode=disable key=\'id\' srid=4326 type=POINT table="public"."mynewlayer" (the_geom) sql=', 'UTF-8', layer.crs(), 'PostgreSQL')      This returns `QgsVectorFileWriter.ErrCreateDataSource`. I don't have any problems modifying existing PostgreSQL layers, and I can write a new layer to the database using `ogr2ogr` without issue.   * How do I create a new empty postgres layer?   * How do I save an existing layer into a postgres database?


Directly Proportional Hexbin Cartograms in QGIS

I've been using Scapetoad to create population cartograms, which I then convert into hexbins back in QGIS. However, the Scapetoad software seems to create cartograms that are affected, but not directly informed by the variable being mapped (eg a cartogram for the United States based on population would show California as larger and Alaska as smaller, but California is not 30 times larger than Alaska as their populations would dictate. I mention hexbinning because I wish to produce a hexbin cartogram where each hexagon represents a discreet quantity (eg 100K people) and this is only possible if the cartograms are directly proportional. Any help would be tremendously appreciated!


Converting .dxf to shapefile

I have a .dxf file to convert to .shp. Using ArcMap I've added the .dxf and tried exporting to .shp (various types, polyline, point, polygon) and also tried exporting to a gdb. For the most part it works but some of the original polyline (or polygon) files come into ArcMap as points. Has anyone come across this problem before and know of a solution?


Changing object/point to custom symbol based on a specific name in MapInfo, using MapBasic

First, I must clarify I am green when it comes to programming and Basic. I only started trying to use MapBasic and have reviewed a few sites and their reference guide to get an idea of what I can do and would like to do. So any help or guidance is much appreciated. For this project I am trying to eliminate a monotonous task that is performed each time a user creates a "custom aerial". Basically we have a table with a range of 15 to 45 (sometimes more and sometimes less) records that are name specific. For example let's say they are Fast Food Users (Taco Bell, McDonald's, KFC) Each time we create an aerial we change each record to their respective custom symbol (which I have created) and it uses up a lot of time. So what I am trying to figure out is how I can write some code that will automate this task by taking my table "retail.tab" and call on a column ("CustImgName") that contains the custom symbol name (TacoBell.bmp, KFC.bmp, etc) and automatically change it to the custom symbol. In addition, I would also like to find a way to report back if it matches them all or not so that the user can QC their work before proceeding. I have tried the Hard Code Thematics tool that is out there, but due to the massive amount of records we use in our database it causes performance issues with MapInfo. Thanks in advance for any replies.


Most Efficient method of Storing Point Data in PostGres/PostGIS to later re-create a track

I am trying to determine the most efficient way to store point data in PostGIS to later re-create tracks > Criteria: > > 1 second updates > > 100- 200 tracks active at any one time > > 1 hour max track time so approx 5400 points per track > > Track data extracted as a report, not real time display, but the reports > would be run frequently, many times daily I can see two possibilities at this stage: > > a) Store the point data as a table with a field that will group them to a > particular track. So three fields used, gid, trackid, lat/lon, resulting in > a lot of rows >> >> or: >> >> b) Store each track as one row in a table with a field that has the point data appended to it at each update My Questions are: >   1. Which is a more efficient way to store the point data, Numeric Fields > (two columns), char fields, or GIS POINT/LINESTRING fields > >   2. Which would be the most efficient way of the two options above, given > server/database load to store and recreate the track data. Option a) would > require queries to build each reported track whereas option b) would only > need to look at one row per track. > >   3. Is there a better way than either a) or b) to approach this > requirement. > > Thanks Mark


QGIS - adding timestamps to spatialite data during data collection

I am trying to do field data collection using QGIS. One of the features that I regard as necessary for data management is timestamps. For example, a timestamp can indicate that an inspection record has been updated. I have figured out how to add triggers using Spatialite to add a timestamp on update, however the timestamp is added when the edited records are saved and not when the identify dialog box is closed. This means that timestamps can be out by many minutes. One solution would be to force the updated record to be saved by using a custom form with an OK button (Can do the form with Qt- Designer but don't know how to add the save command to the button yet.) However my preferred solution would be to take a timestamp for new records, when the point or line is created. The reason for this is if I am surveying a road, I can stand on the road, collect the point and them move to the side to complete data collection. I have been unable to work out how to get Spatialite to run a trigger that puts in the start of feature editing. Perhaps this is also something that needs to be done by code in a custom form. Is there an On-dirty event or signal in QGIS that indicates when someone starts editing a record and that can be used to capture the time? Could I also ask what the Python code (and what to hook it to) that would put such a timestamp in the timestamp field. AndrewM


AttributeError: 'unicode' object has no attribute 'save'

I'm trying to multiply my raster to 100 from my ListRasters. I've adapted the code (especially the for loop portion) also from this site. Now, I'm encountering an error at the last line, when saving the raster. How can I successfully run this code?Thank you all!                   #import the module         import arcpy         from arcpy.sa import *         from arcpy import env         arcpy.CheckOutExtension("Spatial")         env.overwriteOutput = True              #set the workspace         arcpy.env.workspace = r"C:\Users\Windows\Documents\JO_GIS_Analyst"              #Create a list of raster files         rasterList = arcpy.ListRasters("reprojected*", "TIF")              #Loop through the list of ListRaster         for k in rasterList:             print k #check the presence of rasters             OutRaster = (k)*100) #multiplying the raster by 100             OutRaster_Name = "nofpt" + k  #specifying the output name             OutRaster.save(OutRaster_Name) #saving the raster


OSM administrative polygons : what is the current worldwide coverage?

**Does OSM have a summary view of its administrative polygons coverage worldwide for each administrative level ?** * * * NaturalEarth have Countries (L0), and subdivisions (L-1) with complete (100%) coverage. GADM.org have a very clean summary of its coverage for L-1 to L-5, it's super easily readable thanks to a nice visualization (see previous link and following snapshot) : ![enter image description here](http://i.stack.imgur.com/kopHs.png) ![enter image description here](http://i.stack.imgur.com/smeXQ.png) ![enter image description here](http://i.stack.imgur.com/oqp2S.png) ![enter image description here](http://i.stack.imgur.com/I30p8.png) Does OSM have a similar coverage summary somewhere ?


arcgis 10.0 od matrix only solves A-A, B-B, C-C, not A-B, A-C, etc

I think I have a very noob question here. Using ArcGIS 10.0 and Network Analyst extension to create Origin-Destination Matrix. I have a shapefile of 120 points, and I want to create a matrix of shortest road network distances between all 120 points (120x120 matrix). I've tried using network datasets that (a) include the road network + points and (b) include road network only. Using the OD tool, I load the points as both origins and destinations, so both read (120) once loaded. I set impedance to length, no cutoff value, and destinations to find `<All>`. When I solve, I get lines (120), and the attribute table shows only 120 pairs: each point with itself. So all distances are 0. In other words, I get A-A, B-B, C-C, etc, not A-A, A-B, A-C, B-B, B-C, etc. **Update** Here are links to the road network dataset and origins- destinations.


repeating steps in GRASS r.mapcalc

I simply cannot find out the following: I want to repeat a calculation in GRASS GIS several times. Is there a command for r.mapcalc to repeat a calculation x times (similar to this possibility in r.mfilter, for example)....besides listing that step x times in s shell scripts (I use shell).


Is there an open source tool to planarize graphs?

I read about the planarize function in ArcGIS, which seem to do exactly what I want. Is there a similar feature in QGIS or another free tool? I have a shapefile with various shapes intersecting each other and I want each intersection to become a node and between every two nodes to have a simple line. The goal is to easily convert my .shp in .osm and use it with Graphserver. As it is, Graphserver says I don't have edges, and I deduced the above is my problem. Thanks a lot


How to convert MGRS to Lat/Long or UTM?

Can anyone please guide me on converting Military Grid Reference System (MGRS) to lat/long or UTM. Any help is greatly appreciated. Rahul


Converting VB code to C# for coverting Polyline to polygon

It is a while that I am stuck at converting polylines to polygon and I couldent find any solutions into it.I have tried some diffrent methods like using `ESRI.ArcGIS.DataManagementTools.FeatureToPolygon` but I get errors and couldent find any way to fix it:( I have asked a question about it here: Convert polyline to polygon Using ArcObjects Then I tried to find another way and I find this sample code:               Option Explicit          Public Sub CreateNewPolygonFromPolylineGraphic()       '       ' This function creates a new graphic from the currently selected graphic in the active view.       '       Dim pMxDoc As IMxDocument       Set pMxDoc = ThisDocument       '       ' We will need the IGraphicsContainerSelect to find the currently selected graphic,       ' and the IGraphicsContainer to add the new graphic to.       '       Dim pGraphicsSelect As IGraphicsContainerSelect, pGraphics As IGraphicsContainer       Set pGraphicsSelect = pMxDoc.ActiveView       Set pGraphics = pMxDoc.ActiveView.GraphicsContainer            If pGraphicsSelect.ElementSelectionCount = 1 Then         If pGraphicsSelect.SelectedElement(0).Geometry.GeometryType = esriGeometryPolyline Then           '           ' Get the currently selected Polyline element.           '           Dim pElement_Polyline As IElement, pLineElement As ILineElement           Set pElement_Polyline = pGraphicsSelect.SelectedElement(0)           Set pLineElement = pElement_Polyline           '           ' Use the PolylineToPolygon function to return a Polygon.           '           Dim pPolygon As IPolygon           Set pPolygon = PolylineToPolygon(pElement_Polyline.Geometry)           If Not pPolygon Is Nothing Then             If Not pPolygon.IsEmpty Then               '               ' Now create a new PolygonElement for the Polygon.               '               Dim pElement_Polygon As IElement, pFillShpElement As IFillShapeElement               Set pElement_Polygon = New PolygonElement               Set pFillShpElement = pElement_Polygon                    pElement_Polygon.Geometry = pPolygon               pFillShpElement.Symbol = New SimpleFillSymbol               '               ' Delete the old element from the graphics layer, because a Polygon and Polyline               ' cannot be displayed using the same element coclass. Add the new element.               '               pGraphics.DeleteElement pElement_Polyline               pGraphics.AddElement pElement_Polygon, 0               pMxDoc.ActiveView.PartialRefresh esriViewGraphics, Nothing, Nothing             End If           End If         End If           End If         End Sub               Private Function PolylineToPolygon(ByRef pPolyline As IPolyline) As IGeometryCollection       '       ' Create a new Polygon geometry.       '       Set PolylineToPolygon = New Polygon       '       ' Clone the incoming Polyline, so we can use the references to this new Polylines segments.       '       Dim pGeoms_Polyline As IGeometryCollection, pClone As IClone       Set pClone = pPolyline       Set pGeoms_Polyline = pClone.Clone       '       ' Transfer the segments from the Polyline Paths to new Rings, and add the Rings       ' to the new Polygon.       '       Dim i As Long, pSegs_Ring As ISegmentCollection       For i = 0 To pGeoms_Polyline.GeometryCount - 1         Set pSegs_Ring = New Ring         pSegs_Ring.AddSegmentCollection pGeoms_Polyline.Geometry(i)         PolylineToPolygon.AddGeometry pSegs_Ring       Next i       '       ' The Polygon may have it's rings oriented incorrectly. We call simplify here to       ' ensure they are in the correct rotation.       '       Dim pPolygon As IPolygon       Set pPolygon = PolylineToPolygon       pPolygon.SimplifyPreserveFromTo     End Function      and also this one:               Option Explicit          Public Sub CreatePolygonFromPolylines()       Dim pUID As New UID       Dim pEditor As IEditor       Dim pEditLayers As IEditLayers       Dim pActiveView As IActiveView       Dim pEnumFeature As IEnumFeature       Dim pFeature As IFeature       Dim pPolygon As IPolygon       Dim pPolygonPointColl As IPointCollection       Dim pTempPolyline As ITopologicalOperator       Dim pNewFeature As IFeature            On Error GoTo ErrorHandler            'Get a handle to the Editor extension       pUID = "esriCore.Editor"       Set pEditor = Application.FindExtensionByCLSID(pUID)       Set pEditLayers = pEditor 'QI       Set pActiveView = pEditor.Map            'Check that at least one feature is selected       'and ensure the target layer is a polygon layer       If pEditor.SelectionCount = 0 Then Exit Sub       If Not pEditLayers.CurrentLayer.FeatureClass.ShapeType = esriGeometryPolygon Then Exit Sub            'Start an edit operation       pEditor.StartOperation            'Get the Editor's feature selection       Set pEnumFeature = pEditor.EditSelection       pEnumFeature.Reset       Set pFeature = pEnumFeature.Next            'Union all the polylines together       Set pTempPolyline = New Polyline       Do While Not pFeature Is Nothing         If pFeature.Shape.GeometryType = esriGeometryPolyline Then           Set pTempPolyline = pTempPolyline.Union(pFeature.Shape)         End If           Set pFeature = pEnumFeature.Next       Loop            'Create a new polygon and call Close to ensure a closed polygon       Set pPolygonPointColl = New Polygon       pPolygonPointColl.AddPointCollection pTempPolyline       Set pPolygon = pPolygonPointColl 'QI       pPolygon.Close            'Create a new feature in the target layer       Set pNewFeature = pEditLayers.CurrentLayer.FeatureClass.CreateFeature       Set pNewFeature.Shape = pPolygon       pNewFeature.Store            'Complete the edit operation       pEditor.StopOperation "Create Polygon"            'Flag the area of the new feature for refreshing       pActiveView.PartialRefresh esriViewGeography, Nothing, pPolygon.Envelope            Exit Sub 'Exit to avoid error handler          ErrorHandler:       pEditor.AbortOperation     End Sub      I tried to convert this vb codes to C# form but I get error with casting interfaces :( Here is the code that I tried to convert from first sample but It is full of mistakes :(Can you help me with this problem? thanks a lot I am going to use ArcObject 10.2.1 and C#,I checked ArcToolbox/Datamanagmant results and it gives me a closed polyline. then I tried this code to convert it to polygon.                   `public IPolygon PolylineToPolygon(IFeature polyline)         {                  IPolyline pl = new PolylineClass();             Polyline p2 = polyline.Shape as Polyline;                  //Build a polygon segment-by-segment.             IPolygon polygon = new PolygonClass();             IGeometryCollection geometryCollection = (IGeometryCollection)polygon;             IGeometry geometry1 = (IGeometry)p2;             object before1a = Type.Missing;             object after1a = Type.Missing;             geometryCollection.AddGeometry(geometry1, ref before1a, ref after1a);             geometryCollection.GeometriesChanged();                  return polygon;                }`      But I get this error `The parameter is (or has an element that is) the wrong kind of geometry.` at this line `geometryCollection.AddGeometry(geometry1, ref before1a, ref after1a);` in fact I can not add geometry to geometry collection.Why?where is my mistake? ## my input Ifeature comes from a shapefile from disk and it is not null,It is a closed polyline **Edit** I used the way that you suggested but I get an error in `ISegment polyseg = (ISegment)p2;` I think problem is with casting IFeature polyline to a polyline feature and then casting it as ISegment..right?whats the best way to cast an IFeature to a polyline feature? public IPolygon PolylineToPolygon(IFeature polyline) {                       IPolyline pl = new PolylineClass();             Polyline p2 = polyline.Shape as Polyline;                       //Build a polygon segment-by-segment.             IPolygon polygon = new PolygonClass();             ISegment polyseg = (ISegment)p2;             ISegmentCollection ring = new RingClass();                       object before2 = null;             object after2 = null;             ring.AddSegment(polyseg, ref before2, ref after2);                  IGeometryCollection geometryCollection = (IGeometryCollection)polygon;                  IGeometry geometry1 = (IGeometry)ring;             object before1a = null;             object after1a = null;             geometryCollection.AddGeometry(geometry1, ref before1a, ref after1a);                  geometryCollection.GeometriesChanged();                  return polygon;                }      here is the error:               Unable to cast COM object of type 'System.__ComObject' to interface type 'ESRI.ArcGIS.Geometry.ISegment'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{F2C4F0DE-C5AE-11D0-8307-0000F8034032}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE))      as I checked in debuger polyseg is null while p2 is nut..I thing the way I am casting is wrong


How to investigate ModelBuilder results in ArcGIS 10.2?

When executing a model, is there a way to view the geoprocessing results? When I visit the geoprocessing menu and results, nothing appears. Thanks in advance.


Create a consistent topology using pgrouting

I'm developing an application that needs routing information for certain cities. First, I downloaded a openstreetmap datafile (*.osm) and then I imported it into a postgreSQL database using osm2pgrouting tool (http://workshop.pgrouting.org/chapters/installation.html). After this, I have the following tables:   * nodes: that contains simple locations points   * ways: that contains ways with some nodes involved   * vertices_tmp: stores nodes that may be used for pgrouting funtcions like Djistra, A*...etc. Would I use nodes that isn't in "vertices_tmp" table for calculate distances between nodes? Or I would only do it with the nodes stored in "vertices_tmp"? Into ways table there are a field named "the_geom" that encapsulates different locations points (nodes). For example: "MULTILINESTRING((1.5897786 42.5600441,1.5898376 42.5601455,1.589992 42.5605438,1.590095 42.5606795,1.5901782 42.5608026,1.5902238 42.561018,1.5902912 42.5616808,1.5903685 42.561899,1.5904008 42.5620563,1.5903836 42.5624117,1.5904265 42.5627151,1.5904947 42.5628368,1.5905981 42.5629553,1.5906926 42.5631007,1.590802 42.5633238,1.5908604 42.5634883,1.5909501 42.5637139,1.5910869 42.5638755,1.5913053 42.5639639,1.5914994 42.5640237,1.591648 42.5640261,1.5919232 42.5640145,1.5921124 42.5640363,1.5923292 42.5640953,1.592804 42.5643306))" Can I route with intermediate nodes or only with source/target nodes? My goal is to be able to routing betweent differents nodes or POIs, depending of its amenity tags, not only driving distance, walking distance too. Furthermore I need to calculate shortest path for source/targets nodes. Any idea for do this? Thanks in advance!


Should I use a projection or not, and if so what SRID would be useful?

First off, I realize that this is perhaps not the most stackexchange-esque question. I am however having trouble finding a good source of information for this. So if there is a better place for me to look for this information please redirect me there. I am creating an application for which the persistence layer is PostGIS, and I am unsure what if any projection I should use for storing my data. My spatial data system is working on the following general requirements:   * The data that I am storing pertain to events, and I would like to be able to find events that are nearby another event. This is to say, given event 'foo' I would like to find events within a certain radius of 'foo.'   * The data points are distributed at a national, and later at a potentially global level, but the distance comparisons would only occur at a relatively local level < 100k, so I only really care about fidelity of distance up until that point.   * Accuracy is much less important than speed in my use case, and single digit percentage error is acceptable as long as the distance lookup is quick. I have looked up the geography type which is not tied to a particular position, however the PostGIS documentation appears to take a rather condescending view of the geography type: > If you don't understand projections, and you don't want to learn about them, > and you're prepared to accept the limitations in functionality available in > GEOGRAPHY, then it might be easier for you to use GEOGRAPHY than GEOMETRY. > Simply load your data up as longitude/latitude and go from there. I am relatively comfortable with the mathematical notion of projection and the topology of manifolds, and I do care about performance, but I have little GIS specific knowledge and I have yet to find a place where there is a mapping between SRIDs and usecases. Is there a specific type of projection that I should be using, or a type that I should be looking for?


How do you disable archiving for a table?

I would expect to have a `Disable Archiving...` like I do for a featureclass. But for a table, the Enabled Archiving menu-item is grayed out. Here's the menu for a table:   ![Menu on a versioned, archived table](http://i.stack.imgur.com/lz2XX.png) And here's the menu for a featureclass, which is what I would expect according to the documentation: ![Menu on a versioned, archived featureclass](http://i.stack.imgur.com/7Km93.png) Is there another way to disable archiving on a table? Or is this a bug? ArcCatalog 10 SP3 client. Seeing the issue in both SQL Server/Oracle **SDE**.


Geoserver KML Rendering in Google Earth - SLD Errors

I have a layergroup with custom SLD's in Geoserver: Layer preview All the symbology renders fine. If I try and add the KML as a network link into google earth using this URL I lose most of my SVG and Polygon symbology. ![and just get Red Crosses for all the SVG layers](http://i.stack.imgur.com/QLcgU.png) The svg files are in the styles folder in geoserver and I've also tried copying one of them to an accessible URL. The SLD for that layer now contains:               <PointSymbolizer>             <Graphic>               <ExternalGraphic>                 <OnlineResource xlink:type="simple" xlink:href="http://www.dassh.ac.uk/images/carpark.svg" />                 <Format>image/svg+xml</Format>               </ExternalGraphic>               <Size>                 <!--<ogc:Literal>12</ogc:Literal>-->                 12               </Size>             </Graphic>           </PointSymbolizer>      And as before, displays fine in OpenLayers (within Geoserver) but not Google Earth. Any help gratefully received. Thanks Dan