While updating some ArcObjects projects to ArcGIS 10, I realized that I don't have a comprehensive logging strategy. Sometimes it's log4net. Sometimes it's System Trace/Debug. Sometimes custom logging. Sometimes all three within in the same project. log4net certainly seems to be popular. I use it and I have had no trouble with it, but I don't feel like I'm experienced enough with log4net to anticipate possible issues with its use. This question is for ArcGIS Desktop only: AddIn or COM extensibility. I think the answers to the same question for ArcGIS Server might be different and deserve its own question and its own set of tags. What issues exist with using log4net as a logging framework for ArcGIS Desktop? Some related Stackoverflow.com questions:   http://stackoverflow.com/questions/576456/log4net-versus-tracesource http://stackoverflow.com/questions/98080/what-is-the-best-logging-solution- for-a-c-net-3-5-project http://stackoverflow.com/questions/2410438/log4net-performance http://stackoverflow.com/questions/126540/what-is-your-net-logging-framework- of-choice


Extracting all address locations from street centerline file

I have a project in which I want to "extract" all of the geocoded addresses from a street centerline file (with my defined offset and whatever other user defined input is needed). If it is helpful here is a description of what type of format a street centerline file is in. Currently the only way I know how to do this would be a brute force geocode (i.e. make all possible options and geocode the points that way). Which isn't an impossible option but I would like to see if a more efficient means exists. I mostly use ESRI software (I have access to machines running 9.2 and 9.3) but if an easier solution exists in some freeware package I'm open to anything. I also have access to MapInfo through my university which I would be willing to use if a simple solution exists. Also all of the street centerline files are in .shp format so any other program will have to either use the shapefile format or have the ability for me to convert the shapefile to a useable format (I assume a trivial step). I have a very little bit of programming experience in Python (and more extensive experience with statistical software but that won't really help out here). So if I had code options I suppose an ArcScript with a GUI or Python would be preferred. Also my "universe" of locations I am creating will include street intersections, so if anyone can point to a solution to extract all of the street intersections in the street centerline file (and record both the intersecting streets) I would appreciate this as well. I assume this is more likely to already exist in some ArcScript. **Edit:** To address DavidF's concerns, I know what information is contained in a street centerline file, and I know they are not actual and verified street addresses. For this project I am not making my own geocoder, I am simply defining the universe of address locations according to the street centerline file itself (I also know this universe will be dependent on how far I decide to offset the address locations). The immediate goal of this question is simply to define a coordinate for all potential addresses. I'm assuming all potential addresses are integers between the minimum and maximum values for the centerline. For this project it is ok that they are not real or verified. For alittle bit more insight into the project and its goals, often with inferential spatial statistics distributions are created via creating random locations within your study boundary and calculating distributions from those random samples. Often times the universe of potential locations is dictated by residential addresses (i.e. a potential location has to be defined by whatever geocoder you are using, it can't be everywhere within the study boundary). Since these residential addresses are likely clustered in space, I want to see if functions like Ripley's K tend to be biased in using complete spatial randomness to define the sampling distribution as opposed to using the actual locations of addresses (defined apriori by whatever you are using to geocode those addresses). I know that if I use a parcel based geocoder that pretty much all of these concerns are circumvented. I am still interested in extending the analysis to street centerline files though because as far as I'm aware street centerline files are still regularly used to geocode addresses, and so such a question is still pertinent. I plan on conducting the analysis with a parcel based geocoding system as well. As far as DavidF's and Mark Ireland's concern about the "realness" of the addresses if I use every integer value, it is a legitmate concern given the nature of the project. If I use more addresses than really exist, it will induce artificial clustering of addresses. I would likely conduct post hoc specificity tests using Both David's suggestion (addresses only every 40 feet by a sampling strategy) and Mark's suggestion (verifying real addresses from some outside source). In either case I still want to be able to extract all the address points from the street centerline file. I am not verifying the accuracy of the geocoder from the onset, I am seeing if complete spatial randomness conforms to the distribution of points that a geocoding process could potentially give. I understand the errors associated with street centerline files, but I want to mimic how geocoding is actually conducted with a street centerline file. Also if people can point to some literature that they think would be pertinent I would appreciate it. I know of a bit of work done on the accuracy of geocoding, but I have not seen any work addressing this particular issue.


How to perform a cascaded combine from python script in QGIS?

I'm working with a large dataset, and I need to be able to combine up to 400,000 polygons. I have been using the `QgsGeometry::combine(QgsGeometry* geometry)` function and simply looping over all geometries in an interative fashion like this:               union_geoms = geometries[0]     for geometry in geometries:       union_geoms = union_geoms.combine(geometry)      This works fine for most of my data, (the largest list of polygons I have gotten it to complete is ~30,000.) But I have two sets of ~200,000 and one of ~400,000 and I can't get this to complete in a timely fashion (I have let it run for days to no avail). So I started looking for a better method to combine these geometries, and I found `geos::operation::geounion::CascadedPolygonUnion` This algorithm, described here, is well suited to my application as the polygons of interest contain a lot of adjacency. I found a couple references to implementations of this in Qgis, here in 2010 and here in 2013, but it doesn't appear to have made it into the API (unless I'm looking in the wrong place!) So my question is how would I go about implementing this type of algorithm, or more simply how can I use the existing implementation in GEOS from my own (python) scripts? From the 2013 link, > you can use `QgsGeometry::asGeos()` in the plugin instead of wkt-export / > wkt-import. For cascaded union, there is the method `GEOSUnaryUnion(const > GEOSGeometry* g1)` in the c-api. The argument seems to be a geometry > collection, which can be created with `GEOSGeom_createCollection`. But there doesn't seem to by python bindings for the `asGeos()` method. Anyone have suggestions as to how to proceed?


ArcPy merge datasets with slightly different fields

i have many (>15) shapefiles which have slightly differing fields.               s1: (Name, age, layer_1, ...)     s2: (Name, age, layer_1, layer_2, ...)     ...     s_n: (Name, age, layer_1, layer_1_extra, ...)      I want to combine s1,s2 up to s_n into a new feature class/shapefile with attributes               s_merge: (Name, age, layer_1, layer_1_extra, layer_2, ...)      Field order is irrelevant. layer_1_extra should be set to ' ' or 0 depending on type, where features come from e.g. s1 ()which does not have layer_1_extra)). Do I have to program this myself using search cursors (to get the field names), add field tool and insert cursors, or is there a way to coerce e.g. the merge tool to do what I want? So far i tried to use the merge tool, but this fails with               arcgisscripting.ExecuteError: ERROR 001156: Failed on input OID 0, could not write value ' ' to output field SCHICHT_2      Field SCHICHT_2 is a number field, so of course arcgis can't write ' ' to it. Code for setting the fieldMap is               for shapepath in ...:       land_shape_paths.append(shapepath)       fieldMappings.addTable(shapepath)     arcpy.Merge_management(land_shape_paths, land+'_full.shp', fieldMappings)      I had guessed ArcGIS was aware of field types and tried to write sensible "empty" values depending on field type. Apparently not, or my data is more botched than I think. Any help (especially on a tool more suited to my needs than merge, or on the needed fieldMap magic) is appreciated!


Setting "R Folder" Path in QGIS Sextante

I have installed R via the R-Project website. I have QGIS installed via OSGEO4W (currently 1.9.0 Master), and have Sextante plugin installed and working with GRASS and SAGA providers. I am now trying to get R to run, but with no luck. I initially installed R to Program Files, but found mention that perhaps the space in the file path was an issue, so I have re-installed to C:\R\R-3.0.1\ What paths do I need to enter the "R Folder" and "RScripts Folder" configuration area in Sextante? Or am I missing something?


Near analysis with mixed feature types in ArcObjects

I am trying to emulate the Near (analysis) ArcGIS tool in ArcObjects. http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00080000001q000000 I want to use Mixed Feature Types. I have a point, polygon and line feature class and I want to use Near to compare all three of them with each other. This can be done one featureclass at a time like so (pseudocode logic):   1. Create IFeatureIndex    2. Store my feature class in IFeatureIndex.FeatureClass   3. Use IIndexQuery.NearestFeature for every IGeometry in a feature class to get distance to the nearest feature The problem I am running into is that I can only store one feature class in IFeatureIndex. I need to store three different feature classes (points, lines and polygons) to be able to properly execute my comparison. How can I do this? ESRI's feature that I linked above has managed to do this but there is unfortunately no way to peek at the code behind the geoprocessing tool that I know of. **Edit: I have solved this. See the answer below.**


ImportError: No module named qgis.core

I am on Ubuntu 13.04. I get the following error message -                   Traceback (most recent call last):           File "analyse.py", line 1, in <module>             from log import shelve           File "/home/shubham/SMART/TaxiData/log.py", line 27, in <module>             from demo import *           File "/home/shubham/SMART/zones/demo.py", line 5, in <module>             from qgis.core import *         ImportError: No module named qgis.core      Actually, everything was working fine till today morning. I guess this might be due to a package update. The qgis version I am using is 1.8.0-2~raring1. The remote repository is http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu/ raring/main amd64 Packages. I tried looking around on Google but my search was fruitless. So, I will really appreciate any help or pointers you guys can give :) Thanks.


What kind of table is bingHybrid?

I closed all table but I don't wan't to close underlying map eg like bingHybrid in mapinfo. How to prevent. Any detail about there map and way to handle while closing layers would be appreciated.


trouble with i.landsat.toar failing to identify satellite

I am trying to use the i.landsat.toar tool on L7 bands. I have tried to use both the MTL and MTLold, but no matter what I try, it returns "Failed to identify satellite." What am I doing wrong?


SPOT NDVI resolution

I downloaded SPOT S10 NDVI data which is supposed to be 1km spatial resolution. When I open the images in ArcMap the resolution is definitely not 1km and the NDVI values seems to be inverted with higher values where I expect lower values. Can anyone tell me why I have this problem and how to rectify it? It was downloaded from the vgt.vito.be website. It displays a range of values between 0-255, which I tried to change to the real NDVI values by using the formula provided on the website: (0.004* digital number)+(-0.1). I assumed the digital number to be the image and I therefore used the raster calculator to do the calculations. The new values make sense except that it still seems to be inverted (e.g. higher NDVI values where I expect lower values and the other way around). The pixel size of the images are also huge compared to my AVHRR data at 1km resolution. ![SPOT NDVI image](http://i.stack.imgur.com/Xl1QH.jpg)


Joining two polygon layers based on distance?

I'm new to GIS so this question may be an obvious one. I have one polygon layer of urban land use and another polygon layer of swamps. How do I join the two layers so that I get a column in the attributes tables that gives me the distance of the closest land use polygon to that of each swamp?


What is the difference between the compact build and standard build of the ArcGIS JavaScript API?

I am creating a JSAPI application using version 3.2/3.3 and have recently gone through the page detailing the difference between the compact build and standard build. Right now, I am confused about which build I should use. (I know a few people will use iPhone while others will use a PC to access our application.) So what should I use in my application? Since in the compact build, a few tools are not supported, I cannot create all applications in it. Software platform: ArcGIS Server & Desktop 10.1 Device platform: Windows , iOS & Android


What's the mature solution for label placement?

I am working on an android map application, while I need to place the labels for points/lines/polygons manually. I have googled and I found this: https://www.ads.tuwien.ac.at/research/labeling/ But it seems that it is last updated at 2004, I am not sure if this manner is out of date. And further more, it just lable the points, while I need to other kind of feature like line,polygon. So I wonder if there is a better solution? * * * Maybe I do not make myself clear enough. I am not looking for what should be placed in the map but how to make the features in the map labeled easy readable and without overlap.


How to open most recent directory using PyQGIS?

For example, when I add a vector layer, next time that I want to add another layer it opens up where I chose my last layer from. How would one implement this in Python and/or PyQgis? I'm writing a plugin, and I want user to select layers in the same way as above.


GeoExplorer Limit by Filter layer property not filtering correctly?

Using GeoExplorer to visualize data from GeoServer, I'm able to use the layer's Display "limit by filter" feature to remove certain features from the map, but when I use the Identify tool to expose the features remaining, I find some points with features that should not be included based on the filter. Does the Identify tool pull ALL data from the source data layer that matches that point on the map, and in that case, shouldn't there never be a point displayed on the map that contains ONLY features that violate the filter conditions (I have that situation)? Any help would be appreciated.


Recommended way to explicitly distinguish 2D from 3D locations

In strongly typed object-oriented programming environment, I want to make an explicit distinction between two types of Locations:   1. One type would be 2D (along Earth surface), thus having Latitude and Longitude. With a DEM available, Elevation would be a function of Latitude, Longitude, and the given DEM model. This type would represent positions of terrestrial or water-floating objects moving along the Earth surface.   2. Other type would be (inherently) 3D, with independend Elevation, intended to represent aerial, underwater or subterraneal positions and trajectories. So my question is: > Is there already any de-facto standard or commonly used name for such > distinct types of locations?


How do I generate a large number of maps?

I have to make a large number (hundreds) of distribution maps of species. I have a shapefile that contain the distributions for each species, and for each one, I would like to get a map as an image (jpg, png or otherwise) which contain the name of the species concerned, the legend (to distinguish areas of annual distributions, breeding, non-breeding, etc. ...). Do you have any solutions which would automate this task? If possible with an OpenSource software like QGis (with Sextante?) for example? Potentially, I can use PostGis, but I'd rather use QGis. Thank you.


Uploading Polygon Shapefile to Garmin GPS. How to View all Polygons?

I am trying to upload a polygon shapefile to a Garmin 60CSx unit. The polygon shapefile is a small area containing polygons of vegetation types. There are are 53 polygons (records) in the shapefile. I am using DNRGPS v6.0.0.15 Only one of the 53 my polygons I have uploaded appears in the GPS unit. I do not know why This is what i have done   1. Open DNRGPS and connect to Garmin.   2. Go to File-->Load From-->File... Locate Polygon Shapefile.   3. When I choose the shapefile, the 'Select TIDENT Field' dialogue prompts and I choose a field called 'SITE'. The SITE field has the same value for all 53 records ('Forest Stand 101').   4. Now the polygons are in a table under 'Tracks'. There's 2150 Tracks. I choose Tracks-->Upload. The 'Upload To' dialogue prompts and I choose 'Named tracks'   5. GPS beeps and I have a successful upload.   6. I open GPS, go to the 'Tracks' menu and see my new track 'Forest Stand 101'. I open that track and choose the 'Map' button to view my polygons in the map.   7. This is where I notice only one of the 53 polygons is displaying. How to I get all polygons to display? Thanks, MIke


Experiencing transformation anomalies when performing a Save As to convert coordinates between NAD83-Z14 and NAD27-Z13

Good morning all: I have recently discovered QGIS and have been hoping to find a solution for converting bacthes of xy coordinates between two projection systems for our mapping system. I have known good coordinates for both datums that I am trying to convert between, but even though I believe I'm doing the right steps in QGIS, my coordinates are still out by a small margin, which is where my question begins... Prior to finding QGIS, for single coordinate conversion I have been using the free Java-based Coordinate and Data Transformations tool that is available on the internet from Charles L. Taylor. I've attached an image of the two known coordinates from this tool. **As my rating does not allow image posting, I've provided the text data of my coordinates. If anyone wants to see the images, please reply and I can e-mail them. Original coords in NAD83/WGS84 Zone 14N (EPSG:4326)               Lat/Long: 49.362977,-101-742026     UTMs: x 300914.226, y 5471423.864      Converted coords in NAD27 Zone 13N (EPSG:26713)               Lat/Long: 49.362924,-101.741634     UTMs: 736577.110,5472689.933      So from here, I had imported my list of coordinates (original datum is NAD83/WGS84) into QGIS to get my list of points. After adding the corresponding UTM coordinates using the Export/Add Geometry function, I can see that the UTMs in the attribute table are the same as my original .csv file. After conversion to what I thought was NAD27-Z13 using QGIS, my first coordinate comes back with the following coordinates:               Lat/Long: 49.36297733,-101.74205733     UTMs: 736548.431,5472694.612      When I plot the above coordinate on the map I have with the known good points already on the map, obviously they don't line up. What I'm wondering is if I'm missing a step or if there are options that must be set during conversion. From what I can tell of QGIS, if I can find a solution to this, it will make batch conversion between datums much quicker. Many of the coordinate files that I receive are in .csv format and QGIS seems like the perfect application for what I need, however, I'm hoping that someone that has more experience can point me in the right direction. Thanks in advance for any and all replies, Jeff M


ESRI JS API - How to get event object from Draw Toolbar onDrawEnd

I am using the `Draw Toolbar` in the Esri Javascript API v3.4 and connecting to the `onDrawEnd` event using `aspect.after(drawingToolbar, "onDrawEnd", drawEndHandleFunction, true);` I am using the `Draw Toolbar` with the `EXTENT` tool to allow my user to select features by drawing a box around them. So far it is working fine. However, I want the user to be able to add and subtract features from the selection using the `CTRL` and `SHIFT` keys while drawing. I was able to do this in Chrome using the `event.ctrlKey` and `event.shiftKey` properties of the `event` global variable. Firefox does not appear to have an `event` global variable like this and so my function doesn't work. Firefox apparently passes an event as a parameter in the function, but that is not available because I used `dojo/aspect`. Is there a better way to handle this? Otherwise is there a way to get a map mouse event that triggers the `onDrawEnd` event in the `Draw Toolbar`?


How to create desire lines in QGIS?

How can I show the flow coming from an Origin-Destination matrix as desire lines? I need a result like the one in the picture below. ![desire lines](http://i.stack.imgur.com/tTp9y.jpg) I need to scale them proportionally to its value (coming from a linked MDB) and I like that the lines are a bit curved (but I can use straight lines too).


PgAdmin cannot load postgis for a database

Postgis works fine on my other postgresql databases, but I can't load postgis and postgis_topology extensions on a new database. I get following error message:               ERROR: could not load library (path to PostgreSQL): unknown error 126      Off course I could work in a different database with postgis loaded, but I don't like the idea that my new databases might not support postgis. How to solve this problem? I have PostgreSQL 9.2, PostGIS 2.0.1 and PgAdmin III 1.16. EDIT: My system is Windows XP SP 2. And the statement I used: > CREATE EXTENSION postgis SCHEMA topology VERSION "2.0.1"; I have created schema "topology" manually, but it makes the same error for


QSpatiaLite: Cannot create table

I am running QGIS 1.8 (SpatiaLite 3.0.1) and QSpatiaLite 6.0.1. I have a spatial table `EventPrecise` (with geometry column `p` in EPSG:4326). I want to join this table with another, non-spatial table `Event` and produce a new spatial table out of it with EPSG:21781, while at the same time filtering on a non-spatial attribute `t`. This is my query:               SELECT e.id, e.oid, e.type, e.subtype, e.t, ST_Transform(ep.p, 21781) AS p     FROM event e LEFT OUTER JOIN eventprecise ep ON e.id = ep.eid     WHERE datetime(e.t) > datetime('2013-02-05 18:20:00') AND datetime(e.t) < datetime('2013-02-19 08:31:00');      When running this query in QSpatiaLite with options "Create Spatial Table & Load in QGIS", and geometry column = "p", I get the error:               '%s' doesn't correspond to a geometry field, try with another field name      Creating a View works though.. is this a bug? **EDIT** : Turns out that it works when doing an `INNER JOIN`, so `p` is never null - still, is this normal behaviour?


Adding a class for null value

I'm making a graduated style map and I would like to add a class that would represent null values. I can add a class for zero (0) value ... meaning some of the areas reported zero report, but some areas don't have reports (i.e. null values). How can I add a class for null values? Thank you in advance. Herdie Hizon


How to request a limited no of features in Overpass api?

I am using Overpass api to query Building data from OpenStreetMap. the query string is like this               (way[building](bbox);node(w););out body;      This works really fine (the bounding box is specified by Openlayers). Now i want to improve it, such that only 10 buildings are returned by the query, to speed up the process. For this i used the query               (way[building](bbox);node(w););out 10;      but doing this returns only 10 nodes like here What i want is 10 buildings.


How to cluster features based on their proximity?

I have around 500 features (Forests) that I want to cluster based on their proximity, and then work with those clusters. I only have the ID, and shape area of those features. How can I cluster them?


QuantumGIS 1.8: how to define bounding box within Add WFS Layer dialog

I use QGIS 1.8 under WIN XP in Standalone Installer Version. I need to limit the extent of the data to be downloaded via WFS because of the large amount of data in the requested layer. In older/different versions of QGIS there used to be a check box within the Add WFS layer dialog to limit the WFS download to the actual view. In my version of QGIS it is missing. What is the best way to set a bounding box for WFS download or how can I get above mentioned check box?


How to generate jVectorMap for United Kingdom (UK)?

I have shapefile for UK , i need to convert this to the jVectorMap Here is my script               python ^        converter.py ^        ./shapefile/map.shp ^        ./output/jquery-uk.js ^        --width 400 ^        --where "ISO = 'GBR'" ^        --language en ^        --country_name_index ? ^        --country_code_index ? ^        --minimal_area 40000 ^        --buffer_distance -0.5 ^        --simplify_tolerance 10000 ^        --longitude0 ? ^        --name UK      how to find the values(?) country_name_index, country_code_index and longitude0? I have referred the following pages, http://stackoverflow.com/questions/11068645/how-to-generate-a-new-map-for- jvectormap-jquery-plugin http://jvectormap.com/documentation/gis-converter/


how to findout semi attched or detached polygon in Qgis?

![enter image description here](http://i.stack.imgur.com/ermJF.jpg)i m quite new to GIS,i've got polygon shapefiles and i want to find out the way that polygon are attached,semi attched or detached.i have area and perimeter of polygons,but i want to know length and width seperatelly of polygon.how to findout these two parameters?and i also want to findout the direction of that polygon facing towards street. thank you


popup in unrequired field/layer

I am new in webGIS. I am using WMS layer. I used ftl file in the geoserver directory and WMSGetFeatureInfo for popup required information. Every thing is ok but the popup activates even in unrequired features/layer. I just want to popup while clicking specific layer.               var layersToBeQueried=[kathmandu,bhaktapur,lalitpur];           var popup;      identify = new OpenLayers.Control.WMSGetFeatureInfo({                      autoActivate: false,                      queryVisible:true,                      maxFeatures: 4,                      eventListeners: {                          "beforegetfeatureinfo": function (event) {                              this.layers = removeLayersOutOfRange(layersToBeQueried);                          },                          getfeatureinfo: function(event) {                                                  if (popup) {                                                     popup.dialog("destroy").remove();                                                 }                                                     if (event.text.length =0) {                                                     alert("No features found");                                                     }                                                     else{                                                     var xx=(event.xy.x)-150;                                             popup = $("
" + event.text + "
").dialog(                                             {closeOnEscape: true,show: { effect: "blind", duration: 80 },                                             position: { my: "left+"+xx+" bottom+"+(event.xy.y), at: "left top", of: "#map" } });                              $('.ui-resizable-handle').css("left","46%");                                         popup.show(); //show the popup upon activating the control                                     }                                        }                                     }                  });              map.addControl(identify);


Why my python script of r.watershed has no output？

I type those code in pyscripter,               import os     import sys          #set up GRASS environment variables     sys.path.append(os.path.join(os.environ['GISBASE'], 'etc', 'python'))     import grass.script as g     import grass.script.setup as gsetup     gisbase = os.environ['GISBASE']     gisdb = 'C:\Users\Heinz\Documents\grassdata'     location = 'newLocation'     mapset = 'TC'     gsetup.init(gisbase, gisdb, location, mapset)          #run r.watershed module     #set thresh = 5000     g.run_command('r.watershed', elevation = 'hc', threshold = 5000, accumulation = 'acc1', drainge = 'dra1', basin = 'bas1', stream = 'str1', half_basin = 'hbas1', visual = 'vis1')     print g.read_command('g.list', _type = 'rast')      PS. I set the output half.basin as half_basin because the following error will occur as I set it as former one,               Message File Name   Line    Position         SyntaxError                      keyword can't be an expression (module2.py, line 27)    C:\Users\Heinz\Documents\pyscript\module2.py    27      and here's the output, ![enter image description here](http://i.stack.imgur.com/C7GoB.png) there are no new raster file generated, and I don't know where I make mistake. * * * **Update#1** This is my code:               import os     import sys          #set up GRASS environment variables     sys.path.append(os.path.join(os.environ['GISBASE'], 'etc', 'python'))     import grass.script as g     import grass.script.setup as gsetup     gisbase = os.environ['GISBASE']     gisdb = 'C:\Users\Heinz\Documents\grassdata'     location = 'newLocation'     mapset = 'TC'     gsetup.init(gisbase, gisdb, location, mapset)          #run r.watershed module     #set thresh = 5000     g.run_command('r.watershed', elevation = 'hc', threshold = 5000, accumulation = 'accu1', drainge = 'dran1', basin = 'basi1', stream = 'stre1', half.basin = 'hbasi1', visual = 'visu1')          #check result     print g.read_command('g.list', _type = 'rast')      I use **drainage** and **half.basin** as my parameter, and here's the output: ![enter image description here](http://i.stack.imgur.com/o19zD.png) * * * **Update#2** I tried the script below,               import os     import sys          #set up GRASS environment variables     sys.path.append(os.path.join(os.environ['GISBASE'], 'etc', 'python'))     import grass.script as g     import grass.script.setup as gsetup     gisbase = os.environ['GISBASE']     gisdb = 'C:\Users\Heinz\Documents\grassdata'     location = 'newLocation'     mapset = 'water_test_2'     gsetup.init(gisbase, gisdb, location, mapset)          #import raster data     #g.run_command('r.in.gdal', input = 'hc', out = 'hc')          #run r.watershed module     #set thresh = 5000     g.run_command('r.watershed', elevation = 'hc', threshold = 5000, accumulation = 'accu', drainage = 'dran', basin = 'basi', stream = 'stre', half = 'hbas', visual = 'visu')          #check result     print g.read_command('g.list', _type = 'rast')      And the output looks fine,               *** Remote Interpreter Reinitialized  ***     >>>      ----------------------------------------------     raster files available in mapset <water_test_2>:     accu basi dran hbas stre visu          raster files available in mapset <PERMANENT>:     hc          ----------------------------------------------      **My conclusion is, we can use python to call r.watershed in GRASS 6.4.3 from outside, but one of the input name must be 'half'** Thanks everyone that helps me successfully get the result I want.


d3.geo.path() to draw a path from GIS coordinates

Trying to take GIS data of the zip codes of the Bronx and turn it into a map using d3.js. But I am having trouble rendering. Could you show me proper use of d3.geo.path() ?               [ [ -73.84463693999993, 40.90475939500004 ], [ -73.84443733899991, 40.90423928800004 ], [ -73.84443555299993, 40.904234630000076 ], [ -73.84332154899994, 40.90397722300008 ],...]      These numbesr are taken from NYC zip codes map: https://nycopendata.socrata.com/Social-Services/Zip-Codes-Map/zsjh-u7ve In fact, this question goes for any list of GIS coordinates. How do I turn it into a path? I could not convert the documentation this into code. https://github.com/mbostock/d3/wiki/Geo-Paths


ArcGIS 10.0/10.1 - arcpy - automate projection tool with different datum or projection

I am getting stuck with a task that is slightly different from the posts I found so far on this same website. Assumption: all layers have a defined coordinate system Problem: I would like to automate a python script (using arcGIS 10.1 but 10.0 is fine as well) that projects a list of vector layers (some of which with different coordinate systems) to a common coordinate system, given by a target vector layer. The main issue I would need help with is how to automate something this: 1) check if the coordinate system of the current vector layer is the same as the target layer 2) if not, check if the datum is the same 3) if it's the same datum, then project the current layer to the target layer without any datum transformation 4) if, instead, they do not have the same datum, pick a pre-defined transformation and include that in the projection function Any help would be much appreciated! thanks! Here is my sample code:               import arcpy     from arcpy import env          arcpy.gp.overwriteOutput = True     env.workspace = 'C:\\Temp'     Target_lyr = 'water_Broward.shp'          try:      desc = arcpy.Describe(Target_lyr)      TargetSR = desc.spatialReference           for inputFC in arcpy.ListFeatureClasses('*'):            if inputFC != Target_lyr:        inputFC_SR = arcpy.Describe(inputFC).spatialReference            if inputFC_SR.Name == TargetSR.Name:        continue       else:        #check if current layer and target layer are the same type        #thus if they are both 'projected' or 'geographic'         if inputFC_SR.type == TargetSR.type:              #HELP STARTING FROM HERE...         #Check if both have same datum..              #if they ARE, then         #outFC = inputFC + '_prj.shp'         #arcpy.Project_management(inputFC, outFC, TargetCS)              #if datum is NOT the same use         #transformation = for example "WGS_1972_To_WGS_1984_1"         #arcpy.Project_management(inputFC, outFC, TargetCS,transformation)             #if current layer and target layer are NOT same kind         else:         #HELP         #repeat as above same steps as above to check the datum           except:      print arcpy.GetMessages()


let user add his location on interactive map

I would like to know if it is possible to create an interactive map where the user will be allowed to add their own location to the map (I would use OSM as the basemap) and then calculate the distance between that location and some other objects that the map shows? If it is possible I would appreciate if you could explain to me the basic idea how it could be done. Thanks


Geoexplorer (Opengeo Suite) cannot upload data

i am following the tutorial how to create a simple map. However, I got stuck in the step to upload the data. It gives me an error and I dont know why (see photo). I zipped the shapefile with all the respective other files and uploaded it. Doesnt work. This is why I also added a Spatial Reference. The data is WGS84 --> EPSG:4326. ![enter image description here](http://i.stack.imgur.com/mH2Z7.jpg) I just downloaded and installed Opengeo Suite. So its the latest version. I have Windows 7, 32 bit on my PC.


How to save IDocumentInfo attributes to a map document programmatically?

We have been successfully creating mxd files based on MapDocument, adding layers, setting spatial information and saving them. Our code has been working, literally, for years and has made the transition from 9.x to 10.x without trouble. The other day we decided that we wanted to incorporate field based links that required us to use the HyperlinkBase attribute of the DocumentInfo class. We have tried the 5 or 6 most obvious ways to do that and have not been able to accomplish it. No matter what we insert into the IDocumentInfo or IDocumentInfo2 interface, it does not get saved with the mxd. Furthermore, if you open an mxd that already has attributes (that you added with ArcMap, for example) twiddle them, and then save the mxd again ... all the attributes are cleared. This is intensely frustrating of course. Our code is of this form ...               IMapDocument mapDoc = null;          try     {         mapDoc = ArcObjects.CartoUtil.OpenMxd(mxdPath, null);              AddMapLayersToMxd( "our hidden, sanitized stuff goes here" );              IDocumentInfo2 infoDoc = (IDocumentInfo2) mapDoc;         infoDoc.HyperlinkBase = BlahBlah.ServerBaseUrl;              mapDoc.Save(true, false);         mapDoc.Close();     }     finally     {         ComUtil.Release(mapDoc);     }      Where AddMapLayersToMxd() does just what it says. This works fine and the mxd has the layers and other things we add to it. Our desired DocumentInfo ... nowhere to be found. If you crack the resulting mxd, you will find only the DocumentInfo added by the system ... paths, dates, RelativePaths, etc. None of the user-defined items.


Polygons not appearing when creating shapefile based on criteria using GDAL and Python (area calculated properly)

I am looping over the features of a shapefile containing multiple polygons. If certain criteria are met, I want to save the current feature in a new shapefile. I am doing this using GDAL 1.10.0 with Python 2.7.3 The code runs, creates the files I want, calculates the area correctly. In the shapefile that is created, the attribute table contains the propoer fields ('name' and FID). Two things are wrong:   1. No polygons are visible (in ArcMap). This seems to me particularly weird, because the polygons seem to me proper, in the sense that they are closed (and the area is calculated properly).    2. The coordinate system seems off (in Arc Catalog there appears in the bottom -20,9667 0,0000 (are these degrees??)), despite the fact that I am creating a projection file (they are in German national grid 3) Any hints as to what the problems could be? I tried to put the relevant excerpt of the code below:               from osgeo import gdal, gdalnumeric, ogr, osr, gdalconst          ### prepare shapefile into which to save     driver = ogr.GetDriverByName('ESRI Shapefile')     path_matched = r'.../.../path'     datasource = driver.CreateDataSource(path_matched)     lyr_matched = 'matched_%s' % cur_id  # from above     # Remove output shapefile if it already exists     name_shpfile = lyr_matched + '.shp'     if os.path.exists(os.path.join(path_matched, name_shpfile)):         driver.DeleteDataSource(os.path.join(path_matched, name_shpfile))     layer = datasource.CreateLayer(lyr_matched, geom_type=ogr.wkbPolygon)     #layer.ResetReading()     field_name = ogr.FieldDefn("name", ogr.OFTString)     layer.CreateField(field_name)          ### prepare file in which I want to write the areas of matched polygons     path_area = path_matched     file_area = 'matched_area_%s.txt' % (cur_id)     fobj_area = open(os.path.join(path_area, file_area), 'w')          ### original shape file containing all polygons     shp = ogr.Open(shp_all)  # os fobj from above     lyr = shp.GetLayer()          # loop over polygons in original shameful     for FID in featList:         feat = lyr.GetFeature(FID)              # this is from the shapefile          cur_name = feat.GetField(1)              # ... work on conditions ...              if condition = true:             myPoly = ogr.Geometry(type=ogr.wkbPolygon)             cur_poly = feat.GetGeometryRef()             myPoly.AddGeometry(cur_poly)             cur_spat_ref = cur_poly.GetSpatialReference()                  cur_area =  cur_poly.GetArea()             cur_area_string = "%s \t %f \n" % (gw_name_EZG, cur_area)             fobj_area.write(cur_area_string)                  featur_dfn = layer.GetLayerDefn()             feature_abc = ogr.Feature(featur_dfn)             feature_abc.SetGeometry(myPoly)             feature_abc.SetField("name", cur_name)             feature_abc.SetFID(FID)             layer.CreateFeature(feature_abc)             myPoly.Destroy()             feature.Destroy()               # generate projection file     prj_filename = lyr_matched + '.prj'     file = open(os.path.join(path_matched, prj_filename), 'w')     targetSR = cur_spat_ref     targetSR.MorphToESRI()     file.write(targetSR.ExportToWkt())     file.close()               datasource.Destroy()


Where to find World Latitude and Longitude Grid (arctic circle, equator, tropics..) in shapefile/ e00?

i was wondering if you could teach me how to find World Latitude and Longitude Grid (arctic circle, equator, tropics..) in shapefile/ e00? I saw some of these datas affiliated with universities but unfortunately i am not one of their students, thank you! Anna


Design fiberoptic network in QGIS?

I'm a GIS newbie trying to design a fiberoptic network in QGIS. What I'd ideally need is to draw lines on top of a map or orthophoto, assign a name/id to each line and a type. Get a list of all the lines and how long they are. I'm grateful for any tips on how to go about doing this and what resources to read.


vb.net arcgis add in, log4net works for the exe file, does not work for the esriAddIn

I want to use log4net in my vb.net for ArcGIS add-in. After I build the solution, it generates a .exe file and a .esriAddIn file. The problem is when I run the .exe file (without open ArcMap), the log4net works, but when I install the .esriAddIn in ArcMap, and call a form from ArcMap, the log4net doesn't work at all. I check from internet but most of the answers are talking about c#.net, this problem drive me crazy, anybody has the experience of using log4net in vb.net ArcGIS add in?


ISet.Next() not moving forward

I am trying to move features programmatically using _IFeatureEdit:MoveSet()_ method.   It works fine if I simply move one feature, but if I add more than one feature (from another FC of course), it hangs. It seems to be processing, but never finishes. I have waited for about 45 mins...the same operation when done via ArcMap finishes in a few seconds. I also noticed that in some cases, _pFeatMoveSet.Next() as IFeatureEdit2_ does not move to the next feature, and keeps returning the same pointer, resulting in a infinite loop of sorts. I have also tried the one feature per FC approach as suggested by ESRI in this link, but same behaviour. Is it an API issue? Any clues? PS: I am on ArcGIS 10.0 (sp4) with ArcFM 10.0.3 and FCs participate in a geo net. **Update:** The following code works.                           pFeatMoveSet = GetRelatedFeatures(pPoleFeat);                 pFeatMoveSet.Reset();                      pFeatEdit = pFeatMoveSet.Next() as IFeatureEdit2;                      if (pFeatEdit != null)                 {                     pFeatEdit.MoveSet(pFeatMoveSet, pMoveVector);                 }


How do I subdivide and edit polygons preserving topology?

I'm using QGIS. I have a layer made up of many adjacent polygons - let's call them "countries". I currently use the Atlas plugin to export each "country" polygon to a .png file. I want to further subdivide each polygon into 3 or more sections (let's call them "states"), and to be able to export these in the same way. However, I want my original polygons ("countries") to remain intact (and hence exportable). Furthermore, if I alter my "country" boundaries, I want the "state" boundaries that are affected to also be automatically updated. Can anyone advise me on a way I could achieve this? Thanks. EDIT: Here's a rough mock-up of my state/country relationships: ![states and countries](http://i.stack.imgur.com/fN7uw.jpg)


I have an ArcObjects 10.1 c# toolbar working, but when I add an addin extension to project the Startup function is never hit. why?

I have created an Esri Addin toolbar in VS2010 to add layers and search an address file, this works fine. I want to add an extension that will replace text on a template MXD with the current users details. I have all the logic working in a base class and would like to add an extension that listens for the user to switch to layout view and then calls a function in my base class. I have everything working except that when I right click the project and add an extension the extension code never loads. I am probably missing something pretty basic, could someone please point it out to me.               [Guid("ff8f632e-79c3-4168-a591-441bb8f6c2d7")]     [ClassInterface(ClassInterfaceType.None)]     [ProgId("DCC_Toolbar_10.addUserDetailsextension")]     public class addUserDetailsextension : IExtension     {         #region COM Registration Function(s)         [ComRegisterFunction()]         [ComVisible(false)]         static void RegisterFunction(Type registerType)         {             // Required for ArcGIS Component Category Registrar support             ArcGISCategoryRegistration(registerType);                  //             // TODO: Add any COM registration code here             //              }              [ComUnregisterFunction()]         [ComVisible(false)]         static void UnregisterFunction(Type registerType)         {             // Required for ArcGIS Component Category Registrar support             ArcGISCategoryUnregistration(registerType);                  //             // TODO: Add any COM unregistration code here             //         }              #region ArcGIS Component Category Registrar generated code         /// <summary>         /// Required method for ArcGIS Component Category registration -         /// Do not modify the contents of this method with the code editor.         /// </summary>         private static void ArcGISCategoryRegistration(Type registerType)         {             string regKey = string.Format("HKEY_CLASSES_ROOT\\CLSID\\{{{0}}}", registerType.GUID);             MxExtension.Register(regKey);         }         /// <summary>         /// Required method for ArcGIS Component Category unregistration -         /// Do not modify the contents of this method with the code editor.         /// </summary>         private static void ArcGISCategoryUnregistration(Type registerType)         {             string regKey = string.Format("HKEY_CLASSES_ROOT\\CLSID\\{{{0}}}", registerType.GUID);             MxExtension.Unregister(regKey);         }              #endregion         #endregion         private IApplication m_application;              #region IExtension Members              /// <summary>         /// Name of extension. Do not exceed 31 characters         /// </summary>         public string Name         {             get             {                 //TODO: Modify string to uniquely identify extension                 return "addUserDetailsextension";             }         }              public void Shutdown()         {             //TODO: Clean up resources                  m_application = null;         }              public void Startup(ref object initializationData)         {             m_application = initializationData as IApplication;             if (m_application == null)                 return;                  //Listening to document events             SetUpDocumentEvent(m_application.Document);         }              #endregion               #region Document events         //Event member variable.         private ESRI.ArcGIS.ArcMapUI.IDocumentEvents_Event m_docEvents = null;              //Wiring.         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.OpenDocument += new ESRI.ArcGIS.ArcMapUI.IDocumentEvents_OpenDocumentEventHandler(OnOpenDocument);         }              //Event handler methods.         void OnNewDocument()         {             System.Diagnostics.Debug.WriteLine("New document event (C# Sample)");         }              void OnOpenDocument()         {             System.Diagnostics.Debug.WriteLine("Open document event (C# Sample)");         }         #endregion     }


How to calculate distance from point to polygon with a time frame?

Using the _Near_ tool, I knew that I can just calculate the distance of each house to the nearest fire. However, I only want to keep fires that happened in the past 7 years for each house. For example, I have fire data from 1950 to 2013, a house was built in 2002. I only want to measure distance to the nearest fire from 1995 to 2002. Any idea on how to do that?


Softwar to draw graph from a OSM map

This is my first time asking here so forgive me if something isn't appropriate, and sorry if my English isn't very good. Im new in OSM, I have downloaded the data of my map from OSM using the JOSM and i have saved it in a *.xml format. I'm trying to **convert a nodes and a edges (ways) from a OSM map to a graph** ( connected graph for example) ... ... can we do somthing like taht ?? Is there a **softwar** to do it ??? someone will say me, try to use the ' **GraphView** ' plugin, but, whaht i need is a specifique **softwar or another way** to draw a graph frome xml file for a OSM map ... I googled a lot, but either I used the wrong keywords or there are no simple solutions on the internet. I hope somebody here can help me. Thnak you in advance ... BinaryMan


Is it possible to implement sticky move tolerance in a ArcGIS JavaScript API application?

We are working on a project in ArcGIS JavaScript and is going fine. We want to add sticky move tolerance to our project so it will not be so easy to move features on the map. Is it not possible to add that to our project? Does anyone know anything about that?


How do I deal with tiles in the Orfeo Toolbox segmentation?

I'm using the Orfeo Toolbox for segementation of large Very High Resolution Satellite images. It performs very well and i'm mostly very happy with it. But I still get some weird/bad results that I assume are related to the partition of the process in tiles. I'm doing this: `#Segmentation variables spatialr = '7' maxiter = '6000' ranger = '2,6' minsize = '8000' tilesize = '1048' simplify = '0.4' # SEGMENTATION   print "Performing image segmentation" app = otbApplication.Registry.CreateApplication("Segmentation") app.SetParameterString("in", imagem_base_com_ndvi) app.SetParameterString("filter.meanshift.spatialr", spatialr) app.SetParameterString("filter.meanshift.maxiter", maxiter) app.SetParameterString("filter.meanshift.ranger", ranger) app.SetParameterString("filter.meanshift.minsize", minsize) app.SetParameterString("mode.vector.inmask", image_mask) app.SetParameterString("mode.vector.stitch", 'True') app.SetParameterString("mode.vector.out", vector_out) app.SetParameterString("mode.vector.simplify", simplify) app.SetParameterString("mode.vector.outmode", 'ovw') app.SetParameterString("mode.vector.tilesize", tilesize) app.SetParameterString("mode.vector.neighbor", 'True') app.ExecuteAndWriteOutput()` Here are some examples of the resulting segmentation: ![enter image description here](http://i.stack.imgur.com/J80qw.png) ![enter image description here](http://i.stack.imgur.com/D3TwZ.jpg) Anyone has ideas to help me avoid these errors? Thanks.


How to bring feature selection into Printing Composer?

I'd like to make maps of Finland's municipalities. Our National Land Survey provides data I can make into a Shapefile, and when a municipality is selected in QGIS/Identify Features, three different levels of associated administrative boundaries are helpfully highlighted, even the exclaves and enclaves of the selected municipality. My question then is, how can I export this exact map view? When I open a new Print Composer, the selection/color scheme is gone. The exclaves are an important feature I'd like to keep. ![finnish municipalities](http://i.stack.imgur.com/rv69C.png) You can probably see that there are hundreds of those tiny exclaves, whose names aren't easily readable in the GML, so I really wouldn't bother checking up manually which of them belong where, and then color them in Inkscape. I tried exporting with the plugin SimpleSVG, but it just compresses the shapes into uglyness. Compare original and after: ![enter image description here](http://i.stack.imgur.com/MQ1Gs.png)


Modeling data in PostGIS when Several Join queries with Geometry are Needed

Suppose you have a database where you have several tables with geometric information and you have several cases in your system where you need to query the tables with a lot of joins (ie: `LEFT JOIN table2 ON st_intersects(table1.the_geom,table2.the_geom)`). I believe this type of query is slow compared to a "normal" int field join, even if you use spatial indexes on the fields. In a system where this situation arrives a lot, how do you model the data? For example, I have many situations where you would have to query this, joining with 10 other tables. Each table holds a different type of information, but I need to see if a row in table1 intersects with the geometry of all the other tables. I thought about creating a many-to-many relationship, relating the ids to make the queries run faster. But then I would need a trigger to each time a new row is inserted, check which ones it intersects on each possible relationship (10, in the example) and save it. This would make the inserts a lot slower too. Is there a common pattern to solve this type of problem on PostGIS?


Get latitude and longitude of each point forming a MultiLineString

A MultiLineString is formed by a sequence of points and each point has latitude and longitude. Use the sql below to get the latitudes and longitudes of each point so that my MultiLineString:               SELECT         St_AsText (ST_Transform("public"."Shapes".geom,4326)),         "public"."Shapes"."id"     FROM         "public"."Shapes"      ![Result](http://i.stack.imgur.com/xXoK4.png) I want to get the sequence of points of each line in separate rows and lat / long in separate columns example:                  ID            pt_lat            pt_lon        1001             lat1             lon1        1001             lat2             lon2        1001             lat3             lon3        1001             lat4             lon4        1001             lat5             lon5        1001             lat6             lon6        1002             lat1             lon1        1002             lat2             lon2        1002             lat3             lon3        1002             lat4             lon4        1002             lat5             lon5        1002             lat6             lon6      I know I can do that consuming one GeoJSON for example, but want to know if there is a native function of PostGIS for this.


Vectorized few lines using QGIS with Google Maps as a base. If I do not Trabachar with maximum zoom does not respect the topology of the base. It is possible to make snap using Google Maps based on QGIS?


OpenLayers 3: context specific styling

I am having trouble with OL3 extracting context specific info from a nested JSON object. My feature's JSON goes like this: feature.attributes.geometry.name = "Point Alpha" How do I display the name as label when styling the feature? I tried ol.expr but it only parses the first level properties. Please advice!


Map Layout Elements In New Layer Automated Using Python

I was wondering if there was a way to put a title and integer data from an attribute table in a new layer created in Python. I was able to create a new layer using copy features, zoom to the selected features, and export the zoomed features in a map as a PNG all using arcpy, but I also wanted a title at the top and data from the attribute table of that specific layer in the map layout before it was exported. Is it possible to get all this automated using Python?


Can ArcGIS only merge two shapefiles each time?

I need to merge multiple point shapefiles (in the same directory) into one point shapefile. After inputting these shapefiles and merging it, I found the final output only contained the data from two shapefiles. How to merge multiple shapefile in ArcGIS at once instead of merging only two at each time?


How to make a certain attribute Toggelable?

I have imported data from an excel spreadsheet containing lat,long coordinates associated with other attributes such as current operator of each point (well). I imported as a tab delimited file, then saved this as a shapefile. I want to be able to organize the files by operator so that they can be toggled on and off (by operator). I have been doing this by opening the attribute table, making a selection and then saving the selection as a new shapefile for each operator, which works, but I have reached the limit of shapefiles for a single project, and am wondering if there is another way to accomplish this.


How to set up the layer order with Google Maps API?

I'm developing a web mapping site (using google maps api 3.0 and javascript) that combines wms layers and ground overlays (uploaded rasters) that are displayed on top of google maps. The software is working well except that I'm having problems controlling the draw order of the layers. I would like to have the wms layer (the NRCS soils layer) displayed on top of the custom raster images, with the google maps as the base layer. Currently, the wms layer displays as expected on top of the google maps layer, but is covered by the raster layer. The question is: does the google maps api allow control of the order that layers are displayed (in my case the vector layer on top of raster layer on top of google maps)? I have tried setting the zindex of the display order, but that has not worked (but I could easily be missing something).


MODIS Level 1B batch process

I am a new MODIS Level 1B user. I have been using the MODIS Swath tool to process my images. However, I have over 1000 images to process. I was wondering if there a script available in IDL or R (very little coding experience) where I can batch process all the images?


How can I find and fix broken raster metadata using QGIS?

I have a raster (TIFF) hillshade image that I would like to use in a mapping project. However, I'm having a hard time lining it up properly in QGIS. Through a series of investigations, I have determined that this problem might be caused by broken metadata. The raster was apparently created in ERDAS Imagine. I opened this raster in a text editor, to see if the metadata tags were visible. Sure enough, the following appears at the very end of the file:               #IMAGINE GeoTIFF Support     Copyright 1991 - 2005 by Leica Geosystems Geospatial Imaging, LLC. All Rights Reserved     @(#)$RCSfile: egtf.c $ IMAGINE 9.0 $Revision: 10.0 $ $Date: 2005/07/26 15:10:00 EST $     Projection Name = NAD_1983_HARN_StatePlane_Hawaii_3_FIPS_5103_Feet     Units = us_survey_feet     GeoTIFF Units = feet|IMAGINE GeoTIFF Support     Copyright 1991 - 2005 by Leica Geosystems Geospatial Imaging, LLC. All Rights Reserved     @(#)$RCSfile: egtf.c $ IMAGINE 9.0 $Revision: 10.0 $ $Date: 2005/07/26 15:10:00 EST $     State Plane Zone -5103     NAD = HARN      This data indicates the right projection, with the right units (feet) (this projection is functionally similar to EPSG:3760). ArcGIS is apparently able to read these tags, and readily assigns it the correct projection. However, when I view metadata on this file using QGIS or the QGIS browser I see that the projection of the raster is different. Most of the parameters are correct, but the units are set to meters. See screenshot from QGIS browser below. ![enter image description here](http://i.stack.imgur.com/UevgS.png) Using ArcGIS, I removed the spatial reference of [a copy of] this raster, and then reset it using the Define Projection tool. Unfortunately, the metadata shown in QGIS remained the same. This leads me to two questions.   1. Where is this information coming from? Is there some other set of tags that QGIS is reading?   2. How can I remove or repair this broken metadata? I'd prefer an open source solution, but I'll accept anything that works for now.


ArcGIS 10.0 Service Pack 5

Another service pack for ArcGIS 10.0 has recently been released. However, previous service pack releases have introduced problems and instability along with fixes. Have there been any reported bugs or known stability issues with the latest service pack release? Also, what are the pros/cons of upgrading to ArcGIS 10.1 over ArcGIS 10.0 SP5? Info Service Pack 5


Looking for pedestrian-specific routing engines

Most of the applications providing pedestrian routing I see are sufficient for many needs but not optimal: you cannot cross open spaces like town squares, routing is in the middle of the street etc. Do you have examples of websites or applications with routing really specific to pedestrians? Thanks


Python Program for "QC of PDFs Created from Data Driven Pages"

I need some help. I am fairly new to Python. I found a sample code and I need to change a couple things in it for it to work. I need it to make sure that all PDFs were created from the Data Driven Pages program I have now. Reason is I sometimes have about 150 PDFs created from the DDP program. For Example : Houston has 152 pages in my mxd and DDP is supposed to make 152 pages. I've made some changes already to the code I was needing someone to double check my work.               import arcpy, os, sys     from os import path as p          #Make parameters for people to choose mxd and folder of PDFs to compare     mxdList = arcpy.GetParameterAsText(0).split(';')     pdf_path = arcpy.GetParameterAsText(1)     fc_path = arcpy.GetParameterAsText(2)          report = {}     page_list = []          #Use Search Cursor to go through Attribuite Table to get Sheet number info     for mapDoc in mxdList:         mxd = arcpy.mapping.MapDocument(mapDoc)     for fcClass in fc_path:         fc = arcpy.ListFeatureClasses()                 max_list = []                 rows = arcpy.SearchCursor(mxdList, "Sheet_ID")                 for row in rows:                     max_list.append(row.Sheet_ID)                     sheet_count = max(max_list)                     arcpy.AddMessage('Sheet count: {0}'.format(sheet_count))                 else:                     arcpy.AddError('No Layers in %s match data source'%mapDoc)     pdfDoc = arcpy.mapping.PDFDocumentOpen(path)     print pdfDoc.pageCount


Using select by location to update a field in a feature class

I am using Arc 10.1 and I am working on a script that takes a value from a field within one shape file and updates a field in another shape file based on its location. Basically I have smaller parcels that reside within larger areas and I want to assign the name of the larger area to a field within the smaller parcels. The issue I am having is that when I run the script, every parcel ends up having the same "area". I believe its because its essentially writing each area to the parcel and then rewriting it again and again until there are no more areas to loop through. Can someone provide some advice?               #Make a feature layer for the neighourhoods     arcpy.MakeFeatureLayer_management(neighbourhood, "neighbourhoodLayer")     arcpy.MakeFeatureLayer_management(parcel, "parcelLayerTest1")     #Setup cursor to update new NBHD field     with arcpy.da.UpdateCursor(parcel, (parcelIDField,nbhdField)) as parRows:         for par in parRows:             # Create a query string for the current patrol zone              #parcelIDstring = par[0]             #queryString = '"' + str(parcelIDField) + '" =' + "'" + str(parcelIDstring) + "'"                  #Select parcels based on location contained within neighbourhood             arcpy.SelectLayerByLocation_management("parcelLayerTest1", "HAVE_THEIR_CENTER_IN", neighbourhood)                  nbhdTable = arcpy.SearchCursor(neighbourhood)             for nbhd in nbhdTable:                 nbhdValue = nbhd.getValue("Neighbourh")                 if nbhdValue:                     par[1] = nbhdValue                     parRows.updateRow(par)


Why does onDemand setting remove my buttons from my menu?

When I set the onDemand="false" attribute, my buttons disappear from my menu! I'm setting the attribute to false so that I control its behaviour using the OnUpdate override in code. Am I doing anything wrong?               <ArcMap>         <Commands>           <Button id="SayHi_Btn" onDemand="false" class="SayHiButton" caption="Say Hi!" image="Images\SayHi_Btn.png" />           <Button id="SayHello_Btn" onDemand="false" class="SayHelloButton" caption="Say Hello!" image="Images\SayHello_Btn.png" />           <Button id="SayAloha_Btn" onDemand="false" class="SayAlohaButton" caption="Say Aloha!" image="Images\SayAloha_Btn.png" />         </Commands>         <Menus>           <Menu id="ChooseGreeting_RootMenu" caption="Choose Greeting" isRootMenu="true">             <Items>               <Button refID="SayHello_Btn" separator="true" />               <Button refID="SayAloha_Btn"  />               <Button refID="SayHi_Btn" />             </Items>           </Menu>         </Menus>       </ArcMap>


Environmental styles library

i'm looking for environmental symbols, related to berm diagnostic (collapses, subsidences, anthropogenics deposits... Is there any style library available? Thanks in advance, Max.


How to create lines between pairs of two coordinates?

I have a table with pairs of points. Out of that I want to create a line layer (that keeps all attributes of the table). One line for each raw from point to point. I want to calculate the length of these lines later. A simplified example table would look like that: ![table](http://i.stack.imgur.com/VoGjU.png) Can I make this in QGIS? I am using QGIS 1.8.0 on a Mac 10.6.8


TatukGIS SQLite Spatial vs. Spatialite

I must apologize in advance, I'm just getting into GIS and trying to figure things out. I have an SQLite spatial database that I'm pretty sure was created in TatukGIS. I've tried to open it in QGIS but the database format is different than that of a Spatialite database. I would like to find a way to convert the SQLite database created in TatukGIS to a Spatialite Database that can be opened in QGIS. I know it has something to do with the OpenGIS simple features specification and how Spatialite may not fully comply with those specifications, but I don't have enough experience to know how to go about converting it (if it's even possible). Here is a link to the Databases to give you an idea how they are organized. https://drive.google.com/folderview?id=0B2TMeZ6iEFvHa3BBOVJpVVpBY1E&usp=sharing TatukGIS.sqlite is in epsg:3569, Spatialite is in epsg:3857


Custom Model should be used with ArcMap or ArcCatalog?

I have one basic question , when you create custom model using model builder in ArcGIS. It should be used with ArcMap or ArcCatalog? Reason I am asking this question is I have created a model and I am setting it "Store relative path names" and I have defined a directory structure for the same. Now the problem is in ArcMap when you right click on "ToolBox" it will allow you to add toolbox and you can select your tool from the specific location whereas in ArcCatalog it creates Tool (.tbx) at C:\Users\\AppData\Roaming\ESRI\Desktop10.0\ArcToolbox\My Toolboxes folder. Where I am not able to access the relative scripts because I will not have any absolute path and it should not be absolute. Also can someone share the difference between ArcMap and ArcCatalog? Any idea or suggestions on this?


batch attribute table export

How can I export multiple raster attribute tables at once? Using the batch grid control tool mentioned here? Batch Export feature attribute to ascii I can't seem to find how to access the tool in ArcMap 10.0. Thanks.


What are valid values for "data defined" labeling settings?

I'm using QGIS 1.8. I'd like to customize label features on an existing shapefile using the new label engine and it's "data defined settings" option. I'd like to know what the attribute table field types should be for each of the settings: All 7 font options, all 2 buffer options, and all 6 position options. Should they all be numeric fields, or some text, or both? I want to create these fields in the attribute table correctly so that I can map them to the label field settings. I can't find information on the proper field types anywhere. Thanks for your thoughts.


Is segment of polyline contained in polygon

I am pretty new to arcpy and am slowly learning all its functions. I have a scenario where I am traversing a polyline. I get a start point and an end point on the polyline and form a segment with those points. That segment is used to create geometries to construct a polygon around that area of the polyline. My problem is that on areas where the polyline curves, a part of the polyline is outside of the polygon. Ultimately I will need to shift my polygon downward/upward depending (change the heights of the polygon). I was looking to construct a function using the [contains] method but am lost on how to write a function to see if every point in the polyline, between that segment, fits inside of the polygon. Any help/ideas would be greatly appreciated. Thanks in advance


Problem in VersionEdit4.Reconcile4 method

I had an standalone application in which i am getting all the available versions in the database. Based on user filter he selects multiple versions and reconcile it.                if (pVersionEdit4.Reconcile4(pVesrion.VersionInfo.Parent.VersionName, true, false, false, false) == true)      I am iterating user selected versions and generating conflict report. But the previous one is **Row level** conflict check. But i want to check **column level**. For that my code changed to               if (pVersionEdit4.Reconcile4(pVesrion.VersionInfo.Parent.VersionName, true, false, false, true) == true)      But i am getting exception message **Failed Security**. Is any where i am missing.


Map Basic. Where-clause in Select Statement

what is wrong with this statement? I recon the where-clause is the problem.               Select * from "BEDIRECT_POT_" + vo_num, PLZ5_2012_bereinigt      where "BEDIRECT_POT_" + vo_num.PLZ like PLZ5_2012_bereinigt.PLZ      order by PLZ      into "BEDIRECT_POT_" + vo_num + "_PLZ"      This section seems to be wrong: "BEDIRECT_POT_" + vo_num.PLZ Thanks for your help. a.


How to crop an image into more than 80 small sections automatically in R

I'd like to crop an image into 15 sections in R. The image projection is Geog lat/long, extending 87 to 120 degree in East and 45 to 55 degree in North. I want to separate it by every 2 degree. So I have 17 degree in X coordinate and 5 degree in Y coordinate. 17 x 5= 85 sections. And then every section has own names such as crop1, 2, 3 etc. Can I do this automatically in R? If so, how to do this? Thanks a lot


Without Proxy page can't use IE8 and IE9 for Editing and Buffer

The server where my editing application is hosted does not allow a proxy page because of outgoing calls restriction. This makes it difficult for IE8 and IE9 since using CORS is not an option as there is limited support for these browsers. The limitation is that they do not support POST when using XDomainRequest and also there is a URL length limit. What is the best practice to POST Cross Origin messages from these browsers. Even if I write custom code I would like to leverage the heavy lifting done by esri's tasks like the ApplyEdits event handlers.


Installing Qgis2 on openSUSE 13.1

I need to install Qgis2 on my openSUSE 13.1 box but its standard repo (Application:Geo) on software.opensuse.org reports a build error. Has anyone already found a way to get it working? martin


data driven pages format

I have an issue, but I don't even know the terms needed to search for an answer. I'm exporting the pages to png files. The pages are divided by lots. Each page has a label with the lot number. In the case of the sample included, 18-385 is the lot being exported. Pieces of several other neighboring lots are also printed. What I would like to do if possible is format the label of the lot being exported different from the neighboring lots. The first pic is what I have so far, and the second pic is what I would like to do. Please take this into consideration: I am very new to ArcGIS.   I'm doing the exports in the Geoprocessing->Python box. I don't know yet how to get to a full IDE where I can save code.   I'm using ArcGIS 10.1 If it helps, here's the code I'm using.               mxd = arcpy.mapping.MapDocument("CURRENT")     ddp = mxd.dataDrivenPages     basePath = "C:\\Downloads\\Dev\\ArcGIS\\Fulton\\"      for pageNum in ddp.selectedPages:        mxd.dataDrivenPages.currentPageID = pageNum        distNum = mxd.dataDrivenPages.pageRow.DistNum        savePath = basePath + distNum        fileName = savePath + "\\" + mxd.dataDrivenPages.pageRow.DistPage + ".png"        print fileName        if not arcpy.os.path.exists(savePath):           arcpy.CreateFolder_management(baseDir,dirName)        arcpy.mapping.ExportToPNG(mxd, fileName,resolution=300)     del mxd      Thanks for any help. ![What I have](http://i.stack.imgur.com/YhLh2.png) ![What I want](http://i.stack.imgur.com/iJzHN.png)


GetFeatureInfo for gxp_olsource in OGS GeoExplorer

We have an OpenGeo Suite GeoExplorer 3.0.1 and want to make GetFeatureInfo- requests, via the identify button, for WMS-layers of type gxp_olsource but it doesn't work, I get no response at all and I don't get any errors in the browser debug console. It works great to make a GetFeatureInfo-request for WMS-layers with sources of type gxp_wmscsource or gxp_wmssource. Is it supposed to be working in the original version of GeoExplorer or do I have to make adjustments to the code? Layer configuration: ... sources: { ... ol: { ptype: "gx_olsource" } }, map: { ... { group: "groupfisketsgeografier", visibility: false, queryable: true, source: "ol", type: "OpenLayers.Layer.WMS", args: ["Fredningsomraden", "http://geodata.havochvatten.se/geoservices/hav-fisketsgeografier/ows", {layers: "hav-fisketsgeografier:havet-fredningsomraden", transparent: true, isBaseLayer: false, tiled: true} ] }, } ...


How to exclude the "More" tab where your operational layers are stored in the Flexviewer 2.2

I am using Robert's awesome TOC widget. I want to exclude the "more" tab where your operational layers show up, because they are listed in the TOC widget. Can I do this in the config.xml?


Finding DEM/HIllshade sources California

Creating watershed maps for schools. I want to color ramp the elevation to show low and high points. What kind of files do I need and where to find them?


ArcView 3.x Avenue Bitmaps (Tabs?) vs. ArcView 10 Python Cursors

_Note: While this question has an answer, any further tips for optimizing a cursor process would be greatly appreciated. I will be monitoring for any updates._ Currently, my boss (who works in Avenue) and I (working in Python) are both attempting to solve the same problem. Rather, we have both solved it, but the speed at which our solutions operate are... disjointed, to say the least. What his script processes in 2 hours can take mine up to 6. The only real difference in syntax and implementation in logic comes from 3.x's Bitmaps and 10.x's Cursors. We both: 1) Store values from Table 1.   2) Use those values to query a row in Table 2.   3) Store values from Table 2 for insertion into Table 3 as a new row. In both scripts, these processes are completed in two nested loops. Before I start digging into the wonderful world of code optimization, is this an expected occurrence when comparing Avenue script performance to Python? This is not the first time his scripts have greatly outperformed mine in terms of operation time, so I would like to know if there is something I should be aware of before I crucify myself for horrid scripting. Here's my script sans extraneous bits:               import arcpy     import time     import sys     import os          def recordfindcopy(inFile,query,outFile):         findRecord = arcpy.SearchCursor(inFile,query)         for record in findRecord:             copyRecord = arcpy.InsertCursor(outData) # <--- D'oh! (See answer)             field = record.FIELD             copy = copyRecord.newRow()             copy.FIELD = field             copyRecord.insertRow(copy)          StreetsFileList = [r"Path",                      r"Path"]          for sfile in StreetsFileList:         inStreets = sfile         inTable = r"Path"         outData = r"Path"         fsaEntry = arcpy.SearchCursor(inTable)         for row in fsaEntry:             id = row.ID             sQuery = "ID = %s " % (str(id))             recordfindcopy(inStreets,sQuery,outData)      **EDIT** : Given some of the comments so far, I wonder if there might be a better way to do this via joins, although I am dubious given the brobdingnagian (word of the day!) size of the tables. The heart of the processing is to append information from one table to any matching records in a second table and create a third table only containing the important fields. I wanted to try this using SDE, but that appears to not be an available option. Thoughts? I apologize if my questions are always so _involved_ , but I'm trying to get to the bottom of a long-standing annoyance. **Answered** : Jakub's simple suggestion alone decreased the processing time from **30** seconds per 500 records to **3** seconds per 500 records. Re- initiating the insert cursor on every insert slowed things down considerably (obviously). While this may not be the most optimization one can do for this process when put up against ArcView 3.x's speed, it is enough for my purposes at this time. Further suggestions are very welcome!


Standard SQL with ArcGIS

Is it possible to use Python to run actual standard SQL on an enterprise geo- database? Think about batch deleting, joints, etc moving beyond just the cursor objects in Arcpy. Note that one can shortcut ArcGIS and directly work with the back end database, but that is not the purpose of the questions here (and it I'd not recommended if you have n advanced geodatabase, like a versioned one)


NHD Flowline legend colors?

Does Anyone have legend colors for the NHD Flowline that USGS sets colors for theirs ? I'd like to get a copy of their color legend. They can be from their website, brouchure, lyr files or anything that I can set it up easily to match their colors. Thanks.


Create vector grid from canvas using script

I've modified "Hex grid from layer bounds" script to my need. Just added `cellsizex` and `cellsizey`. Changed the hexagonal - 3 to "1" to make it as a square grid. Is it possible to include an option to select extent from canvas? Instead of getting it from layer extent, I want to manually select the extents from the canvas by drawing a square or rectangle. Edit: I am new to scripting and though I can understand what a line of code does, I find it difficult to implement it by myself. For eg, with the help of the above said code, I was trying to get the extents from the canvas through a square or rectangle drawing. What I did was, Create new script -> just started to type (after the initial declaration or whatever) `## get extent`, `##select extent`...things like that. The problem is, i don't know which will be the right method, what is for what? Is script editor's code different from python's? (Don't know python either). What do I have to do to build small scripting tools by myself? If anyone can shed light as to where to start, it'll be immensely helpful.


Where can I find shapefiles for New Zealand Cities and Suburbs/Neighbourhoods?

I'm trying to find some shapefiles (administrative boundaries) of New Zealand CITIES and SUBURBS/NEIGHBOURHOODS. I've found some boundaries for the Country, Regions, Districts (not useful for me) .. but not cities and suburbs. Can anyone lead me in the right direction, please?


how to get ALL FIELD NAMES from table? (using arcpy.ListFields)

I have a table: ![enter image description here](http://i.stack.imgur.com/wLrUD.jpg) , Script at ModelBuilder's "calculate values": Expression:               a("%path%")      Code BLOCK:               def a(path):       fields = arcpy.ListFields(path,"FID_*")       for field in fields:         return field.name      Gives me only ONE field name!


Displaying text from dxf in Openlayers

I managed to import .dxf into Postgis table, and now have, among others, rows with Point geometries and values in text column (which corespodent with Label values from ACAD .dxf). What is the best way to display these geometries in Openlayers so they look the same as in any other dxf viewer (format, size, color)? Fonts, sizes and colors are imported into postgis using sql "select *,ogr_style from entities". The rest of the geometries (lines, polygons) are correctly displayed using HTTP protocol and GeoJSON format, but with labels missing. Also, is there a way to import Text from .dxf into Postgis as set of lines/polygons? That would also solve the problem.


Looking for qml specification

Where I can find qml specification which is used for store symbology information in QGIS? Try to googe it - no result.


ECW/MrSid plugin for GDAL from Kyngchaos not working on Mountain Lion?

Subject says it all. I have installed all of Kyngchaos packages, but               gdalinfo --formats      does not list ECW or MrSid formats. Could someone else with Mountain Lion try if they can get _any_ JP2 driver installed into GDAL?


Find Duplicate Polygons Algorithm

I have a group of polygons. My objective is to find the duplicate polygons from these group of polygons. Using NetTopologySuite(A c# port of JTS), it is possible to compare two geometires and check if they are equal. The brute-force method(checking each polygon against every other polygon) is the only idea that comes to my mind but it is not usable if there are large number of polygons. Are there any algorithm's which would better the brute-force in this case? I found this script which seems to contain ideas to what i am looking for(the comments indicate a divide and conquer approach..but not much details in the comments). But I have to admit i cannot get anything out of it :) .. It was done for ArcView, which I am not familiar with. **Note:** I am not looking for a PostGIS/database solution as in this question. I am looking for something that can be integrated to AutoCAD, Quantum GIS or such desktop GIS products through customization(c#,c++, python etc..)


Generating tiles for osm/esri shapefiles

I've generated tiles for OpenStreetMap .OSM files using Maperitive and quickly consumed them with leaflet (with no tile cache yet). I'm now looking for the right and simple way to do that also with the shapefiles given by OSM. (Tried TileMill but the generated mbtiles file needs further processing)


Drawing a rectangle that will always be on certain area of map

Using OpenLayers is it possible to draw a rectange that will always be on one portion of map without regards to zooming and panning of map?


How To Highlight Roads?

I wish to change the colors of various roads on a map and save the changes to either a "personal map" or a "map layer." The personal map could look something like this, except it would need to have the "snap to roads" feature, which is currently bugged on google mymaps. The map layer option seems a lot more complicated, but would be ideal if combined with a wiki function as the entire point of this exercise is to color roads according to a cyclist's perspective: according to speed and volume of traffic. It would be ideal if the road itself could be selected and highlighted so that any changes to the road would automatically be incorporated into the color scheme--instead of having colors going where the road no longer goes. I am not necessarily asking for a detailed step-by-step walkthrough of a specific possibility (though that would be nice), but rather a general overview of what my options are and hopefully some idea as to which options are most promising. I have been researching various mapping systems for several hours and feel as if I'm re-inventing the wheel. Please suggest a method for highlighting roads.


How do i popup a context menu with custom command items in a Select tool OnMouseDown (Right Click) with VB .Net?

This should be simple... I am converting VBA customization to VB .NET in VS 2008 Express Edition. In VBA i have a custom selection tool. Aside from just selecting features, when OnMouseDown receives Button = 2 parameter (right click) I popup a context menu with some macro items that call various other procedures. I need some help with making this work in .Net... I used the ESRI .NET sample project to get the feel for this and i am sure i can re-create the select tool but i am having problems with the context menu. I would also like to know how to call procedures when user clicks the context menu item.               Private Sub UIToolControl1_MouseDown(ByVal button As Long, _         ByVal shift As Long, ByVal x As Long, ByVal y As Long)          Dim pLayer As ILayer     Dim pContextMenu As ICommandBar     Dim pAppPosition As IWindowPosition     Dim pPoint As POINTAPI          If pMxDoc.SelectedLayer Is Nothing Then     MsgBox "Select a layer in the TOC!": GoTo ep     End If          Select Case button     Case 1     Set pLayer = pMxDoc.SelectedLayer     If pLayer Is Nothing Then     MsgBox "You must select 1 feature layer in the TOC!": GoTo ep     End If          If Not TypeOf pLayer Is IGeoFeatureLayer Then     MsgBox "You must select 1 feature layer in the TOC!": GoTo ep     End If          Set m_pPoint = _         pActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(x, y)     m_bIsMouseDown = True     Case 2     'on right click = popup     Set pContextMenu = CommandBars.Create("Go2Grid", esriCmdBarTypeShortcutMenu)          Set pAppPosition = Application          ' Add 3 built in commands to the new context menu using the     ' built-in ArcID module.          pContextMenu.CreateMacroItem "New Feature Class", 8, _         "Normal.Module1.CreateNewFeatureClass"     pContextMenu.CreateMacroItem "Delete Layer", 13, _         "Normal.Module1.DeleteFeatureClass"     pContextMenu.CreateMacroItem "Copy To...", 20, _         "Normal.ThisDocument.CopyFeatures"     pContextMenu.CreateMacroItem "Draws Around...", 26, _         "Normal.ThisDocument.DrawsAroundFeatures"     pContextMenu.CreateMacroItem "Clear Tool", 10, _         "Normal.ThisDocument.ClearCurrentTool"     pContextMenu.CreateMacroItem "Delete Features", 13, _         "Normal.Module1.DeleteFeatures"          ' Popup the menu.          pPoint.x = x     pPoint.y = y     ClientToScreen pActiveView.ScreenDisplay.hwnd, pPoint          pContextMenu.Popup pPoint.x, pPoint.y     Case Else     GoTo ep     End Select          End Sub


QGis: scripting the map rendering (multiple similar maps from one shapefile)

I would like to ask for advice on creating a **Python script** that will provide the opportunity to **render a plenty of similar maps** (with the same extent, projection, layout, color scheme and composition, but with differing titles and data used for rendering). Say we have a single shapefile or Spatialite DB with a huge attribute table inherited from csv file like this: ![enter image description here](http://i.stack.imgur.com/9fx5I.png) I want to turn them into a set of choropleth maps like this: ![enter image description here](http://i.stack.imgur.com/VeexB.png) So I guess that I need a script that will just:   1. Iterate through specified range of columns in the attribute table;   2. Call some (yet not written?) rendering function that will produce the choropleth map with a legend and title;   3. Dump the output to the vector formatted-file (PDF, EPS, etc.).  I'm going to use QGis for that purpose and would be glad if anyone could outline the main ideas and key QGis API functions that I can rely on at first. Thank you.


Export table structure information to Excel QGIS or MapInfo

I want to create a data dictionary of the tables of our primary layers. So I want a way to export the table structure to Excel. I don't need the actual data, I just want to know what columns are in each table and the data types for each column. Our layers are in MapInfo, and I also have access to QGIS. I can use the MapInfo Table Manager to export to a .met file, but when I copen that with Excel, the information is imported into one column - then requiring manual processing.


Modifying the Score text in the Locate Widget of Flexviewer 2.4

I want to add text where it says "score" to make it more clear that this is an address matching score. ![enter image description here](http://i.stack.imgur.com/nRgu7.jpg) I am using the LocateWidget_US.xml and do not think I can do it here. I think the place to do it may be in the LocateWidget.mxml in this line????                locateResult.content = getDefaultString("resultScoreText") + " " +       (addrCandidate.score % 1 == 0 ? addrCandidate.score : addrCandidate.score.toFixed(1));


Merging US counties in QGIS?

I'm doing research on US cotton price fluctuations from 1877-1930. Here's the problem: my data is county-level, but county borders changed from 1877 to 1930! To solve this, I plan to "aggregate up" to the smallest consistent unit (eg. if a county border splits, use the un-split original county as the unit of observation). How can I do this on QGIS? I am using data from the Historical County Project here: http://publications.newberry.org/ahcbp/ Any help would be greatly appreciated.


Is there a way to get a good human readable error from a COM error in arcEngine?

I'm trying to perform the following operation:                IPropertySet addressProperties = reverseGeocoding.ReverseGeocode(point, false);      And I get this error: Exception from HRESULT: 0x80040217 Is there some function to get a human readable form of this error?


Add toolbar - error "no object added"

I'm trying to add Hawths Tools to by Toolbar selection. I'm running ArcMap/ArcInfo v.9.3.1. Hawths Tools is not supported in v.10. I've dowloaded the zip file, extracted the files, adn ran teh .exe file. When I go to "customize" Tools, add from file, and select under Program files "HawthsTools3.dll", an "Added Objects..." menu pops up that reads: No new objects added. If you then open ArcMap, select View, then Toolbars, Hawths Tools does not show up. Can anyone provide assistance?


Want to convert Lat/Long to UTM

I want to convert Lat/Long to UTM. When I search on net I am getting completely different formulas. e.g. Lat/Long, 21.0909,79.067635 How to convert it to UTM? Thanks


How to install Apache Web Server from OSGeo4W?

Good morning, I'm trying to create a QGIS web client on my Windows 8 But with OSGEO4W not appear the option to make Apache installs Web Server, as of this writing in several tutorials and documentations. A print screen of my Windows 8 ![enter image description here](http://i.stack.imgur.com/CVUea.jpg) Should this well, this print belongs to a tutorial found on the web ![enter image description here](http://i.stack.imgur.com/bnolO.jpg)


Is there a way to have a choropleth map in Excel reading data from a sheet?

Is it possible to have a solution similar to ESRI maps for office in which I want basically a geojson file or any file for that matters to render a choropleth map based on data in a sheet? Tried already this tutorial http://www.clearlyandsimply.com/clearly_and_simply/2012/09/faster-choropleth- maps-with-microsoft-excel.html but I have a to do this in a way that can be dynamic. I was thinking exporting to geojson and loading on LeafletJS and be able to display it within Excel, is this even possible?


Mapserver and SLD Files

I have a set of data layers that define a map from small to large scales. These layers are available through mapserver and are grouped in the mapfile so:-               LAYER       GROUP large_scale       NAME roads       ..     END     LAYER        GROUP large_scale       NAME water      ...     END     LAYER        GROUP medium_scale       NAME roads      ....     END     ....      I have been given SLD files for these layers but they break down into the NAME level not the group level. So I **large_scale_roads.sld** **large_scale_water.sld** **medium_scale_roads.sld** etc.. As I understand it mapserver cannot use an SLD file from the mapfile itself, this has to come from the request. I am hoping to publish this all through a WMS with the layer name as either **large_scale** or **medium_scale** and using the SLD files rather than the mapserver file. Can I do this given multiple SLD files, or do I have to combine them all into a single file which is going to be huge to cover all of these layers? Or is there a better approach? I do not want to re-do all of the styling in the SLD files and am using mapserver behind a mapcache tile cache.


How do I stop null values from being assigned extreme color values?

I have a raster surface that I kriged in Surfer and imported to Grass GIS but when I view it in QGIS, the null values outside of the interpolated surface take an extreme value and wash out the resolution in the rest of my surface. Is there an easy way to stop the null values from being assigned off the scale values?


Autoincrement field when New Feature added

I know that this is probably a very basic programming but I am brand new to Python. I have a layer in a geodatabase that I need a unique ID field (for joining). I can't use the ObjectID because that can change. I can't use a GlobalID because the data will be used by databases that can't handle the "{" brackets or dashes. I have already populated the field. When I add a new feature I want to have the value of the max existing value + 1 for the new feature. Thanks to Jason here is what I have so far-               import arcpy     gdb_full_path = r'D:\GIS\ZA.gdb\Current'     feat = 'ZA_Merge'     arcpy.env.workspace = gdb_full_path     with arcpy.da.SearchCursor(feat,["ANID"]) as cursor:          for row in cursor:              unique_id_counter = row.count     with arcpy.da.InsertCursor(feat,["ANID"]) as cursor:          cursor.insertRow((unique_id_counter + 1))      Here is the error that I get - Runtime error Traceback (most recent call last): File "", line 9, in TypeError: unsupported operand type(s) for +: 'builtin_function_or_method' and 'int'


How to represent trend over time?

I have a time series of rasters where the cells of each raster represents some value at a certain time. I'd like to generate a map that highlights the magnitude of positive or negative trends in this value over time for each cell. My somewhat naive approach is to fit a simple linear regression (X=time and Y=value) to each cell and output the array of slopes to a raster (as per example images below). This can be filtered by only exporting significant results. ![time series from four individual cells](http://i.stack.imgur.com/XEPTu.jpg) ![Slopes from linear regression](http://i.stack.imgur.com/KIbyS.jpg) How else might I represent trend over time in a raster timeseries? NB: I'm interested in general techniques not software specific instructions.


Python GDAL: Save array as raster with projection from other file

I have an array of data, and for each datapoint I know the latitude and longitude. I'd like to save it as a GTiff with the same projection as other rasters I have. This is what I've tried so far, but no luck.               import numpy as np     import gdal     from gdalconst import *     from osgeo import osr          def GetGeoInfo(FileName):         SourceDS = gdal.Open(FileName, GA_ReadOnly)         GeoT = SourceDS.GetGeoTransform()         Projection = osr.SpatialReference()         Projection.ImportFromWkt(SourceDS.GetProjectionRef())         return GeoT, Projection          def CreateGeoTiff(Name, Array, driver,                        xsize, ysize, GeoT, Projection):         DataType = gdal.GDT_Float32         NewFileName = Name+'.tif'         # Set up the dataset         DataSet = driver.Create( NewFileName, xsize, ysize, 1, DataType )                 # the '1' is for band 1.         DataSet.SetGeoTransform(GeoT)         DataSet.SetProjection( Projection.ExportToWkt() )         # Write the array         DataSet.GetRasterBand(1).WriteArray( Array )         return NewFileName          def ReprojectCoords(x, y,src_srs,tgt_srs):         trans_coords=[]         transform = osr.CoordinateTransformation( src_srs, tgt_srs)         x,y,z = transform.TransformPoint(x, y)         return x, y          # Some Data     Data = np.random.rand(5,6)     Lats = np.array([-5.5, -5.0, -4.5, -4.0, -3.5])     Lons = np.array([135.0, 135.5, 136.0, 136.5, 137.0, 137.5])          # A raster file that exists in the same approximate aregion.     RASTER_FN = 'some_raster.tif'          # Open the raster file and get the projection, that's the     # projection I'd like my new raster to have, it's 'projected',     # i.e. x, y values are numbers of pixels.     GeoT, TargetProjection, DataType = GetGeoInfo(RASTER_FN)     # Meanwhile my raster is currently in geographic coordinates.     SourceProjection = TargetProjection.CloneGeogCS()          # Get the corner coordinates of my array     LatSize, LonSize = len(Lats), len(Lons)     LatLow, LatHigh = Lats[0], Lats[-1]     LonLow, LonHigh = Lons[0], Lons[-1]     # Reproject the corner coordinates from geographic     # to projected...     TopLeft = ReprojectCoords(LonLow, LatHigh, SourceProjection, TargetProjection)     BottomLeft = ReprojectCoords(LonLow, LatLow, SourceProjection, TargetProjection)     TopRight = ReprojectCoords(LonHigh, LatHigh, SourceProjection, TargetProjection)     # And define my Geotransform     GeoTNew = [TopLeft[0],  (TopLeft[0]-TopRight[0])/(LonSize-1), 0,                TopLeft[1], 0, (TopLeft[1]-BottomLeft[1])/(LatSize-1)]          # I want a GTiff     driver = gdal.GetDriverByName('GTiff')     # Create the new file...     NewFileName = CreateGeoTiff('Output', Data, driver, LatSize, LonSize, GeoTNew, TargetProjection)      But this results in the following error message:               File "TES2GtifBBB.py", line 25, in CreateGeoTiff       DataSet.GetRasterBand(1).WriteArray( Array )     File "/Library/Frameworks/GDAL.framework/Versions/1.9/Python/2.7/site packages/osgeo/gdal.py", line 1082, in WriteArray       return gdalnumeric.BandWriteArray( self, array, xoff, yoff )     File "/Library/Frameworks/GDAL.framework/Versions/1.9/Python/2.7/site packages/osgeo/gdal_array.py", line 256, in BandWriteArray       raise ValueError("array larger than output file, or offset off edge")     ValueError: array larger than output file, or offset off edge