How to change cursor shape in pyQGIS?

I noticed that PyQGis has QgsMapToolPan() and QgsMapToolZoom() functions, and the cursor shape on the canvas will change to a hand (for pan), magnifying- glass(+/-) (for zoomIn / zoomOut). I have a toolbar for Select (arrow icon), Marquee (bounding box icon), besides the Pan, ZoomIn and ZoomOut tool buttons. Currently I created the Select & Marquee tools as QgsMapTool(canvas) and setAction with the appropriately ui widget buttons. How can I change the cursor shape to arrow when the Select tool is activated, and cross when the Marquee tool is activated? (I noted the default cursor shape for QgsMapTool() is Cross icon which I could use for the Marquee tool.)


How do I figure out the grid references (Eastings and Northings) necessary to create a circular 1 mile radius around one location?

How do I figure out the grid references necessary to create a circular 1 mile radius around one location? For instance: Grid Reference: SO 47904 87484 X (Eastings): 347904 Y (Northings): 287484 I know the approach has something to do with referencing the number of degrees from the original point for instance 10. Then subtracting the output by the number of metres in the radius size (a mile, so 1609.344). But I've forgot the actual approach. What is it, thanks?


point of intersection issues

I have a table containing a set of points of intersections. Most of the roads intersects whith just one road BUT i have some roads which intersects with two, therefore three different point of intersection has been created. BUT, i want only one point of intersection for all the three distinct roads. Any suggestion how I can merge the 3 points to just one where there is such situation. I am using postgresql with postgis The following is the table where i have the points of intersection ![enter image description here](http://i.stack.imgur.com/beoyh.png) The following is a graphical screenshot of the situation. ![enter image description here](http://i.stack.imgur.com/VGE5G.png)


What's the difference between Viewshed and Observer Points?

Can someone explain to me in layman's terms the difference between Viewshed and Observer Points? Thanks.


How to install PostGIS on Linux Mint 14?

I am trying to install PostGIS on Linux Mint 14 KDE. First thing I tried was to install PostgreSQL using "sudo apt-get install postgresql". I was successful doing that. I then did "sudo apt-get install postgis" and it installed something, but when I try to use it, say following the tutorials on the postGIS site, it won't recognize any command I type and the tutorial will refer me back to the installation section. So, I assume the Linux Mint PostGIS package is somehow broken or I am missing some key step. So, I decided to install PostGIS by building from source. After downloading many different dependencies I still can't get it to compile. I can successfully do ./configure. But it fails on 'sudo make' with the following error:               make -C liblwgeom      make[1]: Entering directory `/home/user/Downloads/postgis-1.4.2/liblwgeom'     make[1]: Nothing to be done for `all'.     make[1]: Leaving directory `/home/user/Downloads/postgis-1.4.2/liblwgeom'     make -C postgis      make[1]: Entering directory `/home/user/Downloads/postgis-1.4.2/postgis' gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -fPIC -pie -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -fpic -I/usr/include  -I../liblwgeom -I. -I. -I/usr/include/postgresql/9.1/server -I/usr/include/postgresql/internal -D_FORTIFY_SOURCE=2 -DLINUX_OOM_ADJ=0 -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include/tcl8.5  -c -o lwgeom_accum.o lwgeom_accum.c     lwgeom_accum.c: In function ‘pgis_geometry_accum_transfn’:     lwgeom_accum.c:110:52: error: ‘WindowAggState’ has no member named ‘wincontext’     lwgeom_accum.c: In function ‘PGISDirectFunctionCall1’:     lwgeom_accum.c:304:61: error: macro "InitFunctionCallInfoData" requires 6 arguments, but only 5 given     lwgeom_accum.c:304:9: error: ‘InitFunctionCallInfoData’ undeclared (first use in this function)     lwgeom_accum.c:304:9: note: each undeclared identifier is reported only once for each function it appears in     make[1]: *** [lwgeom_accum.o] Error 1     make[1]: Leaving directory `/home/user/Downloads/postgis-1.4.2/postgis'     make: *** [postgis] Error 2      Is there some easier way to do this or a good and up to date tutorial out there?


TIGER Geocoder not matching intersections without ZIP

I'm using the TIGER geocoder (2013 data, PostGIS 2.1, Postgres 9.3) to geocode intersections in New York City, but I'm finding that if I omit the zip code, I almost never get a match. So, for example...               ny_tiger=# SELECT pprint_addy(addy), st_astext(geomout), rating FROM       geocode_intersection('Broadway', 'Houston St', 'NY', 'New York', '10012');            pprint_addy            |          st_astext          | rating      ----------------------------------+-----------------------------+--------      607 Broadway, New York, NY 10012 | POINT(-73.996772 40.725432) |      0      604 Broadway, New York, NY 10012 | POINT(-73.996772 40.725432) |      0      609 Broadway, New York, NY 10012 | POINT(-73.996772 40.725432) |      0      606 Broadway, New York, NY 10012 | POINT(-73.996772 40.725432) |      0     (4 rows)      but...               ny_tiger=# SELECT pprint_addy(addy), st_astext(geomout), rating FROM       geocode_intersection('Broadway', 'Houston St', 'NY', 'New York');                                                                                pprint_addy | st_astext | rating      -------------+-----------+--------     (0 rows)      Is there a good way to get these addresses to resolve without the zip code?


Gaussian plume model in PostGIS or geocouch

Does anyone know of existing code for dispersion modeling using Gaussian Plume or comparable model, that I could plug in / adapt to be used programmatically from PostGIS or alternatively via GeoJSON/geocouch? I'm trying to model something like this: http://ready.arl.noaa.gov/gaussian- bin/dispsrc.pl to calculate dispersion values providing as few inputs as reasonably possible: lat/lon, Wind Speed, Wind Direction (possibly cloud cover maybe elevation, cloud cover, etc) My primary objective is to return computed values for % concentrations at points A, B, C, D downwind from emission point X, assuming 100% at point of release X Secondary objective is visualize it along the lines of something like below ![enter image description here](http://i.stack.imgur.com/Em54O.gif) Thanks in advance!


georeference and orthorectification of aerial photos

I am trying to process photos taken with a tetracam ADC micro camera placed on a UAV. I have GPS coordinates and mavlink logs providing roll, pitch and yaw of the UAV. I am having a real hard time georeferencing and orthorectifying the pics using tools as ossim or grass. Has anyone done this before?


Generating buffers in a automate way

I would like to creat buffers in a automate form and no matter the way (e.g. script, batches and etc) I am asking if anybody here knows how to do it or if are there scripts ready to do it. My situation is: I have two vectors layers (a point, representing a station, and roads. From the point I need to creat circular buffers that intersect the roads and after calculate the lengths of intersected roads. No matter the solution I would like the simple, like batch process, or built in scripts.


SQL within Python Script to get only part of the expression by GetParameterAsText

I was wondering if anybody could help me. Im trying to create a tool within ArcMap using a python script. Within the script i've been trying figure out how to change it so that I only need to get the numerical value from GetParameterAsText. So that for the tool i do not need to include the whole SQL expression just have the user input a value. This the last method that I have used "wf_value = arcpy.GetParameterAsText(4) wf_expression = ' "AGE_18_64"' + ">=" + "'%'" %wf_value arcpy.Select_analysis(counties, workforce, wf_expression)" ERROR MESSAGE: ExecuteError: ERROR 000358: Invalid expression 3000 Failed to execute (Select) As I'm guessing this way doesn't work as the wf_value is a float not a string but I can't seem to get it to work whichever way I've tried. Any help or suggestions would be great! Thanks!


How to Clear Parameters from Model Builder - ArcGIS

I'm attempting to clear out the parameters from my model so that the parameter locations don't show up in the tool when launched from ArcToolbox. ESRI's resource center has a couple of sentences about clearing parameters, but not how to actually do it. ![enter image description here](http://i.stack.imgur.com/j2Szv.jpg) ESRI's attempt at explaining how to clear out the parameters Does anyone know the steps to clear the parameters of a model built inside Model Builder for ArcMap?


PostGIS : I want to use ST_OffsetCurve with MultiLineStrings

I need to use the function ST_OffsetCurve for a multilinestring, but PostgreSQL gives me the error that the function is only for Linestrings. Is there a way arround? I want to use the function beceause I need to check if 2 lines (multilinestrings actually) are located at contrary sided of another multilinestring. For example, I need to find 2 lines, 1 on the right and 1 on the left side of the road (and the road is located by a line). I wanted to do this check by performing the ST_OffsetCurve function and the ST_Distance function. (if a line is on the right side of the road an you perform an offset to the right, the distance between the lines gets bigger). I hope this was understandable, so;   * Is there a way to use ST_OffsetCurce for Multilinestrings ?   * Is there maybe another way to achieve what I want ? Thanks!


how to add a query layer to a mxd in a python script

I want to add a query layer to an arcmap document so that whenever i have a db data update, it is reflected in my ma and I can update my service through python script. This is my script so far...               import arcpy     from arcpy import env     arcpy.env.overWriteOutput = 1          # define local variables     wrkspc = 'C:/ArcGIS_Workspace/'     mxd = arcpy.mapping.MapDocument(wrkspc + 'scripts/Trial.mxd')          input_db_name = "Database Connections/xxx.sde"     outLayer = "DynamicQueryLayer"     out_layer_name = wrkspc +"/shapefiles/DynamicQueryLayer.lyr"     query = "SELECT * FROM TEST_TABLE"          #unique key for the table     oid_field = "schema.TEST_TABLE.TEST_ID"          try:              # Create a query layer         arcpy.MakeQueryLayer_management (input_db_name, outLayer, query, oid_field)              # save the created query layer         arcpy.SaveToLayerFile_management(outLayer, out_layer_name, "ABSOLUTE")              # Get the created layer         lyr = arcpy.mapping.Layer(out_layer_name)              # get the data frame of the given mxd         data_frame = arcpy.mapping.ListDataFrames(mxd)[0]              # Switch to data view         mxd.activeView = data_frame.name              arcpy.mapping.AddLayer(data_frame, lyr, 'TOP')         print "Added layer to the MXD ..."              mxd.save()         print "MXD saved..."         except Exception, e:         # If an error occurred, print line number and error message         import traceback, sys         tb = sys.exc_info()[2]         print "Line %i" % tb.tb_lineno         print e.message      I get this error. ERROR 000732: Input Features: Dataset DynamicQueryLayer does not exist or is not supported. I am sure there is a way to save the created query layer as a layer file.Any help is greatly appreciated.


How to use GDAL on Heroku?

I have a geospatial python app that I want to use on Heroku. This is my `requirements.txt` file:               Flask==0.10.1     Jinja2==2.7.2     MarkupSafe==0.19     Werkzeug==0.9.4     gunicorn==18.0     itsdangerous==0.23     numpy==1.8.0     requests==2.2.1     wsgiref==0.1.2      I want to use the heroku-buildpack-geodjango to install Python GDAL. I create and do a git push.               heroku create --stack cedar --buildpack http://github.com/dulaccc/heroku-buildpack-geodjango/          git push heroku master      This all works fine. However the app crashes because it doesn't find GDAL. These are my logs:               $ heroku logs     ...     2014-03-23T18:57:08.224720+00:00 app[web.1]: ImportError: No module named osgeo     2014-03-23T18:57:08.348803+00:00 app[web.1]: 2014-03-23 18:57:08 [2] [INFO] Shutting down: Master     2014-03-23T18:57:08.348803+00:00 app[web.1]: 2014-03-23 18:57:08 [2] [INFO] Reason: Worker failed to boot.     ...      How do I set up GDAL in order to work properly?


How do you convert a bounding box into the canvas CRS?

I need to convert the pixel coordinates of a bounding box to the same CRS being used by an existing layer. Here's the relevant code so far:               # First, get the layer-coords version of the bounding box:     def pixelToCrsBox(self, theClickBox, theCanvas, theLayer):         """         Takes a bbox in pixel coords, converts it to a bbox in layer coords.              Args:             The bbox that needs to be converted.             The current canvas.             The current layer.         Returns:             The converted bbox.         Raises:             None         """         # converts from screen to map canvas crs         myMapToPixel = theCanvas.getCoordinateTransform()         myX1 = theClickBox.xMinimum()         myY1 = theClickBox.yMinimum()         myPoint1 = myMapToPixel.toMapCoordinates(myX1, myY1)              myX2 = theClickBox.xMaximum()         myY2 = theClickBox.yMaximum()         myPoint2 = myMapToPixel.toMapCoordinates(myX2, myY2)              myRectangle = QgsRectangle(myPoint1, myPoint2)              # converts the click box from canvas crs to the layer's CRS         myCanvasCrs = theCanvas.mapRenderer().destinationCrs()         myLayerCrs = theLayer.crs()         myTransform = QgsCoordinateTransform(myCanvasCrs, myLayerCrs)         myExtent = myTransform.transform(myRectangle)         return myExtent          # Next, get the first feature in the layer using the extents computed above     # (returned as myExtent, but fed to this function as theExtent).     def getFirstFeature(self, theLayer, theExtent):         """         Gets the first feature within the bbox in the active layer.              Args:             The current layer.             The converted bbox.         Returns:             A feature.         Raises:             Exception if data could not be loaded.         """              myProvider = theLayer.dataProvider()         if myProvider is None:             msg = ('Could not obtain data provider from '                'layer "%s"' % theLayer.source())             raise Exception(msg)              #myLayerExtent = theLayer.extent()         myAttributes = myProvider.attributeIndexes()         myFetchGeometryFlag = True         myUseIntersectFlag = True              mySelection = myProvider.select(myAttributes,                       theExtent, myFetchGeometryFlag, myUseIntersectFlag)         print ('SELECTED: %s' % mySelection)         myFeature = myProvider.nextFeature(mySelection)         return myFeature      To test this, I have these functions:               def prepareTestCanvas(self):         """         Sets parameters for a test canvas.         """         loadLayers()         setCanvasCrs(4326, True)         canvas.zoomToFullExtent()          def testPixelToCrsBox(self):         """         Tests that a bbox in pixel coords is converted to map coords         """         self.prepareTestCanvas()         myPoint = QgsPoint(40, 15)         myBox = self.bucketFill.getClickBbox(myPoint)         myLayer = self.bucketFill.getActiveVectorLayer()         myRectangle = self.bucketFill.pixelToCrsBox(myBox, canvas, myLayer)         myExpectedBox = QgsRectangle(106.758705784, -6.13591899755,                                      106.761696484, -6.1329282975)         myMessage = ('Bounding box was incorrect.\n'             'Received values %s\n'             'Expected values %s' % (             str('%s, %s, %s, %s' % (                 myRectangle.xMinimum(), myRectangle.yMinimum(),                 myRectangle.xMaximum(), myRectangle.yMaximum()                 )),             str('%s, %s, %s, %s' % (                 myExpectedBox.xMinimum(), myExpectedBox.yMinimum(),                 myExpectedBox.xMaximum(), myExpectedBox.yMaximum()                 )),             ))         assert (             round(myRectangle.xMinimum(), 9) ==             round(myExpectedBox.xMinimum(), 9) and             round(myRectangle.xMaximum(), 9) ==             round(myExpectedBox.xMaximum(), 9) and             round(myRectangle.yMinimum(), 9) ==             round(myExpectedBox.yMinimum(), 9) and             round(myRectangle.yMaximum(), 9) ==             round(myExpectedBox.yMaximum(), 9)), myMessage          def testGetFirstFeature(self):         """         Tests that a feature is returned.         """         self.prepareTestCanvas()         myLayer = self.bucketFill.getActiveVectorLayer()         myTestBox = QgsRectangle(106.758705784, -6.13591899755,                                  106.761696484, -6.1329282975)         myFeature = self.bucketFill.getFirstFeature(myLayer, myTestBox)         print myFeature         myMessage = ('Returned object was not a feature.')         assert myFeature.type() == QgsFeature, myMessage      However, the coordinates are not in the right place when they are returned in the layer CRS. They're supposed to hit the feature I'm trying to select, but they don't. The coordinates that get returned (same as those in the test) are way off base, and it shouldn't be possible to click there if the canvas is zoomed to the layer extents (there are no other features in the test layer). So my theory is that the coordinates are transformed incorrectly. What am I doing wrong?


Get Database Table Name From Layer Name in ArcObjects

I am using ArcObjects v10.0 with a SQL Server 2008 database. Given the name of a Layer, is there a way for me to extract the corresponding name of the database table that represents that Layer? The Layer name and the Database Table name will often be identical, but they will not in cases where the Layer name contains invalid characters, such as spaces.


How to load spatial data into ArcGIS Javascript API application from SQL Server 2008?

I have geometry data in SQL Server 2008 R2. How do I load that spatial data using the ArcGIS Javascript API?


Options for manually identifying road defects from Terrestrial Lidar

I am trying to create a process to identify road defects manually from Lidar. We have Erdas 2013, ArcGIS10.1 and Global Mappper 14.2 as options for paid software. So far Merrick Mars displays the data the best but (the free version) does not allow one to draw polygons. ![enter image description here](http://i.stack.imgur.com/MpLPZ.jpg) With ESRI the best I could get is ![enter image description here](http://i.stack.imgur.com/yaQ9w.jpg) Unfortunately you can't zoom any further to view defects. With ERDAS the best I could get is ![enter image description here](http://i.stack.imgur.com/kcgHc.jpg) With Global Mapper the best I could get is ![enter image description here](http://i.stack.imgur.com/R5fkB.jpg) I can manually assign a color to each range of elevation but this is very cumbersome. So any ideas on what I am doing wrong? how can I get a similar view to Mars in any of the other software? I need to then create a polygon around each road defect.


How to extract Latitude and Longitude of Shapefile for importing into Tableau?

I'm having a hell of a time so any help would be appreciated. I want to extract the latitude and longitude of the Health Authority boundaries from the zip file below. The ultimate goal is to import these coordinates into Tableau. http://www.bcstats.gov.bc.ca/Files/1d01fdf3-dc2a-4715-ba81-0aef150a49b8/Boundaries- HealthAuthorities.zip Any thoughts would be appreciated!


Find nearest neighbours faster in PostGIS

I currently have a query that calculates the number of useful amenities within a certain radius of each town, using OSM data:               create table places as     select town.name, place, town.way, (       select count(*)       from planet_osm_point pub       where (pub.amenity in ('pub','cafe','restaurant','supermarket','fuel') or pub.shop in ('bakery','convenience')) and pub.way <-> town.way < 5000     ) + (       select count(*)       from planet_osm_polygon pub       where (pub.amenity in('pub','cafe','restaurant','supermarket','fuel') or pub.shop in ('bakery','convenience')) and pub.way <-> town.way < 5000     ) pubs     from planet_osm_point town where place in ('hamlet','village','town','city');      It works fine, but is very slow, probably because of the high level algorithm: compare every town to every amenity. Are there any easy ways to optimise this? (Both tables have indexes already.) "Explain" returns this:                Seq Scan on planet_osm_point town  (cost=0.00..260497454.31 rows=6490 width=125)        Filter: (place = ANY ('{hamlet,village,town,city}'::text[]))        SubPlan 1          ->  Aggregate  (cost=17614.09..17614.10 rows=1 width=0)                ->  Seq Scan on planet_osm_point pub  (cost=0.00..17612.32 rows=710 width=0)                      Filter: (((amenity = ANY ('{pub,cafe,restaurant,supermarket,fuel}'::text[])) OR (shop = ANY ('{bakery,convenience}'::text[]))) AND (((way)::box <-> (town.way)::box) < 5000::double precision))        SubPlan 2          ->  Aggregate  (cost=22522.32..22522.33 rows=1 width=0)                ->  Seq Scan on planet_osm_polygon pub  (cost=0.00..22521.83 rows=197 width=0)                      Filter: (((amenity = ANY ('{pub,cafe,restaurant,supermarket,fuel}'::text[])) OR (shop = ANY ('{bakery,convenience}'::text[]))) AND (((way)::box <-> (town.way)::box) < 5000::double precision))      ## Answer My new query looks like this:               create table places as     select town.name, place, town.way,        (select count(*)        from planet_osm_point p        where p.amenity = 'pub' and st_dwithin(p.way,town.way,5000) as p1) +        (select count(*)        from planet_osm_polygon p        where p.amenity = 'pub' and st_dwithin(p.way,town.way,5000) as p2) pubs     ...


How to write a point-in-polygon query for Postgis?

I'm trying to write a query in Postgis which will return all rows where a dynamically changing longitude/latitude point resides within the geometric polygon of that row (in the `geom` column). This is the query I'm trying to use:               SELECT * FROM "geospatial-data" WHERE ST_Contains("geospatial-data".geom,ST_Transform(ST_GeomFromText('POINT(-90.56210 38.60369)',4326), 4269))=true      I'm basing this query off of an older post here: http://codemagician.wordpress.com/2009/09/12/point-in-polygon-in-postgis/ I'm not getting any errors but I can't understand what I'm doing wrong. How should I write/modify the query in order to query for a point-in-polygon?


Why are my raster mean and standard deviation -1?

I have a set of about 25 rasters whose descriptive statistics I have been examining. The data in the rasters were calculated in Python and the rasters were created using Python-GDAL. In all but one raster, the mean, std. dev., minimum and maximum seem correct. In one raster, however, the minimum and maximum values are correct (4.842 and 9.458 respectively) but the mean and standard deviation are `-1` if I take a look in ArcCatalog and `-1.#IND` in QGIS. I opened the raster in Python via GDAL and calculated the minimum and maximum using `data[data>band.GetNoDataValue()].min()` and `data[data>band.GetNoDataValue()].max()` respectively, and the values these functions returned were correct (as above). But the mean value via `data[data>band.GetNoDataValue()].mean()` was 2.905, which is clearly nonsense as this value does not occur within the minimum and maximum value limits for this raster. Any ideas as to what's going wrong?


Enterprise Architect - domains relationship

I am not sure if this forum is right place to ask but let me try. I am building an ArcGIS model in Enterprise Architect. I have a couple domains inside. The problem is: I want to make the following realtionship between two of it (domains) that after i import the xml file to ArcGIS i will be able to choose one attribute (from the first domain) and the second one (from the connect- relationship domain) will be filled automatically . Do you know how to make such relationship (connection) ? I hope i make myself clear... Thank's in advance


Point clustering only works for part of an area?

I am using the 3rd party scripts for point clustering as published by Globoserve, http://globoserve.posterous.com/ . I followed the instructions to the letter - and just replaced the queryTask variable to point to my point features that are projected in the one of the compatible projection systems. But the point cluster alogrithm will only cluster a section of points rather than all of my points - see image below. ![enter image description here](http://i.stack.imgur.com/U1jY9.jpg) Can anyone explain why this is happening? Cheers NOTE - I have tried this with a totally different point layer in US - and it shows a 500 point limit - the same as the pic below!! Why is there a point limit???


IE 9 reopen tab if close window while applyedits are executing

We load a map in a pop up using window.open but when we execute the applyedits method and immediately after this we close the pop up, on Internet Explorer the parent window "crash" and show the message: "A problem with this webpage caused Internet Explorer to close and reopen the tab" and we don´t know how to prevent this. We try window.onbeforeunload but not fired it while applyedits are running. Any clue will be welcome. Sorry about my bad english.


What is the difference between ActiveView, FocusMap and PageLayout in ArcObjects?

I see that different starting points are used when interacting with ArcMap IMxDocument                 IMxDocument mxDocument = application.Document as IMxDocument;            IActiveView activeView = mxDocument.ActiveView;         //IActiveView activeView = mxDocument.FocusMap as IActiveView;       //IActiveView activeView = mxDocument.PageLayout as IActiveView;            // Get an envelope corresponding to the view extent.       IEnvelope envelope = activeView.Extent;      What is the difference between mxDocument.ActiveView, mxDocument.FocusMap and mxDocument.PageLayout related their extent? Are they going to be different? In what case each can be used? Thanks


How to select GeoJSON vector feature in Leaflet?

I've been using OpenLayers for years,instead of comparing OL & Leaflet libraries,I decided to use Leaflet for the job for now. I have a GeoJSON data layer where I show point objects only.Just as I have used in OpenLayers,when user hovers(which is supplied with leaflet) & **toggle click** where I should change style of vector(s) (mostly color).I cannot find this event system in leaflet. Is there any way to do this ?


OpenLayers and external CSS

I am using geoExt and OpenLayers to plot some map. Everything worked well until I had to add some styling. To display it on the webpage, I need to use the CSS of my university and once I do that, I have some horizontal white lines between each tile (but not vertically though). The lines have always the same height. The problem seems to come only from the CSS, since if I remove it in the html (it is the first thing invoked in `<head>`), everything looks correct. Searching here and on the web, I found than some people proposed to create a CSS after everything else which sets:               .openlayers-map img {max-width: none;}      But it didn't solve anything. Is there a way to tell to a div that it needs to load no styles but the one used by OpenLayers? Here is a sample of the code I have:                var osm = new OpenLayers.Layer.OSM(                 "Open Street Map"         );      bwms = new OpenLayers.Layer.WMS(                         "usa:states - Tiled", "http://128.178.82.176:8080/geoserver/usa/wms",                 {                         layers: "usa:states",                         tiled: true,                         transparent: true                 },{                         singleTile: true,                         projection: new OpenLayers.Projection("EPSG:4326") // specified because it is different than OSM's                 }         );                       mapPanel = new GeoExt.MapPanel({                 renderTo: "mapPanel",                 map: new OpenLayers.Map({                         projection: epsg900913,                         displayProjection: epsg4326,                         units: "m",                         center: new OpenLayers.LonLat(6.59,46.39).transform(epsg4326,epsg900913)                 }),                 layers: [osm,bwms],                 // height/width in pixels                 height: 450,                      zoom: 10,                 border: false         });


How to sum area of polygons by values occuring in multiple fields?

My data has 2 fields holding landuse types, which both describe what is within the polygon. For example, the polygon may have Type1=Retail, Type2=Leisure Area= 1 but another polygon has Type1=Leisure, Type2=Swimming Pool Area=3 I want to discover the total area of polygons with a Retail attribute, Leisure attribute etc.. to build a table like:               Retail 1     Leisure 4     Swimming Pool  3      etc. Of course some polygons will be counted in multiple categories, but this is ok for what I am working on. In some cases the polygon might have Type1= Retail, Type2= Retail. In this case the area should only be counted once. Can I ask PostGIS to sum the areas for all of the values it finds in the fields, without me having to write/run a query for each of the types (there are a lot)?


Implementing day night functionality

I want to implement day/night functionality on world map i.e there will be dark layer showing countires having night now. This world map could be creaeted through ESRI or SVG map.I want to understand what is the logic of showing behind implementing this.Any known algorithms/formulas. I have posted this question in stackoverlfow (http://stackoverflow.com/questions/19685010/implementing-day-night- functionality-on-map). But thought this is better forum.


String variable substitution in selection expression

I'm trying to put a variable into a string used to do a selection. At the moment it's like this...               expression = "'No_Props' > 5 AND %s < 200 AND 'ST_Ori' >60" % metres_field     arcpy.SelectLayerByAttribute_management(streets_table, "NEW_SELECTION", '"' + expression + '"')      Printing the expression gives this....               'No_Props' > 5 AND 'Shape_Le_2' < 200 AND 'ST_Ori' >60      .. which I thought would work. I've tried several things. Originally the expression was in a docstring..               """'No_Props' > 5 AND %s < 200 AND 'ST_Ori' >60""" % metres_field      .. but that didn't work I considered using the **doc** attribute but it only worked on a function (not a variable) Anyone know what I'm doing wrong / how to make it work? The expression looks like it should do the trick when it's printed out.. Anyone have any ideas? Cheers


Display a single country with OpenLayers

Can I display a single country using Openlayers? I'm not trying to restrict zoom levels or . I want only one single country to be displayed. The rest of the world cannot be displayed. My reasearch shows no information on my specific issue.


Is it possible to add to the map a layer containing results from a sql query

I'm developping an ArcMap Extension and I need to join an existing feature class with data from a sql query located on another DBMS. I already set up a Workspace with an OleDbWorkspaceFactory. I'm even able to add to the document any table contained in this database. I'm now trying to add a sql query to the document the same way I do it with tables. The query can be complex and include a couple of table with inner/left joins. I looked in the ESRI documentation and I can't find the good object to do this. Thanks


Arcpy hanging on Linux

I am having issues getting arcpy to run correctly on Linux Red Hat. I solved some earlier problems which appeared to be related to permissions on the init_server file. Now that si resolved, when I 'import arcpy' in Python, it just hangs, not even timing out after 20 minutes. Does anyone have any experience of using arcpy on Linux and did you face any issues setting it up? Thanks in advance for any help/suggestions. **EDIT** AN update. I have rebooted the server and edited the LD_LIBRARY_PATH in init_server.sh and also changed the call to set_pyton_anv.sh (as it didn' appear to be calling it ) and it failed with **Cannot open X display "(not specified)"** I then started an XWindows session on the box in Hummingbird and then, and only then, did import arcpy run correctly. Not really sure what to say other than **What? Why? How?** Does anybody know any reason why this should be?


Automating capture of Extent from multiple mxds with multiple dataframes

I want to create a single shape file from multiple mxd's that have multiple frame sets with different extents in them. I have found/started a script to do this (attached) but can't figure out how to write the captured X&Y Max/Min into the shape file that is created for this. See output below. I also want it to write the scale and title of the frame as well as the file name of the mxd. Would appreciate your help in completing this script.                import arcpy, glob, os from arcpy      import env from arcpy import mapping      env.overwriteOutput = True           path = r"C:\temp" mxdList =      glob.glob(path + "\*.mxd")           env.workspace = r"C:\temp\Test.gdb"           y = 1           for mxd in mxdList:          mxd2 = mapping.MapDocument(mxd)          dataframe = mapping.ListDataFrames(mxd2, "*")[0]          frameExtent = dataframe.extent          XMAX = frameExtent.XMax          XMIN = frameExtent.XMin          YMAX = frameExtent.YMax          YMIN = frameExtent.YMin          pnt1 = arcpy.Point(XMIN, YMIN)          pnt2 = arcpy.Point(XMIN, YMAX)          pnt3 = arcpy.Point(XMAX, YMAX)          pnt4 = arcpy.Point(XMAX, YMIN)          array = arcpy.Array()          array.add(pnt1)          array.add(pnt2)          array.add(pnt3)          array.add(pnt4)          array.add(pnt1)          polygon = arcpy.Polygon(array)          arcpy.CopyFeatures_management(polygon,      "Polygon_Extent" + "_" + str(y))          y = y + 1                list = []           lstFCs =      arcpy.ListFeatureClasses("Polygon_Extent*")      for fc in lstFCs:          list.append(fc)           arcpy.Merge_management(list, "Extent")           for item in list:          arcpy.Delete_management(item)      Even with this I get errors...               Traceback (most recent call last):       File "P:\2011\Job_031_TownPlanning_SeriesProduction\Working\mxd\extent_creation.py", line 32, in <module>         arcpy.CopyFeatures_management(polygon, "Polygon_Extent" + "_" + str(y))       File "C:\Program Files\ArcGIS\Desktop10.0\arcpy\arcpy\management.py", line 1943, in CopyFeatures         raise e     ExecuteError: ERROR 000210: Cannot create output Polygon_Extent_1     Failed to execute (CopyFeatures).


Java Contour Algorithm

Does anyone know if there is an open source project in Java that will take a set of (x, y, z) points and create a contour map for Google Maps/Earth? There does not seem to be a good contouring application for Google Maps. Any suggestions? Thx!


Can Civil 3D reproject shapefiles?

Sorry to ask, but I just don't have time for help menus this week. That said, does anyone know if CAD is capable of re-projecting shapefiles? I find myself in a situation whereby I may have to use spatial data without access to ESRI software. The data are delivered in the GCS_North_American_1983 datum, and my clients site drawing is in NAD83 Z17N. I fully expect problems. Can any of you post any related links that you're aware of? There's no budget to purchase software on this one either (just a heads-up). Alternatively, is there a way to get CAD to project on the fly? Thanks in advance


QGIS or Postgis - How to split polylines with a point layer?

In QGIS, I would like to split the polylines in a layer loaded in the workspace with the points in another loaded layer. If a point intersects a polyline, this polyline should be transformed into two polylines... I've read that this could be done with grass but i have no idea how to do it with layers (SHP)loaded in the QGIS workspace.


How to increase resolution of DEM rasters?

Thanks to the fine folks here at the GIS SE, I have managed to batch process a load of ASC files into raster hillshade TIFs. However, while they look fine on screen, when printed they are very pixellated - they are too low a resolution in the printing sense. Is there anyway I can increase the resolution so they print well?


Open Layers override class or method in Android 2.3

I'm implementing my own image loading mechanism for openlayers, because lack of functions in android 2.3 webview. It will get cached images from android db. I wan't to override OpenLayers.Tile.Image.initImage(). What options I have? I have try Utils for extending TMS layer, but can't extend initImage.


QGIS create layer with the points of the beginnings and ends of a polylines layer (without duplicate points)

In QGIS, i would like to create a new layer containing the beginning and end points of a polylines layer, but without the duplicate points that would result of adjacent polylines.


What affects the kind of date (local vs. UTC vs unspecified) on JTXJobClass.StartedDate?

I am accessing the JTXJobClass.StartedDate for a JTX Job (with IJTXJob3). I am getting an unspecified DateTime.Kind value. The value appears to be UTC (iirc, WMX always stores UTC in the database but I'm questioning that since the DateTime.Kind is unspecified). The value comes from the started_date field of the JTX_JOBS table and its values looks like UTC to me. Is there a WMX configuration that would make the DateTime.Kind on the JTXJobClass.StartedDate return as `Utc`? Or `Local`? Or is it safe to _assume_ that the unspecified value is `Utc`? Instinctively, this is my first approach (because it is easy), but then I started to think about what could go wrong if that assumption doesn't hold true.


Heat Maps only for feature layer (why not for dynamic layer ?) in ArcGIS Java script API 3.0/3.2

I am referring this link to generate the heat map. In this example they used feature layer and I tried using dynamic layer but getting an error (that no map is displaying). I researched on Google regarding this but not able to find such information . So is there any specific requirement/purpose to use feature layer instead of dynamic layer?? If anyone know this please let me know…. Thanks… Software platform : ArcGIS 10.1 (Server & Desktop), ArcGIS JSAPI 3.0/3.2


VSIMalloc3() and UnifiedSrcDensity mask errors when running gdal_warp in OSGEO4w shell

This is related to gdal.py as part of bat script in windows 7 I am getting > ERROR 2: VSIMalloc3(): Out of memory allocating 854522136 bytes. > > ERROR 2: Out of memory allocating 119813400 bytes for UnifiedSrcDensity > mask. I am running a XEON 3.4GHz. Windows 7, 64-bit with 16GB RAM. 930GB on C and 850gb on D (this is free space off 1TB drives) and network drives with 1.72TB free. The command I am running in a bat file is               gdalwarp -multi --config GDAL_CACHEMAX 500 -wm 500 -r near -co "COMPRESS=DEFLATE" -co "TILED=YES" -co "BIGTIFF=YES" -srcnodata 255 -dstnodata 255 -overwrite %2\%3\%3_translated.tif %2\%3\%3.tif > %2\%3\2_%3_warp_log.txt      where %1=input tif, %2=output directory, %3=file name In this case the input file is > Driver: GTiff/GeoTIFF Files: > P:\2012\183_TownPlanning_Symbology\Working\Raster_Layer_Creation\4Band_translated_pyramid\z_zones\z_zones_translated.tif > Size is 411096, 298318 Coordinate System is: PROJCS["WGS 84 / Pseudo- > Mercator", GEOGCS["WGS 84", DATUM["WGS_1984", SPHEROID["WGS > 84",6378137,298.257223563, AUTHORITY["EPSG","7030"]], > AUTHORITY["EPSG","6326"]], PRIMEM["Greenwich",0], > UNIT["degree",0.0174532925199433], AUTHORITY["EPSG","4326"]], > PROJECTION["Mercator_1SP"], PARAMETER["central_meridian",0], > PARAMETER["scale_factor",1], PARAMETER["false_easting",0], > PARAMETER["false_northing",0], UNIT["metre",1, AUTHORITY["EPSG","9001"]], > EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 > +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs"], > AUTHORITY["EPSG","3857"]] Origin = > (15825753.321902087000000,-1808723.335397920600000) Pixel Size = > (1.000002861523879,-1.000001022298165) Metadata: AREA_OR_POINT=Area > DataType=Thematic Image Structure Metadata: INTERLEAVE=PIXEL Corner > Coordinates: Upper Left (15825753.322,-1808723.335) (142d 9'54.58"E, 16d 2' > 4.35"S) Lower Left (15825753.322,-2107041.640) (142d 9'54.58"E, > 18d35'33.74"S) Upper Right (16236850.498,-1808723.335) (145d51'29.19"E, 16d > 2' 4.35"S) Lower Right (16236850.498,-2107041.640) (145d51'29.19"E, > 18d35'33.74"S) Center   >  (16031301.910,-1957882.488) (144d 0'41.89"E, 17d19' 5.07"S) Band 1 > Block=256x256 Type=Byte, ColorInterp=Red Mask Flags: PER_DATASET ALPHA Band > 2 Block=256x256 Type=Byte, ColorInterp=Green Mask Flags: PER_DATASET ALPHA > Band 3 Block=256x256 Type=Byte, ColorInterp=Blue   >  Mask Flags: PER_DATASET ALPHA Band 4 Block=256x256 Type=Byte, > ColorInterp=Alpha The pipe of the gdal_warp command gives > Creating output file that is 411096P x 298318L. Processing input file > P:\2012\183_TownPlanning_Symbology\Working\Raster_Layer_Creation\4Band_translated_pyramid\z_zones\z_zones_translated.tif. > Using band 4 of source image as alpha. Using band 4 of destination image as > alpha. 0 so the process is failing before even 10% is complete and fails about 1h after processing starts. I am just setting up a linux box to try this out on but is there something I can tweak in windows to get this to work? best, --- UPDATE 1 Part of the issue is with the cache and wm switches. Removing these helps but the larger process still crash. http://trac.osgeo.org/gdal/wiki/UserDocs/GdalWarp


TIN Interpolation using a vector layer

I'm writing a plugin in QGIS and I'd like to generate a TIN surface using a vector layer with x,y and z (interpolation attribute). The idea is to visualize the same result like in the Interpolation plugin but optimize it in my plugin, to facilitate users. Does such a function exist? Can I communicate with the Interpolation plugin to generate the result? Thank you very much! Ciao Steffy


QGIS, how do you break segments of a polygon, ie break 1 polygon into 2 or more?

I have a polygon but would like it to be in broken up to put into different layers. I can't work out how to do this.


OpenLayers XYZ Unable to Load Local Tiles

I have some local tiles that were generated from OpenStreetMaps using Maperitive. I've tried going through the docs and tests but the map is not loading. I'm not getting any errors in chrome's js console either. I think OpenLayers has access to my images because previous errors stated that some tiles could not be found. The solution to that problem was to initialize the OpenLayers.Map.restrictedExtent with bounds. I'm not sure where to go from here.               function initMap() {         var extent = new OpenLayers.Bounds(-80.604570, 43.228173, -79.481697, 43.607333);             extent = extent.transform("EPSG:4326", "EPSG:900913");              var map = new OpenLayers.Map('map',  {restrictedExtent:extent});         //var options = {'layername':'basic', 'type':'png'};         var xyz = new OpenLayers.Layer.XYZ('OpenLayersXYZ', 'http://localhost:8081/maps/tiles/${z}/${x}/${y}.png', {sphericalMercator:true, layers:'basic'});         console.log(xyz);         map.addLayer(xyz);         map.zoomToExtent(extent);     }          <!DOCTYPE html>

                Maperitive log from tile generation: set-geo-bounds Setting the geometry bounds to srid=4326, (-80.604904441331,43.2284165575301,-79.4820319148331,43.6075754238019) set-print-bounds-view Set the printing bounds to '-80.604570253079,43.2281730577825,-79.4816977265812,43.6073334440597' generate-tiles minzoom=0 maxzoom=14


Does SQL Server need extensions to do spatial?

Does SQL Server need extensions to do spatial like Oracle does? Just wondering if there will be extra costs for implementing a SQL Server backend to SDE. Thanks


featureLayer.fields is undefined

When working with the javascript API, I have been getting an error in FireBug when trying to execute the following script:               var featLayerURL = "http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/TaxParcel/AssessorsLiveLayers/MapServer/1";     var featLayer = new esri.layers.FeatureLayer(featLayerURL);     alert(featLayer.fields.length);      The error returned is "TypeError: featLayer.fields is undefined". At first I thought it was something wrong with one of my server's layers, but after using that sample server and getting the same error, I'm sure there is something else wrong. Here is a link to the REST response: Layer: Recorded Tax Parcel Sales (ID: 1). I have the feeling it is something really simple I'm forgetting, but for now it's been driving me crazy trying to figure it out.


How to solve the problem when buildings are extruded without roof?

![enter image description here](http://i.stack.imgur.com/JWaT7.png)I tried to extrude buildings in ArcScene with Extrusion function in Layer Properties. But most of the buildings seem like only their walls are extruded. Instead of solid blocks, they appear like no roof and ground. Any one knows how to solve this problem? thanks so much!


How to Add Values together using FindLabel (VBscript) function of ArcMap Label Expression?

I'm wanting to add together values from multiple fields in shp file and display the result as a the label here's what I'm looking at right now: if ( [SwineGesBo] + [SwineSowLt] > 0) then output = output & [SwineGesBo] + [SwineSowLt] & "Sows" Unfortunately what I've wrote here only sticks the two value together and does not sum them together. Is what I'm wanting to do possible? And if so how whould I do it? TIA


How to access each raster in a stack with a loop

I have a stack of rasters and I want to access each layer, combine each later with another file and finally export the resulting file as a csv file. Is there any way to do this with a loop? So far I have done this but I do not get a file for each raster layer:               for (i in 1:nlayers(sms))       {       x<-sms[[i]]       assign(x,raster(x))       y<-extract(x,zipcoords)       write.table(y,file=paste0("C:home",i,".csv"),sep=",",row.names=F)       }      Thank you all!!!!


Visualize feature class with many relationship classes?

I have a feature class in a geodatabase that I want to review. It has many relationship classes - possibly a hundred or more. If I load the feature class into ArcMap and identify one of the features, it takes several minutes to expand the relations. What is a good way to visualize this feature class so that I can understand it? Specifically, I want to know if having a relation to a relation will obstruct editing the feature class.


How to Convert labels to Annotation

I am a beginner in GIS (for graduate school) and am using the GIS Tutorial Basic Workbook 1 for ArcGIS10. In Chapter 1 of this text, there is a "Convert labels to annotation" section which I cannot follow. When I right-click the item, "Convert labels to annotion" is not an option. Please let me know how to implement this process. Thank you for all of your help.


Extract number of vertices in each polygon in R

Simple question: how best to do this? I've found one way that works, but this is very slow (when x is a SpatialPolygonsDataFrame):               y <- fortify(x)      n.verts <- aggregate(y, by=list(y$id), FUN=length)[,2]     x@data$nverts <- n.verts


Geospatial Tools for SketchUp

I was wondering if anyone knows of geospatial tools that work in SketchUp? I know if GeoSketch, which allows a user to import ortho imagery, DEMs, shapefiles and GPS enabled photographs into SketchUp for 3D model creation. I am looking for other geospatial tools that are designed for SketchUp, but I am having issues finding any. I am interested in geospatial tools that work within SketchUp. Any help is appreciated. Thanks...


What is the best method of visualizing a network on a map?

I have several hundred geo-referenced data points, and the relationships from that point, to other points. I'm trying to figure out the best way of visualizing this on an interactive map (possibly using google maps). One idea I had was that when a user clicks on a point, it then displays all the links from that point, to the related points. I would appreciate any suggestions or examples of how best to do this. I have experience using ArcGIS, QGIS, Python and a small amount of javascript.


reclass, raster calculator

I'm trying to apply seperate equations for different land types. I have created a raster containing only the land type I'm interested in. I then reclassed the values to '0'. My plan was to use the raster calculator with the equation and add + "reclassed raster", which would be +0, thus only returning values that are within the area I'm interested in. However, when I try the calculation, it doesn't work properly, giving me something like values from -3e20 to +3e20 but there are no values or points actually there. If I do the raster calculator without the "+ reclassed raster", it works perfectly, so the equation itself (or other data layers) is not the problem. If I look at the reclassed raster, there is no attribute table, and every time I try to build one it fails. Any ideas on what's going wrong or a better way to do this? Thanks!!! Yes, it's ArcGIS 10.1 with Spatial Analyst. The reclassify doesn't give me an empty raster (only no attribute table), it's only when I use the raster calculator.


Are FME2013 and 64bit Background Geoprocessing of ArcGIS 10.1 SP1 compatible?

We are running ArcGIS 10.1 sp1 and have installed **64-bit background geoprocessing**. We are also upgrading to FME 2013. I know in the past we have had to install the 32-bit version of FME due to compatibility issues - I think regarding writing to File Geodatabases. Now that ArcGIS has 64-bit background processing available, am I able to install the 64-bit version of FME? Or do I still need to install the 32-bit version in order to have full compatibility? Does the 64-bit background geoprocessing even have anything to do with the compatibility?


QGIS Python Labelling

i want to label a point layer with those values exceeding a set of variables attribute table as follows               'loc field'(text),'a'(float),'b'(float),'c'(float)      variables as follows               vara = 5, varb = 3, varc=1      basically i want to be able to label `'a' > vara, 'b' > varb, 'c' > varc` on a multi-line label, needs to label if any are true not just all three e.g               Loc: F23     a: 6      ('b' was 2 so not labelled)               c: 1.5      If none are true then loc not labelled at all I am thinking this will be best achieved using the expression based label with a python function but don't know how to go about it, as i haven't found any documentation that deals directly with this. Could someone point me in the right direction on how to write a function that takes in each field to be queried and returns the multi-line label. Cheers


How to fix the possible memory leak issue in Openlayers 2.13.1 version?

Recently we have upgraded the Openlayers from version 2.12 to 2.13.1. However the performance of the new version is not that promising, infact it has degraded exponentially. I have a draggable model window and once the base map has been loaded if I do the drag and drop operation over the top of the map window, the user experience is not so smooth as for 2.12 version. After some memory leak detection approach three snapshot technique, I found that there is some memory leakage issue in **_OpenLayers.Control.Navigation.OpenLayers.Class.initialize_**. Is there any tuning need to be performed while upgrading to the new OL? Did someone face the similar performance issue as well? Thanks for your answers.


converting/parsing geojson into com.vividsolutions.jts geometry

Does any has any experience with converting string geojson into com.vividsolutions.jts geometry object (point, polygon, etc). Maybe there is some java library I cannot find. Greets!


OpenGeo Explorer connect to geoserver

Just a quick and easy question. I have installed OpenGeo Explorer as a plugin to QGis for publishing seamlessly to a web based geoserver (hosted through AcuGIS). I have pointed to the server through the URL in the image below. ![enter image description here](http://i.stack.imgur.com/8HsKx.png) I then try and connect and find the following. Any pointers as to what the url should be? ![enter image description here](http://i.stack.imgur.com/I47Vu.png)


In what coordinate systems do true circles appear round?

Please excuse what is probably an obvious question from a relative newB to GIS -- this seems like it should be a snap. I've been developing in Gmaps for awhile and am switching to OpenLayers but am stuck on one point: I am drawing vectors that are mostly circular but also involve some custom geometry so I can't use createRegularPolygon. I'm creating an array of points and sending it to a OpenLayers.Layer.Vector object. This works great but the resulting 'circles' are only round near the equator, not at higher latitudes. They are squashed about the same amount as the basemap is at higher latitudes, which seems to makes sense. If I use Google as a base layer then they are the correct shape at all latitudes, but I'm making an offline mobile solution so that won't do. My question is: what do I use for a base layer (or what params to set) so that my geometry remains round at all latitudes without using Google or online maps?


Adding additional Grass modules to QGIS Processing toolbox

I am very happily using the Processing toolbox (nee Sextante) within QGIS 2.3 but there are a number of Grass modules I use missing which I'l like to add. I followed the guide at: https://github.com/qgis/QGIS/blob/master/python/plugins/processing/grass/grass.txt and have created what I believe is an appropriate description for v.net It wasn't obvious where to install this file so I've dropped it into "C:\Users\XXXXXX.qgis2\python\plugins\processing\grass\description" alongside the other descriptions. v.net now appears in the toolbox but when I click to use it, the paramters don't wholly align with the decription file:               v.net     v.net - Perform network maintenance.     Vector (v.*)     ParameterVector|input|"map" input layer|1|False     ParameterVector|points|"point" input layer|0|False     ParameterSelection|operation|Operation to be performed|nodes;connect;report;nreport|1     ParameterNumericalValue|alayer|Arc layer to be used|None|None|1     ParameterNumericalValue|nlayer|Node layer to be used|None|None|1     ParameterNumericalValue|thresh|Threshold distance|None|None|30.0     OutputVector|output|Output layer      The first three parameters are correct, including my preference to default to "connect" but alayer, nlayer, and thresh have been replaced by a field for the Grass extent. ![enter image description here](http://i.stack.imgur.com/xN9Iu.jpg) It also has an advanced parameters button which adds further paramters that aren't defined like v.in.org snap tolerance. Am I totally missing something?


How to convert a CAD 2D section into PolylineM(Z)?

Good morning, How do I convert a 2D section drawn in CAD into 3D polyline in ArcGIS. By 3D polyline I mean PolylineM(Z). I have 300 sections. Drafting it manually seems a bit laborious. Any Ideas? Thanks. Cheers.


Does File Geodatabase performance degrade as it fills up?

I'm having a memory leak issue. Upon investigating this more, it seems the file based geodatabase I write to in a loop, is growing very large, and as it grows, it significantly degrades the performance of the scripts I am running. Any ideas how to optimize the configuration of the fgdb? Or how to speed it all up? I am not writing 'in_memory', I am using aggregatePoints to create a temp featureclass (which I delete), and I buffer this FC, which I keep. However, it seems to get slower, and slower, and slower...               def createGeom1(geom, scratchDB):         filetime = (str(time.time())).split(".")         outfile = "fc" + filetime[0] + filetime[1]         outpath = scratchDB + "tmp1.gdb/Polygon/"         outFeatureAggClass = outpath+outfile + "_Agg"         arcpy.AggregatePoints_cartography(geom, outFeatureAggClass, "124000 meters")      geom is a collection of Points, scratch the scratch area (local gdb I am using). Just looping through a list of files, I call a procedure that creates alist of geoms (and doesn't degrade) and then call this. Doing this, will see this function, createGeom, degrade significantly, and the previous one, not a bit.


How to cluster points based on a kernel density?

I have a large dataset with 36k points representing commercial land uses, each with a field containing the square footage. I have run a kernel density analysis on this dataset, producing a raster showing the density of commercial square footage over the entire metro area. I need to divide this raster into regions corresponding to local maxima, which I call a "center". I have already determined the locations of the centers, and now I need to do one of two things:   * use a point clustering tool, such as "partitioning around medoids", to group the points into clusters around the centers I've identified. The problem with this method is that it is computationally intense, and even more so if I try to use a dissimilarity matrix to weight the points by size.   * somehow divide the kernel density raster (which roughly resembles a terrain raster) into individual "hills" around each center. But I can't think of any tool for doing this. This problem has plagued me for a while, and I hoped that I'd be able to perform the clustering method in R, but it is time consuming and I'm running out of time. Does anyone know of a simple method for either dividing density rasters into neighborhoods of intensity or for quickly clustering large datasets?


Split a layer into a single layer

I have two multi-polygon layers, one a map of land uses, the other borders of administrative areas. I am interested in analyzing the amount of land use in each administrative area, but the polygons in the map cross the boundaries, therefore it need to split these polygons into parts along the administrative boundaries. I know I can use the Split Tool but that makes each administrative area a separate layer. Is there a way of splitting up the polygons in the map layer but leaving the whole map as a single layer?


Help needed using REGEXP for address string parsing

Using JavaScript, my aim is to create an "intelligent" address search function with a single textbox (rather than separate textboxes for house number, street name, street type, suburb, etc). I'm attempting to parse the input string entered by the user, to determine which components of the address have been entered. A complication is that users may enter combinations such as:   * 1 Kent Street Sydney _(number, name, type, suburb)_   * 1 King Georges Road Sydney _(number, 2x name, type, suburb)_   * 1 New South Head Road Rose Bay _(number, 3x name, type, 2x suburb)_   * Kent Street Sydney _(name, type, suburb)_   * Sydney _(suburb)_   * 2000 _(postcode)_   * 275/2/1000 _(lot/section/plan)_ At the moment I'm breaking the input string into tokens using _string.split(" ")_ and iterating through each token to determine which component it represents. Here's a very rough sample. This is working most of the time (it fails on 1 St Georges Road Sydney), but a colleague suggested I try using a REGEXP to improve the process. I can't see any examples of where this has been done for an address search. **Does anyone have any examples where REGEXP has been used for address validation?** (Note that I'm not actually entering this information into a geocoder at this stage - I just need to break the input string into its component parts, and know what each part represents) Thanks, Steve


How to connect mapinfo 10 with bing map or other mapping service?

Is there way to connect mapinfo with bing or google map. I have done this with mapinfo 10.5 but could not find it with mapinfo 10.


How to draw an arc by centerpoint, radius and azimuth in KML

The question is how to generate lon/lat coordinates for an arc/sector. Coordinates can be used/filled into a KML file. Pointers to geometric formula or a program applying the formula are much appreciated. Radius is 2 km and location is Europe North East. Accuracy is not a issue at this point.


Where is Table Manager in QGIS 1.7.x?

I would like to ask you, if is available funcionality like "Table Manager" for **QGIS 1.7.x**? I need to **move fields in attribute table** and then save changes. I don't see "Table Manager" or something like that in available plugins. Thank you, Jaroslav


How do I delete specific graphics on the map using arcobjects

I am writing a small application that allows the user to click on the map, and it will create 3 buffers (these are graphics using the IElement interface) at specified distances. What I want to do is if there are buffers on the map from the previous click, and the user clicks on the map to create another set of buffers, delete the oldest set of buffers (which are graphics) So in essence at anyone time there should only be 3 buffers on the map. Has anyone got any ideas on the best way to do this? Thanks


multispectral images (Band Sequential format)

How can I create a multispectral image file (in band sequential (BSQ) format), from several 1-band images, using GDAL libraries? I work with C++ language. Thanks for your attention.


How to Rotate Features in ArcGIS for Desktop using ArcPy?

I have a series of polygons that I want to rotate. Each polygon has a rotate angle and an anchor point (xy coordinate) stored as field values. As it happens, all anchor points are on a vertex of the polygon. What is the best way to do this using ArcGIS for Desktop and ArcPy? I know we can rotate them when in editing mode, but I don't want to do them all manually since they are all different. I would prefer a Python answer so I can automate it and build it into my work flow. Thanks


Background no data areas appearing where raster and vector data meet in Geoserver

I'm using Geoserver (2.1) to load raster data with the Imagemosaic plugin and then using Geowebcache to cut this data into tiles across the full coverage of the British National Grid. However the data does not extend to all areas of this extent and in these areas I get black background where there is no data. To resolve this I loaded a vector background which serves as a blue sea background for areas where the raster data does not extend to. However where the vector and raster areas meet I am still seeing sections of black no data background (even though the vector data covers all areas where the raster data does not and is behind it in the layer group). I've tried setting both the InputTransparentColour and the OutputTransparentColour options to black which does make these black areas disappear, however it also causes the black text on the raster mapping to become transparent as well. Does anyone know of any other ways to change this background colour without effecting the raster data itself? Or why these black areas might still be appearing even though there is vector data there that should be displayed? Cheers, Michael


What are "M" point locations on the NOAA forcecast cone map?

I don't think I've ever noticed M before. H and S are Hurricane and Tropical Storm. ![alt text](http://i.stack.imgur.com/OiyP5.gif)


Is it possible to perform a definition query against a Polyline shape field?

I have joined two polyline shapefiles together that represent two months worth of data. I'm now trying to find any changes to the shape of the records between the two months (added vertices, deleted vertices). Is this possible to detect these changes with a definition query? If not, is there an efficient way to detect changes in the geometry of the record? I have a "LENGTH" field and I am able to query records that have a different length but that doesn't necessarily give me all of the records who have had their vertices changed.


Collapsing the multi-row output of a one-to-many spatial join to single-row (arcmap 10.1)

I'm working with TIGER data, looking at the relationships among incorporated places and counties. Not all places are completely contained by counties; some do span multiple counties. In the final output I'm preparing, I need to have a "location reference memo" for each place; for a city like Cleveland that is completely contained, this might say something like **"Incorporated Place in Cuyahoga County"** for a city like Birmingham, AL, this would instead need to say something like **"Incorporated Place in Jefferson County, Shelby County"** or **"Incorporated Place in Jefferson, Shelby Counties"** -- or something like that. I know that I can do a spatial join to get a multirow output like   * Birmingham | Jefferson   * Birmingham | Shelby   * [city in AL] | [County in AL] Is there any facility, perhaps after the fact, for generating a single row equivalent of this? E.g.,   * Birmingham | Jefferson; Shelby Thanks in advance for any ideas you may have!


ArcGIS Server simple link with SQL Server database

I am using ArcGIS Server 10 to create Rich Internet Application with embeded Maps. Basicaly, I created an Optimized Map Service on ArcGIS Server, from an MXD file (produced with Arc Map). I have different layers of data from shapefile, but what I want is to add XY data from a database (SQL Server). I create a Database Connection through "Add OLE DB Connection" in ArcCatalog, and added my data with "Add XY Data" in ArcMap. (My Table that I am querying is very simple: Id, latitude, longitude) After that I can see my data (dots) on the map within ArcMap. But when I publish the Map Service from the MXD, I have an error saying that the layer's data source is not supported. Is there any way to create a layer from a (Non spatial) table (from database) that just contains basic coordinates (XY data)? I want to directly link the Map Services with the database, to ensure that the map is automatically updated when the table changes.


How to do point-to-point near analysis conditional on common attributes of the two layers in Arcgis 10.2 (advanced)

I am measuring the closest straight distance from cities of interest (in a layer) to their capital cities (in another layer). Basically, distance between a city and a capital city is calculated if only if their country codes are identical. Arcgis license is advanced. **Solution:** The following solution is based on @dklassen. Modification has been made so that I can loop a list of numerical number.               import arcpy     ctryID = [row.ID_0 for row in arcpy.SearchCursor(countryID_feature_class)]     arcpy.MakeFeatureLayer_management('PATH_TO_CITIES_FC','cityfc')     arcpy.MakeFeatureLayer_management('PATH_TO_CAPITALS_FC','capitalfc')          for grd in ctryID:         arcpy.SelectLayerByAttribute_management('cityfc','NEW_SELECTION',""""ID_0" = {}""".format(grd))         arcpy.SelectLayerByAttribute_management('capitalfc','NEW_SELECTION',""""ID_0" = {}""".format(grd))         arcpy.Near_analysis('cityfc','capitalfc',"#","NO_LOCATION","NO_ANGLE")         arcpy.CopyFeatures_management("cityfc", "c:/temp/ctry{}".format(grd))          arcpy.CreateFeatureclass_management("c:/temp/", "ctryall.shp", "POINT", "c:/temp/ctry1.shp", "DISABLED", "DISABLED")          for grd in ctryID:         arcpy.Append_management("c:/temp/ctry{}.shp".format(grd), "c:/temp/ctryall.shp")         arcpy.Delete_management("c:/temp/ctry{}.shp".format(grd))


Creating an installer for an ArcGIS toolbar with Visual Studio 2005

I'm working on a small toolbar for ArcGIS 9.2, Windows XP, using Visual Studio .NET 2005. I followed Esri's instructions for creating an installer: http://edndoc.esri.com/arcobjects/9.2/NET/0df20605-b457-42d6-b63c-341a3824474a.htm. I can install the resulting .msi or .exe file on the workstation where the toolbar was developed, without being an admin. When I or our admin. tried to install it on other computers in the office, the install failed with an error code 2869. A web search ('install error 2869') returned mostly vague, unhelpful, and irrelevant results. Has anyone else experienced this error when creating an installer, and how did you resolve it?


Creating DEM after converting mapinfo tab files to ARC GIS

How do I create DEM for contours after converting map-info tab files to ARC GIS and how do I convert toposheet tab file to ARC GIS.


How to change events in the Oncomplete Drag function in Openlayers

below is code that works for Openlayers drag function:               drag = new OpenLayers.Control.DragFeature(polygonLayer, {         autoActivate: true,         onComplete: function() {alert('Are you sure this is the right postion?')}     });      Now i,m trying to change my onComplete function:               drag = new OpenLayers.Control.DragFeature(polygonLayer, {         autoActivate: true,         onComplete: function (event){             var bounds = event.features[0].geometry.getBounds();             var answer = "bottom: " + bounds.bottom  + "\n";             answer += "left: " + bounds.left  + "\n";             answer += "right: " + bounds.right  + "\n";             answer += "top: " + bounds.top  + "\n";             alert(answer);         }     });      I must be doing something wrong as this does not work?


osm2po errors when converting pbf file

I am trying to prepare OpenStreetMap data for routing. I have downloaded version 4.8.8 of _osm2po_. I also downloaded `north-america-latest.osm.pbf` from Geofabrik. The command I am running is:               $ java -Xmx16g -jar osm2po-core-4.8.8-signed.jar \       cmd=tjsg tileSize=x "C:\maps\north-america-latest.osm.pbf"      The process seems to get well on its way, but I keep encountering a fatal error:               FATAL  Exception at Thu May 01 15:16:58 CDT 2014            Message: java.io.FileNotFoundException: osm\tw_raw.2po               (The system cannot find the file specified)            Class: java.lang.RuntimeException            Stacktrace:            de.cm.osm2po.primitives.InStreamDisk.<init>(InStreamDisk.java:30)            de.cm.osm2po.converter.Joiner.run(Joiner.java:206)            de.cm.osm2po.Main.runJoiner(Main.java:196)            de.cm.osm2po.Main.main(Main.java:131)      I am not sure if there is a problem with the command as I have executed it, or if there may be a data problem, or what? - I am using Java version 1.7.0_55. Please let me know if there is any other information which would be helpful in getting to the bottom of this.


How do I remove TIR bands from current stacked ASTER

How do I remove TIR from already stacked ASTR that has VIS and SWIR bands. I want to do it in ENVI 5.0. Is there a workaround to do this ? The bands I stacked has VIS, SWIR, and TIR.


Vector title attribute can't display?

var vectormap = new OpenLayers.Layer.Vector('Overlay',         {             styleMap: new OpenLayers.StyleMap(             {                 "default": new OpenLayers.Style({                                externalGraphic: 'girl.png',                                graphicWidth: 50,                                graphicHeight: 50,                                graphicYOffset: -24,                                title: 'marker'}),                 "select": new OpenLayers.Style({                                externalGraphic: 'boy.png',                                graphicWidth: 16,                                graphicHeight: 26,                                graphicYOffset: -24,                                title: 'marker_select'})             })         });     featurearray = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(113.950,33.019));     vectormap.addFeatures([ featurearray ]);       This is my vector layer, but a bit wrong, my png image title attribute can not be displayed when the mouse to move up, I checked the official website the "OSM with Marker and Popup.html" code, exactly the same, you know why, thank you!


How to group individual groups of pixels into a single class

I have a raster image with certain pixel groups of equal area. Each group represents a single house. I want all the pixels near a group of houses to have the same pixel value, i.e., I want to name that area "residential area". How can I do this? I want something like this done:![enter image description here](http://i.stack.imgur.com/xWbby.png) this image should change to:![enter image description here](http://i.stack.imgur.com/0XKwi.png)


Length of forms in ArcPad10

I'm trying to create a survey with about 250 questions in ArcPad 10. Normally you would expect that a form you created in any application will be able to scroll in PDA if it is too long. But the custom forms I create in ArcPad 10 just ignores the extra fields and doesn't scroll to them. Did anyone come across this? Thanks


How to limit visibility in OpenScales?

I use flex and OpenScale and I want to limit visibility just over Morocco using the coordinates, please how can I do that?!                   <os:Map id="fxmap" width="100%" height="100%" zoom="3" center="4.83212,45.75781">         <os:Mapnik name="base"/>         <os:DragHandler/>         <os:ClickHandler/>         <os:WheelHandler/>         <os:PanZoom map="{map}" x="{fxmap.x+10}" y="{fxmap.y+10}"/>     </os:Map>      I can do that on the properties of the map ?


It is possible to use satellite map on OpenScales?

It is possible to use satellite map on openscales, like that http://api.ign.fr/geoportail/api/doc/examples/geoportalFxMap_minimum.html   I'v seen a exemple :               <os:WMSC name="Nasa"                    url="http://openscales.org/geoserver/gwc/service/wms"                  layers="bluemarble"                  format="image/jpeg"                  maxExtent="-180,-90,180,90"/>        But it's show just an image of earth and when i zoom in, image lose quality !? Is there any other solution !?


How to improve the cartographic design of graticules?

The attached image shows a conflict between the graticule and the state boundary on a map. I have not found a way to display user-defined lines of latitude, which would solve the 42 degree line conflict. How can I resolve this conflict in Arcmap 10.1 by having better control of where the graticule parallels are placed? ![enter image description here](http://i.stack.imgur.com/OUTdP.jpg)


Does multimodal network need a physical intersection between a point (terminal) and a line (rail or road)?

I have created a network dataset with rail, road, and intermodal terminals and set up the connectivity so that you can only travel in-between the two at the terminals. Terminals realistically can be hundreds of yards long and wide, and can connect to multiple roads and rails. It makes sense that my points are located between rail and road but none of them are intersected, so I cannot traverse through both segments. I am working with all of North America so manually creating lines is out of the question. I would think to be realistic that I should not have to connect them, and ArcMap would pick up on this (in an ideal world). Any suggestions would be great! Also help with setting parameters for terminals that transfer one way or both ways between rail and road would be beneficial as well. Thank you Ben


How can I specify a spatial reference system which has a north pole different than the standard north pole?

I have a geographic spatial reference system (i.e., latitude and longitude) which has a north pole that is not the usual north pole: it's the magnetic north pole at approximately 70.30 degrees north, 109 degrees west. Is it possible to write a PROJ.4 string or a WKT spatial reference string describing this coordinate system? If so, what would that string be? At the level of precision of my data, the specific ellipsoid does not matter much. Even a spherical Earth would be fine. (Related: How can I convert geomagnetic coordinates to geographic coordinates without doing the math myself?.)


What's the simplest way to style vector data in Geoserver?

There seem to be three main options:   1. Manually write the SLD files, based on the SLD cookbook   2. Create the SLD file in QGIS, then import   3. Use the add-on GeoExplorer to create custom styles online Options 2 and 3 are attractive to me, as they avoid writing long SLD files. However, both have failed for me, meaning I still have boring grey polygons being served from my geoserver to a test map. I also wonder if there other options I've not yet tried, such as styling on the client side, or creating styles with a different GIS whose .sld files work better with geoserver. In visual terms, I want to go from this: ![geoserver-polygon- grey](http://i.stack.imgur.com/vKrmb.jpg) To this: ![territories](http://i.stack.imgur.com/AOM7u.png) ASAP (as simply as possible!)


API for Real Time World Statistics

Does anyone know of an API (preferably free) that can provide real time world statistics such as Crude Birth Rate, Crude Death Rate, world/country population, or emails sent today as on the website http://www.worldometers.info/? I'm looking to connect the data to an iPhone app, and I can work with any sort of return type.


Erase within a feature class - Planar enforcement

I´m using ArcGIS v10 ArcInfo. I´m working with a feature class that has 5 features which are waterdepths (1 to 5m). These features are overlapping each other. What I need, is that they are not overlapping. To achieve this I used two differend methods that are leading to the same goal:   1. I extracted each feature in a single feature class (1, 2, 3, 4, 5). 1 is the biggest overlapping 2, 3, 4 and 5. So I erased 1 with 2, 2 with 3, 4 with 5, merged them and had the feature class I needed.   2. I ran the union-tool (geoprocessing) on the feature class itself. The problem is, that all overlapping parts are created additionally as new features. Instead of the 5 features I need, I get 10 features more which I have to sort and erase by hand. My question: Is there a tool or method that does this without so many steps by hand? I´m able working with QGIS and ArcGIS v10 ArcINFO.


What Open Source (command line/API) method is there to orthorectify and georeference an aerial image given telemetry data?

How can I take an image and orthorectify it automatically with open source software? The information associated with each image is:   * camera specs   * latitude, longitude, elevation of the camera   * orientation of the camera: facing down off a UAV, roll pitch and yaw are given I want to output a geotiff file and hopefully end up stitching the images together to create a map.


How to populate M values for an existing x,y,m route layer in ArcGIS 10?

Very surprised to not find this in docs, I swear this was easy in former versions... Whatever, here we go: Say you have a rivers layer of x,y,m polylines. Each feature is a named river. Each feature was created in the direction of flow, so that the first vertex of each feature is the river's headwater, and the last is its drain (probably where it flows into the next river). I want to assign measures to each vertex of a given feature as the accumulated length of the feature from its drain to that point. I've only found the 'CreateRoutes' ArcToolbox tool, which not only does the unnecessary work to aggregate features and output a new layer, but it has a wonky idea of 'coordinate priority' to define each feature's measures start point, being that closest to a corner of its bounding box... I want to operate on my layer in-place, and I simply want to start the measures from the start (or end, in my case) of each feature. One possibility with that tool might be to use its 'TWO_FIELDS' Measure Source, where I use a pair of columns calc'ed with zeros (first column) and feature length (second column)... I thought I'd check first if anyone else has already been down this path? Thank you, MC


OGC webservice engine like geoserver in .NET

In java there are a lots of third part libraries which can used to create OGC webserivce like wcs/wfs/wms etc. However I have not found anything similar in .NET. We are currently using ArcGIS Engine, but it ArcGIS Engine does not support web applications. Is there a alternative?


Describing a coordinate system in arcpy

I have a python script in ArcGIS 10.1 which takes in a few inputs from the user. One of the inputs is a coordinate system. I would like to test whether the coordinate system the user chose was projected or geographic. A sample of the code is:               input1 = arcpy.GetParameterAsText(0)     input2 = arcpy.GetParameterAsText(1)     coordsys = arcpy.GetParameterAsText(2)          desc1 = arcpy.Describe(input1)     desc2 = arcpy.Describe(input2)     descCoordSys = arcpy.Describe(coordsys)      The code runs fine until the last line. I have forced the user to enter a coordinate system in the third line: ![enter image description here](http://i.stack.imgur.com/Tj56S.jpg) What am I missing here? * * * **EDIT:** I've tried to implement the changes proposed by @dmahr but it still doesn't work. It isn't getting to the nested `try` statement. It just quits with the error "There was an error with an input file. Please run again." I'm not sure what I'm doing wrong. I've tried with both projected and geographic coordinate systems.               input1 = arcpy.GetParameterAsText(0)     input2 = arcpy.GetParameterAsText(1)     coordsys = arcpy.GetParameter(2)          try:         desc1 = arcpy.Describe(input1)         desc2 = arcpy.Describe(input2)              try:             coordsys_linearunit = coordsys.linearUnitName         except:             arcpy.AddError("Input coordinate system is not projected.")             sys.exit("Exiting.")          except:         arcpy.AddError("There was an error with an input file.  Please run again.")         sys.exit("Exiting.")


What is the state of the art in html5 geospatial applications?

I am very interested in the html5 `canvas` element for maps; work like Cartagen from an MIT Media Lab researcher looks very promising, for example. There is some interesting SVG based work at carto.net. `WebSocket` seems like a fantastic API for live geospatial data. I have done a few html5 experiments, for example here, with Flickr and Picasa data. What are people getting up to with these new technologies, or what have you tried?


Help simplifying multipolygons in geodjango

I have a few multipolygons that have several hundred points in them. I'm looking to create less complex "thumbnails" polygons. Naturally I'm attempting to use the simplify method, which is supposed to apply the Ramer-Douglas-Peucker algorithm. However, it doesn't seem to be working:               >>> m = Multipolygon.objects.get(id=1)     >>> m.geometry.num_points     1007     >>> m.geometry.simplify(0).num_points     1007     >>> m.geometry.simplify(1).num_points     0     >>> m.geometry.simplify(0.5).num_points     0     >>> m.geometry.simplify(10).num_points     0      I'm clearly missing something. When I simplify, I either get the original polygon back or an empty one, depending on the tolerance value that I use. How is the tolerance parameter supposed to work?


E_FAIL when calling ESRI.ArcGIS.Carto.IImageServer.Initialize()

I am using ArcGIS Engine and Developer Kit 10 on Windows 7. Specifically, I'm writing an ArcObjects console program using Visual C# Express 2008. I am attempting connect to an image server via a URL (e.g. http://server/.../ImageServer), but I get an HRESULT E_FAIL exception when I call IImageServerLayer.Initialize(). The full message is "Error HRESULT E_FAIL has been returned from a call to a COM component." There isn't much information on this error. Any advice on what could be wrong? Here's my code:               using System;     using System.Collections.Generic;     using System.Text;     using ESRI.ArcGIS.esriSystem;     using ESRI.ArcGIS.Geodatabase;     using ESRI.ArcGIS.Carto;     using ESRI.ArcGIS.Geometry;     using ESRI.ArcGIS.DataSourcesRaster;     using ESRI.ArcGIS.GISClient;          namespace EngineConsoleApplication1     {         class Program         {             private static LicenseInitializer m_AOLicenseInitializer = new EngineConsoleApplication1.LicenseInitializer();                  [STAThread()]             static void Main(string[] args)             {                 //ESRI License Initializer generated code.                 m_AOLicenseInitializer.InitializeApplication(new esriLicenseProductCode[] { esriLicenseProductCode.esriLicenseProductCodeEngine },                 new esriLicenseExtensionCode[] { esriLicenseExtensionCode.esriLicenseExtensionCode3DAnalyst, esriLicenseExtensionCode.esriLicenseExtensionCodeNetwork, esriLicenseExtensionCode.esriLicenseExtensionCodeSpatialAnalyst, esriLicenseExtensionCode.esriLicenseExtensionCodeSchematics, esriLicenseExtensionCode.esriLicenseExtensionCodeMLE, esriLicenseExtensionCode.esriLicenseExtensionCodeDataInteroperability, esriLicenseExtensionCode.esriLicenseExtensionCodeTracking });                 //ESRI License Initializer generated code.                 //Do not make any call to ArcObjects after ShutDownApplication()                      //Create an image server layer by passing a URL.                 IImageServerLayer imageserverlayer = new ImageServerLayerClass();                 string URL = "http://vega/ArcGIS/rest/services/grandcanyon/ImageServer";                 imageserverlayer.Initialize(URL); // "Error HRESULT E_FAIL has been returned from a call to a COM component."                      //Get the raster from the image server layer.                 IRaster raster = imageserverlayer.Raster;                      //The raster from an image server is normally large;                  //define the size of the raster.                 IRasterProps rasterProps = (IRasterProps)raster;                 IEnvelope clipEnvelope = new EnvelopeClass();                 clipEnvelope.PutCoords(779000, 9628000, 786000, 9634000);                 rasterProps.Extent = clipEnvelope;                 rasterProps.Width = 256;                 rasterProps.Height = 256;                      //Save the clipped raster to the file geodatabase.                 ISaveAs saveas = (ISaveAs)raster;                 Type factoryType = Type.GetTypeFromProgID(                     "esriDataSourcesGDB.FileGDBWorkspaceFactory");                 IWorkspaceFactory workspaceFact = (IWorkspaceFactory)Activator.CreateInstance                     (factoryType);                 IWorkspace workspace = workspaceFact.OpenFromFile(@"c:\temp\fgdb.gdb", 0);                 saveas.SaveAs("clipfromimageserverlayer", workspace, "gdb");                      m_AOLicenseInitializer.ShutdownApplication();             }         }     }      This code is based on http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//00010000047t000000. Here's the exception detail provided by Visual C#'s error dialog:               System.Runtime.InteropServices.COMException was unhandled       Message="Error HRESULT E_FAIL has been returned from a call to a COM component."       Source="ESRI.ArcGIS.Carto"       ErrorCode=-2147467259       StackTrace:            at ESRI.ArcGIS.Carto.ImageServerLayerClass.Initialize(String ServiceURL)            at EngineConsoleApplication1.Program.Main(String[] args) in C:\Users\brown\AppData\Local\Temporary Projects\EngineConsoleApplication1\Program.cs:line 35            at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)            at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)            at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()            at System.Threading.ThreadHelper.ThreadStart_Context(Object state)            at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)            at System.Threading.ThreadHelper.ThreadStart()       InnerException:


Programmatically convert multipart polygon to singlepart in ArcGis 10

I have a multipart feature and I need to convert it to a singlepart feature. Couldn't find any code sample. I wonder if i could get some help from you! I'm working with ArcGis10 and c#. Tks


Doubts about Manipulation of Layers

I'm working with OpenLayers, I created a new plugin to perform a selection feature. But every event I perform in my plugin button it creates a new layers. (Attached is a print). Of the attempts that tried to make the removal of the layer were:               map.layers.remove (0);     map.layers.length;     map.layers.remove;      Can anyone help me ?


Why isn't this Python calculation working correctly?

I want to label the source files for a unified shapefile, and there are three respective columns for each. If there is no value in the column, there is no data from that source; if there is a value in multiple columns, it is from multiple sources (and therein lies the problem). I have written the following for use in the Codeblock in field calculator:               def srcfind (grcode,grcode2,lur):      if lur == 'Parks and Recreational' and grcode == 0 and grcode2 == 0:       return 'dmti'      elif lur == 'Parks and Recreational' and grcode > 0 and grcode2 > 0:        if grcode <> 0 and grcode2 <> 0:        return 'dmti, land cover, clutter'       elif grcode == 0 and grcode2 > 0:        return 'dmti and land cover'       elif grcode > 0 and grcode2 == 0:        return 'dmti and clutter'      elif lur <> 'Parks and Recreational' and grcode > 0 and grcode2 == 0:       return 'clutter'      elif lur <> 'Parks and Recreational' and grcode == 0 and grcode2 > 0:       return 'land cover'      elif lur <> 'Parks and Recreational' and grcode > 0 and grcode2 > 0:       return 'clutter and land cover'       The first 'if' works correctly; even the 'dmti, land cover, clutter' category works correctly; and the last three elifs work correctly, it's just the middle part to determine 'dmti and land cover' and 'dmti and clutter' which don't work, resulting in the field being labelled 'land cover' or 'clutter' (depending on which column has a value). Essentially, how do I fix this? The image below is the attribute table with the variables labelled. You can see that it doesn't work for the conditions I mentioned. ![The attribute table](http://i.stack.imgur.com/kFlgi.png)


Closest Facility Solve Failing

I have a problem getting a large number of facilities and incidents to draw upon solving. I have about 380 facilities and incidents, that I am attempting to find routes between. I need the actual network geometry, so and OD Cost Matrix won't work. What happens is I load in everything and attempt to solve and it will get to the very end (99%), and then say it is completed, but there are no actual routes. I have got it to route to 299 incidents and 299 facilities, but with 308, the solve fails. I began creating a model to run it outside of ArcMap, because I thought that too many routes trying to draw might be the issue, but the model is returning an error. I have attached a photo of the model. Any suggestions on how to fix this? Or what the problem might be? Is the memory just insufficient or something? I'm using ArcGIS 10.0, with the Network Analyst Extension. Thanks, Eric![enter image description here](http://i.stack.imgur.com/KILgA.png)


How to put 20K points on a map

I have an sqlite 3 database with 20K entries each of which has lat long data and I wanted to create a layer from that data. From what I have read I need to import it into a postrgres DB but I'm not sure how to make sure that each item populates the database correctly (ie has all of the correct attributes completed). my plan is to have a series of tiles created from the result of the query which would be a transparent background with the points overlayed and then allow clicking on them I still have a lot to learn to get this done but I want to ensure i put the data in the correct place to start with. * * * Further details. I am planning to do several things. 1. To render some GEOtiffs into tiles to act as base layer along with using OSM as a layer. I then intend to take my SQLite data and create an overlay layer or points that should be clickable. I wanted everything in a SERVER DBMS for several reasons.   1. There could be up to 6,000 users accessing the data at any one time so I really wanted a robust DBMS UNDER THE HOOD.    2. Also if I end up having to do some real time rendering on other data I can still store it in the same repository.   3. I can exclude points based on certain criterion and create multiple layers from the same data.  My current understanding is that it would work as follows:   1. Create a DB of points by importing SQLite data into POSTGRES with postGIS extensions (ensuring the correct GIS fields get populated appropriately)   2. Use that DB and a query to access points and create a layer to render from within tilemill.    3. Export that layer back into Postgres so that it can act as the layer server for my open layers based client app.  I have tilemill, qGIS, OPENGEO, software. Please let me know if I have misunderstood how to do this !!!


How to return nearest point to input lat/long with distance?

I am trying to write a query with PostGIS that returns one row where the geometry of that row is the closest to an input point. I would also like to include the distance between these points in the result. And of course, I want it to run as quickly as possible. I have scoured the internets, but haven't quite found the solution to this specific problem. Here is what I have so far, the query runs just fine, but the result is definitely not the closest record. (Note that `geom` is the name of the geometry column)               SELECT * FROM table      ORDER BY geom <-> st_setsrid(st_makepoint(-112,33),3857)     LIMIT 1;      I have also tried to use the following `ORDER BY` clause, but I get the same incorrect result:               ORDER BY ST_Distance(geom,ST_GeomFromText('POINT(-112 33)', 3857));      I need to fix this query so:   1. It returns the correct closest geom and associated row, and   2. Include the distance between the points with the result.  Any help is much appreciated!


How to sample raster datasets at ALL points?

I know it is possible to use tools like ArcGis's 'extract sample' tool to extract values at a given number of points. I would like to sample every pixel in a raster, and drill down through all other rasters (which have the same extent and resolution). How could I do this? I can use QGIS, Arc, or Idrisi. Would the best way be to generate regular points at a spacing of 'RESOLUTION' and an initial offset of 'RESOLUTION/2'?


How to create georeferenced and projected data from hand-drawn map?

I am preparing datasets for students in a spatial statistics course for a module on spatial autoregressive models. We will use ArcGIS 10.1. The first dataset will correspond to a mythical pre-industrial village in which houses closest to the tannery will be smaller and more tightly packed and as the distance from the tannery increases, houses will become larger and less tightly packed. Likewise, the property values of houses will increase as distance from tannery increases. NB: Tanneries were historically noxious points that smelled dreadfully and often polluted local waterways. This example is purposely designed with multicollinearity between distance from tannery and size of house. I want my students to struggle with the question of what is explaining property values so they can understand what multicollinearity means in a concrete example. Later modules will include larger houses near the tannery, as well as smaller houses further from the tannery, so that my students can then use a spatial autoregressive model to identify the effects of positive externalities impacting a small house's property values when it located in a neighborhood with large houses, and the negative externalities impacting a large house located near a tannery. I currently have a hand-drawn map of this mythical village, and have scanned it as jpg. Each building will have an ID number, a property value, a distance from the tannery and a size in square meters. While I could simply plug these data into Minitab, etc., I want to show my students how to use the spatial autoregressive model function in ArcGIS 10.1 (the proper name from the command escapes me as I type this, but it is under the _Spatial Statistics Toolbar_ ). For this function to work, however, I must also project my data. I plan on doing this by selecting a 300m x 300 m polygon somewhere on the globe and simply add control points that arbitrarily line up with my mythical village map (also scaled to capture a 300m x 300m area). The added benefit of georeference this map is that I can also easily calculate the centers of these structures as well as their areas --- so long as I digitize the buildings. My question is this: does this sound like a reasonable solution in terms of creating georeferenced and projected data to fit an image for an imaginary village?


What does Runtime error : 'NoneType' object has no attribute '<field_name>' mean?

Here is my code               #arcpy     import arcpy,sys          from arcpy import env          env=r"C:\Users\Jaya\Desktop\python_practice"     totalRec=arcpy.GetCount_management("river")          rows=arcpy.SearchCursor("river")     row=rows.next()          pp=[]          for row in rows:         initialH=row.RASTERVALU         for r in range(1,55):             val=val+1             headav=initialH-row.RASTERVALU             if(headav>=50):                 if(r>=12):                     break             elif(headav<50):                 if(r>=12):                     row=rows.next()                  row=rows.next()         print headav         pp.append((row.POINT_X,row.POINT_Y_1,headav))         row=rows.next()               pt=arcpy.Point()     ptGeoms=[]          for p in pp:         pt.X=p[0]         pt.Y=p[1]         pt.Z=p[2]         ptGeoms.append(arcpy.PointGeometry(pt))          arcpy.CopyFeatures_management(ptGeoms,r"C:\Users\Jaya\Desktop\python_practice\power_plant.shp")      I am getting error message like this: _Runtime error : 'NoneType' object has no attribute 'RASTERVALU'_ Can you help me in this regards