ArcObjects joins and non-persistent fields after joining to multiple tables

I have inherited a truly awful and very large ArcObjects project that was originally written in VB and then ported to C#. Apparently the source code I have been given is not the latest version and I am chasing down errors everywhere. The most challenging problem goes like this... A number of tables are being joined (one after the other) to a Feature Layer via `IDisplayRelationshipClass.DisplayRelationshipClass`. Let's call these tables A and B (there are more than 2). Each of these tables has fields 1 and 2. The ITable objects are created by using IFeatureWorkspace.OpenTable with a DBF file. After the first join if I check the fields in my Feature Layer and at the end I can see A.1 and A.2 (field name prefixed with the name of the DBF file the table came from) - Great! However, after the second join A.1 and A.2 are gone, and in their place I have B.1, B.2 - not so great... Do I need to do anything to persist the additional fields across these joins, so that I end up with A.1, A.2, B.1, B.2 etc. ? If I do, either this behaviour has changed since the code was first written, or the code never worked. Given that the fields are properly prefixed they shouldn't be overwriting each other. The joins are happening like this:               IMemoryRelationshipClassFactory pMemRelFact = new MemoryRelationshipClassFactoryClass();     IRelationshipClass pRelClass = pMemRelFact.Open("TabletoLayer", (IObjectClass)pTTable, dbfJnField, (IObjectClass)pFeatLayer.FeatureClass, layerJnField, "forward", "backward", esriRelCardinality.esriRelCardinalityOneToMany);          IDisplayRelationshipClass pDispRC = (IDisplayRelationshipClass) pFeatLayer;     pDispRC.DisplayRelationshipClass(pRelClass, esriJoinType.esriLeftInnerJoin);      Any assistance with this issue would be hugely appreciated. **EDIT** : If this helps, I have observed something quite strange. After the join, pFeatLayer.FeatureClass.Fields.FieldsCount gives the original number of fields before the join, but ((ITable)pFeatLayer.Fields.FieldsCount gives the expected number (with joined fields). Unfortunately the pFeatLayer variable is then being passed back in to the join function, so it appears that tables are repeatedly being joined against the feature layer's initial state, hence only the last join making a difference. Any suggestions for why an ITable cast would give a different field count to the FeatureClass? Is this a bug or just silly design??


How can I enable Shapefile GUI Loader in pgadmin3?

I have installed PostgreSQL 9.1 with PostGIS 1.5.3 on Ubuntu 11.10. I also installed pgadmin3 1.14.0-beta1, following this instructions. If I remember correctly, when I installed PostGIS on Windows pgadmin automagically came with Shapefile GUI Loader plugin already installed. On Ubuntu however, the plugin drop down menu is empty. Instructions I found seems to be Windows specific. Is there a way to install / enable it on Ubuntu?


Why is "Replace With Model" not replacing my multipatch with a SketchUp model?

I am following the steps recommended by ESRI:   1. extrude polyline in ArcScene   2. Save as Layer File   3. convert Layer file to multipatch   4. convert multipatch to Collada   5. import collada file to Sketchup   6. edit model in SketchUp   7. start editing in ArcScene   8. select multipatch with Edit Placement Tool   9. Replace with Model - Navigate to saved skp **(NOTHING HAPPENS)** This only seems to (sort of) work if I export from SketchUp to Collada but only fully closed faces (and only some faces) are visible in ArcScene. Some faces can be seen from the reverse side. It's basically a mess. Not what I was expecting. **Why can't I replace the SketchUp model itself?** Is this procedure only meant for very simple models? I initially wanted to build the model in SketchUp but it seems impossible to export anything out of ArcGIS without the SketchUp 6 Plugin for ArcGIS. Exporting complex surfaces to COLLADA almost always fails and since TIN cannot be exported to SketchUp directly, it has to first be converted to Multipatch. This either fails if the surface is not very simple or yields unusable results. I then decided to do it the other way around (build the model in ArcScene and add SketchUp models to it) but I don't seem to be able to replace simple multipatches with models edited in Sketchup. I was able to create large Sketchup models in the past (up to version 9.3.1) with complex TIN, polygons, points and lines exported directly from ArcGIS using the SketchUp 6 plugin. I am not really sure what the workflow should now be if the recommended ESRI workflow doesn't really work.


How best to map lines based on multiple attributes?

I need to plot lines onto a map to display road quality. I'm already using colours to distinguish between different road conditions, but I also need to display another factor - the survey origin. There are only two different origins to display, but I'm not sure what's the best way to do this. Dashed lines with gaps are not appropriate as surveys can legitimately contain gaps. My current approach is to display the two types as follows:   1. Solid colour lines for one of the survey types.    2. For the second type, use a dashed line, but with the gaps drawn in a lighter shade of the same colour (shown below).  However it still seems a little confusing to see where surveys start and end. Are there any alternatives or best practices to follow? ![enter image description here](http://i.stack.imgur.com/PhVzb.png)


Looking for USA county level health and socio-economic indicator data that is comparable to data on other countries of the world

I want to compare USA counties with other countries. I am looking for USA county level health and socio-economic indicator data that is comparable to data on other countries of the world. Ideally the answers provided will come with URL links to the data sources. Ideally, if you are an expert in a domain area, you can share your knowledge about making comparisons using specific variables/indicators. Thanks


Geocoding with county level .Locator Style

I'm using ArcGIS 10.1 locators to geocode some addresses on a state by state level, using the dual ranges locator style. Since I have the administration levels city/county/state on both datasets (reference data and addresses to geocode), I would like to add them when creating the locator so that it geolocates on groups: city/county/state. The issue I'm finding is that on locator creation of Dual Ranges style, I can't find a way to add the county level, I only see the city left and right, and state left and right along with other reference attributes.


Enumeration Problem with Eclipse and ArcGis 9.3

i'm recently using Python for my Processing work that I do with ArcGis 9.3. I figured out, that using Eclipse (with PyDev) could be helpfull for debugging purpose. The geoprocessor is starting as demanded. Nevertheless i got into trouble using a Example-Script from Esri: http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=fieldmappings_properties               fcs = gp.ListFeatureClasses("block*", "Polygon")          for fc in fcs:      This causes an error:               File "C:\Python26\lib\site-packages\win32com\client\dynamic.py", line 228, in __getitem__         raise TypeError, "This object does not support enumeration"      The Script works fine when starting from ArcCatalog! It seems that the variable "fcs" is of type "instance" and that python ain't able to enumerate this type. But why doesn't ArcGis have a problem with this? Does anybody know this? :) Greetings, Markus


How to zoom to full map extent with mapserver?

I need to put checkbox with name "Zoom to extents" which will zoom to full map extent (first extent which appears by opening web page). Can someone help me? In mapfile I have this "EXTENT 563090 5072655 588220 5093325".


Mapserver, TMS, Scales zoom levels and how to deal with all of it

I have a whole bunch of data in my db that I need to draw at different zoom levels using Mapserver. Everything uses a 4326 SRID. My (custom) client, will fetch the data using 20 TMS zoom levels and images of 256x256 pixels. In fact, for every zoom level, these are the units-per-pixel that every zoom level uses:               <TileMap version="1.0.0" tilemapservice="http://myserver.com/cgi-bin/tilecache.cgi/1.0.0/">     <!-- Additional data: tms_type is default -->     <Title>myimagery</Title>     <Abstract/>     <SRS>EPSG:4326</SRS>     <BoundingBox minx="-180.000000" miny="-90.000000" maxx="180.000000" maxy="90.000000"/>     <Origin x="-180.000000" y="-90.000000"/>     <TileFormat width="256" height="256" mime-type="image/png" extension="png"/>     <TileSets>       <TileSet href="http://myserver.com/1.0.0/myimagery/0" units-per-pixel="0.70312500000000000000" order="0"/>       <TileSet href="http://myserver.com/1.0.0/myimagery/1" units-per-pixel="0.35156250000000000000" order="1"/>       <TileSet href="http://myserver.com/cgi-bin/tilecache.cgi/1.0.0/myimagery/2" units-per-pixel="0.17578125000000000000" order="2"/>       <TileSet href="http://myserver.com/cgi-bin/tilecache.cgi/1.0.0/myimagery/3" units-per-pixel="0.08789062500000000000" order="3"/>       <TileSet href="http://myserver.com/cgi-bin/tilecache.cgi/1.0.0/myimagery/4" units-per-pixel="0.04394531250000000000" order="4"/>       <TileSet href="http://myserver.com/cgi-bin/tilecache.cgi/1.0.0/myimagery/5" units-per-pixel="0.02197265625000000000" order="5"/>       <TileSet href="http://myserver.com/cgi-bin/tilecache.cgi/1.0.0/myimagery/6" units-per-pixel="0.01098632812500000000" order="6"/>       <TileSet href="http://myserver.com/cgi-bin/tilecache.cgi/1.0.0/myimagery/7" units-per-pixel="0.00549316406250000000" order="7"/>       <TileSet href="http://myserver.com/cgi-bin/tilecache.cgi/1.0.0/myimagery/8" units-per-pixel="0.00274658203125000000" order="8"/>       <TileSet href="http://myserver.com/cgi-bin/tilecache.cgi/1.0.0/myimagery/9" units-per-pixel="0.00137329101562500000" order="9"/>       <TileSet href="http://myserver.com/cgi-bin/tilecache.cgi/1.0.0/myimagery/10" units-per-pixel="0.00068664550781250000" order="10"/>       <TileSet href="http://myserver.com/cgi-bin/tilecache.cgi/1.0.0/myimagery/11" units-per-pixel="0.00034332275390625000" order="11"/>       <TileSet href="http://myserver.com/cgi-bin/tilecache.cgi/1.0.0/myimagery/12" units-per-pixel="0.00017166137695312500" order="12"/>       <TileSet href="http://myserver.com/cgi-bin/tilecache.cgi/1.0.0/myimagery/13" units-per-pixel="0.00008583068847656250" order="13"/>       <TileSet href="http://myserver.com/cgi-bin/tilecache.cgi/1.0.0/myimagery/14" units-per-pixel="0.00004291534423828125" order="14"/>       <TileSet href="http://myserver.com/cgi-bin/tilecache.cgi/1.0.0/myimagery/15" units-per-pixel="0.00002145767211914062" order="15"/>       <TileSet href="http://myserver.com/cgi-bin/tilecache.cgi/1.0.0/myimagery/16" units-per-pixel="0.00001072883605957031" order="16"/>       <TileSet href="http://myserver.com/cgi-bin/tilecache.cgi/1.0.0/myimagery/17" units-per-pixel="0.00000536441802978516" order="17"/>       <TileSet href="http://myserver.com/cgi-bin/tilecache.cgi/1.0.0/myimagery/18" units-per-pixel="0.00000268220901489258" order="18"/>       <TileSet href="http://myserver.com/cgi-bin/tilecache.cgi/1.0.0/myimagery/19" units-per-pixel="0.00000134110450744629" order="19"/>      </TileSets>     </TileMap>      I am aware that, depending on the projection I use, true scale changes differently. Some people have even produced scale tables for WGS84 at different latitudes for 72DPI output, which is very helpful to answer this question... so the question is: How are people dealing with this problem when they want to guarantee that some data is only drawn at a particular zoom level? This seems like such a basic question, but I am honestly curious. I guess I could arbitrarily pick MAXSCALEDENOM and MINSCALEDENOM scale values that are half way between the zoom levels. So using the table above, to guarantee that something should draw on level 13, but not level 14, I could say 1:40500, or * MAXSCALEDENOM 40500*. Is this right? It seems hacky :(


How to enter multiple image on a single page

I have 10 dynamic images. I wanna print these images (10) on a single layout page. How to do this using ARCGIS 9.2. Thanks a lot


Adding features/points/polygons to OpenLayer map

I'm trying to get a bunch of markers/points/polygons to show up on my OpenLayer map, but nothing seems to show up and the vector_layer seems to only have 2 SVG attributes when it should have way more than that, so maybe I'm not creating the features correctly?               var vector_layer = new OpenLayers.Layer.Vector('Points', {         styleMap: new OpenLayers.StyleMap({'default':{             pointRadius: 6,             labelYOffset: -15,             labelOutlineColor: "white",             labelOutlineWidth: 3,             label: "BOOB",             strokeColor: "#FF00FF",             strokeOpacity: 1.0,             strokeWidth: 6         }})     });          polygonFeature = [];     polygonGeom = OpenLayers.Geometry.fromWKT('LINESTRING(588508.747252596 168674.954513992,588706.355881724 168104.100450511,588805.174332032 167818.655647441,588904.002207028 167533.198996286)');     polygonFeature.push( [ OpenLayers.Feature.Vector(polygonGeom, {             label: 'Vallée de l\'impossible',             color: '#00FF66',             type: '5',             strokeColor: '#FF9966',             strokeWidth: 10         }     )]);     polygonGeom = OpenLayers.Geometry.fromWKT('LINESTRING(588591.788935473 168704.056645848,588799.712933324 168593.991578248,589007.644549979 168483.931724448)');     polygonFeature.push( [ OpenLayers.Feature.Vector(polygonGeom, {             label: 'Trainerlift',             color: '#00FF66',             type: '5',             strokeColor: '#FF9966',             strokeWidth: 10         }     )]);     polygonGeom = OpenLayers.Geometry.fromWKT('LINESTRING(589367.815099211 167613.858604876,589342.892993503 167453.459513931,589317.969563007 167293.056263815,589293.04480767 167132.648854482,589268.118727426 166972.237285751,589243.191322243 166811.821557544,589218.262592051 166651.401669799,589193.332536805 166490.977622361,589168.401156456 166330.54941513)');     polygonFeature.push( [ OpenLayers.Feature.Vector(polygonGeom, {             label: '',             color: '#00FF66',             type: '5',             strokeColor: '#FF9966',             strokeWidth: 10         }     )]);     polygonGeom = OpenLayers.Geometry.fromWKT('LINESTRING(589381.008650411 167618.595027528,589528.167834526 167597.665516203,589675.32803885 167576.739543001,589822.489263299 167555.81710792,589969.651507792 167534.898210995,590116.814772244 167513.982852311,590190.396786934 167503.526499788,590263.979056575 167493.071031836,590411.144360695 167472.162749675,590484.727395153 167461.709935416,590558.310684527 167451.258005792)');     polygonFeature.push( [ OpenLayers.Feature.Vector(polygonGeom, {             label: 'Kaiseregg',             color: '#00FF66',             type: '5',             strokeColor: '#FF9966',             strokeWidth: 10         }     )]);     polygonGeom = OpenLayers.Geometry.fromWKT('LINESTRING(588032.051690777 168677.694251669,587854.411858591 168531.960867246,587727.027545819 168473.087930543,587604.551815243 168406.840665774,587597.086384338 168370.382898673,587586.346776547 168338.842624253,587572.267213375 168280.657156328,587617.379141907 168257.594442098,587674.670785861 168168.20828954,587692.528735376 168068.210711088,587678.42167755 167996.516748919,587671.368022863 167960.669460802,587664.314284324 167924.821967987,587647.392407747 167882.037079818,587614.905936395 167857.292284218,587579.166995959 167848.10676651,587531.979824223 167861.864699831,587488.295691056 167881.805865479,587448.741633028 167913.198156398,587407.948520243 167940.909752369,587367.155783926 167968.621499271,587352.395598283 168002.34037867,587387.659707869 168005.667732583,587471.24959004 167951.596495736,587523.332360333 167935.589860972,587588.546726326 167916.282148895,587595.567211413 167960.59637938,587598.66600232 167982.344965964,587605.028849588 167994.264361834,587630.924627957 168033.627737266,587665.855685172 168074.609313393,587656.466602515 168150.18764367,587608.510272684 168237.303976917,587546.823442271 168285.416528806,587556.537111271 168317.010308028,587566.250678296 168348.603937425,587585.677506407 168411.790746861,587709.592724068 168479.2623002,587833.505151093 168546.735653008,587874.498771181 168568.238839737,587915.535212451 168611.021736516,588014.954848258 168698.700956018,588030.412917213 168679.334411072)');     polygonFeature.push( [ OpenLayers.Feature.Vector(polygonGeom, {             label: '',             color: '#00FF66',             type: '2',             strokeColor: '#FF9966',             strokeWidth: 10         }     )]);     polygonFeature.push( [ OpenLayers.Feature.Vector(polygonGeom, {             label: 'Schwyberg Schneeschuhtour',             color: '#00FF66',             type: '10',             strokeColor: '#FF9966',             strokeWidth: 10         }     )]);          vector_layer.addFeatures(polygonFeature);          map.addLayer(vector_layer);      Here's a jsfiddle, it was based on another fiddle that works for OpenLayers, I just added my code above to it, might not work as I guess it needs to be in the same area/region?: http://jsfiddle.net/fAqae/


"ImportError: No module named fiona" (post-installation of package)

I'm in need of the Fiona and Shapely modules to develop a QGIS 2 plugin, and thus downloaded them from http://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal and installed them. I have no trouble importing shapely, but importing fiona gives me "ImportError: No module named fiona" I am wondering if there's a step I'm missing besides the installation of the correct version (for 32-bit Windows and Python 2.7, using the standalone installer for QGIS) before being able to import them via the QGIS Python console.


Modelbuilder only outputs Info files and logs

I am developing a processing algorithm in ArcMap ModelBuilder. When I run it everything seems to work fine and running to completion. However when I go check the output directories I only find Info files and Logs, but no output rasters although I have these specified in the model. Does anyone know why this may be?


Label *beside* polygons in ArcMap 10?

I try to add labels to polygons in ArcMap 10 based on a field in the corresponding attribute table. However, the labels always appear _inside_ the polygon, and I can't find an option that lets me put the labels _beside_ the polygons. How do I achieve this? Thanks.


Get Lon Lat values from a GEOGRAPHY data type in PostGIS

After storing lon lat values as a GEOGRAPHY data type, how do I retrieve the individual lat lon values? **Failed attempt:**               SELECT id, geog, ST_X(geog), ST_Y(geog) FROM locations;      **Error:**               No function matches the given name and argument types. You might need to add explicit type casts.


How to sequentially increment date field in ArcGIS

I have created a date field in my point shapefile. I want to input date their. I am able to do so. Now I want to create a sequential increment with 6 second interval from previous point to next point. I have Google it but didn't find any solution. Please help me how can I do it with a huge data set. Thanks


How to download GeoTIFF files of TRMM product 3B42 (rainfall estimates)

I want to download GeoTIFF files of TRMM product 3B42. _(This is a rainfall estimate derived from multiple sensors of the Tropical Rainfall Measuring Mission satellite.)_ The _NASA/Goddard Precipitation Measurement Missions_ website directs me to the _TRMMopen ftp Server_ : **ftp://trmmopen.gsfc.nasa.gov/trmmdata/GIS** However, this sporadically asks for username and password. How can I get them?   _Is there an alternative way to obtain this dataset?_ I need precipitation data for each 365 days and 12 month of 2013, so downloading each file one by one is quite tedious.


Do I need to deal with warnings about row count and spatial index to use pgRouting?

After read this nice post from underdark A Beginner’s Guide to pgRouting, although I still have some little problems, I think I can begin the "Creating a routable road network" stage right now. I got a polyline shapefile already, but after I Add PostGIS Layers, I open PostGIS Manager and I don't know if these two red triangles would bother me later on:   * There is a significant difference between estimated and real row count. Consider running VACCUUM ANALYZE.   * No spatial index defined.  If they do, what can I do？ ![enter image description here](http://i.stack.imgur.com/5dhEl.png)


How to visualize 3D model in ArcGIS?

I have hypsometric map/model of mountain which I get by contour lines with Z value. Can you explain how to visualize 3d model in ArcGIS? I need to get something like nviz command in GRASS.


ArcObjects VBA: Setting Spatial Reference for Geometry Bag

Greetings, Within the ESRI SDK resources there is an example of combining polygons by use of a geometry bag. The following code appears:                   'Define the spatial reference of the bag before adding geometries to it.         geometryBag.SpatialReference = geoDataset.SpatialReference      That makes sense, based on some of the other documentation surrounding geometry bags, but when I tried it myself, I got a compile error saying that the method didn't exist. After looking at the geometry object model diagram, it appears as if the spatial reference property of a geometry bag is read- only... so what gives? Thanks, DR


How to add one or more points to an existing polyline or polygon?

Using the following code, I make a polyline with two points.                 vl = QgsVectorLayer("LineString", layerName, "memory")       pr = vl.dataProvider()       vl.startEditing()       fet = QgsFeature()       fet.setGeometry( QgsGeometry.fromPolyline( [QgsPoint(x1,y1), QgsPoint(x2,y2)] ))       pr.addFeatures( [ fet ] )      What I want is to add a line to this polyline while I keep only one id. So I can not use:                 fet.setGeometry( QgsGeometry.fromPolyline( [QgsPoint(x3,y3), QgsPoint(x4,y4)] ))      because this will save two lines with two different id's. I can see in the QGIS API that there is a command:                   addPart (const QList< QgsPoint > &points)         Adds a new island polygon to a multipolygon feature.      but I do not know if it works or how to use it. Does anybody have any idea how to add points or several points to an existing polygon or polyline?


Climatic variables

Could someone suggest me where to find free, very high resolution raster map of the world of climatic variables (such as temperature, precipitation....etc) ? I need a monthly temporal resolution, from 2000 to 2012 and a spatial resolution of about 1 km or larger.


Load PGDB with filename

this is my first question here and I have done extensive searches but still can't find the (full?) answer I'm looking for. Hopefully someone can help! I am loading a number of personal geodatabases (mdb) to PostGIS using OGR2OGR (and GDAL). I am able to get the whole database to load with no issues, but for my requirements I need to store the original filename alongside each record in each table (so that I can query/delete/filter at a later stage). At the moment I am doing this using a simple OGR2OGR script that loads all tables in the MDB (over 250 of them)...this is about the limit of my ability right now so any solution needs to be fairly simple if possible? My current simple script: ogr2ogr -f "PostgreSQL" PG:"host=** active_schema=** user=** dbname=** password=** port=5432" *.mdb -skipfailures -append -a_srs EPSG:27700 Thanks.


Create Polyline feature in Z M Enabled Featureclass

I want to create a polyline feature in Z M enabled featureclass.               Point1.x= 1000     Point1.Y = 1100     Point1.Z = 1200          PointCollection.addpoint Point1     Point2.x= 5000     Point2.Y = 5100     Point2.Z = 5200     PointCollection.addpoint Point2      But when I try to store feature as `Feature.shape = Pointcollection` it is giving this error: `Item not found in the collection`. Please help. Thanks.


How to restrict or block certain paths in NetworkX graphs?

I am trying to calculate shortest path between 2 points using Dijkstra and A Star algorithms (in a directed NetworkX graph). At the moment it works fine and I can see the calculated path but I would like to find a way of **restricting** certain **paths**. For example if we have following nodes: nodes = [1,2,3,4] With these edges: edges = ( (1,2),(2,3),(3,4) ) Is there a way of blocking/restricting **1 -> 2 -> 3** but still **allow 2 -> 3 & 1 -> 2**. This would mean that:   * **can** travel from 1 to 2   * **can** travel from 2 to 3   * **cannot** travel from 1 to 3 .. directly or indirectly (i.e. restrict 1->2->3 path). Can this be achieved in NetworkX.. if not is there another graph library in Python that would allow this ? Thanks.


Methods for lat/lon quality control?

I have a database with fields including latitude, longitude, city, state, and country. When mapped, it is clear that a number of the sites are in the wrong location - most commonly because of a sign error: ![enter image description here](http://i.stack.imgur.com/rVB7k.png) I was thinking of writing a script to check for such errors, along the lines of               if country = USA and lon > 0 set lon = -1*lon     if country in (select names from europe) and lat < 0 set lat = -1*lat      etc. This would be followed by additional checks by plotting the sites with their names over google maps, but this would get most of the errors.   1. What pitfalls to this approach should I anticipate?   2. Any suggestions for how to do comprehensively way?   3. Are there existing scripts that do this? It is hard to imagine that I am the first to face this issue.


Is there a way to add drop-down list of predefined variables to R-script menu in SEXTANTE QGIS?

I would like to create a drop-down list of variables (similar to what it is done for layers input) for my R script menu in SEXTANTE. Is it possible?


How to automate point-in-polygon queries in ArcView?

Layer1 = point shapefile (multiple points, geocoded) Layer2 = polygon (1 attribute; (1,2,3...)) I want a non-gis person to be able input a single address and be told the attribute of the polygon which it falls within. What is the simplest way to accomplish this? The user will be doing this in arcview. I use ArcInfo.


Updating routing graph based on GIS changes in DB

I am using Osm2PO for route finding which reads a graph file created from a pbf file downloaded from OpenStreetMap. I have my own GIS database where updates may be applied to the data. I would like Osm2PO to be able to generate a graph based on this DB. Does anyone know how I can generate a osm pbf file from a database created using Osm2Pgsql? I have tried using Osmosis with commands like:               osmosis --read-pgsql host="localhost" database="gis" user="username" --write-pbf file="OSMDump"       but it gives an error saying Task 2-write-pbf does not support data provided by default pipe stored at level 1 in the default pipe stack. Thanks Relations table schame               Table "public.planet_osm_rels"      Column  |   Type   | Modifiers      ---------+----------+-----------      id      | bigint   | not null      way_off | smallint |       rel_off | smallint |       parts   | bigint[] |       members | text[]   |       tags    | text[]   |       pending | boolean  | not null      Code: Here are the classes (I'll leave out the getters/setters): Node class:               private long id;     private int lat;     private int lon;     private String[] tags;      Way class:               private long id;     private Long[] nodes;     private String[] tags;      Relation:               private long id;     private String[] members;     private String[] tags;      parse method (gets data from DB and stores in the collections):               ArrayList<Node> nodes = getNodes();     ArrayList<Way> ways = getWays();     ArrayList<Relation> relations = getRelations();          // Process all nodes     for(Node n : nodes) {         this.gisHandler.onNode(n.getId(), n.getLat(), n.getLon());         if(n.getTags() !=null) {             for(int i = 0; i < n.getTags().length-1; i+=2) {                 this.gisHandler.onNodeTag(n.getTags()[i], n.getTags()[i+1]);             }            }         this.gisHandler.onNodeComplete();         this.gisHandler.closeNodeProcessing();     }               // Process all ways     for(Way w : ways) {         this.gisHandler.onWay(w.getId());         // Node refs         for(Long l : w.getNodes()) {             this.gisHandler.onWayNdRef(l);           }         // Node tags         if(w.getTags() != null) {             for(int i = 0; i < w.getTags().length-1; i+=2) {                 this.gisHandler.onNodeTag(w.getTags()[i], w.getTags()[i+1]);             }         }         this.gisHandler.onWayComplete();         this.gisHandler.closeWayProcessing();     }          // Process all Relations     for(Relation rel : relations) {         this.gisHandler.onRelation(rel.getId());         for(int i = 0; i < rel.getMembers().length-1; i+=2) {             this.gisHandler.onRelationMember("relation", rel.getId(), "multipolygon");         }              for(int i = 0; i < rel.getTags().length-1; i+=2) {             this.gisHandler.onNodeTag(rel.getTags()[i], rel.getTags()[i+1]);         }         this.gisHandler.onRelationComplete();         this.gisHandler.closeRelationProcessing();     }      Log output               ESTABLISHED CONNETION TO GIS DB     INFO   460,001 of 460,001 nodes extracted - 782M     INFO   33,582 of 66,118 ways extracted - 796M     INFO   43 of 827 relations extracted - 796M     INFO   Tiler finished at Mon Mar 04 16:16:42 GMT 2013     INFO   Starting Joiner at Mon Mar 04 16:16:42 GMT 2013     INFO   Caching relations from tr_raw.2po - 864M     INFO   0 of 43 relations cached - 864M     INFO   460,001 of 460,001 nodes cached (n034-e145) - 853M     INFO   33,582 of 33,582 ways read, 33,582 written            Total 33,582 tiled, 0 shared     INFO   Joiner finished at Mon Mar 04 16:16:43 GMT 2013     INFO   Starting Segmenter at Mon Mar 04 16:16:43 GMT 2013     INFO   0 of 0 nodes cached (shared) - 863M     INFO   175,929 of 222,327 nodes cached (n034-e145) - 830M     INFO   33,582 ways analyzed, 67,881 segments created (n034-e145) - 798M     INFO   55,065 vertices of 175,929 written - 853M     INFO   0 ways analyzed, 0 segments created (shared) - 853M     INFO   0 vertices of 0 written - 853M     INFO   Segmenter finished at Mon Mar 04 16:16:43 GMT 2013     INFO   Starting GraphBuilder at Mon Mar 04 16:16:43 GMT 2013     INFO   Transforming Ways - 853M     INFO   33,582 Ways read, 135,764 Edges cached - 817M       INFO   Transforming Vertices - 817M     INFO   55,065 Vertices read, 0 Restrictions cached - 814M     INFO   Finding SourceVertex EntryPoints - 814M     INFO   135,764 Edges analyzed     INFO   Creating NoTurnBits - 804M     INFO   135,764 Edges analyzed, 0 Crossings checked     INFO   Writing GraphFile            gis_2po.gph - 804M     INFO   55,065 entries written          INFO   135,764 edges written     INFO   GraphBuilder finished at Mon Mar 04 16:16:45 GMT 2013     INFO   Starting PostProccessor at Mon Mar 04 16:16:45 GMT 2013            [de.cm.osm2po.converter.PgRoutingWriter]     INFO   Creating sql file gis/gis_2po_4pgr.sql     INFO   67,881 Segments written.     INFO   commandline template:            psql -U [username] -d [dbname] -q -f "/home/sam/src/osm2po/gis/gis_2po_4pgr.sql"     INFO   PostProcessor finished at Mon Mar 04 16:16:46 GMT 2013     INFO   Loading Graph File            /home/sam/src/osm2po/gis/gis_2po.gph     INFO   Created with Version 4.6.9.4     INFO   Loading SourceVertex-EntryPoints     INFO   55,065 Vertices loaded. - 863M     INFO   Memory for 135,764 edges reserved. - 862M     INFO   135,764 Edges loaded. - 861M     INFO   55,065 Classes loaded. - 861M       INFO   Memory for 55,065 coords reserved. - 861M     INFO   55,065 Coords loaded.        INFO   Graph is in memory - 859M free     INFO   Services started. Waiting for requests at            http://localhost:8888/Osm2poService


QGIS Print Composer Export problems

When I attempt to “Export as PDF” a Print Composer image, it hangs up until I press cntrl/alt/del, whereupon I learn that QGIS is not responding and needs to be closed. I’ve tried this as jpg, jpeg, and tif. Don't know if this is related or a different issue--When I attempt to “Export as PDF”, it goes better until I open the new image in Acrobat Reader. Then I get a message that “An error exists on this page. Acrobat may not display the image correctly.” And indeed, all I get is the background raster (aerial photo) that my map is based on—none of the vectors, etc., that I have overlaid. I've seen in this forum that labels can be an issue, and to use the "new" labels from the ABC icon. Does this refer to labels created in Print Composer (which I have many of), or labels attached to layers (which I don't have any of)? I don't see any ABC icon, and don't understand what this means and cannot find further information Thanks very much for any help you might be able to offer— TVZ


ArcGIS desktop extension and prevent attribute editing

I am building an ArcGIS extension on desktop 10.1 (not add-in, but old extension). I built some forms to edit some feature class, where I implement business rules. I want to force the user to edit the data from these forms. So, I prevent showing the attribute table from the context menu when the user right-mouse click on the layer. But I want as well to disable the keystroke of showing the attribute table "CTRL-T" the user can still press "CTRL-T" and edit the attribute table and edit directly from the attribute table. how can I disable "CTRL-T" in the extension.


Is it possible to implement Geofencing in Openlayers?

We were planning to develop an application using Openlayers, which can display the incoming GPS signals as markers and create alerts , if the markers( positions) are outside a particular zone. Is this possible through Openlayers code ? or do we have to use something JSTS Topology suite with Openlayers ?


Script error searching for tools in ArcGIS 10.2.1 search window

Until I tried installing Visual Studio 6.0 and Crystal Reports 8.5 last week, my ArcGIS was working perfectly. After the installation, however, every time I try to execute any search in the search window in ArcGIS 10.2.1 (both ArcMap and ArcCatalog), I get a script error with the message _Object reference not set to instance of an object_ on Line 93. ![Script Error on line 93 char 5](http://i.stack.imgur.com/AqNeP.png) Below is the function from the file which is causing the error described.                   function DoSearch()         {         var st = document.getElementById("st_ID").value;         if ((st == null) || (st.replace(/\s/g,"") == "") || (st.lenght == 0))         {         if(GetContextCode(currentContextOnPage) != 6)         $('#st_ID').unbind('keypress');         else         {         var autoCompStr =  getAutoCompleteStrings();         $("#st_ID").autocompleteArray(autoCompStr.split('+'),         {         delay:10,         minChars:1,         matchSubset:1,              autoFill:false,         maxItemsToShow:15,         width:0         });         }              document.getElementById("st_ID").focus();         return;         }              var context = GetContextCode(currentContextOnPage);     **window.external.DoSearch(st, context);** // <-- Error line         }      The following are things I tried that did not yield any positive result:   * Uninstalled Visual Studio 6.0 and Crystal Reports   * Uninstalled and then reinstalled ArcGIS   * Replacing the `MdDlgContent.xsl` and `MdDlgHelp.xsl` files with the contents of `ver10.zip` file as described in ESRI KB38099 here.    * Updated my Java RE to the latest available this morning (Java 7 update 60 v7.0.600)    * Installed all Windows Updates for Internet Explorer   * Reset all Internet Explorer settings   * Allow execution of all scripts Surprisingly tool windows are not affected and I am able to run tools when I double click on them from the toolbox. The screen shot below shows the Buffer tool opened and displaying properly. ![Buffer tool window](http://i.stack.imgur.com/o24Km.png) ## How do I fix this error?


Loading an extension-related mxd in ArcMap by double clicking it

I am currently working in a company offering GIS solutions, and using ArcGIS tools on a daily basis. One of their main products is an ArcMap extension, which I am assigned on to correct some remaining bugs (my configuration being Windows 8 , ArcGIS 10.1 and Visual Studio 2008). It was impossible to open a custom mxd file by double clicking it. The file was loaded without the custom solvers, displaying a "naked" network. With lots of debugging and experimenting, I finally "solved" the problem using the ApplicationInitialized event, and loading the file from here with IApplication.OpenDocument if the application was launched from a double click. The idea was to let the file be loaded with the default method, and then load it the right way by triggering our own implementation of IPersistStream.Load. It worked fine at first, but with a particular file the load fails in ArcMap by double clicking it, displaying the following message: screenshot here The file can be loaded from ArcMap with File>Open or the initial browsing panel, is recent and not corrupted. Since the problem is happening right after our implementation of IExtension.Startup, I tried anything I could in this method but I finally understood it isn't supposed to contain file manipulations. Then I tried to force ArcMap to always open a new file on start, but it didn't work either. The class loading the extension:                public class OurExtension : IExtension, IExtensionConfig, IPersistVariant      {         [ComRegisterFunction()]         [ComVisible(false)]         static void RegisterFunction(Type registerType)         {             // Required for ArcGIS Component Category Registrar support             ArcGISCategoryRegistration(registerType);         }              [ComUnregisterFunction()]         [ComVisible(false)]         static void UnregisterFunction(Type registerType)         {             // Required for ArcGIS Component Category Registrar support             ArcGISCategoryUnregistration(registerType);         }             public void Shutdown()         {             //TODO: Clean up resources             application = null;         }             public void Startup(ref object initializationData)         {             application = initializationData as IApplication;                  if (application == null)             {                 return;             }                  //Listening to document events             SetUpDocumentEvent(application.Document);                  //Listening to the initialized status event of the application              (application as IApplicationStatusEvents_Event).Initialized += new IApplicationStatusEvents_InitializedEventHandler(ApplicationInitialized);                  //Language configuration             // ....              }              public void Load(IVariantStream stream)         {             //TODO: Load persisted data from document stream             Marshal.ReleaseComObject(stream);         }              public void Save(IVariantStream stream)         {             //TODO: Save extension related data to document stream             Marshal.ReleaseComObject(stream);         }                        #region EVENTS              //Wiring.         private ESRI.ArcGIS.ArcMapUI.IDocumentEvents_Event m_docEvents = null;              private void SetUpDocumentEvent(ESRI.ArcGIS.Framework.IDocument myDocument)         {             m_docEvents = myDocument as ESRI.ArcGIS.ArcMapUI.IDocumentEvents_Event;             m_docEvents.NewDocument += new ESRI.ArcGIS.ArcMapUI.IDocumentEvents_NewDocumentEventHandler(OnNewDocument);             m_docEvents.BeforeCloseDocument += new ESRI.ArcGIS.ArcMapUI.IDocumentEvents_BeforeCloseDocumentEventHandler(onBeforeCloseDocument);         }              public void OnNewDocument()         {             if (!newDocumentCreated)             {                 //Not listening to this event anymore ensures no error will come from this handler later on                 m_docEvents.NewDocument -= new ESRI.ArcGIS.ArcMapUI.IDocumentEvents_NewDocumentEventHandler(OnNewDocument);             }                  //If a new document is created, the boolean must become true to avoid re-loading the file from this class             newDocumentCreated = true;         }              public bool onBeforeCloseDocument()         {             //If the new document hasn't been created and the current one is being closed, it means it was loaded as a NetworkAnalyst document             if (!newDocumentCreated)             {                 //Setting the current document as clean before closing avoids the opening of the Save Dialog Box                 IDocumentDirty2 dirtyDocument = application.Document as IDocumentDirty2;                 dirtyDocument.SetClean();                      //Not listening to this event anymore ensures no error will come from this handler later on                 m_docEvents.BeforeCloseDocument -= new ESRI.ArcGIS.ArcMapUI.IDocumentEvents_BeforeCloseDocumentEventHandler(onBeforeCloseDocument);             }                  return false;         }              public void ApplicationInitialized()         {             System.Diagnostics.Debug.WriteLine("ApplicationInitialized");                  //When the application is fully initialized, if a new document hasn't been created, then the double clicked file isn't loaded properly yet             if (!newDocumentCreated)             {                 //Retrieve the double clicked file path from the application parameters                 ESRI.ArcGIS.Framework.ITemplates templates = application.Templates;                 doubleClickedFilePath = templates.get_Item(templates.Count - 1);                      //If the file path is correct, a new document is created (without user input and with the default template), then the double clicked file is opened                 //IApplicationDocument.OpenDocument is the method triggering the event that leads to calling the MobiAnalyst implementation of IPersistStream.Load (in Persist.cs)                 if (File.Exists(doubleClickedFilePath))                 {                     application.NewDocument(false, templates.get_Item(0));                          application.OpenDocument(doubleClickedFilePath);                 }             }                  //Not listening to this event anymore ensures no error will come from this handler later on             (application as IApplicationStatusEvents_Event).Initialized -= new IApplicationStatusEvents_InitializedEventHandler(ApplicationInitialized);         }     }      And a part of the Persist.cs file:               public partial class OurSolver : IOurSolver, INASolver, INASolverSettings2, IPersistStream     {         public void GetClassID(out Guid classID)         {             classID = Type.GetTypeFromProgID("MobiAnalystSolverCOM.MobiAnalystSolver").GUID;         }              public int IsDirty()         {             if (PersistDirty)                 return 1;             else                 return 0;         }              public void Load(IStream paramStream)         {             // Load properties into a property set             IPropertySet properties = new PropertySetClass();             (properties as IPersistStream).Load(paramStream);                  //Get back all loaded values into C# system arrays             object propertyNames;             object propertyValues;             properties.GetAllProperties(out propertyNames, out propertyValues);             System.Array propNameArray = (System.Array)propertyNames;             System.Array propValuesArray = (System.Array)propertyValues;                  // Use this property set to populate variables             //For each parameter, check existence first             int index = System.Array.IndexOf(propNameArray, "m_eOutputConnectivity");             if (index >= 0) { outputConnectivity = (OutputConnectivityEnum)(propValuesArray.GetValue(index)); }                  //And so forth             // ...              }        }      So now that I have (I hope) clearly explained the context and the problem, my question is: is it possible to load a custom extension generated mxd with our own loading method right from the start, preventing ArcMap to load it any other way ? or to force it to launch from a double clicked file as it launches from the .exe ? Maybe even to correct the file if this is a known problem, but I couldn't find anything clear about it.


Distance measurements across UTM zones: use geographic or planar approaches?

I have a survey grid spread across 3 UTM zones (36N, 36S, 37S). I want to find the nearest (or shortest) distances of the centroids of these grids to roads and various points between. It seems like there are too many compromises when using any kind of planar projection (read: with regards to **preserving distance between any number of points on the map** ). Should one just forget about using projections in this case and go for goedesic, or ellipsoidal (read: Geographic) techniques? Is there to anyone's knowledge a planar technique that will preserve distance between any number of points on the map? It does not seem like I can use an equidistant projection with exception of the gnomonic projection. Is this correct?


Can't order/sort String columns in ArcMap attribute table

I am new to this site as a registered user and new to GIS in general, and it has proven quite useful to me. I have a very annoying problem with the attribute table being filled by an ArcMap extension, every column of type String cannot be ordered/sorted at all. The table is supposed to display DateTimes, and it was chosen to convert them to Strings. I tried to change one of these fields to "esriFieldTypeDate" and it worked, meaning the dates are correctly sorted. Unfortunately, none of the columns using Strings (esriFieldTypeString) can be sorted. If the initial order by IDs is changed by a new ordre on another column, and then I try to sort a String column, it gets back to this initial order. by IDs. I have no control on the sorting operation, just data being initialized when creating a solver, and then given a value, as follows. Here is the initialization on creating a new solver:                       fields = new Fields() as IFieldsEdit;                  // Arrival time             field = new Field() as IFieldEdit;             field.Name_2 = UnlocalisableResources.arrivalTimeField;             field.AliasName_2 = MobiAnalyst.arrivalTimeField;             field.Type_2 = esriFieldType.esriFieldTypeString;             fields.AddField(field);                  classDefinition.Fields = fields;      And here is where the field value is set:                       dateTime = new DateTime();             dateTime += TimeSpan.FromMinutes(arrivalTime);             linesFeatureBuffer.set_Value((int)arrivalTimeFieldIndex, dateTime.ToLongTimeString());      Since I found absolutely nothing about this particular problem on various forums, I was asking myself if it may be a simple formatting or encoding problem on the Strings, or anything else someone would know about ?


Looking for a GeoJSON describing the french departments

Is there any place where I could find a GeoJson describing the borders of the french departments, or do I have to convert a .shp file?


OSM data on MapServer

I'm making an evaluation to replace the TomTom commercial Database (ex TeleAtlas) with Open Street Map data. What I need to do is **use the street map as a base layer for my WebGIS applications**. I use MapServer as application server and I made styles for features of the TomTom DB based on attributes values. I want to do the same with OSM data. Looking on the web I found many references to MapBox, TileMill, preconfigured style schemas and so on... but I have some questions/doubts about all that. 1) If I need to render this data through MapServer, can I avail of all these instruments? 2) Is there a way to convert those styles to MapServer .MAP files? 3) I imported OSM data from SHP files downloaded from a web site that regularly creates them from updated OSM data. I read something about OSM2PGSQL, OSM2PO, OSMOSIS and so on... but I don't really understand what they are and how they work and if I can use them with my actual database. Do I really need to import OSM data with such tools?


Convert shapes in CSV to shape file

I have a csv file in which one of the fields contains a "shape" polygon in ESRI format. The other fields are textual, numerical, ext. How do I go about creating a layer from only the polygons in the shape field? (Finally, I want to convert that layer to KML and load it on to google maps). Thanks for helping a GIS newb :)


Opengeo Geoexplorer WMS source singleTile property?

I was wondering whether there is a way to control what layers should be fetched as a single tile in a GeoExplorer composer application? OpenLayers.Layer.WMS objects have a singleTile property but it does not appear defined for gxp.plugins.WMSSource for instance, so adding the property to a source or a layer in composer.html does not appear to do much. If the line "var singleTile = false" in WMSSource.js is changed to true then every layer added via Add Layer are single tile, even if the source they belong to (defined in composer.html) is of ptype gxp_wmscsource and the WMS request is "tiled=true", perhaps because WMSCSource extends WMSSource. If I understand correctly, T.Schaub indicated sources should have a singleTile property sometime in the future here: https://getsatisfaction.com/opengeo/topics/opengeo_suite1_9_2_community_edition_issues_geoexplorer_white_background That would allow some control: all layers needing to be served a single tile could be put under one source. Right now things do not appear to work that way, however, so if there is wisdom for some sort of clarification out there I would be glad :)


Python Script for shape file to layer conversion

What is the python Script for Shape file to Layer Conversion? I tried the following...               import arcpy       from arcpy import env       env.workspace="working path"       arcpy.MakeFeatureLayer_conversion("source shapefile", "target name")


How to (vertically) register a DEM to GPS readings?

I don't know if what I ask is possible or not but let's try... I have two datasets:   * a DEM as a point cloud in a relative coordinate system, constructed with 3D algorithm structure-from-motion.   * 20 ground control points with absolute elevations values (between 130 and 140 meters) taken with a GPS.   * 20 points of the point cloud representing the GCPs in the relative coordinate system (georeferencing targets visible on the point cloud).  I would like to constrain the elevation of my point cloud DEM with the GPS ground truth elevation, in order to have a DEM with absolute elevation calibrated to my study area. At the moment, the study area is about 1 hectare and with slopes around max. 20% but the aim is to export the methodology in river catchment with a size of some kilometers-square and with max. slopes around 60%. Any help is welcome, preferably in ArcGIS or R but I can deal with other softwares if necessary! Thanks for the help.


How do you create and use a SQL Server spatial view in ArcMap?

All, (using SQL Server 2012, ArcMap 10.1) I have created a SQL spatial statement to test out how a) the union function works, and b) how creating a view of this data will work with ArcGIS. a) the function i'm testing is: SELECT GEOMETRY::UnionAggregate(shape) FROM CENSUS_TRACTS_2010_2877 WHERE PCT_ASIAN > 5 ...which gives the following correct result: ![Click image for larger version Name: spatialUnion.png Views: 0 Size: 37.9 KB ID: 25497](http://i.stack.imgur.com/nBo09.png) b) our database would greatly benefit using a spatial view of our boundary data (using a union, etc.) to display boundaries to our internal users as a single table. To accomplish this, it seems that a spatial view would be the best use case, as that gives us the option to edit/maintain one file, and the view will serve up a fresh version of the boundaries. Problem is, when I create the view in SQL Server, it will not show up in ArcMap, and I get the error: Warning: Could not add the specified data object to the map. I think I might be creating the view incorrectly, as this is the field properties ArcMap sees from the view: ![enter image description here](http://i.stack.imgur.com/D0zza.png) ...which doesn't seem correct. Can anyone point me to a place that describes how to create / register / use a spatial view in ArcMap / SQL Server 2012? Thanks! -mb


SAGA GIS ----> need to export shapefiles to SVG

I am trying to export three shapefiles to svg files but the problem I could not make these shapefiles polygon to black outlines to be export to svg files. How do I do that ? I tried to run that in ArcGIS 10.1 but it failed. HELP !!! Robert


Easiest way to find spatial differences between Polyline shapefiles

I run into this problem a lot. I have two polyline's and I need to test for Spatial differences in them. Usually I use Erase and I have my answer, but on this PC I now only have access to ArcGIS Basic license. I have found ways to do this by creating a temporary copy of the files and doing some editing, but there has to be a better way!


LeafletJS: Load Tile Layer based on bounding box

I have a LeafletJS map application with lots of layers. I have a few layers that only have imagery for certain regions across the world. Because everything goes on a world base map. All tile caches are generated as standard tile caches covering the world in web Mercator (Google tile cache system) and are served using a ArcGIS Server. Here is what I would like to do: Load a tile layer when certain bounding box comes into active view and then unload it when box is out. Is there a simple way to do this in LeafletJS without going through manual geometry check ?


SharpMap WMS - How to add labels to a map containing a VectorLayer

First, I'm new to SharpMap.   I'm adding in labels for a vector layer, but for some reason the labels are not showing up. My PostGIS data is in Geographic NAD 83 and the UI is OpenLayers so am converting it to Google's CRS. This is what my tile request looks like:               http://lh/customwms/wms.ashx?LAYERS=uscounties&SERVICE;=WMS&VERSION;=1.3.0&FORMAT;=image%2Fpng&TRANSPARENT;=TRUE&FILTER;=state%20%3D%20'FL'&EXCEPTIONS;=INIMAGE&REQUEST;=GetMap&STYLES;=&MAP;_TYPE=PGS&CRS;=EPSG%3A900913&BBOX;=-9179495,2913453,-8940360,3152589&WIDTH;=256&HEIGHT;=256      This is what I'm doing to get my Map object.                       public static Map CreateMap(List layerRequests)             {                 var map = new Map(new Size(1, 1));                 foreach (var layerRequest in layerRequests)                 {                     var vectorLayer = CreateVectorLayer(layerRequest);                     var labelLayer = CreateLabelLayer(vectorLayer, layerRequest);                     map.Layers.Add(vectorLayer);                     map.Layers.Add(labelLayer);                 }                 return map;             }                  private static LabelLayer CreateLabelLayer(VectorLayer vectorLayer, VectorLayerRequest layerRequest)             {                 return new LabelLayer("Labels:" + vectorLayer.LayerName)                 {                     DataSource = vectorLayer.DataSource,                     Enabled = true,                     LabelColumn = GetLabelColumnName(layerRequest),                     SRID = vectorLayer.SRID,                     TargetSRID = vectorLayer.TargetSRID,                     CoordinateTransformation = vectorLayer.CoordinateTransformation,                     Style = new LabelStyle                     {                         ForeColor = Color.Black,                         Font = new Font(FontFamily.GenericSerif, 11),                         HorizontalAlignment = LabelStyle.HorizontalAlignmentEnum.Center,                         VerticalAlignment = LabelStyle.VerticalAlignmentEnum.Middle,                         Offset = new PointF(3, 3),                         Halo = new Pen(Color.Yellow, 2)                     },                     TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias,                     SmoothingMode = SmoothingMode.AntiAlias                 };             }                  private static string GetLabelColumnName(VectorLayerRequest layerRequest)             {                 switch (layerRequest.Table.ToLower())                 {                     case "uscounties":                     case "states":                         return "name";                     default:                         return "district";                 }             }                  private static VectorLayer CreateVectorLayer(VectorLayerRequest layerRequest)             {                 //var cacheKey = String.Format("{0}_{1}_{2}:{3}",                  //    layerRequest.Schema,                  //    layerRequest.Table,                  //    layerRequest.SRID,                 //    layerRequest.Filter == null ? "" : layerRequest.Filter.Replace(" ", ""));                 //return VectorLayersCache.GetOrPut(cacheKey, () =>                 //{                     int? originalSrid = null;                     if (layerRequest.SRID != GeographicNad1983Srid)                     {                         originalSrid = layerRequest.SRID;                         layerRequest.SRID = GeographicNad1983Srid;                     }                          var dataSource = new PostGIS(ConnectionString, layerRequest.Table, GeometryColumnName, SpatialTableIdColumnName)                     {                         Schema = layerRequest.Schema,                         SRID = layerRequest.SRID,                         DefinitionQuery = layerRequest.Filter                     };                     return new VectorLayer(layerRequest.Table, dataSource)                     {                         SRID = GeographicNad1983Srid,                         TargetSRID = originalSrid.HasValue ? originalSrid.Value : layerRequest.SRID,                         CoordinateTransformation = ProjHelper.LatLonToGoogle(),                         Style = layerRequest.Style,                         SmoothingMode = SmoothingMode.AntiAlias,                         LayerName = layerRequest.Table,                         Enabled = true,                         IsQueryEnabled = true                     };                  //});             }      When I do the above directly through an MVC controller and zoom to map extents and spit out an image, I get the labels layer to show up over the vector layer in the image. However since the calls from my client (using OpenLayers) are discrete, I suspect that the labels are not being shown. So how do we show labels when using SharpMap WMS?


Open source implementation of "feature density" algorithm

I'm working on a dataset of house searches - 1 polygon for each area in which people want to find a house from an online search tool. This produces many overlapping polygons. It would be great to get a basic understanding of the places that are most frequently searched. You can do this in QGIS and other programs using transparency: ![enter image description here](http://i.stack.imgur.com/l9cI6.png) But ideally, you would create a new layer with the search density for each cell in a grid. This is exactly what the "feature density" algorithm does in ArcView 3.2 and I've seen it work to great effect. It creates a raster map from a mass of overlaid polygons. So the question is: is there an implementation of this algorithm for my polygon dataset for open source programs. I'm an R and QGIS user so one of those would be preferable. Many thanks!


QGIS – Raster Calculator: Using flat (no data) areas of an aspect-raster in the raster calculator

I´m playing around with the Raster tools, following more or less the qgis- tutorial but using my own data. When I calculate the aspect of a DEM, flat areas are (logically) left without data. However, when I try to make an addition with another rather afterwards in the raster calculator, the flat areas (no data in my aspect layer) are never taken into consideration, even if the raster I use for addition has data in this area. **For example:** Let´s say I´m looking for places facing south (135-225°) with slopes less than 15%. To find these places I have two rasters:   * Raster A: aspect 135-225° has the value 1, the rest 0 and flat areas without aspect have no data (the appear transparent)    * Raster B: slopes less 15% have the value 1, the rest 0 If I combine the two rasters in the Raster Calculator (e.g. like this: "ANP_aspect_sur@1" = 1 AND "ANP_slope_15@1" = 1), the output file has no data where Raster A has no data, independent of Raster B. I´m I doing wrong? Is there any work-around? I thought about setting flat areas to 0 (-zero_for_flat). But in this case 0 would stand both for north in regards of the aspect and for nodata, right? As far as I know ArcMap assigns -1 to flat areas. How could this be done in QGIS? Thank you and best regards


Iterating through an numpy array and index to a value in another numpy array

I am struggling to get this code to work I want to iterate through an numpy array and based on the result, index to a value in another numpy array and then save that in a new position based on that value.                    # Convert the sediment transport and the flow direction rasters into Numpy arrays         sediment_transport_np = arcpy.RasterToNumPyArray(sediment_transport_convert, '#', '#', '#', -9999)         flow_direction_np = arcpy.RasterToNumPyArray(flow_direction_convert, '#', '#', '#', -9999)              [rows,cols]= sediment_transport_np.shape         elevation_change = np.zeros((rows,cols), np.float)             # Main body for calculating elevation change                      # Attempt 1         for [i, j], flow in np.ndenumerate(flow_direction_np):             if flow == 32:                 elevation_change[i, j]  = sediment_transport_np[i - 1, j - 1]             elif flow == 16:                 elevation_change[i, j] = sediment_transport_np[i, j - 1]             elif flow == 8:                 elevation_change[i, j] = sediment_transport_np[i + 1, j - 1]             elif flow == 4:                 elevation_change[i, j] = sediment_transport_np[i + 1, j]             elif flow == 64:                 elevation_change[i, j] = sediment_transport_np[i - 1, j]             elif flow == 128:                 elevation_change[i, j] = sediment_transport_np[i - 1, j + 1]             elif flow == 1:                 elevation_change[i, j] = sediment_transport_np[i, j + 1]             elif flow == 2:                 elevation_change[i, j] = sediment_transport_np[i + 1, j + 1]                   #sediment_flow_np = np.concatenate((flow_direction_np, sediment_transport_np), axis = 0)         #case1 = numpy.where((flow_direction_np == 32)) & (sediment_transport_np > 0),                    # Convert the Numpy arrays back to rasters         #sediment_transport_raster = arcpy.NumPyArrayToRaster(sediment_transport_np, bottom_left_corner, raster_cell_width, raster_cell_height, -9999)         #flow_direction_raster = arcpy.NumPyArrayToRaster(flow_direction_np, bottom_left_corner, raster_cell_width, raster_cell_height, -9999)         elevation_change_raster = arcpy.NumPyArrayToRaster(elevation_change, bottom_left_corner, raster_cell_width, raster_cell_height, -9999)         elevation_change_raster.save(output_raster)      The error i get is: Running script elevation_change... Traceback (most recent call last): File "", line 606, in execute IndexError: index (655) out of range (0<=index<655) in dimension 0 Failed to execute (elevation_change)


Obtaining coordinates when computing distance of a polygon to a line

I have a shapefile of a county. I am interested in computing its distance to a line, which I've been doing using Near. I want to know the coordinates on the line that produces the minimum distance. How do I obtain the coordinates? I use ArcMap in ArcGIS 10.1


How to convert xml into readable gis format

I have data in xml format which contains a child element "GEOM" which has coordinates in the following format > `POINT (9.9632253030540205 52.9569277022282421)` > > `POLYGON ((9.7423702151211078 53.0121955350022205, 9.7434299430377305 > 53.0116226800417607, 9.7419839466114624 53.0117578529546236, > 9.7416965815231169 53.0120388635930269, 9.7423702151211078 > 53.0121955350022205))` > > `LINESTRING (10.1563217305953994 52.6132026962184227, 10.1562498991917636 > 52.6133444920414988, 10.1562499164679956 52.6134644695202240, > 10.1564744722547857 52.6135953416881534, 10.1566720631912712 > 52.6135844241491171, 10.1568606616562924 52.6134971580102473, > 10.1569414808197767 52.6133989904039652, 10.1569953469126961 > 52.6132408350926326, 10.1570132855248811 52.6130717740015399, > 10.1567528163921743 52.6130281593698683, 10.1564564331277936 > 52.6130663501461342, 10.1563576580763968 52.6132136013941718)` I can parse the table into csv or xls but how can I transform this format into SHP?


Markers on openlayers openstreetmap

I am trying to show some markers from a database in openlayers. I tried it in google maps in past using GDownloadURL fuction to read a json php generated file from my database. Now I tried the same with openlayers and I am not able to do that. I read about incompatibility between php and javascript but I think there have to be a way to do what I want. My file jsonZona.php returns an array like this: {"markers":[{"lng":"-3.880102031707764","lat":"43.46711564169348","limpio":"1"}, {"lng":"-3.862788677215576","lat":"43.4669443349282","limpio":"1"}]} limpio is an option to select one icon or other one. It can be 0 or 1. My code is:               <!DOCTYPE HTML>               <title>OpenLayers Demo</title>

     Zona:      <select id="zona" onchange="loadMarkers();">         <option value="0">=== Selecciona una zona ===</option>         <option value="1">Zona 1</option>         <option value="2">Zona 2</option>           <option value="3">Zona 3</option>         <option value="4">Zona 4</option>       </select>           Do you have any idea about how I can do that? Also, I want to refresh markers each X minutes. I think I can use setTimeOut function to do it but I don't know how I can apply it here. I edit: I think I can't use GDownloadURL function because it is related to google maps. How can I execute php code in javascript to take data?


cannot print listRasters

I'm trying to run this very simple script to check a problem in another more comlpex one.               import arcpy     arcpy.env.workspace= 'C:\\Users\\Umberto\\Desktop\\Prove_Script\\Karakoram\\temporary_01'          rst= arcpy.listRasters ()     print rst      I didn't find out what's the matter so far. In python console within arcgis it works without any problem. It gives me this error:               Traceback (most recent call last):       File "C:\Python27\ArcGIS10.1\Lib\site-  packages\pythonwin\pywin\framework\scriptutils.py", line 326, in RunScript         exec codeObject in __main__.__dict__       File     "C:\Users\Umberto\Documents\UniversitᝐhD\Karakoram\MODIS_Pakistan\Script\test_listClip.py",     line 4, in <module>         rst= arcpy.listRasters ()     AttributeError: 'module' object has no attribute 'listRasters'


Relative Path not working in ArcMap and ArcObjects

I'm using ArcMap 10.0 and Windows 7 64 bit. I'm trying to set a relative paths for my MXD file. My MXD is located c:\workspace\rastertest.mxd and the data is located at c:\workstation\data\testdted.dt2. When I set Relative Path to true in ArcMap's Document Properties or in ArcObjects using IMapDocument.SaveAs(true, true) the new raster data source will point to C:\Users\tester\AppData\Local\Temp\data. Do you know what could be causing this? I would like to eventually move around the MXD file and Rasters and keeping the same directory hierarchy. Thank you. Also, when I run ArcMap 10.0 on a Windows XP machine the relative paths work correctly. David


how to reproject data in EPSG:4326 to 3857 using SharpMapv0.9 for display on google maps

I have data stored in `SQL Server 2012` in **EPSG:4326**. I need to display this data on a google map in **3857**. but without an `ST_Transform` function, I cannot determine how to convert my data on the fly to **3857** to display them properly. Thanks in advance!


Allow viewer to embed OpenLayers in their own site?

I am trying to create a way for someone viewing my site to embed the map they are viewing into their own site. Not sure where to begin on this. Any help? Thanks!


Are there any geocoding plugins for QGIS that interpolate along linear features instead of querying web services?

I am curious if there are any tools for QGIS to facilitate geocoding tabular data using a local linear features layer (ie, a street map with street name and address ranges - similar to geocoding in ArcGIS). I am aware of Alessandro Pasotti's _GeoCoding_ plugin, but it queries Google Maps/OpenStreetMap rather than interpolating along line segments of a user-provided layer. One reason I am interested in this approach is that for some projects it is desirable to have geocoded points placed exactly on features from other project-specific layers, such as the street maps provided by local services or municipalities, which may not necessarily match the positions returned by web services. Any ideas - or any input in case I have a go at writing a solution from scratch?


QGIS server don't show layers in Openlayers

I have a project with 3 layers , I see the layers names in the GetCapabilies and also as WMS layer in QGIS , But in Openlayers I get the tile empty. I've used the following code :               var P4326 = new OpenLayers.Projection("EPSG:4326");         var P900913 = new OpenLayers.Projection("EPSG:900913");         var center = new OpenLayers.LonLat(34.87726678, 32.04670294).transform(P4326, P900913);         var extent = new OpenLayers.Bounds(34.865,32.042,34.890,32.054).transform(P4326, P900913);         var zoom = 15;         var map, layer;              function init() {                         var options = {                 controls: [                              new OpenLayers.Control.Navigation(),                         new OpenLayers.Control.ScaleLine(),                         new OpenLayers.Control.PanZoomBar(),                         new OpenLayers.Control.LayerSwitcher(),                                          new OpenLayers.Control.MousePosition()                     ],             maxExtent: extent,             restrictedExtent: extent,                        displayProjection: P4326         };              map = new OpenLayers.Map("map",options);         var layerOptions = { zoomOffset: 11, resolutions: [76.4370282714844, 38.2185141357422, 19.1092570678711, 9.55462853393555, 4.77731426696777, 2.388657133483885, 1.194328566741943, 0.5971642833709715] };         var base = new OpenLayers.Layer.OSM("Base", "", layerOptions);               layer = new OpenLayers.Layer.WMS("WMS",                     "http://localhost:8081/qgis/qgis_mapserv.fcgi.exe",                      {                         layers: 'Water',                         format: 'image/png',                         map: 'D:/OSGeo4W/apps/qgis/bin/MyCity.qgs'                      },                       {                         buffer: 1,                          isBaseLayer: true,                         graphicZIndex: 1                      }                     );              map.addLayers([base,layer]);          And only the OSM layer show , when I switch to the WMS , nothing shown. Any Idea?!


Classifying small structure in water using IR band

I was wondering how to identify small structures (eg. beacons) in a water body. I have worked with RGB images and its almost impossible to classify waterbodies in these images. How does IR band help here? Will they be good enough to say that this pixel belongs to water body and this pixel doesn't. I hope I am clear enough. Kindly ask if you need more information, Cheers N


Self organizing maps and spatially Constrained Clustering in R

There are a few algorithms to perform spatial clustering in R but most of them focus on point pattern analysis (for example here). I would like to perform spatial constrained clustering for polygon data, something similar to this. There are some interesting Open-Source Tools to do this task like SOMVIS and other tools on the site from this link. But rather than using "another" tool I would like to try this in R since I work a lot in R and I'd like to keep that flexible working environment. So there seems to be very good information here. Does anybody have expirience with a similar task and can anybody give me some advice on good ressources, packages, books etc? Best,Johannes


Why is it possible to annotate a layer without being in an edit session?

My colleague discovered that you don't have to be in an edit session to annotate a layer. Are the annotations still saved to the database? If, yes: HOW without an edit sesstion??? If no: Where are they stored then?


Where to find qgsaffine in the menu?

I installed the plugin qgsaffine but cannot find the entry in the menu bar. Where do I find this. Can anyone here help me with this? best regards desputin


Remove duplicate features based on attributes using ModelBuilder?

I need to create a model in the ArcGIS ModelBuilder. I am working with a feature class of zip-codes for a state. I have got to the point where the zip- codes that have duplicates are selected from the feature class. There is a field called "Spots" within this feature class that has numeric values from 0-10. Of the zip-codes that have duplicates, I want to delete the feature that has the smaller number in the "Spots" field. Furthurmore, if the spots field is the same for the duplicates, I'd like to keep only the bottom row. I hope this makes sense! Any help would be great!


unable to create the polygon using openlayer.geometry.polygon

I tried to generate Point using OpenLayers.Geometry.Point(), which worked beautifully so I tried to produce a ploygon similarly with the same concept, but I m unable to see it. Please go through my code and let me know where I m wrong. Thanks in advance.               <script type="text/javascript">              var options = {                 projection : new OpenLayers.Projection("EPSG:900913"),                 units:"m",                 maxResolution : 156543.0339,                 maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34,                         20037508.34, 20037508.34)         }         var map = new OpenLayers.Map("map",options);         map.addControl(new OpenLayers.Control.LayerSwitcher());         var gMap = new OpenLayers.Layer.Google(                 "Google Streets",                 {                     'sphericalMercator':true,                     'maxExtent': new OpenLayers.Bounds(-20037508.34, -20037508.34,                             20037508.34, 20037508.34)                 }         );              var vector = new OpenLayers.Layer.Vector("Polygon Layer");              map.addLayers([gMap,vector]);              var proj = new OpenLayers.Projection("EPSG:4326");              var style = {                 strokeColor: "#00FF00",                 strokeOpacity: 1,                 strokewidth: 3,                 fillColor: "#00FF00",                 fillOpacity: 0.8,         };              var p1 = new OpenLayers.Geometry.Point(78.595062,12.971104).transform(proj,this.map.getProjectionObject());         var p2 = new OpenLayers.Geometry.Point(75.595062,18.971104).transform(proj,this.map.getProjectionObject());         var p3 = new OpenLayers.Geometry.Point(72.365874,10.362149).transform(proj,this.map.getProjectionObject());         var p4 = new OpenLayers.Geometry.Point(71.148523,15.374596).transform(proj,this.map.getProjectionObject());         var p5 = new OpenLayers.Geometry.Point(74.785412,11.258741).transform(proj,this.map.getProjectionObject());         var point = [];              point.push(p1,p2,p3,p4,p5);         var ln = new OpenLayers.Geometry.LinearRing(point);         var pf = new OpenLayers.Feature.Vector(ln,null,style);              vector.addFeatures([pf]);                   map.zoomTo(1);               </script>


Extracting rooftops using MATLAB

I am using Matlab to extract rooftops of buildings and I want an orthoimage i.e. a .jpg file, a world file .jgw and a shape file .shp as input. A mask is needed to "hide" the pixels of the image which do not belong to the roof.I am getting these masks from metadata (shp), superimposing orthophotos and metadata using the same reference system. So, does anyone know where I can get a sample of .jpg, .jgw and .shp files to test the algorithm?


SQL Server UNion of geography feature returns FULLGLOBE result?

I have some trouble with sql server 2012. I store coordinates of french cities in my database as geography object (with ESRI 4326) and i want to make the UNION of some cities. I have in result (with the method `AsTEXT()` ) :   * If I ask for 100 cities : FULLGLOBE   * If I ask for 1 cities : I have the good coordinates  There is a limit of how many cities i can union ? (I do my sql request in c# with ASP .NET MVC 4 :               DbGeography result = System.Data.Spatial.DbGeography.PointFromText("POINT EMPTY", 4326);          //PolygonFromText("POLYGON((0 0,0 1,1 0, 0 0))", 4326);;         string resultString = "";          try     {       var commune = db.Communes         .Where(com => com.IDCommune.StartsWith("073"))         .Select(com => com);            foreach(var com in commune)       {         if (com.coordinates == null)         {              }         else         {                                  result = result.Union(com.coordinates);         }                          }      Thank you ! EDIT / I solved my problem : i put my polygon in geometry type and not in geography type ans it works =)


Spatialite database creation problem (QGIS DB manager)

I am trying to create a Spatialite database in QGIS 1.8.0. Step one of instructions is: Right click on the Spatialite entry in the Browser tree and select Create Database. The Spatialite icon is frozen. It does not respond to right click or anything else. Anyone who encountered this issue before?


finding closest -longest line in qgis

how can i find closest line of polygon to the point within it in Qgis?.i have used mmqgis plugin for this but hub layer and polygon layer plcement are not matching though both are having same CRS


Ohio State Plane to Lat/Lon

I've looked into a few other posts/libraries as far as converting between State Plane (Easting/Northing) to get a Lat/Lon value, however I've run into some trouble. I saw here (http://stackoverflow.com/questions/1676958/coordinate-transform) that there were a few libraries that would be useful in doing such a conversion. I decided to give Java Map Projection Library a shot because it seemed to be more straight forward in terms of usage than say GDAL or CTS. But.. alas that is not the case. Below you can see some dumby code that I am trying to use to get the correct coordinates, but it is outputting (garble) information that I'm not quite sure about. I guess I have not found 'documentation' or examples as to how the code is intended to be used, and I am not extremely familiar with coordinate based systems, only that I need lat lon. Which leads me to the reason I am doing this. I am developing a product that uses WorldWind 2.0 SDK, and in order to plot points, it is my understanding that it needs to be in the form of Latitude and Longitude. I have roughly 2000-n rows in a database, all containing State Plane based coordinates that I need to programmatically convert to lat/lon in order to plot points on a map. So I guess I am asking if anyone knows of preexisting documentation/examples that relate to my problem, or if someone can spot out what I am doing wrong. Code:               import com.jhlabs.map.proj.Projection;     import com.jhlabs.map.proj.ProjectionFactory;     import java.awt.geom.Point2D;          public class Conversion()     {         public static void main(String[] args)         {               // Easting  = 01495728               // Northing = 00663563                    Projection epsg = ProjectionFactory.getNamedPROJ4CoordinateSystem("nad27:3402");               Point2D.Double pEPSG = new Point2D.Double(01495728, 00663563);               Point2D.Double test = new Point2D.Double(0, 0);               epsg.transform(pEPSG, test);                    System.out.println(test.x + ", " + test.y);               System.out.println(epsg.getPROJ4Description());          }     }      This code outputs:               856515.186461105, 5819341.3114590645     +proj=lcc +a=6378249.145 +es=0.006803481196021999 +lon_0=-82d30 +lat_0=38d00 x_0=609601.2192024384 +y_0=0.0      Using this code Code 2:                       Projection epsg2835 = ProjectionFactory.getNamedPROJ4CoordinateSystem("nad27:3402");             Point2D.Double pEPSG2835 = new Point2D.Double(01495728.0, 00663563.0);             Point2D.Double test = new Point2D.Double(0, 0);             epsg2835.inverseTransform(pEPSG2835, test);             System.out.println("x: " + test.getX() + "\ny: " + test.getY());             System.out.println(epsg2835.getPROJ4Description());      I get,               x: -71.5472000389142     y: 43.48764838968165     +proj=lcc +a=6378249.145 +es=0.006803481196021999 +lon_0=-82d30 +lat_0=38d00 +x_0=609601.2192024384 +y_0=0.0      I am not entirely familiar with the second line, only that it is outputting in Lambert Conic Conformal form. Otherwise, from my understanding, I am giving it the NAD27 Zone (3402) of South Ohio, Easting point of 001495728 and Northing point of 00663563. After manually doing the conversion from http://www.ngs.noaa.gov/cgi- bin/spc_getgp.prl It shows that is should be                ===========================================================               East(Feet)        North(Feet)      Datum     Zone      INPUT =  01495728.0        00663563.0       NAD27     3402      ===========================================================               LATITUDE        LONGITUDE         AREA          DD MM SS.sssss  DDD MM SS.sssss                 --------------  ---------------   ----          39 48 29.30270   84 17 42.17103   3402      (this is DDD MMM SSSS) but can be converted to decimal. Any help is appreciated, Mike PS: I am not stuck on using this library so if you have other suggestions with documentation/examples or know the format that needs to be set I am entirely open to switching. ## EDIT I may have had Easting/Northing backwards to begin with, I remember updating the code shortly after posting (sorry about any confusing) but I believe they are correct now. I have updated my code such that                   public class Conversion         {              // 00663563 01495728 3402              public static void main(String[] args)               {                    double meters =  .3048;                    double lat = 00663563.0 * meters;                    double lon = 01495728.0 * meters;                              Projection nad27= ProjectionFactory.getNamedPROJ4CoordinateSystem("nad27:3402");                    Point2D.Double p_nad27= new Point2D.Double(lon, lat);                    Point2D.Double test      = new Point2D.Double(0, 0);                         nad27.inverseTransform(p_nad27, test);                         System.out.println("Longitude: " + test.getX() + "\nLatitude: " + test.getY());                    System.out.println(nad27.getPROJ4Description());                }        }       ## Which now outputs                  Longitude: -84.29503354393064        Latitude: 39.80814993524988        +proj=lcc +a=6378249.145 +es=0.006803481196021999 +lon_0=-82d30 +lat_0=38d00 +x_0=609601.2192024384 +y_0=0.0      I guess I should've assumed the information given would be in US feet, and the program requires meters, however this seem to have fixed the problem.


Looking for cloud hosting similar to QGIS cloud

I have about 6 or 7 large clients who each require some form of personalised online mapping service. My aim is to produce a secure login required database for each client using my shapefiles and open source mapping. In essence something like QGIS Cloud, but that i have full control over. When i make a change to the shapefile it should update on the online map. All the online map needs to do is have layer control, basic query, measure and print. print composer will be standard with my company's logo on each print and theirs. also there will be no editing function, and display style will be set by me. UPDATE: QGIS Clouds limits are too constrictive.


How to create a TIN in arcGIS from 5 points using VB.NET

I am asking this question as I do not have any experience in VB.NET coding. I tried to follow ESRI help but I did not quite understand it. I have 5 points with X,Y and Z dimensions. How to add these 5 points to make a TIN? I want VB.NET code. Thank you very much in advance.


How to enable 3D analyst in ArcGIS through VB.NET?

I tried to create a TIN and suddenly an error comes saying "3D analyst is not enabled". In ArcGIS it can be done through managing extensions. How to do it through vb.net ?


PostgreSQL : Question about dropping tables inside funtions

I am writing a PostgreSQL code where I have a function wich is used multiple times in a single query with different input values. Inside the function I create some tables and use them. What is the correct way to handle those tables? should I drop them at the end of the function (right before the RETURN), or should I use temp tables? Thanks!


PostgreSQL : question about SELECT .. WHERE .. = max()

If you have, for example;               SELECT * FROM data      WHERE line = min( (SELECT length FROM lines) )            AND number < 500;      (It's just an example, not a real code) How does PostgreSQL react when the result from the MIN has a number > 500 ? Is he then going after the second MIN or what happens ?


How to add a new column into an attribute table in ArcGIS Online?

Is it possible to add a new column in the attribute table using the ArcGIS Online version or do I have to return to my home computer and do this through QGIS? A little background to help better understand exactly what I'm doing: I am working with ArcGIS Online at work and have successfully uploaded my parcel data after using QGIS on my home computer to convert it from the geo database into a shape file. I'm being asked to list each parcel by the property owner. I figured the best way to do this would be to add a field in the attribute table named 'owner' and populate the attributes that way.


Pyqgis 2.2 : How to allow editing on layer and features

I'm writing a pyqgis plugin with qgis 2.2 I succeeded in accessing and displaying vector data (geometries & attributes). Now I would like to allow editing for all my layers and all features with layer’s in-memory editing buffer in order to be able in a 2nd time to commit/rollback the editions : -> modifying features (geom & attributes) -> adding features (geom & attributes) -> deleting features (geom & attributes) I read the qgis cookbook part called "Modifying Vector Layers with an Editing Buffer". But there is not examples showing the structure of the code. I would like to get, if possible the method I should use? Is it possible to get the structure of the code please? Which classes and which functions should i use ? Thanks.


How to batch-process attribute tables in QGIS (or GRASS)?

I'm using GRASS 6.4.3 in Linuxmint 16. I have a bash script for GRASS which I use to process almost 300 raster files. The script first imports some raster files (`r.in.gdal`), then does some calculations and classification (using `r.mapcalc` and `r.reclass`). And finally transforms the resultant raster to vector (`r.to.vect`) and saves it (`v.out.ogr`, using `type=area`). Let's say each vector files has a field labeled _category_ and that it takes only two values 1 and 2. As I'm interested only in the total area of polygons with _category = 2_ and with an area higher than 10,000 m2, I open each vector file in QGIS, edit its attribute table, calculate the area of each polygon and eliminate all of them with _category=1_ and _$area <10,000_. But I have to do it manually, Is there a way to do it in a batch process within QGIS? Or even better, is it possible to do it in GRASS? Is it possible to edit the attribute table within the command console in GRASS? Could I do it in the same bash script which I use to do all the other processes in GRASS? I've been reading this but I'm not sure how to apply it to my problem. I couldn't find how to calculate the polygons area and add it to a new column using GRASS. I think I could use `db.select` to search for the polygons I want to eliminate, but I don't know how to do it. Thanks for your help!


Create a table with open() in a loop using the SearchCursor and InsertCursor

I like to create a table with open() in a loop using the SearchCursor and InsertCursor, but I don't know how. Before I used a few geoprocessing tools to get a field for percent. The Attributtable of the raster looks like this ![enter image description here](http://i.stack.imgur.com/KAja8.jpg) So I need to write the field percent with the value 8 in a new table to get a result which looks like this: ![enter image description here](http://i.stack.imgur.com/HqxkP.jpg) This is where I'm working on with ArcMap10.2.1:               import arcpy     import os     from arcpy import env          env.overwriteOutput = True     env.workspace = r"D:\Julia_T\projekt\testdataA"          #folder to list     ascFileList = arcpy.ListFiles("*.asc")          print ascFileList     #works     for ascFile in ascFileList:     # geoprocessing steps     ascFileName = os.path.splitext (ascFile)[0]     print ascFileName     #works     rastFile = ascFileName + "_output.img"     print rastFile     #works     #run the tool     arcpy.ASCIIToRaster_conversion (env.workspace + "\\" + ascFile, env.workspace + "\\" + rastFile, "INTEGER")          # Process: Projektion definieren     arcpy.DefineProjection_management (env.workspace + "\\" + rastFile, "GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]]")     # Process: Feld hinzufügen     arcpy.AddField_management (env.workspace + "\\" + rastFile,"Prozent","DOUBLE")     # Process: Feld berechnen     arcpy.CalculateField_management(env.workspace + "\\" + rastFile,"Prozent","( [Count] /53959) *100", "VB")     #tabelle bauen     with arcpy.da.SearchCursor(env.workspace + "\\" + rastFile,["Value","Prozent"],""""Value" = 8""") as sCur:         outputfile = r"D:\Julia_T\output\output.txt"         with arcpy.da.InsertCursor(outputfile,["Value","Prozent"]) as iCur:                    for row in sCur:                     print row [0], row [1]                     f = open (outputfile, 'w')                     f.write ("Value\nProzent")                     f.close()      How can I get the percent from the value 8 in a new table?


Solar irradiation calculation using r.sun

I am trying to compute the global solar irradiation for a region and the run times seem to be a bit too high. I have as inputs a Digital Surface Model with the buildings and a Digital Terrain Model for the surrounding area. The PROJ_INFO is               name       : Lat/Lon     proj       : ll     datum      : wgs84     ellps      : wgs84      The PROJ_UNITS are               unit       : degree     units      : degrees     meters     : 1.0      The DSM has 8020 Rows, 8782 Columns and 70431640 Total Cells. The resolution of the DSM is 0:00:00.03303. The DTM has 1080 Rows, 1476 Columns and 1594080 Total Cells with a resolution of 0:00:00.28913. These are the steps I did for the r.sun calculation   1. Set the region to the area covered by the DTM and the resolution to the resolution of the DSM              g.region rast=DTM@PERMANENT res=0:00:00.03303   2. Overlay the DSM and the DTM to get a high resolution elevation map using r.series              r.series input=DSM,DTM output=Overlay method=maximum   3. From the Overlay map I generate slope and aspect maps              r.slope.aspect elevation=Overlay slope=Slope aspect=Aspect   4. I run r.sun on using the following command              r.sun -s elevin=DSM aspin=Aspect slopein=Slope glob_rad=GlobalRad day=262 The whole process ran on a system with two Intel Xeon l5430 CPU @ 2.66 GHz with 8 GB of RAM and it took 15 hours to finalize 55% of the process. What am I doing wrong? Am I missing something, is it normal to run this long? Please help me understand how should I compute solar irradiation starting from two elevation maps, a Digital Surface Model that contains the buildings and a Digital Terrain Model for the area that surrounds the Digital Surface Model. Thank you!


What is correct entry to Input Location (GPFeatureRecordSetLayer)*?

I use: http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Network/ESRI_DriveTime_US/GPServer/CreateDriveTimePolygons/execute What is correct entry to **Input Location (GPFeatureRecordSetLayer)** ? I try:               {"type": "Point","coordinates": [-105.01621,39.57422]}      but I get : "Invalid value for parameter 'Input_Location'"


Displaying multiple records in CartoDB with common zip code

I am uploading multiple records and want to use five digit zip code as the georeference. I would like to display each of those records on a map. Some of the records have identical zip code fields, meaning that several records share a single zip code. In the map view, only one of those records, among the handful that share a single zip code, appears. Is it possible to show on the map all of the records that share that single zip code?


gdallocationinfo is not recognized

I tried to run **gdallocationinfo** from my FWTools shell and got a message saying: "gdallocationinfo is not recognized as an internal or external command, operable program or batch file". So I checked the installation folder and didn't see any file with this name. So I am guessing that something could be missing. I've also tried to search for the file on Google but without success. I am using FWTools 2.4.7 installed on Windows 7. Any idea on how to fix this? Thanks