Looking for QGIS 2.4 C++ Hello World example?

In the project I'm working on (C/C++/Qt application), we are trying to integrate QGIS (latest version desirable, 2.4 for the moment). But there is very little information in the web on how to use QGIS C++ API. To start I wanted to write a simple code example (read shapefile and visualize it in a window). I found a code example for QGIS 1.8, but it does not work with QGIS 2.4 as the API has changed since. Then I tried to edit it in order to make it work with QGIS 2.4, but it did not succeed. Here is the original code:               #include <QtCore/QString>     #include <QtGui/QApplication>          #include <qgsapplication.h>     #include <qgsproviderregistry.h>     #include <qgssinglesymbolrenderer.h>     #include <qgsmaplayerregistry.h>     #include <qgsvectorlayer.h>     #include <qgsmapcanvas.h>          #include <iostream>          int main(int argc, char** argv)     {       // Creation of the Qt GIS application       QgsApplication app(argc, argv, true);            // Hard coded paths       QString myPluginsDir        = "/usr/lib64/qgis";       QString myLayerPath         = "./HelloWorld/GUI/data/helloQGIS.shp";       QString myLayerBaseName     = "helloQGIS";       QString myProviderName      = "ogr";            // Instantiate Provider Registry       QgsProviderRegistry::instance(myPluginsDir);            // Create a maplayer instance       QgsVectorLayer* mypLayer = new QgsVectorLayer(myLayerPath, myLayerBaseName, myProviderName);       QgsSingleSymbolRenderer* mypRenderer = new QgsSingleSymbolRenderer(mypLayer->geometryType());       QList <QgsMapCanvasLayer> myLayerSet;       mypLayer->setRenderer(mypRenderer);       if (mypLayer->isValid())       {         qDebug("Layer is valid");       }       else       {         qDebug("Layer is NOT valid");       }            // Add the Vector Layer to the Layer Registry       QList<QgsMapLayer*> theMapLayers;       theMapLayers.append(mypLayer);       QgsMapLayerRegistry::instance()->addMapLayers(theMapLayers, TRUE);            // Add the Layer to the Layer Set       myLayerSet.append(QgsMapCanvasLayer(mypLayer, TRUE));            // Create the Map Canvas       QgsMapCanvas * mypMapCanvas = new QgsMapCanvas(0, 0);       mypMapCanvas->setExtent(mypLayer->extent());       mypMapCanvas->enableAntiAliasing(true);       mypMapCanvas->setCanvasColor(QColor(255, 255, 255));       mypMapCanvas->freeze(false);       // Set the Map Canvas Layer Set       mypMapCanvas->setLayerSet(myLayerSet);       mypMapCanvas->setVisible(true);       mypMapCanvas->refresh();       mypMapCanvas->show();            // Start the Application Event Loop       return app.exec();     }      I've tried many different ways to modify this code in order to make it work with QGIS 2.4, but no success. The only source of information I've used is the official doc API. I said to myself that maybe someone has already did it and/or have any other code example of using QGIS 2.4. As GIS is a new domain for me, I have some difficulties in understanding how the API should work.


ArcGIS geoprocessing Metadata Translator error

We're using the ArcGIS Metadata Translator tool within ArcObjects.net using geoprocessing, which for the most part is working fine, but it's throwing us this error occasionally: > The process cannot access the file 'C:\Documents and Settings\\\Local > Settings\Temp\translator_source.xml' because it is being used by another > process. Failed to execute (ESRITranslator). The only reference I could find to this file is in a list of resolved issues for a Arc 9.3.1 update, which reads: > NIM036270 - Every other time you run the USGS MP Metadata Translator with > anything except XML files, the tool will fail with the error "The process > cannot access the file 'C:\Documents and Settings\aleta\Local > Settings\Temp\translator_source.xml' because it is being used by another > process." We are running ArcGIS 10 and our process is just running on feature classes and tables and exporting metadata to XML. The only thing I can think of that might be causing this is that it's likely that our server may be running more than one metadata update process at the same time, so multiple processes may be using this geoprocessing tool at the same time, but should that cause this issue? I assume ArcGIS handles multiple requests for a tool appropriately, but I could be wrong. Does anyone know? Has anyone come across a similar issue before? Does anyone know if this temporary location used by the tool can be changed?


Summarizing at Modelbuilder

I like to summarize of the ID-Field with the ModelBulider because in the end I have to build a tool. The problem I have is that the field “GRIDCODE” should get in the new table comma separate. So that it is possible to see the combinations, for example the ID-Field 244 has the GRIDCODE 7, 10, 10. The Field area should get added. ![enter image description here](http://i.stack.imgur.com/IG4ik.png) Background: The Field ID-Field is from a fishnet lying over a shape with a classification “GRIDCODE” and got intersect. Now I need just a table with the ID form the fishnetcell and the combinations of the classification-code and the area. Does anyone have an idea how to do this with the Modelbuilder? Thanks a lot. Here is the last part of the Model so far.![enter image description here](http://i.stack.imgur.com/GJYVS.png) The final table should look like this; in the field area should be the sum area from the combination. ![enter image description here](http://i.stack.imgur.com/1ZMxc.png)


ArcGIS Server: "MapServer is not supported with the current license."

I am at a complete loss... I have a Server 10.0 license on my machine but the following code fails:               if (ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Server) == false)         throw new Exception("License Failed");          MapServerClass mapServer = new MapServerClass();     mapServer.Connect(pathToMap); // Fails!       `ComException was unhandled` `MapServer is not supported with the current license.`


Intersection of triangle and polygon

I have a triangle and an arbitrary polygon lying on the same plane in 3D space. I need to find the fastest way to determine if these two intersect, one is inside the other, or completely separated. At first stage, it's not important to find the intersection points or tell the difference between the states when one is inside the other and when they intersect. The important thing is having the minimum number of calculations. Can someone guide me in the right direction?


Give Properties to a shapefile to be used by another person

I have bedrock geoology data. I want to classify the data so it appears with the same propeerties as it does on the suppliers website. Is there a way i can attribute a property to a layer (in this instance colour) so that when i add the layer to another project it has the same properties. In essence can someone send me a copied style? Working in qgis 1.8.0


How to define a css class for a delete button in Openlayers?

Define a css class for delete button in openlayers?                       .olControlDelete {          background-image: url("help.png");           background-repeat:no-repeat;          background-attachment:fixed;          background-position:center;          z-index:10;           }      Or                 div.olControlDelete {       top: 100px;       left: 50px;       position: absolute;            }            .olControlDelete div {       background-image: url("edit_sprite.png");       background-repeat: no-repeat;       width:  22px;       height: 22px;       border: thin solid black;       margin-top: 10px;     }      Don,t seem to work, Please help. Last question for openlayers. please Below Code from Vadin:                                deleteShape = new OpenLayers.Control.SelectFeature(     polygonLayer,      {         displayClass: "olControlDelete",         title: deleteFeature,         eventListeners: {             featurehighlighted: function overlay_delete(event) {                 var feature = event.feature;                 if( confirm(strConfirmMessage) ) { // prompt                     polygonLayer.removeFeatures( [ feature ] );                     // TODO other clean up - remove popups or send some ajax to server.  Up to you....                      }             }         }        }             );                      map.addControl(deleteShape);


Clarification of Map Scale

I need some clarification. I have a map the is set to the scale of 1:6000. In _Settings>Project Properties_ , under the General tab I have the Layer Units set to feet. Therfore I assume that means the scale is 1 foot equals 6000 feet. Does this seem rights? Or is it 1 inch equals 6000 inches? I am ultimately attempting to convert this to traditional engineering scale of 1 inch equal __ feet.


How to keep bound popups from opening on [click]?

I am working on a map application which creates and binds popups on markers and polyline objects. The popups are created and bound lazily, i.e. ad-hoc when a user clicks on a specific object. The reason for this is simply the performance, as we use handlebar templates to create quite extensive popups and doing this for hundreds of markers/polylines takes its toll on loading times... What I am actually trying to do is to open all popups (on markers, lines, ...) on [right click]. I have proper right-click event listener, and if a user right-clicks on an object for the first time, the popup is created and bound to said object _and then opened_. But _from then on_ , i.e. when a popup is already bound on a marker/line even a simple left-click will open the bound popup. This is somwhat confusing for users (as they can then suddenly use left-click OR right-click to show popups, but only on certain, i.e. already right-clicked-on elements...). Furthermore this interferes with a selection mechanism I implemented to allow users to select markers by left-clicking on them. Does anyone know how to **disable opening bound popups on clicks**?


Kernel Density Analysis using R and ArcGis

I am doing some Kernel Density Estimations, and like everyone elese I face difficulties with setting the bandwidth to create georeferenced rasters. ArcGis (10.1) does it just fine, but it has no built-in option to set a convenient bandwidth for your. However, using R's package spatstat, I have can better control the bandwidth, but I don't know how to export the result of the `density()` function to something that I could use with ArcMap.               > library(spatstat)     > data(redwood)     > denRedwood <- density(redwood, bw="SJ")     > plot(denRedwood)     > summary(denRedwood)     real-valued pixel image     128 x 128 pixel array (ny, nx)     enclosing rectangle: [0, 1] x [-1, 0] units     dimensions of each pixel: 0.00781 x 0.00781 units      Image is defined on the full rectangular grid     Frame area =  1 square units      Pixel values :             range = [0.937301342339499,123.501426710366]             integral = 64.6432674200093             mean = 64.6432674200093      As you can see, the output is a "pixel image". I tried with my own dataset, and the coordinates are conserved. So I am wondering how I can export this output into a raster I can use in a GIS. If I use the `tiff()` function to export as a .tiff file, I get the whole plot (with legend, title, etc.), not just the "real" data. Thank you for your help!


Calculating path sinuosity in postgis

Sinuosity is a fairly straightforward concept. How can this be calculated in postgis given a series of linestrings that represent the path?


How do I get geodatabase automatically upated from edits in access database?

I have an Access database that I have joined to a file geodatabase. There is a numeric field in the database that the symbology graduated colors is based on, ie: 0-39=red, 40-60 is orange, etc. I am wondering what is the best way to update/edit the data within the access database (because these numeric values will change over time) in order to have it automatically update the attribute table/symbology colors in the file geodatabase. I just have Arcview 10 and Microsoft access.


How to export map in draft mode?

ArcMap 10.2. I want to export map in draft mode. Without layers. Only few rectangles displaying main part of map, legend, scale bars, north arrows, margins and guide lines. E.g. something like this: ![enter image description here](http://i.stack.imgur.com/BllsD.jpg) Is it possible? I've tried to export by Export Map but I got normal map.


Mixing externalGraphic and default point renderer on VectorLayer

Is it possible to mix externalgraphics and the default point renderer for vector layers? I haven't been able to find an example that does this.


Converting Vertices of Polylines and Polygons to Points and Maintain Attributes

I'm pretty sure someone has done this before, but I'm having no luck. I'm using ArcGIS Standard version 10.2.1 and I want to convert all the vertices of a polyline or polygon to points. Essentially, I want to emulate the **Feature Vertices to Points tool** (which I can't use due to my ArcGIS license). I'm writing a python tool, so any answers should reflect a python/arcpy solution. Therefore, nothing like ET Geowizards, etc. I want to maintain the fields of the original data and in addition, add X and Y fields as well as a point identifier. So, if the input fields look like this:               LABEL |  TYPE  |  CODE     abc   |  type1 |  3     def   |  type2 |  4      Then the resulting output points might look like this:               LABEL |  TYPE  |  CODE  |  LONG  |  LAT  | ID     abc   |  type1 |  3     |  153   | -27.5 | 1     abc   |  type1 |  3     |  150   | -27.5 | 2     def   |  type2 |  4     |  151   | -30   | 1     def   |  type2 |  4     |  151   | -29.5 | 2     def   |  type2 |  4     |  151   | -30.7 | 3     def   |  type2 |  4     |  151   | -30   | 4      I've looked at **this solution** , which is fantastic and quick, but it doesn't maintain the fields of the original data. I've also looked at modifying **this blog post** which seems to be the most promising, but again, I can't figure out how to keep the original fields. My code looks something like this:               fields = arcpy.ListFields(input_fc)     arcpy.CreateFeatureclass_management(destination_workspace, point_file_name, "POINT")     for field in fields:         fieldnames.append(field.name)         if field.type in ('TEXT', 'FLOAT', 'DOUBLE', 'SHORT', 'LONG', 'DATE', 'BLOB', 'RASTER', 'GUID'):             arcpy.AddField_management(point_file_name, field.name, field.type, field.precision, field.scale, field.length, field.aliasName, field.isNullable)          fieldnames.append("SHAPE@JSON")     cursor = arcpy.da.InsertCursor(output_fc, fieldnames)          with arcpy.da.SearchCursor(input_fc, fieldnames) as c:             for row in c:                 geom = json.loads(row[-1])                 for path in geom['paths']:                     for pt in path:                         cursor.insertRow(row[0:-1],pt)      It's failing with the insert cursor. The error message I'm getting is: > Traceback (most recent call last):   >  File "H:\Python\CreatePoints_v0_2.py", line 60, in > cursor.insertRow(row[0:-1],pt) RuntimeError: Cannot find field 'LABEL' The input feature class has a field called "LABEL". However, it's not adding that label to the created feature class. Note, I want to convert _vertices_ , not centroids. I'm probably going about this the wrong way, so if anyone has ideas on how to either modify my code, or point me in another direction, I'd be appreciative.


OpenLayers and TInyOWS WFS won't load - 'InvalidParameterValue'

I've got a tinyows on localhost that works fine (both through browser GetFeature and QGIS). But my OpenLayers code fails. I've checked here: Display a WFS layer with OpenLayers and here : How to add a simple WFS layer from GeoServer to OpenLayers map? and other similar questions to no avail. Can anyone help? Here is the code:                   wfs = new OpenLayers.Layer.Vector("Editable Features", {         strategies : [new OpenLayers.Strategy.Fixed(), saveStrategy],         projection: new OpenLayers.Projection("EPSG:4326"),         protocol: new OpenLayers.Protocol.WFS({             version: "1.1.0",             srsName: "EPSG:4326",             url: "http://localhost/cgi-bin/tinyows",             featurePrefix: "tows",             featureNS :  "http://www.tinyows.org/",             featureType: "trad",             geometryName: "wkb_geometry",             schema: "http://127.0.0.1/cgi-bin/tinyows?service=WFS&version=1.1.0&request=DescribeFeatureType&Typename=tows:trad"         })     });           map.addLayers([gphy, wfs]);      Here is the xml according to Firebug:               <wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.1.0" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">      Here is the post response according to firebug:               <?xml version='1.0' encoding='UTF-8'?>     <ows:ExceptionReport       xmlns='http://www.opengis.net/ows'       xmlns:ows='http://www.opengis.net/ows'       xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'       xsi:schemaLocation='http://www.opengis.net/ows http://schemas.opengis.net/ows/1.0.0/owsExceptionReport.xsd'       version='1.1.0' language='en'>     <ows:Exception exceptionCode='InvalidParameterValue' locator='request'>     <ows:ExceptionText>XML request isn't valid</ows:ExceptionText>     </ows:Exception>     </ows:ExceptionReport>      Here is the tinyows config file:               <tinyows online_resource="http://127.0.0.1/cgi-bin/tinyows"          schema_dir="/usr/local/tinyows/schema/">     <pg host="127.0.0.1" user="postgres" password="****" dbname="****" port="5432"/>     <metadata name="TinyOWS Server"            title="TinyOWS Server - Demo Service" />     <layer retrievable="1"         writable="1"         ns_prefix="tows"         ns_uri="http://www.tinyows.org/"         name="trad"         title="Träd" />     </tinyows>      Can anyone help? Thanks in advance


ArcPAD 10 backup shp files?

Is there an automatic backup script for ArcPAD 10 when you are out in the field?


Algorithms for optimally locating points

I am trying to compare locations of where several thousand facilities have been actually built to where they would be optimally located to minimize travel times of the population (represented by census block or tract centroids). I'm having trouble finding much of anything on how to optimally locate points. I've got some idea of how to go about choosing these locations, but the sheer number of points to be placed in space means that any non-cleverly optimized algorithm is going to take a long time, possibly years. Thus my question: Are there **standard algorithms** for choosing **where to locate** a **fixed number of points**? I will ultimately take whatever algorithm I find as a starting point and adapt it to incorporate more information than just the population counts. Thus the preferred answer would include a detailed description of the algorithm, code, or be written in an open-source language, so that I can replicate and extend it. However, if ArcGIS has a convenient function for this optimization, I'd be happy to start with that.


How to change QGIS back to English?

When I booted up my windows machine this morning my menus had switch from English to what I think may be Russian and I can't read the menu options. I have tried unistalling, rebooting and then reinstalling but this has not helped. Can someone please advise me how to change them back. Thank you


Is it possible to publish a ArcGIS .mxd file in OpenLayers?

It is possible to publish a .mxd in OpenLayers? I am using ArcGIS 10.0.


What method should I use to accurately georeference a geographic map?

I'm writing an application that allows the user to sample points and perform georeferencing In order to test it I have a large scanned map (16k x 13k) pixels covering the area 31 north to 34 north and 34 east to 36 east with a geographic grid I sampled the 4 corners of the map + 2 points on the diagonal and applied an affine transformation :               [x']   [A B C]   [x]     [y'] = [D E F] * [y]     [1]    [0 0 1]   [1]      using the 6 points, and least squares I managed to find [A B C D E F], but applying it gave me an inaccurate transformation... The Longitude is very accurate all along the picture (> 1 arc second), but the latitude deviates sometimes up to 15 arc seconds (~ 400-500 meters) I assume that no matter how many points I will sample the affine transformation won't cut it... What is the appropriate transformation here? **EDIT: Trying to project the geographic coordinates** I projected the sampled points to UTM first, and then calculated the affine transform (again 6 points) The results are pretty much the same - Accurate near the control points but, drops significantly when I get farther **EDIT: Using 2nd Polynomial Transformation** I was able to get better results by using a 2nd order polynomial transform instead of an affine one, but I still get deviation of 4-5 arc seconds The transformation I used -               [x']  =  [A B C D E F] * [x*x]     [y']     [G H I K L M]   [y*y]                              [x*y]                              [ x ]                              [ y ]                              [ 1 ]      Where A-M are the transformation parameters {x',y'} are the geographic coordinates and {x,y} are the screen pixel coordinates. since there are 12 parameters it requires 6 points to be sampled... I suppose I could try to do a 3rd order transform (20 parameters - 10 control points needed) or even higher but I wonder if there isn't a better way?


GeoJSON layer with local projection in Leaflet

I try to add a GeoJSON layer to my map in Lambert II projection. The GeoJSON contains few points. It don't work if the GeoJSON have more than 1 feature, but for 1 feature, it work ! I don't know why (it's quite curious) but I have to put more than 1 feature in my map... My map with GeoJSON with 2 features (it don't work) My map with GeoJSON with 1 feature (it work !) Thanks for some help !


Conflicting measurement units with buffer ftools

I am new to qgis and I would like to create a buffer around point features. My goal is to create a quarter mile buffer (402.336m) around each point feature, using Geoprocessing Tools -> Buffer(s), setting the buffer distance and exporting. The process creates what appears to be a massive polygon. However when I use '.05' as the distance buffers appear around each point. I assumed this happened because the measurement units are not correct. I verified the project projection (NAD83 OH/South). Then I checked the Measure Tool via Options -> Map Tools. Te ellipsoid for distance calculations set at WGS 84 and the Preferred Measurement Units is set to 'meters' I have set up 'on the fly' projections How do I solve the mystery of this buffer problem? Setup: qgis 1.7, Ubuntu 11.04


dijkstra_sp runs without error in postgres query terminal, but triggers an error in Java

I am running this simple query **select id,gid from dijkstra_sp('roads',22,33)** This works perfectly fine and returns results in postgres query terminal. However running exactly the same query in java triggers the error: **** Could anyone tell me how to solve this issue? yours sincerely.


System requirement specification for Big Data Postgesql, PostGIS, and GeoServer based service

I want to start a GIS portal for around 3000-5000 visitors per day. MY database will be of an approximate size of 10 Terrabytes. The maps and layers are moderately complex, satellite-map overlay is supported. I am basically trying to project maps on the satellite images so people using my system can figure out the route they want to take. I will be using Geoserver, POST GIS, POSTGRE SQL for this purpose. Kindly, let me know what might be the hardware and/or software requirements to start such a project. Also kindly let me know the number and types of computing hardware that I may require for a smooth operation. Thanks in advance.


gdal_translate made wrong tranforms

I have a geotiff file in UTM and units in meters. I used gdal_translate with this command : `gdal_translate -of GTiff -a_nodata 0 -a_srs EPSG:4326 old.tif new.tif` gdalinfo on new.tif shows that the file units are in degrees while the data (corners,origin ...etc) are given in meters which is wrong. Is it possible to reverse/correct this action (on the new file) so I can get the file with either UTM in meters or go on and make the file in "real" degrees because I deleted the original file? Thanks.


How to calculate XY coordinates in Decimal Degrees from projected dataset in model or script?

Is it possible to calculate points XY coordinates in Decimal Degrees in model or script when a feature class is in projected coordinate system? It's easy when a FC is in geographic coordinate system:     * using Add XY Coordinates tool or      * using Python expression eg. `!shape.extent.XMax!`   I've found that area and length properties of geometry field can be modified with geometry unit conversion keyword. For linear units of measue one can use @DECIMALDEGREES.   Unfortunatelly, `!shape.extent.XMax@decimaldegrees!` doesn't work as XMax is not a length. In Calculate Geometry function (accessed from right-click) there's a possibility to choose Decimal Degrees output type even for projected feature class.   This should be easy in ArcGIS Python, isn't it?   * * * EDIT   Here's a code snippet based on iRfAn's solution:               import arcpy, os     projectedFC = r"C:\tmp\test.gdb\points01_Projected"     prjFile = os.path.join(arcpy.GetInstallInfo()["InstallDir"],                 r"Coordinate Systems\Geographic Coordinate Systems\World\WGS 1984.prj")     spatialRef = arcpy.SpatialReference(prjFile)          updCursor = arcpy.UpdateCursor(projectedFC,"", spatialRef)     for row in updCursor:         pnt = row.Shape.getPart(0)         row.X = pnt.X         row.Y = pnt.Y         updCursor.updateRow(row)          del updCursor, row


Network Analysis-shortest combined distance to one point

First let me confess I have little experience doing network analysis so I assume I know nothing (in essence approach me like my girlfriend does). Anyway, I am attempting to solve what I believe to be a routing problem. Please see the attached image. I have several points on a network and I would like to find the shortest combined distance from all green dots to the green square. I have attempted to do this using network analysis in ArcGIS 10.2 advanced (I also have QGIS installed and some experience with that) and while I get a solution it does not appear to take into account already established routes while computing. the problem seems easy and I am sure its user error but since I am the user I cannot answer myself. Thanks for the help! ![enter image description here](http://i.stack.imgur.com/sWt96.png)


Are there any document icons for the qgis mimetype?

In a default Ubuntu install (QGIS 1.8.0) no document icon is associated with the mimetype 'application/x-qgis-project'. As a consequence every saved QGIS document is interpreted by the OS as being a text or xml document and the icon displayed gives no indication it has anything to do with QGIS. I've googled around and can't find anything; I could make an icon set myself but wanted to see if I'm just missing something before doing it..


Where can I find latitude and longitude data for the borders of U.S. Congressional districts?

I'm interested in finding the most up-to-date latitude and longitude data for U.S. Congressional district borders. I'd prefer a human readable format (e.g. XML), but I'm writing my own code so I can work with just about anything if the format is well-defined. I only need the state, district, and the latitude and longitude points that define the borders for each district. I need the borders for all U.S. Congressional districts. Is this a dataset that I can download from somewhere all in one place? Or do I need to track down the data for each state individually? (Or even worse, each district?)


Java client for WFS-T?

I have a geoserver with a postgis database on one server and an Java application on a different server. Now I need to connect these two servers so that the Java application can manage (create, alter and remove features) on the geo server. I thought about implementing REST web services for the communication between the servers. But then I thought that WFS-T could be sufficient. Now the question. Are there any Java client implementations for WFS-T available?


Problem with Orfeo Toolbox integration in QGIS

I'm getting this error: OTB execution console output '"C:\OSGeo4W\bin\otbcli_MeanShiftSegmentation"' is not recognized as an internal or external command, operable program or batch file.


OpenLayers FramedCloud has transparent background

I am creating a FrameCloud popup instance and adding to the map using the following code:                 var popup = new OpenLayers.Popup.FramedCloud("popup",                     point,                     null,                     '<div> test context </div>',                        null, true);                      map.addPopup(popup);      Popup is displayed at the correct location but with a transparent background probably because I am using a local copy of OpenLayers.js instead of the public version. For local deployment, where do I put the resources found under the img folder required by OpenLayers?


MS SQL Spatial as Central Datastore?

I've been working on opening up our spatial data from a proprietry system to one that can be read by more products (MapGuide, ESRI, gvSIG, Map3D etc....) I've decided on using SQL Spatial as we have a server in house available to us and we can link to other systems easily enough through it. Before I go all out in actually using it as our central datastore is there anything I should be aware of that could greatly decrease performance?


Using Openlayers Protocol.HTTP GeoJSON format

just took Openlayers GeoJSON Example and inserted the features to file json1.json instead using a variable, then tried to preform HTTP call:                var epsg4326 = new OpenLayers.Projection('EPSG:4326'),             epsg900913 = new OpenLayers.Projection('EPSG:4326');             function init() {                 var map = new OpenLayers.Map({                     div: "map",                     projection: epsg900913,                     displayProjection: epsg4326, //Is used for displaying coordinates in appropriate CRS by MousePosition control                     layers: [                         new OpenLayers.Layer.WMS(                             "WMS", "http://vmap0.tiles.osgeo.org/wms/vmap0",                             { layers: "basic" }                         )                         ,new OpenLayers.Layer.Vector("GeoJSON", {                             strategies: [new OpenLayers.Strategy.Fixed()],                             protocol: new OpenLayers.Protocol.HTTP({                                 //readWithPOST: true,                                 url: "json1.json",                                 format: new OpenLayers.Format.GeoJSON()                             })                         })                          ],                     center: new OpenLayers.LonLat(-112.169, 36.099)                  });             }      The json1.json looks identical to OL example:                { "type": "FeatureCollection",         "features": [           { "type": "Feature",             "geometry": {"type": "Point", "coordinates": [102.0, 0.5]},             "properties": {"prop0": "value0"}             },           { "type": "Feature",             "geometry": {               "type": "LineString",               "coordinates": [                 [102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]                 ]               },             "properties": {               "prop0": "value0",               "prop1": 0.0               }             },           { "type": "Feature",              "geometry": {                "type": "Polygon",                "coordinates": [                  [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0],                    [100.0, 1.0], [100.0, 0.0] ]                  ]              },              "properties": {                "prop0": "value0",                "prop1": {"this": "that"}                }              }            ]          }        Found that the server not finds it: ![debugger](http://i.stack.imgur.com/VhsI1.png) But its there!


Measuring data load and redraw times in ArcMap?

Rephrasing of the question slightly to address some issues. Is there are standard way of measuring load times for data, specifically sybolised data, within ArcMap? In particular, we're comparing load times of different data formats (shapefile, SDE, file and personal geodatabases) across the network for the same (large) sets of data. We're also aiming to test speeds between ArcGIS versions. At this point I've started hacking together a simple VB script to do some of the timing without having to sit there with a stopwatch as @matt-wilkie suggested. The script (thus far) can be found at http://textsnip.com/8912ac/vb. The script was written in ArcGIS 9.3 but works in 9.2 as well. To use the script, copy the VB script to your mxd, and add two buttons, called "LoadDatasets" and "SymboliseDatasets". The LoadDatasets button allows the load of one or more feature classes or layers, and times the load. SymboliseDatasets checks the number of layers in the ActiveView, and if there are none, calls the load dialog (but doesn't time it). Once layers are added then the SymboliseDatasets button will symbolise all layers into 10 quantile groups based on their FIDs. I have fixed the issue of timing the rendering by adding a DoEvents after the ActiveView.Refresh In the meantime if anyone wants to pick this script up and modify it to make it more useful I'm happy to set this question to community wiki.


How can I export a sketchup Model to ArcGIS's Multipatch?

I have a very large model made in Google Sketchup v 7.1. I would like to export this to a Multipatch featureclass, so that I can view it in ArcScene, with other 3D data. I have tried several things, but none of them have worked. I have tried the following things: 1]Used the Sketchup Plugin for ArcGIS; For this I have saved the model as a skecthup 6 model, and on a machine which has Sketchup Pro 6 & ArcGIS 9.2, used the export as ESRI Multipatch. This works for small and simple modles, but fails on my Large Model. 2]Exported the Model as KMZ, and then tried to use the QuickImport using the InterOp Extension of ArcGIS. 3]Exported the Sketchup 6 Model as Google Earth 4 KMZ. Then I tried to use the QuickImport using the InterOp Extension of ArcGIS. This does import the KMZ to Multipatch, but it does not fall where I expect it to fall. Its size is very large as well (when compared to actual or expected size) Has anyone else managed to do something like this?


How can I include a map viewer into my web server from my ArcGIS Server?

I have a web server, what contains my website. I would like to put a map viewer into my site, what would connected to my ArcGIS Server. How can I do this in the easiest way? The ArcGIS Server and my web server are different servers.


Python GDAL/OGR: WGS84 & meters units

I'm dealing with shapefiles projected in:               GEOGCS["GCS_WGS_1984",         DATUM["WGS_1984",             SPHEROID["WGS_84",6378137,298.257223563]],         PRIMEM["Greenwich",0],         UNIT["Degree",0.017453292519943295]]      And I am experiencing technical difficulties to calculate a distance in (kilo)meters between two features. I can only get this distance in degrees. Here's my code:               def PointsOnLines(self, pointsLayer, linesLayer):         """ Returns the number of points situated on lines+(line.width) """         # pointsLayer: shapefile's layer with point geometries         # linesLaye: shapefile's layer with line geometries              nbFound = 0         for i in range(pointsLayer.GetFeatureCount()):             pointFeat = pointsLayer.GetNextFeature()             pointGeo = pointFeat.GetGeometryRef()                  for j in range(linesLayer.GetFeatureCount()):                 lineFeat = linesLayer.GetNextFeature()                 try:                     lineGeo = lineFeat.GetGeometryRef()                     lineWidth = lineFeat.GetFieldAsDouble("WD1") # Gets the width of the line segment (meters)                 except:                     pass                 d = lineGeo.Distance(pointGeo) # Computes the shortest distance between the 2 geometries (degrees)                 # if d<lineWidth then point is on the line, nbFound+=1      Should I reproject the shapefile and calculate afterwards? Ans if so, which projection is best suitable (=>meters units)?   Note that I can't use this post because I don't even know the 2 points I'm currently working with.


Matching ArcGIS and QGIS coordinate systems

I have the following info for a feature class in ArcGIS that is supposed to be in WGS 1984/UTM 16N **_projected_** coordinate system: > Projection: Transverse_Mercator > > False_Easting: 500000.000000 > > False_Northing: 0.000000 > > Central_Meridian: -87.000000 > > Scale_Factor: 0.999600 > > Latitude_Of_Origin: 0.000000 > > Linear Unit: Meter (1.000000) > > Geographic Coordinate System: GCS_WGS_1984 > > Angular Unit: Degree (0.017453292519943299) > > Prime Meridian: Greenwich (0.000000000000000000) > > Datum: D_WGS_1984 > > Spheroid: WGS_1984 > > Semimajor Axis: 6378137.000000000000000000 > > Semiminor Axis: 6356752.314245179300000000 > > Inverse Flattening: 298.257223563000030000 I also have a vector shapefile imported into QGIS that is also supposed to be projected WGS 1984/UTM 16N, with the EPSG 32616 and ID 3100. Since I don't know what the EPSG and ID means, I am not sure if the shapefile in QGIS and the feature class in ArcGIS are actually in the same coordinate system. Can anyone help with this? And if they are _not_ in the same system, what should I do to correct that?


Spatial Analyst Cell Statistics seems to give the wrong answer in ArcGIS 10.0

I have a script that calculates standard deviation for a list of grids using the Cell Statistics function in Spatial Analyst for ArcGIS 10.0 The syntax is this:               stdevGrid = arcpy.sa.CellStatistics(filteredGrids, "STD", "DATA")      However, the output of this command is obvious wrong. Some values are higher than the maximum values for any of the input grids. In Arctoolbox, I did the same calculation over the same grids and got an output that seemed much more reasonable. However, even using the python window in Arcmap produced the same wacky grid from the original command. In desperation, I tried to build the command using modelbuilder and check out the resultant code. The output used this command               arcpy.gp.CellStatistics_sa(filteredGrids,<pathForOutputGrid>,"STD","DATA")      I ran this in python and it got the same (correct) result as Arctoolbox, not the incorrect values that the original command did. The only thing I can figure is that there is an environment setting I'm missing, but as the new line in the exact same place in the original script produced a different output, I'm wondering if this is a bug in ArcGIS 10.0. Has anyone else run into something like this? Does anyone have any idea why this happens?


When using feature-linked annotation in ArcGIS 10, can I create multiple annotations from one feature?

I have a road that I want to create multiple annotations for. Is it possible to attach more than one annotation to the same feature?


Generating a dynamic graph on USA map

I want to reproduce the dynamic US map showing the obesity percentage across the years 1984-2009 as shown in the CDC website http://www.cdc.gov/obesity/data/trends.html I am looking for tools and code to get started on this. EDIT 1 (Apr 22 2011) I was able to gather the data (1994-2009) and I have uploaded it to Google docs in csv format. Using `R` and `googleVis` I was able to generate a map for a single year (say 1994) using `gvisGeoMap`. But I want to create a map which will motion through years 1994 to 2009. I am not sure how to add the _motion_ ability to `gvisGeoMap`. Do I need to look at some other tool?


Can you use CartoDB.js with maps hosted on the CartoDB website

is there anyway to use the cartoDB.js library with maps hosted on the CartoDB website? From the documentation it looks like the library can only be used for maps you make on your own website -- is that correct? Thanks Pete


Grouping lines together to form one line after a distance threshold is met: ArcGIS 10

I have lines on a map showing the most direct way from point data to the coastline (polygon). I would like to group the lines if they are close to each other by a distance that I can set. Where the clusters are, I'd like them all to group together when they get close enough to each other to become one line. What would be the best way to do this? Many thanks!! ![enter image description here](http://i.stack.imgur.com/oOl7U.png)


QGIS how to add string field

I have a few point shapefiles. I want to merge them, but first give each point a certain type according to shapefile. How do I add a String field, all with the same word? (changing the field type from null to "water") thanks. ![enter image description here](http://i.stack.imgur.com/FyAOc.jpg)


Which georeferencing method for Himalayan Awifs-Awifs registration

I would like to know which georeferencing method would provide the best result for Himalayan region in-case of Awifs(Raw) to Awifs(master) georeferencing.. I have already tried polynomial transformation but it shows shift and doesn't match accurately.. I tried rubber sheeting though and it give me comparatively good results with good matching but I am not sure it may cause distortion too at places and also cut the image from the outer GCP points.. kindly guide me if there is any other method where image is not cut and still I get good matching with the master image..I use ERDAS imagine for above operation


Sql to view points of intersection with line not working

I have two tables one called test lines and other points called testepoint with some geometries drawn in QGIS to test my sql. Are as in the image below: ![QGIS](http://i.stack.imgur.com/zlxgp.png) I want to select the points that inteceptam a row, the result should return me the id of these three points: ![Selected](http://i.stack.imgur.com/qWI7f.png) This is my sql that returns no records:                   Select testepoint."id"          FROM         testepoint     inner JOIN         teste         ON ST_Intersects(teste.geom, testepoint.geom)      Can anyone help me on what I might be doing wrong? I drew the shapes in QGIS using Google Streets layer based on EPSG: 3857 and carried in PostGIS * * * I ran the sql:                   Select testepoint."id"     FROM     testepoint     inner JOIN     teste     ON ST_DWithin(teste.geom, testepoint.geom, 1)     WHERE     teste."id"= 1       The result: ![result](http://i.stack.imgur.com/zlxgp.png) But I need this order: 1,2,4 The order of alignment. ![order](http://i.stack.imgur.com/qWI7f.png)


How to resolve a 'Received NULL pointer' ArgumentOutOfRangeException for OSGeo.OGR.Geometry.TransformTo?

I am attempting to project a geometry using the GDAL c# bindings and I'm getting a ArgumentOutOfRangeException ('Received NULL pointer') exception on the Transform methods of Geometry. I'm also getting the same exception when attempting to project a point using a `OSGeo.OSR.CoordinateTransformation` (e.g. http://gis.stackexchange.com/a/61574/31). I am using the DLL in FWTools 2.4.7\csharp. Has anyone seen this before and know what the fix is? Here's a test that creates the exception for me:                       [TestMethod()]             public void TransformPolygonReturnGeoJSON()             {                             string jsonLambert = string.Empty;                 string projectedJson = string.Empty;                      string wkt = "POLYGON ((1831321.945291 412165.262452,1831324.478486 412152.596478,1831312.445811 412108.265569,1831298.513239 412108.265569,1831287.747162 412108.265569,1831275.714486 412102.565881,1831271.914694 412100.032686,1831266.215006 412098.766089,1831253.549032 412188.694503,1831321.945291 412165.262452))";                 int srid = 102009;                      int outputSRID = 26918;                      string sridWKT  = string.Format("EPSG:{0}", srid);                      string outsridWKT = string.Format("EPSG:{0}", outputSRID);                      var g = Geometry.CreateFromWkt(wkt);                      var sr = new OSGeo.OSR.SpatialReference(sridWKT);                      g.AssignSpatialReference(sr);                      jsonLambert = g.ExportToJson();                      Assert.IsFalse(string.IsNullOrEmpty(jsonLambert));                      var outSR = new OSGeo.OSR.SpatialReference(outsridWKT);                      try                 {                     var result = g.TransformTo(outSR); // <--- Exception occurs here                          Trace.WriteLine(string.Format("result={0}", result));                          projectedJson = g.ExportToJson();                          Assert.IsFalse(string.IsNullOrEmpty(projectedJson));                 }                 catch (Exception ex)                 {                     Trace.WriteLine(ex.Message);                     Trace.WriteLine(ex.StackTrace);                          throw;                 }             }


Getting values from attribute table and inserting another table

I have line feature class of a river network and “FromTo” table. Lines are dissolved so they are not segmented from junctions. I need to write a Python script in ArcGIS to do following:   1. Begin from the first row in Hydro feature class attribute table and get its ID   2. Insert this ID into “From” field in “FromTo” table   3. Get ID(s) of line(s) which intersect(s) first line (e.g. second line intersect first line)   4. Inset ID into “To” field in FromTo table **For second loop**   1. Get ID of second row in Hydro feature class attribute table   2. Insert this ID into “From” field in “FromTo” table   3. Get IDs of lines which intersect second line (e.g. first and third lines intersect second line)   4. Inset IDs into “To” field in FromTo table   5. So on… Perhaps, you show a different way in order to get the same result by Python ![enter image description here](http://i.stack.imgur.com/XBgkF.png)


MapServer - Show Polygon Layer with non-transparent border and transparent background

In MapServer, I want to show a polygon WMS layer (watersheds). I want to show the boundaries (outlines) of the polygons as a non-transparent thick line. And I want to show the inside (fill) of the polygons with 50% transparency. Is this possible? I tried to set OPACITY 50, but this changes the transparency of both the outline and the fill. The second option I tried was to set TYPE line, but this shows the fill as complete transparent and the GetFeatureInfo no longer works by clicking inside the polygon. What I would like to get, is: The outlines of my polygons have 0% transparency. The fill of my polygons has 50% transparency.


Is it possible to add house numbers using the Mapbox Street Vector Tiles source in Tilemill2?

Title says it all. Does anyony know if the house number is included in Mapbox’ vector tiles, and if so how to access it for styling? Thanks for any advice!


How to split Relationship Class privileges between different users while maintaining referential integrity?

I am using a relationship class to maintain a one-to-many relationship between material sites (under Engineering's purview) and the material sites' sample status and content (under Materials' purview). I have privileged the tables such that Engineering personnel (user A) can edit the origin table and Materials personnel (user B) can edit the destination table. This works well, until user B needs to create a new record in the related table. In order to create a new record in the related table, user B must have editing privileges to the origin table. This is the only way to access the Attributes dialog from the Editor toolbar, which appears to be the only method which programmatically ensures the GlobalID and ParentGUID fields match. Otherwise, you have to rely on the user to copy/paste. Is there a workaround here? A way to split relationship class privileges between two different users while still maintaing referential integrity? Thank you! ArcGIS Desktop 10 (ArcInfo) SP3 ArcSDE 10


Convert x, y position in georeferenced image (with world file) to longitude, latitude?

What steps do I need to do in order to calculate longitude and latitude for a specific pixel in a georeferenced image? For example this image http://www.shadedreliefarchive.com/medit_Mideast_africa_copy.html contains information, .tfw file:               1627.32174969982000      0.00000000000000      0.00000000000000      -1627.32174969982000      -4957506.34276705000000      6096922.76188281000000       and .prj file:               PROJCS["Lambert Azimuthal Equal-Area",            GEOGCS["GCS_WGS_1984",                   DATUM["D_WGS_1984", SPHEROID["WGS_1984", 6378137, 298.257223563]],                   PRIMEM["Greenwich", 0],                   UNIT["Degree", 0.017453292519943295]],            PROJECTION["Lambert_Azimuthal_Equal_Area"],            PARAMETER["false_easting", 0],            PARAMETER["false_northing", 0],            PARAMETER["latitude_of_origin", 0],            PARAMETER["central_meridian", 20],            PARAMETER["xy_plane_rotation", 0],            UNIT["Meter", 1]]      I've created this snippet of javascript to compute new x1 and y1 values for specific pixels in the image:               var A = 1627.32174969982000,         D = 0.00000000000000,         B = 0.00000000000000,         E = -1627.32174969982000,         C = -4957506.34276705000000,         F = 6096922.76188281000000;          function x1(x, y) { return A*x + B*y + C; }          function y1(x, y) { return D*x + E*y + F; }      What more do I have to do to get longitude and latitude? For example C, F represents the top-left corner of the image, right? Then how do I translate C, F to get longitude and latitude? I want do do it using javascript only, have looked at http://proj4js.org/ but don't really understand what to do with the values I get...


Clip layers in a dataframe with a polygon in python?

I'm trying to clip layers in a dataframe with a polygon using python and I've done this python script but it's giving this error:`"ERROR 000840: The value is not a Feature Layer"` Thanks for any help.               import arcpy, os     from arcpy import env     from arcpy import mapping     mxd = mapping.MapDocument("Current")     df = mxd.activeDataFrame     polygon=r'C:\temp\extentPoly.shp'          for layer in mapping.ListLayers(mxd,"", df):         FL=arcpy.MakeFeatureLayer_management(layer,"_outlayer")         clipped_fc = env.scratchFolder + os.sep + "_clipped.shp"         arcpy.Clip_analysis(FL, polygon,clipped_fc)          del layer     del mxd     del df


How to forbid zoom map under scroll page?

I wrote code at ArcGis JavaScript. There is a map on web page at full display with a fixed height (400px) When i scroll-down page and cursor misses in zone map then browser works for zooming map, not scroll page further. How to forbid?


Capturing Feature Dragging and Dropping, ArcEngine 10 .net 4

I am currently trying to implement something that captures the feature that i clicked on and dragging. Basically i want to be able to "OnMouseUp" figure out the item I was dragging, so I can do some calculations on that feature. Does anyone have an idea on how to do that? Thanks and Regards, Kevin


QGIS custom action and button toggle

I've added a custom toolbar with some buttons to my QGIS 2 plugin. I'm wondering how to get the button toggled (pushed in-looking effect) using Python. I've gotten this to work for existing buttons like so:               iface.actionAddFeature().trigger()      I can't seem to figure out how to apply it to my own actions and buttons.


Map does not appear after following ESRI example of flex api

I followed the example from ArcGIS resource center website: https://developers.arcgis.com/flex/ to create a map, unfortunately after I run the flex builder application, the map does not appear. The following is my code and what happens after running the application. What's wrong with my project? I have tried to use IE, Chrome and Firefox to open the url, but the result is the same:               <?xml version="1.0" encoding="utf-8"?>     <s:Application     xmlns:fx="http://ns.adobe.com/mxml/2009"     xmlns:s="library://ns.adobe.com/flex/spark"     xmlns:mx="library://ns.adobe.com/flex/halo"     xmlns:esri="http://www.esri.com/2008/ags">          <esri:Map level="3" wrapAround180="true">         <esri:center>             <esri:WebMercatorMapPoint lon="0" lat="0"/>         </esri:center>         <esri:ArcGISTiledMapServiceLayer             url="http://server.arcgisonline.com/ArcGIS/rest/services/             World_Street_Map/MapServer"/>         <esri:ArcGISDynamicMapServiceLayer             url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/             Demographics/ESRI_Population_World/MapServer"              alpha=".70"/>      </esri:Map>          </s:Application>      ![enter image description here](http://i.stack.imgur.com/EyYxE.jpg)


ArcObjects - Select fields to Layout

I´ve a project wich I need to do the following task: there is several points with coordinates (X,Y) in the correspondent table. I select, manually, a few points and i want to, trought Arcobjects, send only the 2 fields Coordinates of the selected objects to the layout. Anyone know something or already did code for this? Thank you Alex


Issue with loading zoom slider and info template styling in ArcGIS Javascript API

I have been working on a web app that displays points based on a date query, and an infotemplate pops up when you click on a point. When the user clicks on a point, it retrieves the HTML contents of the infotemplate, but it appears as plain text on the map (no dijit window with an 'x' button in the corner). I assumed that I was loading the tundra CSS theme incorrectly, but that is not the case as I have removed the CSS reference from the HTML of other web maps yet they still retain the infotemplate box. I'm assuming it's an option in the map object but I have had no luck. ![The zoom bar and infotemplate are not styled correctly](http://i.stack.imgur.com/YATvM.png) As you can see, the zoom bar and infotemplate are not being styled correctly. Does anyone know how to resolve this, or know where these styles are derived?


Comparing TIGERLine 2006 (and prior) With New Shapefile Format

I have created a geo database using MySQL and the TIGERLine data files available from the US Census. This is actually an MSSQL database I created that I've transfered to MySQL. Everything works beautifully for geocoding and reverse geocoding. The only problem is that data is now almost 6 years old and I am looking for greater accuracy. I've looked at the 2010 TIGERLine files and noticed that they changed the format back in 2007 to a new Shapefile format. I've had some success using Ogr2Ogr in getting those shapefiles populated into a database but now I'm stuck. I was able to build my street segments table (center line data) easily with the 2006 data and the format made sense from a processing point of view but the new shapefile format doesn't seem as straightforward. Is there any documentation (and I've scoured the US Census Bureau) that relates the two formats? A side by side comparison of fields would be too much to ask, I'm sure, but that is exactly the kind of data that I'm looking for. Thanks in advance.


QGIS QgsOgrProvider library

I asked a question here: http://stackoverflow.com/questions/14790463/qgis- copy-layer-in-c-plugin and I was suggested to find the library which provides `QgsOgrProvider::createEmptyLayer()` function. Can anyone help me with this? Thanks.


Openlayers remove previously drawn polygon on starting to draw next one

Objective: At any point of time there SHOULD only be zero/one polygon(s) on a vector layer with a polygon control. I need the previous polygon to be removed as soon as user starts drawing the first vertex of the next polygon. Code:               var map = new OpenLayers.Map(mapDiv, options);     var tempLayer = new OpenLayers.Layer.Vector("Temp Layer");     map.addLayer(tempLayer);          var polyControl = new OpenLayers.Control.DrawFeature(tempLayer,OpenLayers.Handler.Polygon);          polyControl.events.register('featureadded', ' ', removeExistingPolygon);          function removeExistingPolygon(feature) //Assuming event listener gets a feature object     //Written mainly with featureadded in mind     {       if(feature.layer.features.length > 1){         feature.layer.removeFeatures(feature.layer.features[0]);       }     }          tempLayer.events.register(<event_name>, ' ', <prev_polygon_removal_function>);      Question: What event_name and function should I use to attain the objective? I have tried 'sketchstarted' on tempLayer but it gets triggered even before user starts to draw a polygon. 'vertexmodified' doesn't seem to work at all. Objective is partially satisfied when using featureadded with polyControl but in that case the first polygon remains visible till the second one is completed. Any pointers on how to proceed are most appreciated. Thanks.


How can I disable snapping on one feature layer, among many feature layers on the map?

I'm using ArcGIS Flex API 3.1. I'd like to know if it is possible to choose the layer(s) on which I can snap the graphic I'm moving. Currently, when I activate snapping, my graphics are snapped on all feature layers of the map. I don't want this behaviour. I want to be able to snap only on one feature class. Resgards


Unable to zoom map tile

I try to host osm map locally on my server. I follow this tutorial Rendering OSM on ubuntu And manage to installed mapserver and mapcache. The problem is, when I try to zoom the map it can only zoom once and other will just repeatedly create the same tile, sorry i couldnt post the image, since im new here What I understand is when I enter : localhost/mapcache/demo/tms then apache server will look for xml file (mapcache-osm.xml) and the xml file will find call the mapfile and then it will generate the tile. Is it true? Please correct me. I still couldnt figure out how to make the zoom right, did I miss something on installation? I also test the TMS on opelayer site as recommended by the tutorial site. But the result is the same. I thought if the mapfile and database(postgis) connect successfully then it will generate the tile and I will be able to see all the tile at any zoom level. Or is there something that I need more to create the zoom features? Beacuse I found that if I enter localhost/mapcache/demo/tms then the xml file generate openlayers automatically. Am I wrong? Please correct me with the concept. Any help I really appreciate. Thankyou very much


How do I use the Natural Earth SQLite DB with QGIS?

I just downloaded the Natural Earth data in SQLite format from http://www.naturalearthdata.com/downloads/. I had assumed that this would be a SpatiaLite database, but it appears not to be! QGIS is failing to recognize it as a spatial database. OGR supposedly supports reading geometries even when stored in a plain SQLite database, but maybe QGIS doesn't use OGR for SpatiaLite? The SQLite database does have geometry_columns and spatial_ref_sys tables. Is there some way to convert it to a full SpatiaLite database?


How to Update Multiple Fields of one Layer Using WFS Service

Trying to update two fields of a shapefile using a WFS update service published from GeoServer 2.4.3 with OpenLayers 2.13.1. I have a JavaScript with all the OpenLayers fun and a HTML document with all the interface fun. Essentially the user clicks on an object and updates a form and then saves it. Assuming its possible? It's probably really simple but I can't crack it. The fields do not update and in the demo requests the service times out. Here is the code I am trying;               function saveHandler() {     newDim = document.getElementById("dimension").value;     var num = parseFloat(newDim);     var newDimRound = num.toFixed(3);     newMaterial = document.getElementById("MaterialDD").value;          var saveDetails = OpenLayers.Request.POST({             url: '<url of wfs service>',             username: '<username>',             password: '<password>',             data: '<wfs:Transaction service="WFS" version="1.1.0"\n' +                             'xmlns:topp="http://www.openplans.org/topp"\n' +                             'xmlns:ogc="http://www.opengis.net/ogc"\n' +                             'xmlns:wfs="http://www.opengis.net/wfs">\n' +                             '<wfs:Update typeName="Store:Layer">\n' +                             '<wfs:Property>\n' +                             '<wfs:Name>Field 1</wfs:Name>\n' +                             '<wfs:Value>' + newDimRound + '</wfs:Value>\n' +                             '<wfs:Name>Field 2</wfs:Name>\n' +                             '<wfs:Value>' + newMaterial + '</wfs:Value>\n' +                             '</wfs:Property>\n' +                             '<ogc:PropertyIsEqualTo>\n' +                             '<ogc:PropertyName>Spatial_ID</ogc:PropertyName>\n' +                             '<ogc:Literal>' + getSpatial_ID + '</ogc:Literal>\n' +                             '</ogc:PropertyIsEqualTo>\n' +                             '</wfs:Update>\n' +                             '</wfs:Transaction>\n',             callback: handler         }); // end of Post              function handler(updateSQL) {             alert("Details Saved!")         } // end handler         };      I have tried putting the fields in their own property sections and different orders to no avail.


How to fix incorrect displaying of icons in model from ModelBuilder of ArcGIS 10.1?

Something weird happened with icons in my model. They are displaying incorrectly as you can see here ![Here](http://i.stack.imgur.com/9j7Xt.jpg). In other models all is just fine.


Adding GIS feature into an existing postgis table using django 1.6

i am using Django 1.6 on my web map. the problem i got is that i cannot import shapefile with features about 200. . the console has given me this traceback. .               Saved: 162-05-0001-005-31     Saved: 162-05-0001-005-32     Saved: 162-05-0001-005-42     Saved: 162-05-0001-005-41     Saved: 162-05-0001-005-40     Saved: 162-05-0001-005-39     Saved: 162-05-0001-005-38     Saved: 162-05-0001-005-37     Saved: 162-05-0001-005-36     Saved: 162-05-0001-005-25     Saved: 162-05-0001-005-24     Saved: 162-05-0001-005-23     Saved: 162-05-0001-005-27     Saved: 162-05-0001-005-35     Saved: 162-05-0001-005-22     Saved: 162-05-0001-005-26     Saved: 162-05-0001-005-21     Saved: 162-05-0001-005-28     Saved: 162-05-0001-005-33     Traceback (most recent call last):       File "<console>", line 1, in <module>         File "C:\CLAIMS_WEB\Apps\load_parcel.py", line 15, in run         lm.save(strict=True, verbose=verbose)       File "C:\Python27\lib\site-packages\django\contrib\gis\utils\layermapping.py",      line 596, in save         _save()       File "C:\Python27\lib\site-packages\django\db\transaction.py", line 339, in inner         return func(*args, **kwargs)       File "C:\Python27\lib\site-packages\django\contrib\gis\utils\layermapping.py",      line 512, in _save         kwargs = self.feature_kwargs(feat)       File "C:\Python27\lib\site-packages\django\contrib\gis\utils\layermapping.py",      line 292, in feature_kwargs         raise LayerMapError('Could not retrieve geometry from feature.')     LayerMapError: Could not retrieve geometry from feature.     >>>     >>>      But when I import shapefile with less feature, the import is successful. actually i divided my shapefile into 2 so as to do a little experiment . Now, since i have imported the first half of my shapefile, i wanted to append the other half to my existing postgis table. . i got a thought of it as it might answer my problem. . how would i do that? can anybody give ideas how may i append my shapefile to the existing postgis table?? or could somebody tell me what is going on with my Django that it cannot import a lot of shapes into the database. ? Lots of thanks to you for entertaining my post. .


About getting area from DEM below 5000 and below 3000 m elevation?

I want to get the area from the DEM which is below 5000 and 3000. Actually I need those two areas for my Regression Model to calculate the discharge. In that case, how can I find out using python. I need to calculate in each cell of the stream segment. I have tried with Surface Volume tool but it is taking too long time as i need to calculate for all the cells along the stream segments. Is there any easy and fast way to get this information.


How to find the smallest-area ellipse circumscribing a convex polygon?

We are currently dealing with the problem of:   **How to find an ellipse circumscribing a convex polygon?**   Recent googling and lots of reading could **not** help me so much :(   ![enter image description here](http://i.stack.imgur.com/74McY.png)


split string after first word

I want to split a string field after the first word using the space as a delimiter so that "WA ROSSOUW ORANJE BELEGGINGS" becomes "ROSSOUW ORANJE BELEGGINGS". I am using Arcmap10. Thanks.


Add XY Column in QGIS

Following on from a previous question of mine, where I was given coords in degree-mins, I have successfully converted them to decimal degrees, thanks for the help. I have created a CSV file from the stated coordinates, and then created a shapefile. The CRS was EPSG:4326 (WGS84). The remainder of my mapping is displayed in TM65/Irish Grid (EPSG:29902). With the on the fly projections activated, everything is displayed properly. I need to provide this to a 3rd party. How do I use QGIS to add a geometry colunm using the Current CRS? Using either QGIS 1.8 or 2.0.


How we add XY coordinates (in the attribut table) from shapefile (points) using QGIS?

> **Possible Duplicate:**   >  How to get the coordinates in Lat/long from a point layer? I created a new shape file and edited to add points at specific location. Now, I would like to extract the XY coordinates from these points using QGIS. How I do it?


I would like to show points moving on a map by date

I would like to create a map where i can see points moving. I have table of points for example with a date column,               A 01/01/2012     B 02/01/2012     C 03/01/2012      D 04/01/2012     E 05/01/2012     F 06/01/2012      I would like to show them date after date ( 01/01/2012, 02/01/2012...): First screen we will see only the point A, second screen will show us B ... How can we do it? I am using QGIS and Mapinfo. thank you


Which interface can replace an IArcPadExtension?

I trying to migrate a code written for arcgis desktop and I have there a IArcPadExtension, but here (http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/type_changes_between_9_3_and_10/000100000408000000/) we can read that this Interface removed. Can someone tell me which interface can be used instead of IArcPadExtension?


How to hide/suppress and rename/alias fields when exporting to KML?

I have a feature class that needs to be exported to a KML file. I wonder if there is a way for me to export only some of the columns of the feature class's attribute table; some attributes are not needed in the KML file. Also, some of the column headings of the attribute table need to be edited to make them more understandable by a layperson. Is there a way of doing this when exporting to KML? Or, is there a way to make these edits in a KML file once it already exists? I'm exporting from ArcGIS 10.0, in case this helps.


Error when creating insert cursor in arcpy

I've written several scripts that copy data from MS Access db into a new, empty ESRI Geodatabase. I've pretty much copied the code and changed it for each table -- the first two scripts have worked as expected, but the third is **throwing an error on the line used to create the Insert Cursor.** All of the variables are storing correctly at the top of the script, but the Insert Cursor is never created. Error Message: > Runtime error Traceback (most recent call last): > > File "", line 49, in File "c:\program files > (x86)\arcgis\desktop10.1\arcpy\arcpy__init__.py", line 1005, in InsertCursor > return gp.insertCursor(dataset, spatial_reference) > > File "c:\program files > (x86)\arcgis\desktop10.1\arcpy\arcpy\geoprocessing_base.py", line 383, in > insertCursor self._gp.InsertCursor(*gp_fixargs(args, True))) > > RuntimeError: ERROR 999999: Error executing function. Code:               #Import modules, environment settings     import arcpy     arcpy.env.overwriteOutput = True          # Database connection variables     geodatabase = 'P:/GIS_Development/ArcGIS Database Design/Landowner.gdb/Parcels'     accessDatabase = 'Y:/Database/LANDOWNER/NewLandowner.mdb/TblParcels'          #Create cursor for ACCESS Database and New Landowner GDB     accessCursor = arcpy.SearchCursor(accessDatabase)          # Create a variable that stores the value for column in a given row in the access table          for accessRow in accessCursor:              parcelID   = accessRow.getValue('Parcel_ID')         flag       = accessRow.getValue('Flag')         agreeID    = accessRow.getValue('Agreement_ID')         agreeStat  = accessRow.getValue('AgreementStatus')         ownerType  = accessRow.getValue('Owner_Type')         add1       = accessRow.getValue('Parcel_Address1')         city       = accessRow.getValue('Parcel_City')         county     = accessRow.getValue('Parcel_County')         state      = accessRow.getValue('Parcel_State')         zipCode    = accessRow.getValue('Parcel_Zip')         acreage    = accessRow.getValue('Acreage')         landClass  = accessRow.getValue('Land_Class')         mapGrid    = accessRow.getValue('Map_Grid')         parcelNum  = accessRow.getValue('Parcel_Num')         parcelCom  = accessRow.getValue('Parcel_Comments')         enterRes   = accessRow.getValue('Entry_Restrict')         enterCom   = accessRow.getValue('Entry_Comments')         contacted  = accessRow.getValue('Contact_Made')         appStatus  = accessRow.getValue('ApprovalStatus')         owner      = accessRow.getValue('Owner')              # "Paste" the stored value from the access table into the new geodatabase         gdbCursor = arcpy.InsertCursor(geodatabase)         row = gdbCursor.newRow()              if state:             state = state.upper()              #Fill out fields with variables that are storing MS Access data         row.Parcel_ID            = parcelID         row.Flag                 = flag         row.Agreement_ID         = agreeID         row.Agreement_Status     = agreeStat         row.Owner_Type           = ownerType         row.Address_Line_1       = add1         row.City                 = city         row.County               = county         row.State                = state         row.Zip_Code             = zipCode         row.Acreage              = acreage         row.Land_Classification  = landClass         row.Map_Grid             = mapGrid         row.Parcel_Number        = parcelNum         row.Parcel_Comments      = parcelCom         row.Entry_Restrictions   = enterRes         row.Entry_Comments       = enterCom         row.Contact_Made         = contacted         row.ApprovalStatus       = appStatus              # Insert new row into Geodatabase         gdbCursor.insertRow(row)


What is the easiest way to calculate borehole deviation?

![enter image description here](http://i.stack.imgur.com/Qneo3.jpg) Does anyone know if there was a program or specific method (calculations) in order to create a deviation value based on querying specific geological and drilling variables?


Geometry has incorrect latitude-longitudes

* `SELECT ST_SRID(geom) AS s FROM zones GROUP BY s;`   returns a single record: `4326`   * `SELECT Find_SRID('public', 'zones', 'geom');`   returns `4326`   * `SELECT AsText(geom) FROM zones`   returns geometry like: `MULTIPOLYGON(((495468.88595 5464400.7263,495468.89 5464401.38005,...)))` Shouldn't my geometry been standard lat-lngs? Something like:               MULTIPOLYGON(((-122.968967906831 49.31253667013,-122.970356138605 49.3125609975662...)))      I tried executing both of these queries, but neither worked: `SELECT UpdateGeometrySRID('zones','geom',4326);`   `UPDATE zones SET geom = ST_Transform(geom);` How can I transform the geometry into my desired format?


Need to learn more about Precision and Accuracy

I am currently taking Introduction to Image Interpretation online and there is a section in it that talks about Precision and Accuracy. I wanted to know if someone out there has any good information that I can use to learn more about it.


Using Spatial Analyst Sample tool

I have a bunch of rasters and a point file. I need the information from ll the raster files to be added to my points. My usual workflow is to use the Spatial Analyst sample tool. It works fine and I can do a spatial join to get the information added to the point file. However, furstratingly the sample tool never seems to offer useful field headings and with a lot of rasters it can become confusing as to which value relates to which raster. Does anyone know of a script or workaround that can produce a table with field headings?


ArcGIS forces me to close the program using select layer by attribute

I am using ArcGIS 10.2 At the moment, I am trying to select from a layer of different polygons specific polygons from a specific area but when I am using the tool select Layer by attribute, ArcGIS get stack and It forces me to close the program, what it could be the problem?


Could not commit changes to layer X

I am editing a layer's (Z) attribute table. I made some columns, used the field calculator to fill them up, made some more, went back and deleted some and then tried to save the edits and got the error message: "Could not commit changes to layer Z. Errors: ERROR: 3 attributes not deleted. Success 2 attributes added Success: 10 attribute values changed" Then I closed the error box and the layer remains in edit mode and one can't save it. I tried to save the Z layer and got the same "Could not ..." but also with "OGR error deleting field 3: Invalid field address" I saved the project and then reloaded the project to find that all the columns in layer Z had been wiped out except an ID layer. The layer Z is ruined. v 1.8.0. What is going on? - thanks.


How to update a SLD file in GeoServer?

I'm working on my own geoportal. I have prepared a php page which users can describe their own SLD configuration. The SLD file will be stored in GeoServer style folder. But when I tried to view maps I couldn't see the changes on map. But if I go to the styles editor and click to the Submit button in my new SLD files, I can see the new SLD configuration on my map. I think Submit button is making some another configuration that ı don't know. Are there any way refreshing the style edits?


Heatmap algorithm to visualise point diversity

Can anyone suggest an algorithm to generate a heatmap for visualising point diversity? An example application would be for mapping areas of high species diversity. For some species, every single plant has been mapped, resulting in a high point count, but with very little meaning in terms of the diversity of the area. Other areas genuinely have high diversity. Consider the following input data:               x    y      cat     0.8  8.1    B     1.1  8.9    A     1.6  7.7    C     2.2  8.2    D     7.5  0.9    A     7.5  1.2    A     8.1  1.5    A     8.7  0.3    A     1.9  2.1    B     4.5  7.0    C     3.8  4.0    D     6.6  4.8    A     6.2  2.4    B     2.2  9.1    B     1.7  4.7    C     7.5  7.3    D     9.2  1.2    A      and resulting map: ![grid plot](http://i.stack.imgur.com/8kp2h.png) In the upper left quadrant, there is a highly diverse patch, while in the lower right quadrant, there is an area with high point concentration, but low diversity. Two ways to visualise the diversity could be to use a traditional heatmap, or to count the number of categories represented in each polygon. As the following images show, these approaches have limited use, since the heatmap shows the greatest intensity in the lower right, while the binning approach would look exactly the same if there were only one category (this could be addressed by increasing the size of the polygon bins, but then the result becomes unnecessarily granular). ![heatmap](http://i.stack.imgur.com/xYFtG.png) ![enter image description here](http://i.stack.imgur.com/k3r9h.png) One approach I thought of to do this would be to prime a traditional heatmap algorithm by the number of points of different categories within a defined radius, and then using that count as the weight for the point when generating the heatmap. However, I think this might be prone to unwanted artefacts, like mutual reinforcement leading to very sharp results. Also, closely mapped points of the same type would continue to show up as high concentrations, just not to the same extent. Another approach (probably better but more computationally expensive) would be:   1. Calculate the total number of categories in the dataset   2. For each pixel in the output image:      * For each category:        * calculate the distance to the nearest representative point (r) [probably limiting by some radius beyond which influence is negligible]       * add a weighting proportional to 1/r2 Are there already algorithms that I'm not aware of to do this, or other ways to visualise diversity? **Edit** Following Tomislav Muic's suggestion, I have calculated the heatmaps for each category, and normalised them using the following formula (QGIS raster calculator):               ((heatmap_A@1 >= 1) + (heatmap_A@1 < 1) * heatmap_A@1) +     ((heatmap_B@1 >= 1) + (heatmap_B@1 < 1) * heatmap_B@1) +     ((heatmap_C@1 >= 1) + (heatmap_C@1 < 1) * heatmap_C@1) +     ((heatmap_D@1 >= 1) + (heatmap_D@1 < 1) * heatmap_D@1)      with the following result (comments under his answer): ![normalised sum](http://i.stack.imgur.com/iXlVH.png)


Arcobjects in Python, inherit from Abstract Class

As for question, I am trying to adjust Grid Map labels via Arcobjects with Python. For now I do have:               from comtypes.client import CreateObject, GetModule     import arcpy          def CType(obj, interface):        """Casts obj to interface and returns comtypes POINTER or None"""        try:            newobj = obj.QueryInterface(interface)            return newobj        except:            return None          def NewObj(MyClass, MyInterface):        """Creates a new comtypes POINTER object where\n\        MyClass is the class to be instantiated,\n\        MyInterface is the interface to be assigned"""        from comtypes.client import CreateObject        try:            ptr = CreateObject(MyClass, interface=MyInterface)            return ptr        except:            return None          esriCarto = GetModule(r"C:\Program Files (x86)\ArcGIS\Desktop10.0\com\esriCarto.olb")     esriCartoUI = GetModule(r"C:\Program Files (x86)\ArcGIS\Desktop10.0\com\esriCartoUI.olb")     esriMapUI = GetModule(r"C:\Program Files (x86)\ArcGIS\Desktop10.0\com\esriArcMapUI.olb")     esriFrame = GetModule(r"C:\Program Files (x86)\ArcGIS\Desktop10.0\com\esriFramework.olb")          arcpy.SetProduct('Arcinfo')          pApp = NewObj(esriFrame.AppROT, esriFrame.IAppROT).Item(0)     pDoc = pApp.Document     pMxDoc = CType(pDoc, esriMapUI.IMxDocument)     pLayout = pMxDoc.PageLayout     pGraphContLayout = CType(pLayout, esriCarto.IGraphicsContainer)     iFrameElement = pGraphContLayout.FindFrame(pMxDoc.ActiveView.FocusMap)      As far as I understand, iFrameElement is an interface of an abstract class from which I need to inherit attributes (pointer) to MapFrame object. How do I do that? How do it get to object with IMapGrids interface. Any suggestions?


Rotate Selected Features ArcGIS 10 - VBA

I am attempting to loop through polygon features and rotate pairs of features by a specified angle. Pseudo logic: 1) Open up a standalone table in the map document and retrieve a unique identifier that will used to select a pair of polygons from a feature class. This code works just fine. Code retrieves the identifying value for selecting the polygons and the rotation angle. 2) Create a selection using the unique identifier. In this application only two records will be returned. 3) Rotate the selected polygons around the SelectionAnchor 4) Advance to the next standalone table record, repeat making selection and rotation Every works fine up to the point that the rotation routine attempts to apply QuerryCoords on the selection anchor. The SelectionAnchor is seen as empty geometry. If I manually select the polygon set, and run the RotateSelectedFeatures routine, it produces the desired outcome. Code for selection features:               Sub RotateSelectedFeatures()         Dim sHRMashUP As String         Dim intLayerCnt As Integer         Dim pMXDoc As IMxDocument         Dim pMap As IMap         Dim pFeatureLayer As IFeatureLayer         Dim pDataset As IDataset         Dim pUID As New UID         Dim pEditor As IEditor         Dim pRotatePoint As IPoint         Dim pEnumFeature As IEnumFeature         Dim pFeature As IFeature         Dim pRotateSet As ISet         Dim pFeatureEdit As IFeatureEdit         Dim pFeatureSelection As IFeatureSelection         Dim pQueryFilter As IQueryFilter         Dim sSQL As String         Dim pActiveView As IActiveView         Dim pInvalidArea As IInvalidArea         Dim pStartPoint As IPoint         Dim origX As Double         Dim origY As Double              Set pMXDoc = ThisDocument         Set pMap = pMXDoc.FocusMap         Set pActiveView = pMap              pUID.Value = "esricore.Editor"              Set pEditor = Application.FindExtensionByCLSID(pUID)              'Name of layer with home range polygons         sHRMashUP = "HomeRangePairs_Mashup_2"              'Loop through the table of contents to see which layer is the target home range poygons identified above         For intLayerCnt = 0 To pMXDoc.FocusMap.LayerCount - 1             If pMXDoc.FocusMap.Layer(intLayerCnt).Name = sHRMashUP Then                 Set pFeatureLayer = pMXDoc.FocusMap.Layer(intLayerCnt)             End If         Next intLayerCnt                   If pEditor.EditState = esriStateEditing Then             pEditor.StopEditing False         End If              If pEditor.EditState = esriStateNotEditing Then             Set pDataset = pFeatureLayer.FeatureClass             pEditor.StartEditing pDataset.Workspace                  ' Select features using the X,Y coordinates read in from text file             Set pFeatureSelection = pFeatureLayer 'QI                  'Create the query filter for selecting on the field with the coma delimited xy location read from the text file             Set pQueryFilter = New QueryFilter                  sSQL = "XYCoords = " & Chr(39) & g_sXYCoords & Chr(39)                  pQueryFilter.WhereClause = sSQL                  ' Invalidate only the selection cache             'Flag the original selection             pActiveView.PartialRefresh esriViewGeoSelection, Nothing, Nothing                  'Perform the selection             pFeatureSelection.SelectFeatures pQueryFilter, esriSelectionResultNew, False                  'Make sure something has been selected             'Debug.Print g_sXYCoords             If pEditor.SelectionCount = 0 Then                 pEditor.StopEditing False                 Exit Sub             Else                 Call RotateSelectedFeatures             End If                  'Flag the new selection             pActiveView.PartialRefresh esriViewGeoSelection, Nothing, Nothing         End If     End Sub     Public Sub RotateSelectedFeatures()       Dim pEditor As IEditor       Dim pID As New UID       Dim pEnumFeature As IEnumFeature       Dim pFeature As IFeature       Dim mySet As ISet       Dim pSpatialReference As ISpatialReference       Dim pStartPoint As IPoint       Dim pEndPoint As IPoint       Dim pFeatureEdit As IFeatureEdit       Dim pLine As ILine       Dim origX As Double       Dim origY As Double       Dim Count As Integer            'Get a reference to the editor extension       pID = "esriEditor.Editor"       Set pEditor = Application.FindExtensionByCLSID(pID)       'Make sure something has been selected       If pEditor.SelectionCount = 0 Then         MsgBox "Nothing Selected"         Exit Sub       End If       'Create an edit operation enabling undo/redo       pEditor.StopOperation "Rotate Selection"       pEditor.StartOperation            'Get the selection from the Editor and add all the features to a new Set       Set pEnumFeature = pEditor.EditSelection       Set mySet = New esriSystem.Set       pEnumFeature.Reset       For Count = 0 To pEditor.SelectionCount - 1         Set pFeature = pEnumFeature.Next         mySet.Add pFeature       Next Count            'Reset the Set       mySet.Reset            'MoveSet requires a line to specify the new location       'Use the selection anchor as a starting point for the line       Set pStartPoint = pEditor.SelectionAnchor.Point       pStartPoint.QueryCoords origX, origY            ' Rotate the set       Do         Set pFeatureEdit = mySet.Next         If Not pFeatureEdit Is Nothing Then           pFeatureEdit.RotateSet mySet, pStartPoint, g_dblAngle         Else           Exit Do         End If       Loop            'Stop the Edit Operation       pEditor.StopOperation "Rotate Selection"  'String to appear in Edit menu            'Refresh the Map to redisplay the moved features       pEditor.Display.Invalidate Nothing, True, esriAllScreenCaches          End Sub      The Where clause uses two variables set in the calling routine If a selection is produced, this routine calls the RotateSelectedFeatures routine which acts on the selected set. Bails on the pStartPoint.QueryCoords origX, origY line due to empty geometry.


Is there a way to copy the mxd file with all of the files in that in ArcGIS?

Obviously the mxd doesn't contain the gdb files, and the linked raster files. So when I copy a project, I need to search manually the 49 raster maps from the other 4000. Is there an easier way to copy this?


Help with ListFields and CalculateField_management syntax

I need some assistance with the syntax for a CalculateField_management calculation as I have still yet to master all the python syntax rules. What I am trying to do is find the max value in a variable number of fields in order to populate another field. I am using the ListFields function to discover the desired fields to choose from, but getting that list into the formula is giving me some difficulty.               import arcpy, os, string     LAYERS = arcpy.GetParameterAsText(0)     SLOSHFILEDS = [f.name for f in arcpy.ListFields(LAYERS,"","DOUBLE")     arcpy.CalculateField_management (LAYERS, "MAXSURGE", max(SLOSHFILEDS))      I have tried any number of different string combinations for the max() calc to no avail (not that this particular variation shows that). Adding/Changing the following to the script doesn't give me the syntax error that I would recieve with the above, but it does give me a "The calculate value is invalid for the row with ObjectID = 0..." x 18,526 (or however many rows are in my table) and then does nothing to the table except populate my MAXSURGE field with 0's.               SLOSHFILEDS = arcpy.ListFields(LAYERS,"","DOUBLE")     fieldNameList = []     for field in SLOSHFILEDS:             if not field.required:                 fieldNameList.append(field.name)     arcpy.CalculateField_management (LAYERS, "MAXSURGE", max(fieldNameList))      Hard coding the field names into the formula works great, but of course, I will not always have the same number of fields or same field names to work with. Any help would be appreciated. -John


locator service to use with ArcGIS Javascript API v2.1

I am hoping to find a locator service that will locate by address or intersection, and that will work with version 2.1 of the ArcGIS Javascript API. I tried this locator given in the examples, which works well with 3.1, but it doesn't seem to work with 2.1 : http://help.arcgis.com/en/webapi/jav...r_address.html Unfortunately I think I need to stick with v2.1. SO far I haven't had any luck. Thanks in advance, Jason


How to Build a graph from a map

I spent days looking in all questions here and trying tutorials. I need to build a graph for a region (It will be my input in simulation) I downloaded Postgresql and Postgis and osm2pgsql. Now i can load .osm files into a database. I want to have a complete database with roads ids so i can generate a tbale of edges and nodes then build my graph nodes = intersections and edges = roads for a city using python. Please any detailed help with steps.I saw a lot of keywords (Postgresql/postgis, Networkx, QGIS ..) but i couldn't manage to assemble a good tutorial I am a very beginner.


Why the result of a merge of multiple raster is so big?

I try to merge 14 geotiff like this : ![enter image description here](http://i.stack.imgur.com/0UsMo.jpg) Each geotiff is about 50Mb. I need a geotiff at the output My workflow :               gdalbuildvrt -input_file_list list.txt test.vrt       (where my list contains the name of the tifs) Then :               gdal_translate -of Gtiff test.vrt test.tif     Input file size is 79841, 59955      It works, but the result is a geotiff of 13,3 Gb ! For 14 files, each 50 Mb, I attempted a geotiff of 700 Mb, not 13 Gb. I know that gdal does not compress by default, so I tried this command :               gdal_translate -of Gtiff -co COMPRESS=JPEG test.vrt test_compressed.tif      But the "merge" of the file is too big for JPEG compression :               Input file size is 79841, 59955     0ERROR 1: JPEGPreEncode:Strip/tile too large for JPEG     ERROR 1: WriteEncodedTile/Strip() failed.     ERROR 1: JPEGPreEncode:Strip/tile too large for JPEG     ERROR 1: WriteEncodedTile/Strip() failed.     ERROR 1: An error occured while writing a dirty block     ...      So I tried another workflow, and converted all my tifs in jpeg (14 Mb each), build a vrt file and translated it with LZW compression. But the output geotiff is about 5 Gb. Could you tell me what is the best practice to do the job, and if it is possible to obtain one geotiff of 14*50Mb ? I didn't try it, but I thought about merge this tifs in photoshop, then re- georeference with upper left/lower right coordinates. With this workflow I think I will have 14*50 Mb, but I'm not sure. And I want to learn gdal best practises so I didn't try it for the moment Sorry for my english Thank you EDIT : > _coming to bites: if input is tif with 8bit and export is 32bit by default > you will get serious trouble. so make sure you keep your byte definition as > it is. And remember: the full tif will prob. have 20x 50mb as a tiff is > always rectangular_ If I understand, the number I pointed in green on this screenshot have to be the same on the left and on the right ? ![bits](http://i.stack.imgur.com/Rx52O.jpg) > _Your output image will have more pixels than the sum of your input images, > but this does not explain the large difference. I suggest that you look at > the characteristics of your images based on gdalinfo in order to see what > compression is used and check that the extents are correct._ The 14 tifs of 50 Mb were originally 14 tifs of 700 Mb that I processed with gdal_translate with -co COMPRESS=JPEG. I compressed the raster in order to reduce the number of Mb, but maybe it was not a good idea ? This screenshot represents the 2 gdal info of the same geotiff ( 01.tif) , at the left of the screenshot is is the gdalinfo of the non-compressed Gtiff of 700 Mb, end a the right the same Gtiff with COMPRESS=JPEG, so 50 Mb, with the diff in green: ![non-compress and compress gdalinfo of the 01.tif file](http://i.stack.imgur.com/TusKn.jpg) According to me, the extents are correct because in qgis it matches with other source of data and satellite imagery. > *assuming your input images have the same size, it makes 20000 * 12000 > pixels per input images, which is large for an image of 50 Mb, maybe you are > crossing the extent of your coordinate system when you create the mosaic.* I'm not sure to understand what you mean by "crossing the extent". But I tried to open my 5 Gb LZW in QGIS, and the extent is good, because it matches with other source of data. Your answer makes me realize that the Gtiff have not the same size, do you think it could be the cause of the increasing of the size when merged ? Because gdal prefers file of the same size. I made a gdalinfo on each Gtiff to get its size, there is a very small difference between the size of Gtiffs :               02.tif Size is 19956, 11981     03.tif Size is 19959, 11993     04.tif Size is 19961, 11992     05.tif Size is 19958, 11993     06.tif Size is 19958, 11990     07.tif Size is 19956, 11984     08.tif Size is 19956, 11993     09.tif Size is 19958, 11993     10.tif Size is 19958, 11989     11.tif Size is 19958, 11985     12.tif Size is 19958, 11993     13.tif Size is 19959, 11993     14.tif Size is 19960, 11994      > _Then you should look at the pixel depth of your images : if your input were > in Bytes, >then you should keep bytes. gdal_translate -of Gtiff -ot Byte -co > COMPRESS=LZW test.vrt test.tif_ I tried this command but the gdal told me that the size of the tiff was exceeded.               Input file size is 79841, 59955     0...10...20...30...40...50..ERROR 1: TIFFAppendToStrip:Maximum TIFF file size ex     ceeded. Use BIGTIFF=YES creation option.     ERROR 1: WriteEncodedTile/Strip() failed.      But if I have to create a big tiff, it does not resolve my problem because it is more than 4 Gb. Is the pixel depth important in my case ? ( HD photo of maps, then georeferenced, not DEM) > _Remark 1 : Converting your images to jpeg before building a vrt doesn't > help and you might loose data._ It is not serious if I loose a little bit information. I prefere not to loose it, of course, but if I have to it's not a problem. I was convinced that the output would be lighter if I worked with jpeg, but as a conclusion, it's not true when the output is Gtiff. So this is not a good solution. I give up this solution. > _> Remark 2 : using a vrt is helpful: are you sure that you need GTiff ?_ Yes, I need a Gtiff, because I have to import it in a mobile application which need geotiff input to work ( I think the app can take geospatial pdf input too, but I never work with it, and I want to understand my problem with gdal, because it is not the first time I have it). EDIT 2 : Sorry for the late. I tried -co tiled=yes -co bigtiff=yes -co compress=jpeg -co photometric=ycbcr and i tried -co TILED=yes -co BLOCKXSIZE=512 -co BLOCKYSIZE=512 These 2 commands work well, I have a size of ~700 Mb. It is exactly what I expected. Thank you very much Now I have another problem : it can't be opened quickly by QGIS. I have to wait 15 minutes ( but I quit before QGIS open the tif successfully). I don't know why. And in my android app, it does not work (maybe cause of "tiled=yes"). I have to read some doc on my own, thank you very much for your help


DeleteField_management gives ERROR 000308 Invalid field type?

I am attempting to delete a list of fields in a feature layer but am getting an error: Execute error: Failed to execute. Parameters are not valid. ERROR 000308 Invalid Field type Here is a code snippet:               arcpy.MakeFeatureLayer_management(roads, tmprds)          arcpy.DeleteField_management(tmprds, ["FIELD_NAME"])      I have listed the fields in my feature layer using:               fclass = tmprds     fieldnames = [f.name for f in arcpy.ListFields(fclass)]     print (fieldnames)      and I get a list of layers formatted like:               [u'FIELD1', u'FIELD2, u'FIELD3']      I have tried using both IN_MEMORY and real locations which don't seem to make a difference. Where am I going wrong? Thanks


How to sort Google DynamicMapsEngineLayers?

I tried to add several Google Maps Engine layers using the following code:               gmeLayer = new google.maps.visualization.DynamicMapsEngineLayer({         accessToken: token,         layerId: layerId     });     gmeLayer.setMap(map);      I would like to display the ploygon layer on the bottom and point layer on the top. How can I set the order for each layer? Any help is appreciated!


How do you display each polygon segment while digitizing a polygon with the Polygon construction tool?

I am almost positive that I've digitized the polygons and that I have seen each segment shown as I dropped in vertices during the sketch. I figure that I inadvertently configured something and now I can't get it back. Once I finish the sketch (by double-click or F2), the polygon redraws and displays as expected. The symbol has an outline and there is only one feature template. Here's the polygon, mid-sketch: ![enter image description here](http://i.stack.imgur.com/ejOqd.png) I'm expecting lines for the first 2 segments, but not getting them. Here's the polygon after I've finished the sketch: ![enter image description here](http://i.stack.imgur.com/x3rxZ.png) Here is my configuration while digitizing the polygon: ![enter image description here](http://i.stack.imgur.com/qxD7W.png) And this is the construction tool I'm using:   ![enter image description here](http://i.stack.imgur.com/gUnWs.png)


Compute the latitude of a center of mercator projection

Say I'm looking at a portion of a map that's displayed using Mercator projection with the view bounded at 40°N and 20°N. How do I compute the latitude of the point that's in the centre of that view? I figured it's not 30° and can compute it by firstly projecting the bounding latitudes onto a square using Mercator, computing the middle point, and then projecting back onto a sphere. But is there a simpler way of achieving the same without having to project to and from Mercator?


How can envelope angle be calculated?

Azure SQL has a hemisphere limitation where it errors on any geography having an envelope angle greater than 90 degrees. My coworker wants to set up some detection in the web server to catch such instances before they hit the database. How can envelope angle be calculated from a series of coordinates that define a polygon or multipolygon?