How to add legend in WFS openlayers

How can I publish WFS openlayer with legend, have tried different examples such as http://api.geoext.org/1.0/examples/vector-legend.js. But when I tried using this firebug shows an error=> GeoExt.MapPanel is not a constructor and the polygon for which the legend is defined in the rule(rule_highlight1 and rule_highlight2) has disappeared from the WFS layers.               var india = new OpenLayers.Layer.WMS(                     "cite:india_state - Tiled", "http://localhost:8080/geoserver/cite/wms",                     {                         LAYERS: 'cite:india_state',                         EPSG:4326,                         tiled: true,                         tilesOrigin : map.maxExtent.left + ',' + map.maxExtent.bottom                     },                     {                         buffer: 0,                         displayOutsideMaxExtent: true,                         isBaseLayer: true,                         opacity: 0.8,                          }                 );                               var style = new OpenLayers.Style();                 var rule_highlight1 = new OpenLayers.Rule({                 title: "> 2000m",                 maxScaleDenominator: 3000000,                 filter: new OpenLayers.Filter.Comparison({                     type: OpenLayers.Filter.Comparison.EQUAL_TO,                     property: "classification",                     value: "1",                 }),                 symbolizer: {                     graphicName: "star",                     pointRadius: 8,                     fillColor: "#FE2EF7",                     graphicName: "star",                     fillOpacity: 0.6,                     strokeColor: "#FF0000",                     strokeWidth: 2,                     strokeDashstyle: "solid",                     label: " ${classification}",                     labelAlign: "cc",                     fontColor: "#000000",                     fontOpacity: 1,                     fontFamily: "Arial",                     fontSize: 16,                     fontWeight: "600"}                 });                           var rule_highlight2 = new OpenLayers.Rule({                 title: "< 2000m",                 maxScaleDenominator: 3000000,                 filter: new OpenLayers.Filter.Comparison({                     type: OpenLayers.Filter.Comparison.EQUAL_TO,                     property: "classification",                     value: "2",                 }),                 symbolizer: {                     fillColor: "#0040FF",                     graphicName: "star",                     pointRadius: 5,                     fillOpacity: 0.6,                     strokeColor: "#FF0000",                     strokeWidth: 2,                     strokeDashstyle: "solid",                     label: " ${classification}",                     labelAlign: "cc",                     fontColor: "#000000",                     fontOpacity: 1,                     fontFamily: "Arial",                     fontSize: 16,                     fontWeight: "600"}                 });                               var rule_highlight3 = new OpenLayers.Rule({                     filter: new OpenLayers.Filter.Comparison({                     type: OpenLayers.Filter.Comparison.EQUAL_TO,                     property: "classification",                     value: "2",                 }),                 symbolizer: {                     fillColor: "#0040FF",                     fillOpacity: 0.6,                     strokeColor: "#FF0000",                     strokeWidth: 2,                     strokeDashstyle: "solid",                     label: " ${classification}",                     labelAlign: "cc",                     fontColor: "#000000",                     fontOpacity: 1,                     fontFamily: "Arial",                     fontSize: 16,                     fontWeight: "600"}                 });                      style.addRules([rule_highlight1,rule_highlight2,rule_highlight3]);                 var wfs_layer = new OpenLayers.Layer.Vector("fsa",{                 strategies: [new OpenLayers.Strategy.BBOX()],                 styleMap: style,                 visibility: true,                 protocol: new OpenLayers.Protocol.WFS({                 version: "1.1.0",                 srsName: "EPSG:4326",                 url: "http://localhost:8080/geoserver/cite/wms",                 featureNS :  "http://www.opengeospatial.net/cite",                 featureType: "india_state",                 extractAttributes: true,                 transparent:true                 })                 });                      map.addLayers([india,wfs_layer]);                 map.zoomToMaxExtent();               mapPanel = new GeoExt.MapPanel({         renderTo: "map",         border: false,         layers: map,         center: [6.3, 45.6],         height: 256, // IE6 wants this         zoom: 8     });          legendPanel = new GeoExt.LegendPanel({         layerStore: mapPanel.layers,         renderTo: "legend",         border: false     });      }); Thanks!!!


Converting avl to sld or qml

Is there a simple way to convert a avl file into a sld or qml? Deegree does not work an my laptop (java problems) Or is there a way to open the original avl file in qgis? Thanks


Data Frame Property options have changed

I have Googled and searched ESRI help files and experimented until I am blue, not to mention reloading ArcGIS Desktop10 for Repair and adding the SP5 to it. I no longer have the options of border or background for data frame in layout view. I used to -- and now don't. I don't know what changed it yet it is impossible for me to combine data frame layers with the data frame borders visible. This is what I see when I right click on the data frame properties Both on the data frame in the layout view and on the data frame in the TOC in layout view: What happened and how do I fix it? Thanks. ![enter image description here](http://i.stack.imgur.com/MaLMc.jpg)


I don't seem to be able to save Layer Styles in QGIS

I have created and saved layer styles, not recently I admit but have done in the past. For some reason or other I just don't seem to be able to save any new ones in QGIS. No file is created. It does not even save changes to existing ones, even though it says I am replacing it. I surely must be doing something wrong, but don't know what. I can make the changes in the style and that's fine, it just won't save. I'm running on MS Vista.


Measuring straightness of a curve segment (represented as a polyline)

I'm working on an automatic elevation contour labeling algorithm and one of the factors that I want to take into account when deciding the positions of labels is how "straight" a particular segment of a contour is. The more straight it is, the more likely it is to be used to place the label on that segment. Each contour is represented by a polyline (but with points close together as to look like a curve to a naked eye). I then have a fixed length (width of a label), say, 100 pixels. If I randomly (or otherwise) choose a contour segment with the width of 100 pixels, I want to be able to get a numerical quantitative value of its straightness (say zero for a totally straight contour segment, some value larger than zero for a not so straight segment, and this value increasing as the crookedness increases). I've searched around for answers but I couldn't find anything really useful. I'd be grateful for any pointers.


Area of an EPSG 27700 polygon

I am working with EPSG 27700 polygon data in PHP. All the polygons are in the UK. The polygons do not have holes inside them. I'm hoping to be able to calculate the area of these polygons. For this I believe I need to take two steps. Firstly to convert the coords into something where x an y are the same distance and then once that is done to calculate the area inside each polygon. My naive solution would be to use some graphics package to draw the polygon onto an image and count the coloured squares.   1. What's a good coordinate system for this? UK Easting & Northing is my best guess.   2. Is there a PHP library or easily(!) implemented algorithm to find the area inside a polygon defined by a list of points? Alternatively, should I be getting out of my comfort zone and learning to use a proper GIS system?


How to generate automatically the name of output parameters in a python script tool?

I have some Python script tools in ArcGIS for Desktop. I need to reproduce what all geoprocessing tools do when the first input parameter is introduced: autogenerate a workspace and basename for the outputs. How can I do that?


How to merge Shapefiles from multiple folders into Geodatabase Featureclass?

I have a question regarding the merge of a lot of folders, which has a lot subfolders, which has the shapefiles stored. I would like to merge all those in one geodatabase. So I thought to use a Python script.               import os, arcpy.da          print os.getcwd()          for dirname, dirnames, filenames in os.walk('.'):         for subdirname in dirnames:             current_dir =  os.path.join(dirname, subdirname)             arcpy.env.workspace = current_dir             fcList = arcpy.ListFeatureClasses(".shp")             Merge = r"D:\Test\Merge_multiple.gdb\Totals"             for fc in fcList:                 print fc                 arcpy.Merge_management([fc,destination],Merge)                 arcpy.Delete_management(desination)                 arcpy.Rename_management(Merge, destination)             break      So, I started the script and after a minute it stops and unfortunately, no result. Because there are several different names in the shapefiles, I thought to use only the suffix .shp. Could you help me? [Edit] I get the path of the working directory in the python window. After this message, the window closes without any errors. ![enter image description here](http://i.stack.imgur.com/H6i7M.png) [Edit2] Based on PolyGeo's advice, I've run the script also in the IDLE environment and this is the result: ![enter image description here](http://i.stack.imgur.com/o42jt.png)


ArcObjects : How to identify ITool.OnMouseUp method execution

In ArcMap, I have a tool that inherits `BaseCommand`. The tool enables the user to draw a graphic on the screen. I activated this tool (set as current tool) from a Windows UserForm by getting its reference using `ICommandBars.find` method. Now how can the windows form get a notification when the `ITool.OnMouseUp` method is complete? I see that there are no events generated by the `ITool` interface.


How to create and export complex symbology?

I've got punctual geometries that I'd like to represent in a desktop and a web application, using complex symbology, like this : ![enter image description here](http://i.stack.imgur.com/Vy5sF.png) My idea is to use a symbology editor to create a SLD file that defines the symbols. I used QGis to create the symbology and then tried saving it into a SLD file. The problem is that symbols are simplified and instead of the symbol I created, I get this one: ![enter image description here](http://i.stack.imgur.com/yc1lz.png) Do you know about a SLD editor that supports complex symbology? Do you have any other suggestion different from creating a SLD file?


length array in OpenLayers.Layer.Vector

how to find length array (markers) in OpenLayers.Layer.Vector ?               var data = new OpenLayers.Layer.Vector("Data", {         styleMap: styleMap,         strategies: [new OpenLayers.Strategy.Fixed()],         protocol: new OpenLayers.Protocol.HTTP({             url: "./data/data.geojson",             format: new OpenLayers.Format.GeoJSON({                 extractStyles: true,                  extractAttributes: true,                 maxDepth: 2             })         })     });


Display local language for OSM data in TileMill

I'm following the instructions here to create a minimalist style map for Japan: https://github.com/aaronlidman/Toner-for-Tilemill Now, I've downloaded the OSM data, used _osm2pgsql_ , created the tilemill project and it now properly displays in TileMill. However, all the displayed city name labels are in the Romanized (english) characters. Is there a way that I can get the Japanese (Kanji, hiragana, etc) displayed in place of thier romainzed dipictions? ( _Street names do appear in the original Japanese, sometimes with Romanized letters in parens_ ) I'm assuming that the original Japanese names are contained in the osm.pbf, but somewhere along the pipeline they are being ignored. Any ideas?


Problems with the Clip and Intersect tool

I am having a problem with the clip and the intersect tool on QGIS Valmiera. I have a large vector map of sublocations of a country and am trying to clip them to a district level since I do not need the data for the entire country. I have save both to the project CRS, and have done this multiple times. As a project CRS I am using the WRS 84/Pseudo Mercator (I am using the openlayers plugin for geographic reference). To clip I the large map goes into the Input vector area, and I have made a polygon to represent the district which i add in the "clip layer" field. Then when I clip (or use intersect), nothing ever appears. The layer is created, but is not seen anywhere on the map, and the attribute table, although the fields from the large map are present, has no values. How can I fix this problem?


Why do all rows go missing from File Geodatabase Feature Class to *.dbf conversion?

![enter image description here](http://i.stack.imgur.com/xKIul.png)I tried to export a File Geodatabase Feature Class to a *.dbf table/shapefile, but there are no records inside. I believe there is no mistake in exporting--it is simple. The doubt is the file geodatabase format--I cannot use it as a shapefile or export it as a shapefile with intact data. Attached is the original data and the exported data. I am using ArcGIS 10. The data are from the **United States census**. I am only interested in one data column/Field from each state. Is there a fast way to open, export, or convert the geodatabase format to *.dbf?


GROUP BY clause in the UpdateCursor arcpy.da

I need to specify a "group by" clause for UpdateCursor arcpy.da. From here I found out that it's possible to do using an optional pair of SQL prefix and postfix. But there are no examples and I'm stuck with the syntaxis problem. Can, please, smbd help me? PS. I've tried various modifications of `"(None, 'GROUP BY "INPUT_FID"')"`, but still can't get it. Thank you in advance. Here is the part of the code I'm using:               oDSFields = ('INPUT_FID','NEAR_FID','DISTANCE', popTotalField, popBlacksField)          kernel = 0     alpha = 0.005     #, "(None, 'GROUP BY "INPUT_FID"')"     with arcpy.da.UpdateCursor("outDistanceSorted", oDSFields, "(None, 'GROUP BY "INPUT_FID"')") as cursor:              for row in cursor:                  kernel = float(math.exp(-0.5*math.pow(row[2]/alpha, 2)))


Translate Excel formula to be used in field calculator

I have a series of equations to create corner points to make rotated polygons based on angles in the attribute table, but I have created it in excel and can't figure out the syntax to get it to work properly in the field calculator. I have 8 different trigonometric formulas to create XY coordinates for the 4 corner points. One of them is as follows:               =COS(ATAN(1500/2250)+RADIANS(MOD(360-([Angle]+270),360)))*(SQRT((1500^2)+(2250^2)))+[X]      Once I understand the syntax for one, I should be able to use it for the other 7 formulas, even though they vary slightly.   Can anyone advise the best way to use this formula in field calculator? Thanks. **Edit** , after receiving @Paul's answer: I figured out the correct syntax of some of the other ones, but two of them are still giving me trouble. One is producing a different result than Excel and one is saying that the syntax is incorrect.               =COS(RADIANS(270)-ATAN(750/1500)+RADIANS(MOD(360-([A]+270),360)))*SQRT((1500^2)+(750^2))+[X]          =COS(-ATAN(1500/2250)+RADIANS(MOD(360-([A]+270),360)))*SQRT((1500^2)+(2250^2))+[X]      I think it has to do with the negative signs and me probably putting them in the wrong spot...


Loading Image Services to ArcGIS for Server?

I am publishing Image Services to our ArcGIS for Server. As a mosaic dataset, the image has no issue. Overviews are created, and the footprints read proper elevation values. The issue I am running into is when loading into ArcGIS for Server as an Image Service. Side note, the mosaic is a referenced mosaic dataset. Among 5 other product derivatives referenced, only two are having this issue, the other 3 referenced mosaics are loading just fine. Even the original mosaic dataset is "clean" If anyone could offer insight it'd be much appreciated ![Mosaic Dataset](http://i.stack.imgur.com/oVgoY.png) ![Issue when published as an Image Service](http://i.stack.imgur.com/n6AsB.png)


Check for extraneous bytes that appear before %PDF at the head of a MapInfo printed PDF file?

I am using a MapBasic program that automatically prints individual PDF maps of each polygon in my table. After getting an Adobe Reader XI update, the PDFs no longer open. I receive the following error: The document is damaged and cannot be repaired. Adobe Reader could not open because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded). The workaround from Adobe suggests, "modify the way the PDF is produced. Make sure that no extraneous bytes appear before %PDF at the head of the file." Is there a way to check this in MapBasic and modify the program so it correctly writes the file?


Geoserver/java out of heap space - how do I increase it?

I'm new to Geoserver, Ubuntu and Java, but have downloaded a virtual machine from gisvm.com and am getting up to speed. I got as far as configuring it with some fairly large shapefiles from a project I've worked on previously. My question is related to a problem which I see if I show the shapefile using the OpenLayers layer preview option. I see an error 'OpenLayers map preview code="internalError" Rendering process failed. java.lang.OutOfMemoryError: Java heap space'. Googling has led me to plenty of Java command line options to increase heap space, but I have no idea if this should be applied to an environment variable, in a startup script or as a part of the Geoserver config. Can you help me to understand what I need to edit to get this working? I'm also wondering if I should be splitting my shapefile into smaller pieces and so any guidelines on this matter would be helpful too. Thanks!


How to create an interactive web mapping site with comment/rating system?

I'm trying not to ask something that's already covered by the other 'beginning web mapping' questions, but I want to do something that I don't see covered here yet. Maybe I'm just missing it. Basically, I want to create an interactive web mapping site. Here's the way I picture it: there is a main map, showing points (pretend they're campsites). When a user clicks on a campsite, in another pane info on that campsite pops up, along with the ability to make comments on it. The user can also add other points, and draw rough polygons, lines, and add text boxes, that all other users see. It will be kind of a giant scratchpad, or scribble map that all users can contribute to. I`d also like to add some kind of thumbs-up, thumbs- down rating system for any comments on the individual campsites, and overall rating system for each user (this looks pretty daunting to me after typing it out!) I'm new to web mapping, as you may have guessed, and I think I know how to proceed to get the maps online, but it's the interactive part that I could really use some general direction on. I have mid-level skills with the basic tools: html, css, php, mysql, if that helps. Many thanks!


How to change the page layout from portrait to landscape using Python? (ArcMap 10)

I need my script to access the Page Orientation property of the current MXD, and switch it from portrait to landscape (or back). I've looked through the arcpy and arcpy.mapping documentation, and haven't had any luck. Does anyone know how to do this?


How do I upload a Featureclass to a Geodatabase in C#?

All, I have a featureclass with Arcobjects that came from a Shape file and I wish to import it into a geodatabase. I have the geodatabase connection, I just don't know how to load the feature class to a Geodatabase. Any help would be amazing! Im looking for a code example seeing I can't find it by googling. Hopefully in C#, but I don't mind reading through VB if needed. Thanks. **EDIT:** I wanted to add the Answer thanks to George so here is a code snippet with comments.                ESRI.ArcGIS.Geodatabase.IWorkspace pWorkspace;             ESRI.ArcGIS.Geodatabase.IWorkspaceFactory pWorkspaceFactory;             ESRI.ArcGIS.Geodatabase.IFeatureWorkspace SdeFeatureWorkspace;                  pWorkspaceFactory = new FileGDBWorkspaceFactory();             pWorkspace = pWorkspaceFactory.OpenFromFile(@"C:\tests\test.gdb", 0); //Opens the Geodeabase and creates a connection.             SdeFeatureWorkspace = (ESRI.ArcGIS.Geodatabase.IFeatureWorkspace)pWorkspace;                  IWorkspaceFactory workspaceFactoryShape = new ESRI.ArcGIS.DataSourcesFile.ShapefileWorkspaceFactoryClass(); //creates a shape factory to pull the shape and create the feature class.             IFeatureWorkspace featureWorkspace = (IFeatureWorkspace)workspaceFactoryShape.OpenFromFile(@"C:\Users\Desktop\Newfolder", 0); //Opens the Shape file.             IFeatureClass featureClass = featureWorkspace.OpenFeatureClass("al012009.001_5day_lin"); //opens the featurclass from the shapefile                  SdeFeatureWorkspace.CreateFeatureClass("al012009001_5day_linnn", featureClass.Fields, featureClass.CLSID, featureClass.EXTCLSID, featureClass.FeatureType, featureClass.ShapeFieldName, null); //creates a feature class in the geodb.                  Geoprocessor gp = new Geoprocessor(); //starts a GEOprocess.             gp.SetEnvironmentValue("workspace", @"C:\Tests\test.gdb"); //sets the geodb to use                  ESRI.ArcGIS.DataManagementTools.Append  append = new ESRI.ArcGIS.DataManagementTools.Append(); //this tool uploads the feature class             append.inputs = featureClass;             append.target = @"C:\tests\test.gdb\al012009001_5day_linnn";                  gp.Execute(append, null);


How to programmatically get a reference to an ICommand inside ArcGIS?

I'm having problems trying to get a ICommand using the method ICommandBars.Find. The ICommand is there, but it's returning null to me. Any ideas?                   public static ICommandItem GetCommandItemByName(string progId)         {             UID uid = new UIDClass();             uid.Value = progId;                  Type t = Type.GetTypeFromProgID("esriFramework.AppRef");             object o = Activator.CreateInstance(t);                  IApplication application = o as IApplication;             ICommandBars commandBars = application.Document.CommandBars;             ICommandItem commandItem = commandBars.Find(uid,false,true);                  return commandItem;         }      The result is always null :(. I need to get a reference to this specific command because it contains some fields and properties that I specified (a IWorkspace object, if it matters) Thanks for your help!


Work flow for georeferencing imagery using open source tools?

Does anyone have a recommendation for a work flow for georeferencing high resolution aerial photography using open source tools? Comparison of user friendliness and robustness between Quantum GIS versus GDAL? Thank you!


How to move a Point perpendicular from nearest Line?

I want to move Point perpendicular from nearest line or polygon, and the question is how to do that? example, I have points (house number) near roadbed, and I don't want them to intersect roadbed (buffered street line) I have used near analysis to get street line angle to the points for correct labeling, so the angle of the labels is really good but they are to close the road. So I want to move the points perpendicular away from street line. is there any way?


Store Geometry in a database with the ESRI Silverlight API

Is it possible to store geometry objects in a database using the ESRI Silverlight API? For this particular case, the client may have SQL Server 2005 installed instead of 2008 and therefore I can not use spatial types. Any solution would also have to support clients who use ArcGIS Server 9.3, and therefore we would not be able to use the new editing capabilities in ArcGIS 10.


Store global variables in ArcPad that store user information

I know that it's possible to store global variables in ArcPad from reading the help files. I have several field staff that are out everyday -- generally we have them select their name from a "Specialist" domain for each data point they create. Is it possible to store a table somewhere in the background of ArcPad that stores the user's information that can be used to auto-populate fields such as Specialist (user-name)?


Copy an attribute in ArcPad EXCLUDING the unique Identifier

I'd like to use the toggle button to 'copy attributes' when creating points in ArcPad. Currently, I can't because I'm using the date (+ time) field as my unique identifier to link to related tables. Is there any way to exclude an attribute (in my case the unique id) from the copy attributes toggle action?


PostGIS 2.0 and Postgres 9.1: ST_Transform => failed to load NAD27-83 correction file (Windowsx 64)

after making a clean install with the latest stable release of postgis (2.0) i can't perform any transformations:               SELECT ST_Transform(ST_SetSRID('BOX3D(2644033.2454124987 4580030.29781942,2645409.1119216317 4581406.1643285528)'::box3d,3785), 4326)      The above raises the error:                NOTICE:  PostGIS was unable to transform the point because either no grid shift files were found, or the point does not lie within the range for which the grid shift is defined. Refer to the ST_Transform() section of the PostGIS manual for details on how to configure PostGIS to alter this behaviour.                ERROR:  transform: couldn't project point (2.64403e+006 4.58003e+006 0): failed to load NAD27-83 correction file (-38)                ********** Error **********           ERROR: transform: couldn't project point (2.64403e+006 4.58003e+006 0): failed to load NAD27-83 correction file (-38)      SQL state: XX000      Tried the other suggestions of copying proj in contrib folder, restarting pg service with no luck. Any ideas? UPDATE: Something really weird is going on here. When executing the statement right after a PG restart it works! Any following statements after that fail! -- Executing query: SELECT ST_AsText(ST_Transform(ST_GeomFromText('POINT(2649262.94974021 4579345.79221865)', 3785), 4326)) Total query runtime: 20 ms. 1 row retrieved. -- Executing query: SELECT ST_AsText(ST_Transform(ST_GeomFromText('POINT(2649262.94974021 4579345.79221865)', 3785), 4326)) NOTICE: PostGIS was unable to transform the point because either no grid shift files were found, or the point does not lie within the range for which the grid shift is defined. Refer to the ST_Transform() section of the PostGIS manual for details on how to configure PostGIS to alter this behaviour. ERROR: transform: couldn't project point (2.64926e+006 4.57935e+006 0): failed to load NAD27-83 correction file (-38) _**_*** _**Error **_** _*_** George


ArcObjects DeleteLayer leaving layer artifacts

I'm working on some code for a button in ArcGIS 9.2 using Visual Studio 2005. The process adds a point layer, performs a select by location, exports the attributes of the selected points, then removes the point layer. The code I'm using to remove the point layer at the end of the process is:               Dim pDL As IDataLayer2 = pPtLayer 'QI     pDL.Disconnect()     pMxDoc.FocusMap.DeleteLayer(pPtLayer)     pMxDoc.UpdateContents()     pMxDoc.ActiveView.Refresh()      But there are remnants of the point layer remaining after the process has completed. In the command window, a list of the layers indicates it is still being referenced. This is causing to button to perform incorrectly if it is used multiple times in a session. How can I remove the layer without leaving these 'artifact' references? (Also posted at http://forums.arcgis.com/threads/54771-Data-References-Remain- After-Calling-DeleteLayer)


Integrating DSLAM attainable bitrates

This is a really specific question, but anyone with experience trying to pull in outside information into a map (live or static) can probably add something to the question. A long winded post is here http://www.thadwester.com/1/post/2012/04/mapping- attainable-bitrates-for-rural-telcommunication.html Does anyone have experience mapping attainable bitrates? OR how were you successful in pulling data from a non GIS source and integrating it into your map.


How does ESRI, and how should anyone, transform a coordinate that lies outside a grid transform (e.g. NADCON)?

As I understand it, a datum transform (e.g. `urn:ogc:def:coordinateOperation:EPSG::1241`) based on a grid interpolation method, e.g. NADCON, is undefined outside of the grid of points. Therefore the lat/long of Mexico city as expressed in NAD 1927 cannot be converted to WGS 1984 by way of this NADCON conversion -- it's not in the United States. If you call the ESRI projection engine directly (`pe.dll#pe_geog1_to_geog2`), it simply doesn't transform the coordinates outside of the NADCON grid, though does return a code reminding you that this has happened. (The return code is the # of points transformed, which if less than the # of points you passed in is a sign of trouble.) My guess is that (most?) everywhere else in the ESRI stack, this return code is ignored, and the transform is simply left as effectively zero outside of the grid area. This might be as good an answer as any. What should we be doing instead? In our code at the moment we throw an exception, but this is a contagious and awful thing as it means people looking at studies using this transform can't zoom out past a certain extent.


Generate non-overlapping shapes from a buffer

I have a collection of points, and I need to generate shapes around these points. Let's assume that these points are locations of offices and that the shapes are the 'area of responsibility' around the offices. The area of responsibility is defined by airline distance. This can be easily solved by a buffer function. But now: It is possible that offices are very close to each other and that the areas of responsibility of two or more offices overlap. In this case, only one (the closest) office is responsible. Is it possible to generate such shapes without iterating over the positions in the overlapped area?


ArcGIS GeoProcessing Model - Store List of Altered Features in Database

I am trying to build a GeoProcessing model which will find any parcels that have had their geometry values changed and store the corresponding parcel numbers in a separate non-spatial table. I am using ArcGIS 10. Does anyone know of any python scripts that would accomplish these tasks? One potential solution I found is the Compare Layer to Snapshot tool. Even though this is listed in the ArcGIS Resource Center, I can not find it in my version of ArcMap. Any advice would be greatly appreciated.


How to speed up OpenLayers with WFS in IE?

I'm using Openlayers, Geoserver and noticed that IE is very very slow to display WFS layers. I haven't so many WFS features, about 300. Google base layer appears after 1 sec. but my two WFS layers need each from 10 to 20 seconds to display. With Chrome, it requires only 2 seconds. I tried to disable style rules, events, no change. It's really a client issue, my cpu goes up to 50% for iexplore during features loading. I tried with IE8 and 9, with two differents pc, same results. It seems that I'm not the only one. I can keep using Chrome but would be interested to share ideas Olivier


ArcMap changing toolbars

I have a set of Arcmap map templates, the toolbars within them at one time where fixed in position. Now for whatever reason, every time I or another open the template the ordering of the toolbars has changed. Any Idea how to fix this? * ** _Research_ *** May be related to this bug. Is ArcGIS Desktop-ArcMap 10 affected by the stacked toolbars bug (NIM003161) when opening an MXD on multi-monitor configurations?


How to locate a house on the 3D Map correctly?

I've done my 3D map generation in WebGL/THREE.JS project and have an issue with the building locations. I have the data about building position ( its polygon ) from DB server, but first of all I want just to locate not the polygon data, but a simple cube. The aim is clear is as a crystal: `to set a building to the correct position by putting a cube on the 3D map.` Now it does look like: ![enter image description here](http://i.stack.imgur.com/DNocy.png) I have demonstrated it, because I want to admit, that to create a building and place it on the map - isn't a problem. The problem is to set building into the correct position/location on the map. What I have done before? Because the building record has two fields in DB:               position on map ( lat | long ) | polygon data of building ( points collection )      I thought that I must convert the geospatial coordinates of each building: latitude, longitude to its cartesian values, because WebGL/THREE.JS don't work with the shperical/geographic coordinates system. So I have built also a JSON web-service which helps in data transformations and similar aims. For e.g. the conversion of the point { 38.23, 55.89 } to its cartesian representation: ![enter image description here](http://i.stack.imgur.com/MCwxe.png) Now... I'm really confused how to use it for locating the building correctly on the map. If you would like see, I'm prinring the position of each building in console: ![enter image description here](http://i.stack.imgur.com/7CEd5.png) Spherical coordinates and converting at web-service side by such formula in my C# code:               internal Models.PointCartesian ConvertFromSphericalToCartesian(double angleTheta, double anglePhi)     {         var radTheta = ConvertDegreesToRadians(angleTheta);         var radPhi = ConvertDegreesToRadians(anglePhi);              var model = new Models.PointCartesian()         {             X = earthRadius * Math.Cos(radTheta) * Math.Cos(radPhi),             Y = earthRadius * Math.Cos(radTheta) * Math.Sin(radPhi),             Z = earthRadius * Math.Sin(radTheta)         };              return model;     }      So... Right now I'm thinking about some proportions to use... But this way can be incorrect... So what's your suggestion how to set a cube into the correct position on the 3D map just for showing the real position of some buildings. PS: The records lat | long of each building in DB is 100% correct. Thanks!


Changes in digitised features according to scale

I have a forest boundary from surveyed toposheet digitised on 20,000 scale. When I see the same on 6,000 scale, there are certain changes like smoothing at the edges, slight shift etc. Why does this happen. If the scale of mapping changes, are the features going to be same or can we expect changes in shape and size?


Update PG table setting an area_id

I have a table with lots of points which I'd like to update and set a consecutive area_id to every point "group". I define a point "group" as points that are within a 500 meters radius. The raw table is something like:               point_id    desc_string       lat            lon          gid        geom     A           Glion           25.057939     55.187833       1     B           Glion           25.061244     55.185937       2       C           Springs         46.433853     6.926215        3     D           Springs         46.431851     6.923763        4     E           Hobby Center    24.221813     55.780285       5     F           Ponte           -12.643624    14.864234       6     G           Ponte           -12.644966    14.866923       7     H           Ponte           -9.093045     17.658906       8      You can now see that there are different pairs or groups of points. With the following SQL I can identify the points which by definition belong to these groups:               SELECT distinct on (point_id) t1.*      FROM ciss_poi AS t1 JOIN ciss_poi AS t2 ON St_dwithin(t1.geom, t2.geom, ( 0.5 / 111.111 ))      WHERE t1.desc_string = t2.desc_string AND t1.gid != t2.gid      What I want is to group these pairs and add an area_ or group_id:               point_id    desc_string       lat            lon          gid        geom     group_id     A           Glion           25.057939     55.187833       1                   1     B           Glion           25.061244     55.185937       2                   1     C           Springs         46.433853     6.926215        3                   2     D           Springs         46.431851     6.923763        4                   2     F           Ponte           -12.643624    14.864234       6                   3     G           Ponte           -12.644966    14.866923       7                   3      I have no idea how to write the query. I can identify the groups but I don't know how to add the area_id. Can someone please help me? Thank you very much!


How to refer KML style inside TileMill

The following KML file contains paths with style and name tags: example.               <Folder>               <name>Pedestrian</name>               <Style id="style-Pedestrian">                 <LineStyle>                   <color>#ff808080</color>                   <width>3</width>                 </LineStyle>               </Style>               <Placemark id="">                 <styleUrl>#style-Pedestrian</styleUrl>                 <LineString>                   <altitudeMode>relativeToGround</altitudeMode>                   <coordinates>8.5950278,46.6329618,1 8.5951371,46.6329856,1 8.595266,46.6327811,1 8.5951712,46.6327501,1 8.5950278,46.6329618,1</coordinates>                 </LineString>               </Placemark>     ....      I tried to refer to the styles, but the TileMill does not recognize it. After I import the files and apply the style using "Carto styling language" the path just disappears. Example:               #imported_id {       [Name="Pedestrian"] {         line-width:2;         line-color:#000000;       }     }          #imported_id {       [Name="style-Pedestrian"] {         line-width:2;         line-color:#000000;       }     }          #imported_id  #style-Pedestrian {              line-width:2;           line-color:#000000;            }      Why I can't refer to the styles inside the TileMill? Is it possible or I am doing something wrong?


Differences between SQL dialects in QGIS vs ArcView vs Oracle

I'm kinda new with SQL queries and there is something I don't get: A SQL query in QGIS is written differently than the same query in ArcView and will probably also be written differently if I want to query an Oracle db using an Oracle tool. So is it like SQL is a language and each software uses its own slang of the same language ? EDIT: Thanks for those answers! Now do you guys know of a documentation somewhere that would teach me how to make a query in QGIS field calculator. I can make a simple one using the implemented functions, but what about something more complex (using case when, where, and so on) ?


Needed a free high resolution imagery for Las Cruces, New Mexico area

I'm Looking for a free download Imagery that is a very high resolution and the most recently like the past 3 months. I'm doing to produce a map where our new building being move into next year ? Is that possible for me to find one online ? Any suggestion ? Thank you.


Help with field calculator in Python script

I am getting a syntax error in my script but I know from testing it in ArcMap attribute table, the syntax is fine. Anyone have any idea why this code doesn't work? I see that a search cursor has been used in this situation but (a) I'm not familiar with them and (b) why wont the way I'm doing it work? Thanks for any help, time and consideration. EDIT* - I have added an alternate working codeblock to the script below. Seems both ways work just fine!               import arcpy, os     from arcpy import env          #Path of the workspace     in_workspace = r"C:\folder"          fieldName = "Symbology"          expression = "Class(!City!)"      This is also another way that it works. So both work just fine. Thanks again for all the help!               code ='''     def Class(City):         if 'Milwaukee' in City:             return 2         elif 'Kenosha' in City:             return 4         elif 'Madison' in City:             return 9         else:             return 0     '''          for dirpath, dirnames, filenames in arcpy.da.Walk(in_workspace, datatype="FeatureClass",type="All"):         if "skipFolder" in dirnames:             dirnames.remove('skipFolder')            for filename in filenames:             if "City" in [f.name for f in arcpy.ListFields(os.path.join(dirpath, filename))]:                 arcpy.AddField_management(os.path.join(dirpath,filename), fieldName, "SHORT", "", "", "", "", "NULLABLE")                 arcpy.CalculateField_management(os.path.join(dirpath,filename), "Symbology", expression, "PYTHON", code)             else:                 print "no City field for dataset ", filename          #Prints text that shows script has finished running     print "message that reflected field calc use"     print "Finished script"


How to retrieve all subtype codes from ISubtypes interface

I'm trying to retrieve all subtypes for a given feature class. ISubtypes.Subtypes give you an enumeration of all subtypes in the class. However the IEnumSubtype.Next method requires the subtype code to retrieve the associated subtype. But this obviously requires prior knowledge of all subtype codes. There are no methods on ISubtypes that retrieve all subtype codes. So, how do I obtain a list of both the subtype codes and subtype names associated with a feature class? I must be missing something obvious here.


Any source code for converting an infix filter to a WFS filter?

A WFS GetFeature query looks _something_ like this: http://hname/arcgis/services/sname/MapServer/WFSServer?SERVICE=WFS&REQUEST=GetFeature&VERSION=1.0.0&MAXFEATURES=1001&FILTER=%3CFilter%3E%3CPropertyIsEqualTo%3E%3CPropertyName%3EADDRKEY%3C/PropertyName%3E%3CLiteral%3E1001%3C/Literal%3E%3C/PropertyIsEqualTo%3E%3C/Filter%3E&TYPENAME=Addresses But users would want to enter something like "ADDRKEY = 1001" so it becomes necessary to convert the infix expression to a AST and then into a WFS filter. Are there any reusable solutions for converting an CQL filter into a OGC filter?   * "A=b" is converted into   * "<PropertyIsEqualTo><PropertyName>A</PropertyName><Literal>b</Literal></PropertyIsEqualTo>"


Metadata -auto build using python

We have a large (10,000 plus) repository of spatial data (shp/gdb/tab vectors and ecw/tif rasters and also las, xyz and DEM data) where some have metadata records in xml using anzlic metadata editor. I want to check if each spatial dataset has an associated xml record and check the projections, spatial extent, source and size against the associated spatial file. I have created a arcpy based script to extract this info from ESRI readable formats but am unsure on how to handle tab files and more importantly how to check it against the anzlic metaeditor based xml record. So if we have citypoints.shp/.tab then we should have citypoints_metadata.shp/.tab.xml as the metadata record -this is separate from the citypoints.shp.xml that some software autocreate. Another similar forum question is ANZLIC Metadata in ArcGIS 10 but it doesn't cover the requirement to check for the existence of a valid record and dealing with .tab (other non-esri) formats in an opensource/creative commons workspace as per my question (http://gis.stackexchange.com/questions/13676/how-to-read- mapinfo-tab-files-in-arcpy). I also looked through the software mentioned in Looking for a Metadata Editor but none of them autogenerate the base metadata file or allow comparing of existing records against the source.


Reprojecting sources with MapProxy yields distortion

I have configured MapProxy to aggregate imagery from a number of Internet sources so that I can dynamically overlay them by adjusting the `layers=<x>` query that I pass to MapProxy's WMS service. This all seems to be working properly. Here's the problem: some of the sources are TMS servers, which use the spherical Mercator (EPSG:900913) projection. Some of the others are WMS servers that only serve data in the EPSG:4326 (WGS84) projection. MapProxy is nice enough to handle this for me, caching the images in their native projection and then reprojecting them to the target projection when I request them. However, there is a great deal of distortion in the resulting images near the -180/+180 degree longitude line. Here's an example: ![enter image description here](http://i.stack.imgur.com/wtcI0.jpg) The source image is from MapQuest's Open Aerial service, which is in global Mercator. The above is MapProxy's reprojection of the source to EPSG:4326. For most of the globe, it looks great, but the rightmost part of the image is obviously way off. If I request it in its native projection, then I get a nice image: ![enter image description here](http://i.stack.imgur.com/YZHQ4.jpg) I see very similar results if I take an EPSG:4326 source (Landsat images from this WMS source) and request it from MapProxy using EPSG:900913: ![enter image description here](http://i.stack.imgur.com/agJRm.jpg) Am I missing something fundamental here? Is this to be expected?


How to obtain statistics within a Buffer/Catchment in MapInfo?

I need to calculate the population statistics within a 10 minute drivetime catchment from a point and within 1 Km Buffer from a point in MapInfo, how can I do that can someone please elaborate? I have a population thematic map and I have made a buffer on one location and I need to find the total population living within that area? I am also using a Drivetime addon with MapInfo for drive time catchments and Mapinfo to make Buffers. Many thanks


postgresql pgrouting define C function function with int* arguments

I want to create a psql-C function with an undefined length list of integers (GIDs for example). An erratic example using V0 function definition that works is like:               int mytest4(int *x, int i){       int *a  = &(x[6]);       int j;       for (j = 0; j < i; j++)          printf("Passed on %d", a[j]); // sent to logfile       return a[i];     }      My question concerns the V1 functions to read an int array. I don't understand how to do               PG_FUNCTION_INFO_V1(mytest5);     Datum mytest5(PG_FUNCTION_ARGS){     int *x = PG_GETARG_???(0);     int i = PG_GETARG_INT32(1);     ...      Does anyone know how to write the same function, please??


Using Google Tiles on LeaftLet

I would like to use the Google tiles on LeafLet (RoadMap, Satellite,...). I've tried this https://github.com/shramov/leaflet-plugins and it works fine, but I'm worried about the possible legal issues of this solution. The following text is an extract of LeafLet FAQ. > The problem with Google is that its Terms of Use forbid any means of tile > access other than through the Google Maps API. > > You can add the Google Maps API as a Leaflet layer with a plugin. But note > that the map experience will not be perfect, because Leaflet will just act > as a proxy to the Google Maps JS engine, so you won't get all the > performance and usability benefits of using Leaflet when the Google layer is > on. I think that's right but it depends on the point of view and the differences in interpretation of the Google Maps Terms of Use. For example Google says: > (a) No Access to Maps API(s) except through the Service. You must not access > or use the Maps API(s) or any Content through any technology or means other > than those provided in the Service, or through other explicitly authorized > means Google may designate. For example, you must not access map tiles or > imagery through interfaces or channels (including undocumented Google > interfaces) other than the Maps API(s). Here, LeafLet and this plugin could be consider as other technology. Also Google says: > (g) No Use of Content without a Google Map. You must not use or display the > Content without a corresponding Google map, unless you are explicitly > permitted to do so in the Maps APIs Documentation, or through written > permission from Google. In any event, you must not use or display the > Content on or in conjunction with a non-Google map. For example, you must > not use geocodes obtained through the Service in conjunction with a non- > Google map. As another example, you must not display Street View imagery > alongside a non-Google map, but you may display Street View imagery without > a corresponding Google map because the Maps APIs Documentation explicitly > permits you to do so. At this point it could be interpreted as if we're not using a Google Map, but in a different point of view we could say we're using a Google Map under a LeafLet Map so strictly we're using it. What do you think? Could I have some troubles with Google if I use this plugin?


Summarize values per row using field calculator via Model Builder

I think my problem is easy to solve, but so far I couldn't find a solution. I have a Feature Dataset created with the Union tool in Model Builder and now try to sum up all values of one specific field (VSG_EINZEL->up to 150 fields) into a new field (VSG_ALL) automatically in Model Builder. My problem is, that the number of VSG_EINZEL-fields is rather high and varies so I can’t use a static field calculaion like: VSG_ALL = VSG_EINZEL + VSG_EINZEL_1 + VSG_EINZEL_12 and so on. I am very new in using Python and I really appreciate any help and suggestions. Thank you very much in advance! Michaela


Can I use a blob defined field to store more than 255 Text characters?

As the title states, i´m not sure whether I should/can use a blob field to store text. I need to increase the amount of text in a field to over 255. Is the blob the way to go?


Changing null value to specific numbers in ArcGIS for Desktop?

I have a Excel file showing annual precipitation and I add it on arcmap. When I tried to check it's attribute table the field calculator is passive. I want to change all the Null value to specific number for analysis. How can I solve it please?


openlayers how to get feature info on form submit?

I have an OpenLayers pop-up with a form on selectFeature (WFS-T). Can I recover the feature.attributes in the form's onSubmit? e.g: the form in the popup               var content = '<form onSubmit="processForm(this.form)">' +         'Träd-Id
<input type="text" name="trädnummer" value="' +         feature.attributes.trädnummer + '">' +         '
Art
<input type="text" name="art" value="' +         feature.attributes.art + '">' +         '
Anmärk.
<textarea name="anmärkningar" rows="4" cols="40">' +         feature.attributes.anmärkningar + '"</textarea>' +         '
Åtgärd
<textarea name="anmärkningar" rows="4" cols="40">' +         feature.attributes.rekommendationer + '"</textarea>' +         '
<input type="submit" value="Spara""></form>'      and the onSubmit callback:               function processForm(oForm) {       var feature = **recover currently selected feature here?**       feature.attributes.trädnummer =          oForm.elements["trädnummer"],value;       feature.attributes.art =          oForm.elements["art"],value;       feature.attributes.anmärkningar =          oForm.elements["anmärkningar"],value;       feature.attributes.rekommendationer =          oForm.elements["rekommendationer"],value;       return false;     }      If so, I thought I could use WFS-T to update the attribute info? (instead of e.g. a post to php) Any help appreciated   Thanks Mini


GeoServer REST API Timeout Error

I'm trying to upload a 20MB shapefile using the REST API, but gets a `timeout error`. I can upload smaller files without problems. I'd like to be able to upload a shapefile of any size without restriction. If there's a way of specifying timeout, I guess it might be problematic as I wouldn't want to restrict file size; I do validation on the shapefile, and it should be uploaded provided it's valid. Part of my code is shown below:                   private string getDbXml(string dsName)         {             string exposePKsParameter = "<entry key=\"Expose primary keys\">true</entry>";                  string xml = "<dataStore>" +                             "<name>" + dsName + "</name>" +                              "<enabled>true</enabled>" +                              "<connectionParameters>" +                                  "<host>" + DB_HOST + "</host>" +                                  "<port>" + DB_PORT + "</port>" +                                  "<database>" + DB_NAME + "</database>" +                                  "<user>" + DB_USER + "</user>" +                                  "<password>" + DB_PASSWD + "</password>" +                                 "<dbtype>" + DB_TYPE + "</dbtype>" +                                  "<namespace>" + dsName + "_NS</namespace>" +                                  exposePKsParameter +                               "</connectionParameters>" +                            "</dataStore>";                  return xml;              }      My environment setup: GeoServer 2.1.3, PostGIS 1.5, and C#.


OpenLayers OSM layer

I need to define an layer in OpenLayers just showing world map. The most simpliest variant is to create OSM layer. When I do like this:               var layer = new OpenLayers.Layer.OSM("OSM");     map.addLayer(layer);      How can I define restrictions/bounds to show the world map?


Ordnance Survey data to WGS-84

Recently I have reprojected Ordnance Survey data from British National Grid (ORD SURV GB) to WGS-84 using ArcGIS 9.2. After re-projecting I have found some shift in the data. Can any body guide me what i am doing wrong? Thanks for you reply. Here is my observations. I have download the boundary files from here: http://parlvid.mysociety.org:81/os/ When I re-project boundaries there no shift. But when i used any layer from the tile, it is shifted. After this I have just compare the projection information of both layers. Boundary file have this projection info: Projection: Transverse_Mercator false_easting: 400000,000000 false_northing: -100000,000000 central_meridian: -2,000000 scale_factor: 0,999601 latitude_of_origin: 49,000000 Linear Unit: METER (1,000000) **Geographic Coordinate System: unnamed** Angular Unit: degree (0,017453292519943299) Prime Meridian: Greenwich (0,000000000000000000) Datum: D_OSGB_1936 Spheroid: Airy - 1848 **Semimajor Axis: 6377563,000000000000000000 Semiminor Axis: 6356256,161000000300000000 Inverse Flattening: 299,319997677743000000** and in tile layer for example NaturalFeature_Area have following projection info: Projection: Transverse_Mercator False_Easting: 400000,000000 False_Northing: -100000,000000 Central_Meridian: -2,000000 Scale_Factor: 0,999601 Latitude_Of_Origin: 49,000000 Linear Unit: Meter (1,000000) **Geographic Coordinate System: GCS_OSGB_1936** Angular Unit: Degree (0,017453292519943299) Prime Meridian: Greenwich (0,000000000000000000) Datum: D_OSGB_1936 Spheroid: Airy_1830 **Semimajor Axis: 6377563,395999999700000000 Semiminor Axis: 6356256,909237285100000000 Inverse Flattening: 299,324964599999990000** The bold lines are changed in both layers. Any idea which one is correct?


python qgis 2.4 : display a view with symbology

I have managed to display a view created using postgresql from qgis using python code:               uri = QgsDataSourceURI()     uri.setConnection("localhost", "5432", "stat", "postgres", "admin")     uri.setDataSource("public", "view2", "the_geom", ' ', "gid")     uri.uri()     qgis.utils.iface.addVectorLayer(uri.uri(), "allcountries", "postgres")      Now I want to display this view with symbology (classes), I searched a lot but it was not clear. For example: I tried to do it with:               myVectorLayer = QgsVectorLayer("polygon", "mypoly", 'ogr')     myTargetField = 'code'     myRangeList = []     myOpacity = 1     # Make our first symbol and range...     myMin = 0.0     myMax = 50.0     myLabel = 'Group 1'     myColour = QtGui.QColor('#ffee00')     mySymbol1 = QgsSymbolV2.defaultSymbol(myVectorLayer.geometryType())     mySymbol1.setColor(myColour)     mySymbol1.setAlpha(myOpacity)     myRange1 = QgsRendererRangeV2(myMin, myMax, mySymbol1, myLabel)     myRangeList.append(myRange1)     #now make another symbol and range...     myMin = 50.1     myMax = 100     myLabel = 'Group 2'     myColour = QtGui.QColor('#00eeff')     mySymbol2 = QgsSymbolV2.defaultSymbol(myVectorLayer.geometryType())     mySymbol2.setColor(myColour)     mySymbol2.setAlpha(myOpacity)     myRange2 = QgsRendererRangeV2(myMin, myMax, mySymbol2, myLabel)     myRangeList.append(myRange2)     myRenderer = QgsGraduatedSymbolRendererV2('', myRangeList)     myRenderer.setMode(QgsGraduatedSymbolRendererV2.EqualInterval)     myRenderer.setClassAttribute(myTargetField)          myVectorLayer.setRendererV2(myRenderer)     QgsMapLayerRegistry.instance().addMapLayer(myVectorLayer)      This gives me an error: > mySymbol1.setColor(myColour) AttributeError: 'NoneType' object has no > attribute 'setColor'


Multiple metadata within a single mosaic dataset

I am creating a mosaic dataset consisting of thousands of different DEMs. These will make up a single State, however I need the Counties to be able to hold their own metadata. Each raster contains its own metadata, however when mosaicked together the mosaic dataset contains no metadata. I can import an .xml to the description and to the overviews, but this limits me to a single description for each raster within the dataset. Does anyone know how to make multiple metadata select-able within a single mosaic dataset. Note: I am using ArcGis 10.1 and sharing these to a ArcGis 10.2 server through an image service. Each county mosaic works seamlessly, holding its own metadata. I just cannot figure out how to get different metadata to display when identifying a particular county. Thanks in advance!


Add a new polygon to an existing shapefile from wkt in QGIS

I have a layer of polygons in QGIS; I want to add programatically (pyqgis) a new polygon to this layer using WKT. Example:                  mywkt = POLYGON ((522762 376413 0,530635 368671 0,522237 353713 0,522762 376413 0))      I want to add this polygon to my layer. I try this :               layer.startEditing()     geom = QgsGeometry()     geom = QgsGeometry.fromWkt(mywkt)     feat = QgsFeature()     feat.setGeometry(geom)     layer.dataProvider().addFeatures([feat])     layer.updateExtents()     layer.reload()


Possible workflows for shaded relief representation as vector

I am looking for a good workflow on how to represent relief on a map as vector (e.g. for further processing in Adobe Illustrator or Inkscape). My inspiration is the present google maps at zoom level 12, since this looks like it is based on vector graphics: ![Map data ©2013 Google](http://i.stack.imgur.com/AsJce.jpg) https://maps.google.de/?ll=47.27853,10.686607&spn=0.179816,0.41851&t=m&z=12 Starting with some free SRTM elevation data, what would be the best way to achieve such a result?


ArcMap - proportion of polygon in lon/lat grid cells

I have a polygon representing a river basin on a 1 X 1 degree lat/lon grid. I need to create a boundary using the grid cells as the boundary to best represent the outline of the basin. I would like to make a condition telling ArcMap to include the 1 X 1 cells for which the polygon accounts for more than 10% of the area of that cell. I've added an image to better explain what I am aiming to do with a rough outline in blue. Any help/advice would be great. If the above is not possible, creating a matrix of % accounted for in the polygon would still be useful and I will manually draw![Example GIS](http://i.stack.imgur.com/svgwi.jpg) EDIT: I realise the example I have drawn is 0.5 X 0.5 cells, but I need to do this for 1 X 1 grids. With the data I have the each grid starts at half degree so one cell e.g. 2.5 to 3.5N and 31.5 to 32.5E. Hopefully this makes sense


Field Filter and Value Pick List for an Arcpy Toolbox ValueTable Parameter

In an ArcGIS Python Toolbox (pyt file), how do I specify a filter for a Value Table parameter? In my value table I have two columns. The first is a a field name derived from a selected table view and the second is a argument that should pass through with the field name. I would like to filter the list of available fields by data type, and then define a pick list of values for the second field. I've searched high and low, but setting a filter for a value table is not obvious, or it may not be possible. When I attempt to specify a filter list for the field datatype in the usual way the toolbox fails to load with an error message of "line 118, in getParameterInfoAttributeError: 'NoneType' object has no attribute 'list'". Where line 118 is where I try to specify the filter as in the code below. I can specify list of values to populate the table, but I really need this to be user selected.               field_map = arcpy.Parameter(             displayName='Output Field Map'             , name='out_field_map'             , datatype='GPValueTable'             , parameterType='Required'             , direction='Input')     field_map.columns = [['Field', 'Field Name'], ['GPString', 'NVEL Attribute']]     field_map.parameterDependencies = [trees_table.name]     #specifying a filter list fails     #field_map.filter.list = ['Short', 'Long', 'Float', 'Double']


Missing class org.geotools.util.Version

Full story below, but essentially I'm trying to use Geoserver and it needs the class `org.geotools.util.Version`, but it can't find it even though I can see it's in the appropriate jar file. Something is fundamentally wrong and I can't understand how anything has worked so far for anyone when things appear so broken or how to fix this. Background (probably inessential): I'm trying to use the SLDSelect control in OpenLayers (note that the example http://openlayers.org/dev/examples/SLDSelect.html is also using GeoServer according to the source, which makes this story weirder). I had installed the GeoServer app for Mac via some dmg (can't remember exactly but it doesn't matter) and I was getting an error. I diagnosed wrong and installed Tomcat and the latest `geoserver.war` (2.5.1) straight from the website - so now it's platform independent. I got GeoServer working but still got the same error for SLDSelect. I looked closer and eventually delved into the source of Openlayers. I found that in the function OpenLayers.Control.SLDSelect.parseDescribeLayer the variable url was null from which I saw that describeLayer wasn't being formed properly. This lead me to look at the activate function. **Here's where it gets really weird:** When OpenLayers calls activate, it GETs the following URL, as seen in Firebug:               http://localhost:8080/geoserver/cite/wms?SERVICE=WMS&VERSION=1.1.1&LAYERS=cite%3Aveg_rsa&REQUEST=DescribeLayer      The response to this from GeoServer is:               <?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE ServiceExceptionReport SYSTEM "http://localhost:8080/geoserver/schemas/wms/1.1.1/WMS_exception_1_1_1.dtd"> <ServiceExceptionReport version="1.1.1" >   <ServiceException>           org.apache.commons.lang.SerializationException: java.lang.ClassNotFoundException: org.geotools.util.Version     java.lang.ClassNotFoundException: org.geotools.util.Version     org.geotools.util.Version     </ServiceException></ServiceExceptionReport>      which seems pretty serious. I copied and extracted `$TOMCAT/webapps/geoserver/WEB-INF/lib/gt-metadata-11.1.jar` and found `Version.class` under `org/geotools/util` as expected. So why can't it find it? I also got the same error on a slightly older version of the `geoserver.war` (2.4.5). GeoServer is generally working. OpenLayers is able to request and display polygons from PostGIS over WMS. I even managed a parametrised SQL view. I've restarted my computer and still get the same issue. What could be wrong? In case it helps, when I start Tomcat I get:               Using CATALINA_BASE:   /Library/Tomcat     Using CATALINA_HOME:   /Library/Tomcat     Using CATALINA_TMPDIR: /Library/Tomcat/temp     Using JRE_HOME:        /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home     Using CLASSPATH:       /Library/Tomcat/bin/bootstrap.jar:/Library/Tomcat/bin/tomcat-juli.jar     Tomcat started.      Update: now I'm finding that WFS isn't working in general for similar reasons. When I try making a WFS request, I get `java.lang.ClassNotFoundException: org.geoserver.wfs.WFSInfo$Version`. I also see this if I click on one WFS 1.1.0 link on the home page, i.e. a `GetCapabilities` request. While I'm at it, in case they're linked (maybe a general JRE problem?) if I click on the WFS link on the left sidebar, I get:               org.apache.wicket.WicketRuntimeException: Exception in rendering component: [MarkupContainer [Component id = srsNameStyle]]      I also can't enable any services for workspaces (I'm not sure how I managed before). When I tick a checkbox (e.g. for WMS), it tells me instantly that my session has timed out when it definetely hasn't. Before, it would let me tick, but once I clicked 'Save' it would show a `java.lang.reflect.InvocationException` or something at the top and not save. Basically all my installations seem completely broken.


Custom Layer Properties

I am coding a custom layer for ArcMap using C#. I want the eleven standard property pages to display for the layer (General, Source, Selection, ... , HTML Popup), when the user selects Properties from the TOC context menu. I have not been able to find documentation that associates each page with the interface(s) that it requires. (Other than the General Page which requires ILayer). Anyone have a list that associates the property pages and their interfaces? I suspect that if my custom layer class implements those interfaces, those pages will display. If I am taking the wrong approach, then how do I get those property pages to appear for my custom layer? Thanks, Steve * * * Thanks for your attention. I read those articles before making my post. They describe how to create a property page for my layer. What I am looking for is how to get the eleven standard property pages to appear for my feature layer, when the user selects "Properties" from the TOC context menu, for a feature layer. For example: The first standard property page, for a feature layer, is titled, "General" it appears because the custom layer implements the ILayer interface. The association between "General" and ILayer is not mentioned in those recommended articles. I will reduce my post to singular questions, as follows: What interface(s) are required for the "Source" page? What interface(s) are required for the "Selection" page? What interface(s) are required for the "Display" page? What interface(s) are required for the "Symbology" page? What interface(s) are required for the "Fields" page? What interface(s) are required for the "Definition Query" page? What interface(s) are required for the "Labels" page? What interface(s) are required for the "Join and Relates" page? What interface(s) are required for the "Time" page? What interface(s) are required for the "HTML Popup" page? Respectfully, Steve


proxy.cgi for GeoServer is not accessible in browser

I have a problem with WFS request:                 var wfs = new OpenLayers.Layer.Vector("WFS",{                           strategies: [new OpenLayers.Strategy.Fixed()],       projection: new OpenLayers.Projection("EPSG:4326"),       protocol: new OpenLayers.Protocol.WFS({                                 version: "1.1.0",       url : "http://localhost:8080/geoserver/wfs",//        featureNS : "http://www.opengeospatial.net/cite", // workspace namespace URI                         geometryName: "geom",  // field in Feature Type details with type "Geometry"                  featurePrefix: 'cite',    //geoserver workspace name       featureType: "InfoGeometric"        //geoserver Layer Name                                                                                }),      In particular in chrome console i have the error POST http:// localhost:8081/cgi- bin/proxy.cgi?url=http%3A%2F%2Flocalhost%3A8080%2Fgeoserver%2Fwfs 404 (Not Found). I have create in C:\Program Files\apache-tomcat-6.0.33\lib the folder cgi-bin and in it the file proxy.cgi (i added in allowedHosts variable values'localhost','localhost:8080','localhost:8081', 'localhost:8080/geoserver/wfs'). In OpenLayers.js i set OpenLayers.ProxyHost="/cgi-bin/proxy.cgi?url="; Now, if i go on http:// localhost:8080/geoserver/wfs/DescribeFeatureType?version=1.1.0&typename=cite:InfoGeometric i have a description in xml of my InfoGeometric but if i go on http:// localhost:8081/cgi-bin/proxy.cgi i don't connect to it. I don't know i must do. Thanks very much.


Need to generate ids to connect points and polygons

I have a simple question as I am just getting my head into GIS. I am trying to compare the demographics of charter schools to traditional public schools. I have universe listings (lat,long) of US public schools in a vector layer with additional layers that include separate listings of   1. independent charter schools (not part of a school district) and    2. district linked (tabular district/school links) charter schools.  I want to compare the charters to comparable local schools, but this requires exploring multiple matches- district public schools to charter schools in the same districts and then compare schools in a 10 mile buffer of each charter school. Since the independent charters are not linked to a district I would like to use QGIS to connect points to the polygons they are in. What I cannot figure out is, after I have the schools in a shapefile, how can I generate new ID's to nest 1) charters within the district geographic areas (polygons) and a second id for each charter school that includes all the traditional public schools within the 10 m buffer? Any ideas? Thanks in advance.


Raster display for topographic map

I'm trying to see how good a custom topographic map could be using only free data For the moment I'm just playing with the data so of course the colours are not pretty. I did some classification and used some land cover data anyway I have a raster layer as background with the main land cover basically swamp forest and no vegetation. Since the result of a vectorization was awful and hard to fix I'm going to stay with the raster as background, the question is: How to avoid the squared shape on my map? I would like to smooth the area to have a prettier map. I tried the bilinear interpolation but it creates white boundaries around the area and with the Nearest neighbour it's not pretty. I tried some generalization tools as well but they are way too strong! So what would you do? Here is what I have done so far: ![Progress](http://i.stack.imgur.com/rxZaC.jpg)


arcpy - how to run geoprocessing python script on SDE

I was testing my script on a .gdb on my local drive and I got it to work. The actual geodatabase I would like to run the script on is an SDE. I tried changing my filepath from the .gdb to the .sde and it failed. Can someone help me figure out how to configure my script so that it will work on the SDE?               #import system module      import arcpy, os          #define filepath     filepath = r"C:\Users\kkaszas\AppData\Roaming\ESRI\Desktop10.0\ArcCatalog\SANGeodatabase.sde"          arcpy.env.workspace = filepath          #enable overwrite      arcpy.env.overwriteOutput = True          fcList = arcpy.ListFeatureClasses()     fieldName1 = "Author"     fieldName2 = "LastUpdated"     expression1 = "\"John Doe\""     expression2 = 20121011          for fc in fcList:              arcpy.AddField_management(fc,fieldName1, "TEXT")         arcpy.AddField_management(fc,fieldName2, "LONG")         print "fields added to " + fc                   arcpy.CalculateField_management(fc, fieldName1, expression1, "PYTHON")         arcpy.CalculateField_management(fc, fieldName2, expression2,"PYTHON")         print "Fields have been calculated for " + fc


How to change the view of a map window in MapInfo to a new center coordinate?

How can I change the map view of a map window in MapInfo Professional to a new center coordinate? I need to change the viewed map in the MapInfo window via a predefined set of coordinates via MapBasic. I tried to find it out through the MapBasic window but didn't find anything useful. Thanks Medo


ArcGIS 10.0 \ arcpy - CalculateField_management : help with syntax for updating text in attribute table of feature classes

I am trying to add (ie "Author", "LastUpdated") to feature classes within a gdb and then populate each of those fields. I have been able to get my code to run properly for the numerical field but I cannot get it to run for the text field.                   fcList = arcpy.ListFeatureClasses()         fieldName1 = "Author"         expression1 = "John Doe"              for fc in fcList:                          arcpy.AddField_management(fc,fieldName1, "TEXT")                      arcpy.CalculateField_management(fc, fieldName1, expression1, "PYTHON")      My code returns this error:               ExecuteError: ERROR 000539: <type 'exceptions.SyntaxError'>: unexpected EOF while parsing (<expression>, line 1)     Failed to execute (CalculateField).      How can I fix this? Thanks!!


Python Add in: Pass Selection from Combo Box into Definition Query

I am trying to pass the users selection into a definition query in an addin combo box python script. Basically, I have a feature class with a field called "SITE". I build a python list from that field (using the search cursor and appending the results) and pass it into the combo box items list. The user will choose a value in the combo box box from that list. I want to further pass the users selection into a definition query. You can see in my script below, I just tried to pass the selection into the definition query, but it crashes the whole combo box and toolbar. I've tried converting it to string, placing quotes around it, etc and no luck. Obviously I am doing something wrong with. I believe it's how I'm passing the selection. As suggestions?               import arcpy     import pythonaddins          sitename = []     for row in arcpy.SearchCursor("Z:\Geodatabases\Test.gdb\Tesfc"):     sitename.append(row.SITE)          class ComboBoxClass(object):         """Implementation for SolsticeFigureUpdater_addin.combobox (ComboBox)"""         def __init__(self):             self.items = sorted(sitename)             self.editable = True             self.enabled = True             self.dropdownWidth = 'WWWWWWWWWWWWWW'             self.width = 'WWWWWWWW'         def onSelChange(self, selection):             mxd = arcpy.mapping.MapDocument("CURRENT")                  for df in arcpy.mapping.ListDataFrames(mxd):                 if df.name == "DFMAIN":                     main = arcpy.mapping.ListDataFrames(mxd, "DFMAIN")[0]                 if df.name == "DFINSET":                     dfinset = arcpy.mapping.ListDataFrames(mxd, "DFINSET")[0]                  for lyr in arcpy.mapping.ListLayers(mxd, "", dfmain):                 if lyr.name == "PDA Boundary":                     lyr.definitionQuery = '"SITE" =' selection                  arcpy.RefreshActiveView()             arcpy.RefreshTOC()                   def onEditChange(self, text):             pass         def onFocus(self, focused):             pass         def onEnter(self):             pass         def refresh(self):             pass


How do I export circles from ArcObjects to WKB?

I have a small circle in SDE which I'm trying to extract through ArcObjects into well-known-binary (for later import into other systems). Using the IWkb interface I can obtain the WKB, but it comes out as a PolyLine with 2 points - both exactly the same. I've hand parsed the WKB to confirm this is what ArcObjects is returning. Are there any ways to get ArcObjects to export circles as WKB and maintain the circle? e.g. as a CircularString or similar. I'm using ArcObjects 9.3.


how to make grid cells by point data

I have a csv data. the X, and Y columns show bottom left corner of each grid. It is supposed to show as grid square, but it shows points. what is the problem? and is there any way I can make cell grids from these points? help me please! Thanks a lot.


Does OSGeo4W install a 32 bit or 64 bit version of QGIS?

I just want to know if you are installing Qgis via OSGeo installer on a windows 64 bits OS (XP, vista or 7) Does it install a 32 bits or 64 bits version of QGIS? Usually the stand alone installer installs a 32 bits version, so I want to use the full potential of my new computer (win 7 64 bits, 16 Mb of Ram).... Thanks


How to properly utilize DWITHIN Spatial Filter in OpenLayers

Given the following code:               var points = [];                                     points.push(new OpenLayers.Geometry.Point(-110, 38));     points.push(new OpenLayers.Geometry.Point(-108, 40));     var lineString = new OpenLayers.Geometry.LineString(points);     var filteredPoint = new OpenLayers.Geometry.Point(-108.25, 39.78);     var newFilter = new OpenLayers.Filter.Spatial({             type: OpenLayers.Filter.Spatial.DWITHIN,             distanceUnits: 'm',             distance: 92600,             value: lineString     }); //92600 meters, or 50 nautical miles                                       alert(newFilter.evaluate(filteredPoint));      When the alert is fired, it results in **false**. I'm a beginner to OpenLayers, looking for a way in Javascript to determine whether or not a point is within a certain distance, either side of a line. I cannot use a bounding box for this feature, because I want the user to be able to pick any two points and a distance from the line, so an MBR isn't available here. **filteredPoint** is less than 20nm from the 2nd point in the linestring, so my assumption is that this alert would return **true** , but alas it is **false**. Meanwhile, given the following code, in addition to that above:               var bounds = new OpenLayers.Bounds();     bounds.extend(new OpenLayers.LonLat(-110, 38));     bounds.extend(new OpenLayers.LonLat(-108, 40));     bounds.toBBOX();     var newFilter2 = new OpenLayers.Filter.Spatial({             type: OpenLayers.Filter.Spatial.BBOX,             value: bounds            });      alert(newFilter2.evaluate(filteredPoint));      That code gives a result of **true** inside of this bounding box.   I would think that the two bits of code are trying to find points in the block below represented by the asterisk. Am I wrong in interpreting DWITHIN as such?               ----------                     /     |      * |                 *--/     |  bbox  |                   /     |        |                  /     ----------                 /      Any tips or guidance in the right direction would be greatly appreciated. My overall goal is to determine how many points out of ~3700 points I have fall within a distance of the line.


Translating lat/lon coordinate on rotated/scaled maps

I need to indicate a lat/lon coordinate in an old map like this: http://www.davidrumsey.com/luna/servlet/detail/RUMSEY~8~1~3017~90020003:Topographical- Map-Of-The-City-and-C Projected on Google Maps: http://rumsey.geogarage.com/maps/g2784000.html I know the bounding box of the map as well as the dimensions of the image in pixels, but I couldn't figure out how to locate a lat/lon within this map. Upper left is (40.698291,-74.079051), Lower Left (40.659855,-73.979638), Lower Right (40.855232,-73.835582) and Upper Right (40.882919,-73.940263). Is there a standard formula on how to do locate a lot/lon datum in the historic map?


How do I import UK Environment Agency Lidar data (.asc) into Quantum GIS

I have downloaded Lidar data from the UK Environment Agency as ESRI ASCII files but being a complete novice as far as GIS is concerned I do not know how to view them. Quantum GIS was recommended to me so I have installed this. Any help gratefully received.


Geodjango InspectDB Fails on Postgis Raster_Columns View

I am trying to generate models for an existing Postgresql database using the `Django InspectDB` command. Models are produced but a failure occurs on the raster_columns view. The error is:                Exception: Could not find a geometry or geography column for "raster_columns"."extent". Inspectdb does not continue generating models for the remaining tables.      This makes sense because raster_columns is a system view created by Postgis. Looking at the definition of the geography/geometry_columns views, the raster_columns table is explicitly filtered out from them. Since the Extent field in raster_columns is a spatial type but does not exist in the geometry/geography_columns views, the model generation fails. Anybody know how to get around this aside from generating the models by hand? ...


Create Polylines from arrays of points

Let me describe the data setup. A line has been provided as an array of coordinate pairs, one for each vertex. This array is variable in size, anywhere from 2 to 200 coordinate pairs per line. What I am trying to wrap my mind around is the best way to create these lines. Arcpy and ArcObjects are both viable options, but ArcObjects is preferred due to its speed (generally). I have brainstormed a few methods, but they fall short for some reason or another: 1) I could use the Polyline class with arcpy to create polylines and then Copy Features, but the resulting geometry would not have any of the attribution necessary to identify said points. 2) I could use XY To Line, but this only works with one pair of point, and I require something much more robust. The **long and short** is that I require a method that can create a polyline from arrays and maintain a schema for data that I have created in a table. One idea I have is to create said table and schema, and then somehow create the polyline and copy its `shape` property to the output table, porting over the ID and whatever other attribution is needed. How can I go about creating the polyline's shape property without resorting to an intermediate shapefile? Or, if there is a better method that comes to mind, please share it with me. **Update** This code seems to work!               IFeatureClass fClass = gpUtil.OpenFeatureClassFromString(path);     IFeatureCursor cursor = fClass.Insert(true);     IFeatureBuffer buffer = fClass.CreateFeatureBuffer();          <snip...>          string[] nodearray = a.Split(';');     foreach (string i in nodearray)     {         query.WhereClause = "\"PNT_ID\" = '" + i+"'";         Console.WriteLine(query.WhereClause.ToString());         ICursor search = table.Search(query, false);         IRow row = search.NextRow();         float x = float.Parse(row.get_Value(2).ToString());         float y = float.Parse(row.get_Value(3).ToString());         int id = int.Parse(row.get_Value(1).ToString());         point.X = x;         point.Y = y;         point.ID = id;         point.SpatialReference = sRef;         pCollection.AddPoint(point, ref Missing, ref Missing);          }     IGeometry5 polygeo = (IGeometry5)pCollection;     buffer.set_Value(1, polygeo);     buffer.set_Value(2, wayid);     cursor.InsertFeature(buffer);


How do I create dynamic legend in REST?

I am going through Generate renderer sample in ArcGIS Java Script API and I want to make similar example using my rest service. I am going through the sample REST service and wondering that how they created dynamic legend in REST? I searched and tried to generate the dynamic legend at my end but its not displaying in REST. I am classifying data in Arc Map (using layer properties-- symbology) and publishing on server but not getting dynamic legend.. So any help will be great !! thanks in advance : ) Software's : ArcGIS Server & Desktop 10.1 and JSAPI 3.2/3.3


How to enable smooth zoom in Openlayers in default library set?

I've compared two Openlayers samples:   * Online dev example - clientzoom   * release dev example - clientzoom First one zooms in smoothly, second one just flashes and shows tiles from next zoom level. The only difference between those two versions is the library - release dev example (second) uses default multi-file version, while the first one - uses some compiled version (not sure from which tag). Question is: how to enable smooth zoom in Openlayers 2.12? Or how to enable smooth zooming in any Openlayers version ;) [Edit] The fluent zoom feature is included by default in 2.13 library:   * release dev example for 2.13 - clientzoom


Reducing the resolution of a huge raster

I'm not much of a GIS user, but I've got a big ascii file that I'm trying to convert into a               lat  long  data     x1   y1     d1     x1   y2     d2     x1   y3     d3     x2   y1     d4     ...     etc      format, so that I can work with it in R. I've got global national identifier data (i.e.: which country occupies what grid) at 2.5 arc-minute resolution, but I want to coarsen it into half-degree, because that is the resolution of the rest of my data. I could do so in R if the file weren't so large -- its 3.9GB and I can't read it into memory. A NetCDF file would obviously be ideal for me, but I can't find a netcdf version of the data I want. The data is categorical -- country identifiers. What I want to do is simple to take each 12x12 block of gridcells, evaluate that N=144 matrix, and return the country that appears the most times. (I'd also like it to ignore NA values, unless all values are NA). This would be easy enough in R if I could only open the darn text file. So I opened qgis, but there doesn't seem to be any obvious way to "coarsen" a raster. Is there one? Then it occured to me that I could convert the data to vector, and then convert it _back_ to raster, specifying the resolution that I want. BUT is there a way to do so that would allow me to specify that each gridcell should be .5x.5 degrees, going from -180 to 180 and -90 to 90? This seems like a pretty gross hack. Is there a better way? Thanks in advance for any tips. Edit: Thanks for the help all, but I've decided that it makes more sense for me to just make the file into a netcdf using a remote machine with the memory for it.


OpenLayers.Layer.Markers Does not works with Google maps

Hello I am currently Testing OpenLayers, but I have a problem with the markers, the markers that I add with OpenLayers does not work with google maps, all marks appear in the center of the map, not in the position that I established with open layers. With openlayers my marks works so fine. Any idea what is happens? Thank you. Note: i'm working with GeoExt2 for extjs 4.x


How write query in "Select_analysis" that compare string from one column with another column?

I have a shp file (s.shp) with column "A" and column "B". I try copy from this file only that rows where string value from column "A" is part of string value from column "B" e.g.               A       0.1       0.2       0.3            B       0.12       0.21       0.43      The output file should have two rows first and second. I try make:               import arcpy       source='c:\\MY\\s.shp'         output='c:\\MY\\o.shp'       arcpy.Select_analysis(source,output,"\"B\" like '%'||\"A\"||'%'")      but I have a error :( > ERROR 000358: Invalid expression "B" like '%'||"A"||'%' I use ArcMap 10.1.


MS4W (MapServer 4 Windows) - version 3.0.3 Crashes JVM and Tomcat frequently. How to fix this?

I am using MS4W (MapServer 4 Windows with **Java Mapscript** ) - v 3.0.3 for a GIS web application hosted over Tomcat 6.0.33 with Java jdk1.6.0_13 and PostgreSQL 9.1 with PostGIS 1.5.2 @ the database end. The GIS application has polygon,line and point spatial layers. The problem is that ms4w(MapServer) crashes the JVM & Tomcat very frequently for simple map functionalities such as pan, zoom-in and sometimes even at first time loading of the map. Attached is log file generated in E:\Program Files\apache-tomcat-6.0.33-for-ME\bin\ folder.hs_err_pid3848.log http://osgeo-org.1560.x6.nabble.com/file/n4995523/hs_err_pid5948.log **Is the MapServer MS4W Java API thread safe? Will making the method declarations in`edu.umn.gis.mapscript.mapscriptJNI` or `edu.umn.gis.mapscript.mapObj` classes as `synchronized` effect the API adversely?** I did try marking all the method declarations as `synchronized` in the `edu.umn.gis.mapscript.mapObj` class and few methods such as `mapObj_draw(..)`, `mapObj_drawQuery(..)`, `mapObj_drawLegend(..)`,`mapObj_drawScalebar(..)` and `mapObj_drawReferenceMap(...)` in `edu.umn.gis.mapscript.mapscriptJNI` class. This helped reduce the tomcat crashing issue. Is there any particular way to create (thread-safe) `mapObj` and using it? I have a common `mapObj` with all its properties like `mapHeight`,`mapWidth`,`boundingBox` coords shared by different mapping functionality methods such as zoom-in,zoom-out,pan,fullExtent,etc. Can anybody suggest me about the best way (thread-safe) to create and use the mapObj in MapServer Java Mapscript API? Regards, Shiva


GeoServer Web Map Service

I have added all data in PostgreSQL with the help of POSTGIS. I made a store in Geoserver, but after adding data when I click on the Open Layer option it does not open, and a file downloaded is shown at the bottom (showing WMS service). What is the problem?


QGIS crashes on exit()

Here his my test code               import os     print("in qgis, quitting")     os.sys.exit()      When i execute it in QGIS2.0 with line `qgis --nologo --code q.py` it shows an error on line 3 `os.sys.exit()` Can you tell me what is wrong with this?


Creating summary table using ArcMap 10.2 Report Wizard?

I've been having a play and reading the help about a part of ArcMap I don't really use and that is the Reports. I thought I would teach myself a bit more about this by creating a simple report, for which I have spectacularly failed! I have a point dataset, say with 100 points and there is a text field that gives each point a type. For arguments sake I have types A, B, C and D. I've been trying to create a single page that would give a count for each type, something that the Summary Statistics tool can do. The end result would be a nice looking report with a simple table like:               Type  Count     A      25     B      25     C      30     D      20      That is it! Nothing more complex. Have I misunderstood what a report is actually about? I've tried setting Group Levels, Summary Function to count and Summary Group properties and have not succeeded in creating a simple table.


How to interact with other layers in a QGis Python init function?

I am using QGis and making a Python script that sets the Python Init function to a custom UI file. I have a function with the following signature:               def formOpen(dialog, layer, feature):         ...      I can access the given layer and it's contents - this works fine. But what should I do in order to access other layers? My use case is the following: Whenever a given feature F of layer A is modified, I want to calculate the intersection of feature F with all geometry objects of layer B and show it to user. This information is later saved to the database. I understand that in order to do that, I should be able to access the interface object. In my plugin I save the reference to the interface by:               self.iface = iface.      However, the Python init function is out of my plugin. Should I put it inside my plugin? Or use global variables?


classify lines in shapefile by distance to other lines in same shapefile

I'm using ArcGIS 9.3 (and have XTools Pro). I need to classify each line in a shapefile by how close it is to other lines in the shapefile (ie less than 475 ft, less than 450 ft, less than 425 ft) and am unsure how - usually for things like this I use select by location, but it's always between two different shapefiles, not the same one. I can't easily split it up because there are ~200 lines.


How to convert from one ellipsoid to another?

## Introduction I have the following problem: I want to convert from WGS84 to "Anguilla 1957 / British West Indies Grid" (EPSG 2000). This seems to be straight-forward, as the transformation is a simple Transverse Mercator and the projection uses the Clarke 1880 Ellipsoid without any datum shift. My result differs significantly (some 400m) from the one i.e. epsg.io is returning. ## Problem The reason seems to be the datum transformation chain. Since the code is implemented such that it can convert from any cs to any cs, it also in this case does   1. WGS84 geographic -> WGS84 Geocentric (using the WGS ellipsoid)   2. WGS84 Geocentric -> Clarke 1880 Geocentric (nothing to do here)   3. Clarke 1880 Geocentric -> Clarke 1880 Geographic (now using the Clarke Ellipsoid) The last step is giving me a headache now, because the output of step 3 is _not_ equal to the input at step 1, while the same conversion returns the exact input on reference pages I've checked. ## Question Should and can a "Geographic Ellipsoid 1->Geocentric->Geographic Ellipsoid 2" Conversion change latitude and/or longitude? **Update** Here's the steps I take: I basically want to convert from WGS84 to Anguilla, British West Indies Grid (EPSG 2000). According to http://epsg.io/2000 this uses Datum 4600. This datum consists of the Clarke 1880 RGS ellipsoid 7012 and no datum transformation. I'm only considering the conversion from WGS84 to Datum 4600 here, because the rest is not relevant here. I'm getting `-63.000000000000014, 18.001851635270203, -78.860902368091047`, which is the exact same result as mkennedy below using a 0 0 0 transformation. However, If I input the same coordinates at http://epsg.io/4600/map, The output is precisely `-63, 18`. That's where the confusion comes from. May I assume that the web site is wrong and whatever coordinate system library they're using is incorrectly assuming that a conversion whose datum parameters are 0 can be skipped altogether?


How to Complete ModelBuilder Process Quicker?

I've built a script tool in ArcGIS's ModelBuilder to collect parameters from the user and use them as arguments for another python script. The output of this script is a text file. The only GIS processes being performed is a spatial and attribute query on a feature class. The python script runs with no problem however the processing of the tool in ArcGIS seems to take an inordinate amount of time closing out after completing the script when I have larger (but not too large) output text files. From the tool’s dialog box I would quickly (< 30 seconds) get the “Completed script …” message and my output text file is complete. When a small text (1-2 KB) file is generated the tool generates a 1 KB XML metadata file within 1 second completes with the “Succeeded …” message. However as my output text file gets larger so does the time taken from “Completed script” to “Succeeded”. For example; with a 122 KB output text file the “Completed script” to “Succeeded” process took 1 to 2 minutes and with a mere 366 KB output text file the “Completed script” to “Succeeded” process took over 10 minutes. Does anyone know what’s going on between “Completed script” and “Succeeded” and can make suggestions to speed this up other than adding code that will cause an error and force an immediate break at the of my code?


Expression with postgis

I'm using mapserver and PostGis and I want to draw a geometric table in mapserver. The trouble is when I connect mapserver to PostGis and I want to draw the objects but in different colours. I mean I have this code               LAYER     NAME "poligono"     STATUS ON     CONNECTIONTYPE POSTGIS     CONNECTION "host=localhost user=*** dbname=ejemplo password=*** "     DATA " geom from prueba using srid=4258"     TYPE LINE        PROJECTION         "init=epsg:4258"     END     CLASS         OUTLINECOLOR 0 255 255          END      And the table has 3 columns (gid[PK], name, geom), I want to change the colour for the different names. I tried whith               CLASSITEM "name from prueba"     CLASS         EXPRESSION "Distrito 1"             OUTLINECOLOR 255 255 255              EXPRESSION "Distrito 2"             OUTLINECOLOR 0 255 255              EXPRESSION "Distrito 1"             OUTLINECOLOR 0 128 255      But it doesn`t work. What do I made wrong?


My raster values are always changed to zero

I'm uploading a series of XYZ data points onto GIS and the co-ordinates are coming up fine, but some of the Z values are changed to zero - and in some cases, all! I've interpolated the majority of the data, but cannot for those with 0's across the board. Trawled these pages for answers but I just can't get my head around it. Would someone please put me out of my misery?


Correcting coordinates of CAD drawing imported into ArcGIS?

I am having some issues with some CAD drawings that I have imported to ArcGIS. I have a number of CAD drawings where by the features within the drawing have an error in their coordinates. For example, the CAD file has a coordinate like 308092578,52639792281 where as it should read 308092.578, 52639792.281. The result of this error is obviously causing the features to be placed far outside its actual location. Is there any way to correct this error outside of manually moving the features?


Get geometry from coordinates

I have a table with geometry column called point, saved in SRID 4326. I want to get the geometry by its coordinates, but something didn't work. I suspect database configuration or something. Here is what I do               select point from geom_data limit 1      And I get "0101000060E610000000000020558A5EC0000000C0F3B8424000B0CFCFA4717342" This as text is               select AsText(point) from geom_data where point = '0101000060E610000000000020558A5EC0000000C0F3B8424000B0CFCFA4717342'      And the result is "POINT(-122.161445617676 37.444938659668)" Trying this               select * from geom_data where ST_Contains(point, ST_GeomFromEWKT('SRID=4326;POINT(-122.161445617676 37.444938659668)'))      Didn't give a result. Tried this               select ST_PointFromText('POINT(-122.161445617676 37.444938659668)', 4326)      and get "0101000020E61000000F000020558A5EC0040000C0F3B84240" which is different. Selecting within bounding box didn't worked either               select * from geom_data where     st_x(point) >= '-122.161445617670' AND st_x(point) <= '-122.161445617679'     AND st_y(point) >= '37.444938659660' AND st_y(point) <= '37.444938659669'      Any ideas?


Flood extent extraction from satellite images

How i can extract the floodwater from satellite images? Is the image classification method accurate for moderate-resolution satellite (Terra/Aqua MODIS)? Or is there a more accurate methods? Thanks.