Is there a way of viewing a photo has a point tag from Photo2shape in QGIS?

Is there a way to view images (photos) that have location point from Photo2shape by clicking on the point in QGIS?


Canadian province boundaries in latitude and longitude

Are there any datasets available that give a list of latitude and longitude points for Canadian province boundaries? I don't need anything too detailed as I'm displaying collated data in smallish info graphics.


Case studies of Participatory Spatial Planning

I am wondering if you know any well implemented geoportals for Participatory Spatial Planning. I am looking for the one related to environmental protection or connected somehow with the topic (but of course not only- if you have any just put it here).


How to calculate the number of cells with a given value?

I have a raster file where all cells have values between -3 and 7, no data value is -9999. Have can I calculate the number of cells with a specific value e.g. 6? Can I use the calculator?


Which UTM system do you recommend for Tamaulipas, Mexico?

I'm working with QGIS 1.8.0. Could anyone tell me which UTM system would be better to project a map of Mexico? There are too many to choose from. I have to convert my maps from WGS84 to UTM to do some distance measurements. Please let me know. Regards!


ResultObject: Error in getting output

I am getting "ResultObject: Error in getting output" message when I run the following code. I know it has something to do with "os.path.join" but can't figure out what. Thanks. Sam               import arcpy     import os              arcpy.env.overwriteOutput = True         CADInput = arcpy.GetParameterAsText(0)         OutputFolder = arcpy.GetParameterAsText(1)         OutputGDB = arcpy.CreateFileGDB_management(OutputFolder, "AllPipes.gdb", "CURRENT")         SpatialReference = r"C:\Program Files (x86)\ArcGIS\Desktop10.0\Coordinate Systems\Projected Coordinate Systems\UTM\NAD 1983\NAD 1983 UTM Zone 17N.prj"         OutputData = arcpy.CreateFeatureDataset_management(OutputGDB, "Data", SpatialReference)         OutputCAD = arcpy.CADToGeodatabase_conversion(CADInput,OutputGDB,"CAD_Converted","1000",SpatialReference)         OutputCADLocation = OutputCAD.getOutput(0)                   layerfld = arcpy.AddFieldDelimiters(os.path.join(OutputCADLocation,"Point"),"Layer")         query = layerfld + "='WM-VALVE-ID'"         arcpy.MakeFeatureLayer_management(os.path.join(OutputCADLocation,"Point"),"Valve_lyr8",query)         outfile = os.path.join(OutputData,"Valve")         ValveFC = arcpy.CopyFeatures_management("Valve_lyr8",outfile)         arcpy.Delete_management("Valve_lyr8")


Identify point informaiton openlayer works GeoExplorer not

I am using the OpenGeo Suite. I can preview a layer in the GeoServer Openlayer view, I can click on points and see the data from a layer produced from a PostGIS view. However when I do this in Geoexplorer I click and nothing happens. But if I click on a standard layer produced from a table (happens to contain the same geom data, just different fields) I can identify the point data. I should say, i click the point, and in firefox it brings up the little load icon, but that then disappears. **Update** I have narrowed down the issue to be with views with a Where statement that limits records that are only a certain species. Without this where clause the layer allows me to click. Going to try make the view using geoserver rather than Postgresql directly. **Update 2** The above did not work, with the geoserver query. See my SQL below: The issue comes when I place the last where clause. The layer still loads and I can see the points, in geoexploer + openlayers, but I can only click and identify points in the open layers example?               SELECT       taxom_tbl.scientificname,       sheet_tbl.eventtime,       sheet_tbl.eventdate,       sites_tbl.the_geom,       sites_tbl.sitename,       rivers_tbl.rivername,       rmi_group_tbl.rmigroupname,       record_tbl.category_of_taxom,       record_tbl.number_of_taxom     FROM       public.taxom_tbl,       public.sites_tbl,       public.sheet_tbl,       public.rmi_group_tbl,       public.rivers_tbl,       public.record_tbl     WHERE      taxom_tbl.taxom_id = record_tbl.taxom_id AND     sites_tbl.site_id = sheet_tbl.site_id AND     rmi_group_tbl.group_id = sites_tbl.group_id AND     rivers_tbl.river_id = sites_tbl.river_id AND     record_tbl.sheet_id = sheet_tbl.sheet_id AND     taxom_tbl.scientificname = 'Cased caddisfly'      Any suggestions?


How do I prevent Google Earth (Pro here) from zooming out to the global level everytime it is unsure of a directions search?

This has got to be one of the most annoying things I've dealt with in a while... When I do a google earth pro search to get directions from a pin to say, "groceries",               [Search Google] | Parcel Search (APN)     "from:35.9915465209, -79.977916352 (1600 1618 AUDUBON ST) to:groceries"      google earth prompts (wisely),               Did you mean?     1.) Kroger     2.) Food Lion     ...      and so on. Unfortunately, as it is doing this, it also zooms out from, in my case, a neighborhood level to a satellite level. And not slowly either! Not at all. I'm 10,000 miles away from what I'm studying in less than a second. Is there anyway to prevent this? i.e. Google Earth zooms out to global level **rapidly** by default every time it comes across a user choice (`"Did you mean"`) instance THEORY: One way to get around this would be to change the default location where Google Earth starts. In my case, every time I boot up Google Earth it starts me off somewhere above the Atlantic Ocean between Africa and South America. If I could get it to start out directly above the Southeastern United States or North Carolina, for example, that would possibly solve my problem as this also appears to be where Google is (yep, just checked) taking me ultimately when the dumb-zoom-out finishes. If I could change this "`STARTUP_LOCATION`" value maybe I could prevent this wacked zoom-out effect from happening. EDIT: The hack fix right now is to, after you click the "Search" button, immediately "grab" the map to prevent it from zooming out. You can normally stop it if the timing is right before you're more than 30-100K feet above the ground


Why does an OpenLayers map.getNumLayers() return 0 even though I've added a layer?

When I try the following code, `OpenLayers` returns a `zero` result. What have I done wrong, here?               var map;          function loadMap () {              // Based on example code: view-source:         //     http://openlayers.org/dev/examples/vector-formats.html              map = new OpenLayers.Map(el);         var googleStreetMap = new OpenLayers.Layer.Google('Google Street Map',                                                            { numZoomLevels: 20 });         map.addLayers(googleStreetMap);         var result = map.getNumLayers(); // Result == 0 :sad-panda:                 }      In the code above, I thought that the `map.getNumLayers()` should return `1` - considering i've asked to add a google street map. Why is it returning zero, please? UPDATE: something else to note: there is also no baseLayer :( I thought this would be the base layer???


How to convert geoJSON to python objects?

New to the site, and to geoJSON, and to python.   My goal is to read in a file with geoJSON data, and use it to generate shapes to be used in an application that is using python scripting. Python has the ability to read it in, and do some manipulating. I have found some examples, but they are not traversing the geoJSON hierarchy correctly. I'm looking for a library, or instructions, on how to extract the geometry data from the geoJSON data file. In other words, I would like to be able to say "get the list of features..." - then, for each of the features, I'd like to get the geometry, read the type, and the get the coordinates for that particular geometry item. Repeat for each of the items in the list of features. Does that make sense? Any suggestions?


APDM - error exporting database from Oracle

I have a farily large database on a slow network and I am using a thrid party tool to update data which calculates other fields and so on. I have a guid string with an empty box (weird glyph - seen in shapefile tables before) in the middle of the string for just a few records, seemingly random. {D62D[][]1F1-CA71-4490-B940-046E61989DA6} {A16659DF-7131-4[][]E-8DFF- DBF71257DC08} the empty boxes are not brackets..I just did that for the example - they are empty boxes. Question1. I would like to use python or some other script/sql to run the entire database 300,000 records to see if this is present else where? Question2. What are possible causes? Question3. How would this be related to exporting the database? Thanks. Justin


creating an OD cost matrix in QGIS

I'm a new user of QGIS with limited programming skills (I prefer using menus...). Can anyone help me finding a resource which will guide me through the steps required to produce an origin-destination (OD) cost matrix ? I'm looking for a step-by-step description, starting from scratch (ie, with my 3 shapefiles: origins, destinations, road network). Of note, I need to compute distances to >1 destinations for each origin. Thanks Mathieu


ArcPy Mark ALL duplicated values

I'm sorry if this is too similar to other posts but I'm an arcpy newbie and I can't quite get what I need. I have accomplished this task in the field calculator (thanks to another post here, but I now realize that I need to do it using arcpy). I have code that perfectly marks the second, third etc. duplicate(s) but I need it to mark all values that have a duplicate. Basically, I can't figure out how to mark the FIRST instance as well as the rest. Here's the code:               import arcpy          inFeatures = "thephaseIIIlayer"     fieldName = "PhaseIII_ID"          desc = arcpy.Describe(inFeatures)     fields = desc.fields     rows = arcpy.UpdateCursor("thephaseIIIlayer", "", "", "PhaseIII_ID", "PhaseIII_ID A")               i = 0         for row in rows:             if i == 0:              value = row.PhaseIII_ID         i += 1         if i > 1             row.SplitMarker = i         if row.PhaseIII_ID != value:              value = row.PhaseIII_ID             i = 1         row.SplitMarker = i -1         rows.updateRow(row)          del row      del rows      I'm sure this is elementary but I'm running out of time. Thanks in advance.


Expected DTD markup was not found

I am trying to upload an XML document using python and               arcpy.MetadataImporter_conversion      I keep getting an error: > Expected DTD markup was not found. Line 1, position 3. Failed to execute > (MetadataImporter). I think it's an issue with my XML document, but I'm not sure what. I've been using the same XML document to upload for 4 years now and now I'm getting this error. I haven't made any edits to the XML in that 4 years. I've searched through the internet, but I haven't been able to come up with something that explains what the error is and how to resolve it. Does anyone know what this might mean?


ArcGIS 10.1 Converting a model tool to a script tool

I have recently created a model tool for a class project and my instructor would like it to be converted to a script tool for practice purposes. I have exported the script from my model and loaded it into a script within a toolbox but there are several things I am unsure about. I have defined the Parameters as they were in the model but when I run the script tool it give me multiple errors. I know that the model doesnt pass model only tools to the script(i.e. Select Data) so im sure my problem stems from that but Im not sure what exatly I need to add to fix the problem. I will attach a copy of my script,tool parameters,tool properties,the original model and the errors I get. I am an amatuer with python so bare with me if Im asking too much. NOTE:the '*' represent the actual values but cant be shared               # ---------------------------------------------------------------------------     # CROB1.py     # Created on: 2013-10-08 11:45:20.00000     #   (generated by ArcGIS/ModelBuilder)     # Usage: CROB1 <ArcSDE_Connection_File_Location> <Select_Your_AP_County> <Select_Your_AP> <Your_Counties> <Your_AP>      # Description:      # This tool creates the layers for management plan map for your AP boundary. The user must still format the Layout View before exporting.     # ---------------------------------------------------------------------------          # Set the necessary product code     import arceditor               # Import arcpy module     import arcpy          arcpy.env.overwriteOutput = True          # Script arguments     ArcSDE_Connection_File_Location = arcpy.GetParameterAsText(0)          Select_Your_AP_County = arcpy.GetParameterAsText(1)          Select_Your_AP = arcpy.GetParameterAsText(2)          # Local variables:     FDEP_SDE_Connection_sde = ArcSDE_Connection_File_Location     Counties = FDEP_SDE_Connection_sde     Aquatic_Preserves = FDEP_SDE_Connection_sde          # Process: Create ArcSDE Connection File     arcpy.CreateArcSDEConnectionFile_management(ArcSDE_Connection_File_Location, "FDEP_SDE_Connection", "******", "****", "", "DATABASE_AUTH", "****", "*****", "SAVE_USERNAME", "SDE.DEFAULT", "SAVE_VERSION")          # Process: Select Data     arcpy.SelectData_management(FDEP_SDE_Connection_sde, "BASE.FL_SHORELINE_AREAS")          # Process: Select     arcpy.Select_analysis(Counties, Your_Counties, "\"NAME\" = '%Select Your AP County%' ")          # Process: Select Data (2)     arcpy.SelectData_management(FDEP_SDE_Connection_sde, "DEP.AQUATIC_PRESERVES")          # Process: Select (2)     arcpy.Select_analysis(Aquatic_Preserves, Your_AP, "\"LONG_NAME\" = '%Select Your AP%'")`      ![enter image description here](http://i.stack.imgur.com/Auca3.png) ![enter image description here](http://i.stack.imgur.com/z4kLd.png) ![enter image description here](http://i.stack.imgur.com/Jt2IW.png) ![enter image description here](http://i.stack.imgur.com/BZ2VF.png)


Data of worldwide shore lines and bathymetry

Please excuse my probably naive questions because I am new to this stack exchange. Is there a free database with all geolocations for shorelines? Is there a free database for near-shore bathymetry data?


QGIS polygon centriods - How are they created?

I have been using QGIS to analyses spatial data and I created polygon centroids with the vector geometry tools. Now for a report I have to explain how these centroids were created. I have not been able to find an algorithm or an explanation of how QGIS creates centroids, can anyone help? Thanks in advance Christina


How I relate Census Blocks to FIPS Division/Subdivisions

I need to be able to relate a Census Block to it's corresponding FIPS Division and Subdivision and I have not found any data file or reference to help me identify that relationship, can you help?


QGIS and raster calculator - not working

I have installed QGIS 1.8 on a Mac OS v10.8.4 (with GDAL and installed), and trying to create an NDVI map from a three-band GeoTIFF multispectral image. Even the simplest calculation (e.g. band@1*1) creates a grey "image" with Min- Max values on the order of 208e-308 to 208e+308 (infinity?). Any proposed solution? I suspect I may not have the configuration right, gdal or python paths or...


Is there a way to prevent losing metadata when generating a spatial view in ArcSDE 10.1?

When generating a spatial view in ArcSDE using a script, any previous metadata is dropped when the old view is dropped. Thus, any edits to metadata on the view, are lost. Is there a way to keep the metadata around, or perhaps add the importing of metadata to view script? I'm using Oracle as DBMS. ArcSDE 10.1 and ArcGIS for Desktop 10.2.


working with hydrography raster the cost array ignores the end of water

We have our maps laid out using hydrography maps from NOAA. We had to run the graphics through several steps to create the water feature raster. I have a process that pulls in that raster, sets a start and end point, and computes a Polyline which provides my distance between points. But we were getting strange results that had to be figured out. I added the cost array to the map and it is a regular, circular growth from the target point out. In a few places it appears to follow rivers but mostly it ignores the existance of land. It reports values as being between 0 and 17xx. I'm concerned about the cost value of 0 as I though no raster can have a value of 0. So is this because I need to convert 0 to NoData? And if that is the case how do I do the conversion?


How to highlight polygons within another polygon?

I want to symbolize public buildings in OSM data. For Example: There is a polygon and in column "amenity" it has the value "school". But i don't want to highlight this polygon, but the buildings inside this polygon. How can I do this? Thanks!


Get a spatial reference object by name from a saved string

I am creating an ArcMap 10.2 extension is VS 2012 and C#. I want to give the user the option to select a spatial reference to be applied to a layer - planning to use the Dialog for that. But then, I want to be able to save the name of the SR the user selected to an custom XML settings file so that when they come back to the same section it will be set by default (and they can use the Dialog to change it if needed). This is where I am stuck. My plan was to use that string name and recreate the SR object by see no option for it in something like `ISpatialReferenceFactory3`. As an example, if I run this code on an mxd using a New Jersey projected coordinate system:               ISpatialReference SR = new UnknownCoordinateSystemClass();     IMxDocument Mxd =  (IMxDocument)WestonGISExtension.ExtensionApplicationHook.Document;     ESRI.ArcGIS.Carto.IMap Map = Mxd.FocusMap;     if (Map.SpatialReference != null)         SR = Map.SpatialReference;      then, the SR.Name would produce, say, "NAD_1983_StatePlane_New_Jersey_FIPS_2900_Feet". So, how do I later come back with that string and reproduce the `SpatialReferenceClass`? * * * Thanks guys. Ya, I think you are right in going with the WKID. Here is what I settled on:               ISpatialReferenceFactory3 SpatialReferenceFactory = new SpatialReferenceEnvironmentClass();     ISpatialReference SpatialReference = SpatialReferenceFactory.CreateSpatialReference(SpatialReferenceCode);      Ernie


ogr2ogr csv conversion with latlon in one column

I have a csv with "lat\,lon" in a single column. I am trying to convert it with ogr2ogr to another format, and cannot figure out how to format the VRT file to accept this format. I cannot do anything other than change the VRT at the moment due to other limitations. I would love to rewrite the csv, but this is the format that I have to deal with for now. I have been pulling my hair out all day, and have yet to figure out a viable solution. example for formating:               name, date, value, latlon     a, 20130101, 0, "100.8\,40.2"     b, 20130101, 1, "101.2\,40.4"     c, 20130102, 1, "100.2\,41.2"     d, 20130103, 2, "102.0\,40.7"     e, 20130104, 3, "100.6\,41.0"      Any ideas would be greatly appreciated. edit for clarification: The data is not a set number of characters, so splitting at a character number does not work right.               a, 20130101, 0, "10.844\,-40.2745"     b, 20130101, 1, "101.2010\,40.411111"     c, 20130102, 1, "-100.27867\,1.24522"     d, 20130103, 2, "-1.04577\,16.745637"     e, 20130104, 3, "100.617417\,-1.0757"      EDIT: Accepted answer actually does not require the intermediate CSV, it can be done straight from original CSV. The INSTR is what I managed to get to work.               <OGRVRTDataSource>         <OGRVRTLayer name="result">             <SrcDataSource>test2.csv</SrcDataSource>             <SrcSQL dialect="sqlite">SELECT name, date, value, SUBSTR(latlon,2,INSTR(latlon,"\,")-1) AS lat, SUBSTR(latlon,INSTR(latlon,"\,")+2,-1) AS lon FROM test2</SrcSQL>         </OGRVRTLayer>     </OGRVRTDataSource>


Python query to find records with more than one alpha character in a field

Using ArcGIS Desktop 10.2. I have a field in a table of several thousand records. The field is made up of alphanumeric characters. I'd like to perform two queries using python on this field:   1. Identify the records in this field that contain more than one alpha character   2. Identify the records in this field that end with more than one alpha character


Draw line drawn from point to an open infowindow?

I want the infowindows on my map to be in a fixed location, but that sometimes makes it hard to tell which point was clicked (which point is associated with the infowindow displayed). Is there a way to draw a line from the point to an opened infowindow located in a fixed position or make the selected point stand out from the rest of the non-selected points?


Is there any method to choose the value of each pixel according to land cover

I have 2 images; one is land cover image (imgA) and monthly mean temperature image (imgB). I'd like to choose value of each pixel from imgB corresponding to imgA. WhaT I expected is each pixel of certain land cover type should have different values in different area. I tried it using zonal statistic in ArcGIS and ERDAS. But zonal statistic give me only one value of each land cover (not in each pixel value). I'd like to keep all original pixel values of imgB according to each land cover. How can I do this using ArcGIS or ERDAS?


Performance loss for OpenLayers EPSG transformation? Storing GeoJSON coordinates in lat/lon or in native map projection?

For a project the map projection is EPSG:32468 (tiles). On top of the map, two or three GeoJSON LineStrings should be displayed using OpenLayers. Each LineString has about 1500 coordinates. Actually, I would like to store the coordinates of the GeoJSON in lat/lon (EPSG:4326) and then reproject them using OpenLayer's internalProjection and externalProjection, as lat/lon is more "natural"/"human" to think about positions. That is, something like:               var format = new OpenLayers.Format.GeoJSON({       'internalProjection': new OpenLayers.Projection("EPSG:32468"),       'externalProjection': new OpenLayers.Projection("EPSG:4326")     });      Are there any performance issues to be expected if doing so? Or should I instead rather reproject the GeoJSONs in advance, e.g. by using `ogr2ogr`, that is having them already in the special map projection? I do not yet know how many coordinates a LineString will include in future, and importand: the map should also work nicely on iOS 4 (webkit) and recent Android phones.


Bulk insert into MS SQL Creating ObjectID's

I am running an ETL from a spatial view into publication database. The view has results in duplicate ObjectID's. I started working with the get_ids SP example from ESRI, but that seems to be built more for a single record insert and not a bulk insert. Here is my example...               DECLARE @id as integer     DECLARE @num_ids as integer     EXEC L.i16_get_ids 2, 1, @id output, @num_ids output;           INSERT INTO L.TAXPARCELWCONDOS ([OBJECTID]                ,[PARCELNO]                ,[SHAPE])     SELECT @id           ,[PARCELNO] ,[shape]       FROM [Parcel].[L].[view_TaxParcelwCondos];     END      How can I generate new ObjectID's for the insert. Thanks, Dave


Get lat/lon points from image pixels

I need to build an application with the following requirement:   1. shows a map .png picture to user.   2. then, users select several points around the map (I can get the x/y pixels from each point)   3. based on these points I want to convert x/y pixels to latitude/longitude values.  The question is: **how can I do this? what do I need to consider?** I think that I can relate a point (x,y) with a predefined lat/lon and then calculate the other points based on the first one. But I'm not sure how can I achieve this. This picture shows more or less what I need.   * green point: point with predefined lat/lon   * red points: points I need to determinate ![image example from where I will take the points](http://i.stack.imgur.com/nlrHJ.png)


How to fix distortions for Baden-Württemberg?

I'm working in an area in Baden-Württemberg, Germany. I loaded some OSM data in QGIS but the map display is distorted. I tried ftools define projection with many different projections but nothing changed. I tried: - WGS 84/ World Mercator - DHDN / Gauss-Kruger zone 2 - Google mercator - ETRS89 / UTM zone 32N - DHDN / Gauss-Krugerzone 3 - DHDN / Soldner Berlin and many others...but nothing worked. There was no difference visible. * * * _ich bearbeite derzeit ein Gebiet in Baden-Württemberg und habe dazu Daten aus OpenStreet Map in QGIS geladen. Leider wird das Gebiet immer in der Breite verzerrt dargestellt. Ich habe über Rechtsklick auf den Layer und auch über fTools->Aktuelle Projektion definieren schon viele verschiedene Projektionen ausprobiert, jedoch ändert keine was an dieser Verzerrung. Könnte mir jemand helfen, wie ich den Layer richtig darstellen kann? Vielen Dank!_


bing Basemap Missing

## 3/26/2014 - Since writing this question, a patch has been released. It can be found here: http://support.esri.com/en/downloads/patches- servicepacks/view/productid/160/metaid/2003 > The bing basemap seems to have been recently removed from the "Add Basemap" > dialogue in ArcMap. I'm using 10.1. I've also heard reports from a coworker > that a bing basemap layer was replaced by the dreaded red exclamation mark > in an existing document she was using. > > Any idea if bing/ esri altered their relationship, or is this just a local > problem on my end? > > Thank you!


Nested Iteration with model builder - using nested models

I'm new to using model builder and have to do a nested iteration (for every month I have to iterate through 6 parameters). I am thinking of doing that by using nested models. One model doing the interation through monthes and then providing the current month as parameter to the submodel that iterates through the 6 parameters. The linking of the models does not work correctly (boxes are not colored). How can I make the current month value available to the submodel? I just want the month parameter to be available in a function; I don't connect it to a function as input variable. Your help would be greatly appreciated. Thanks, Lea


Difference between a *.lyr and layer directly added from *.gdb/sde to mxd?

What is the difference between a *.lyr and a layer directly added from *.gdb/sde to mxd? Doing it difference in mxd? Which is better?


How to buffer a line with different distances for left/right sides

How can I buffer a line in QGIS using one attribute for the left side of the line and one attribute for the right side of the line? I am trying to buffer a river with its bank width, which is different on the right and left side.


Dissolve with dominant/majority field

I want to dissolve a feature class of land use polygons, joining subparcels in larger parcel polygons. I want the parcel polygon to keep the dominant land use of all subparcels, taking into account the surface that each subparcel takes. Dissolve GP tool lets me calculate statistics over one field (min, max, avg) but I can't find a way to keep the dominant value. I'm using ArcGIS 10.1 Thank you!


Mapinfo lat Long calculate

I have mapinfo table containing Columns: Lat Long 21.2563 40.1256 21.2565 40.1278 21.2567 40.1288 21.2569 40.1291 21.2571 40.1352 21.2578 40.1380 Now i want to calculate the whole distance like Km or Miles or Feet, How can i do this?


How do I layer stack rasters in QGIS?

I have some multi-spectral data, where the individual bands are separate Raster files. How do I layer stack these rasters so that I get one raster with 3 bands instead of 3 different rasters? This is quite easy to do in ERDAS and ArcGIS, but I haven't figured out how to do it in QGIS


How to check via Arcpy if ArcMap is currently in an edit session or not?

I've created a Python add-in button that helps speed up my coworkers workflow by copying one feature class attribute to another. It uses the arcpy.UpdateCursor function to update a row in the target feature class. As it exists now, this button script can be run regardless of the editing mode. Obviously when its run in an edit session, the user can choose to stop editing and not save changes, but this is not the case when the script runs outside of an edit session. How can I add a check to the script that will stop the script from running if ArcMap is not currently in an edit session? This concerns ArcMap 10 & 10.1 Thanks for any ideas Update: I also want to check with other ArcMap users to verify that updates to tables is not normally allowed without being in an edit session. So how is this script running outside of an edit session? This script also brings up another question about the seemingly serendipitous selection order ArcMap performs that just happens to work for me when I update the 2nd feature class table from a list, but that's for another day... Here's the script as it works now (without any 10.1 editor implementation): How to add a check to ensure the user is in an edit session?               def onClick(self):         #Reference mxd         mxd = arcpy.mapping.MapDocument("CURRENT")         #Reference the main Data frame         mm = arcpy.mapping.ListDataFrames(mxd, "MainMap")[0]         #Reference the Water System Valve feature class         waterValves = arcpy.mapping.ListLayers(mxd, "Water System Valve", mm)[0]         #Reference the fire hydrant feature class         fireHydrants = arcpy.mapping.ListLayers(mxd, "Water Hydrant", mm)[0]              #Use the extent of the main DF to select all valves in the current view         dfAsFeature = arcpy.Polygon(arcpy.Array([mm.extent.lowerLeft, mm.extent.lowerRight, mm.extent.upperRight, mm.extent.upperLeft]), mm.spatialReference)         arcpy.SelectLayerByLocation_management(waterValves, "WITHIN", dfAsFeature,"", "NEW_SELECTION")              arcpy.SelectLayerByAttribute_management(waterValves, "SUBSET_SELECTION", "LOCATIONID IS NULL")              fields = ["LOCATIONID"]              row, rows = None, None         rows = arcpy.UpdateCursor(waterValves,fields)         row = rows.next()         valveList = []         append = valveList.append              #Loop through the valves table to update LocationID         while row:             builder = str(row.QSNO)+"-"+ str(row.VALVESEQNO)             row.setValue("LOCATIONID", builder)             append(builder)             rows.updateRow(row)             row = rows.next()              del row, rows              #New selection for fire hydrants         arcpy.SelectLayerByLocation_management(fireHydrants, "WITHIN", dfAsFeature,"", "NEW_SELECTION")         arcpy.SelectLayerByAttribute_management(fireHydrants, "SUBSET_SELECTION", "LOCATIONID IS NULL")              row, rows = None, None         rows = arcpy.UpdateCursor(fireHydrants,fields)         row = rows.next()              #Loop through fire hydrant table to update LocationID         while row:             for locID in valveList:                 construct = str(locID) + "-FH"                 #print construct                 row.setValue("LOCATIONID", construct)                 rows.updateRow(row)                 row = rows.next()              del row, rows, valveList, mxd


Storing Polygons in PostGIS (data coming from shape files)

We want to store data from shape files in PostGIS all in one table. There will be two columns in the table:   * boundary - The polygon data (How do we store this?)   * mongo_id - Links to a mongo database  It seems if we use shp2postgis it creates a whole set of tables for that shape file. We want to use one table for all boundary data. What is the best way to do this? (Do we need to use a specific srid?)


pgRouting - no 'to_cost' values imported (osm2pgrouting)

I am struggling with the latest pgrouting & osm2pgrouting V2. The toolchain is installed on my server without any issues, I tried to install it from github and compile it - and I tried it from a stable repo via aptitude as well. Both show the same problems. I try to import a chunk of OSM data into my routing DB. The import runs smooth and it looks very promising, but there is no 'to_cost' value filled in. I did calculate it once by hand, but I would like to see the original data from the import. What bothers me most, is thhat after a quick glimpse on the source code I noticed that osm2pgrouting does not do that.               "COPY " + tables_prefix + "ways(gid, class_id, length, x1, y1, x2, y2, osm_id, the_geom, reverse_cost, maxspeed_forward, maxspeed_backward, priority, name) FROM STDIN"      Where is this 'to_cost' assignment? If I am the first one with this issue, I am doing something terribly wrong - please feel free to give any input on this topic! Thank you! Styp


How do I convert 3tm to lat-lon

I'm unable to find out a formula for converting 3tm coordinates to lat-lon? 3tm is a system used in Alberta alone, as far as I can tell. The city of Calgary uses that for its opendata, which is what I'm trying to process.


How to create a metadata json member for an openlayers layers object and display in extjs grid?

I want to do the following: add               metadata: "this is the layer metadata"       ....to my openlayers layer config. This should then be presented in an extjs grid. I can use               alert(layername.metadata);      to display the string inside the config member so I know it works. To display this in the extjs grid I have used the following code               var myData = [];     var x=mapPanel.map.layers;     for (var i=0; i<x.length; i++) {       // alert(mapPanel.map.layers[i].metadata);         myData.push(mapPanel.map.layers[i].metadata);     }          var store = new Ext.data.ArrayStore({             fields: [                {name: 'metadata'}             ]             });          store.loadData(myData);          var myStore = new GeoExt.data.LayerStore({         map: map,         layers: mapPanel.layers     });           var grid = new Ext.grid.GridPanel({             title: "Available Map Layers",             region: "center",             height: 300,             viewConfig: {forceFit: true},             store: store,             columns: [                 {                     header: "metadata",                     dataIndex: "metadata",                     sortable: true                 }             ]         });          var metadataWin = new Ext.Window({                     title: "Map layers",                     layout: 'fit',                     width: '600',                     height: 'auto',                     border: false,                     closable: true,                     collapsible: true,                     x: 450,                     y: 100,                     resizable: true,                     closeAction: 'hide',                     plain: true,                     items: [grid]                });         metadataWin.show();           the grid show the correct amount of rows, but only the first letter is shown....this is probably a newbie javascript error. Can anyone see where i´m going wrong? yours, Rob


Stacking attributes in a text field

I am trying to stack my text in an attribute table using the field calculator, but it does not seem to be working. My field name is: `Facilities`. My attributes are in this format: `Public Access\Campground` I want the field to read like this:               Public Access     Campground      So I am using this expression to stack the text:               Replace( [Facilities] ,"\",vbnewline)      But when I run it, it doesn't do anything. Can anyone steer me in the right direction?


need info on GeoTIFF projection keys

I am a programmer (not a cartographer!!) developing an application which needs to read and write GeoTIFF files. I have a number of questions about those GeoTIFF keys which are related to projections. I would ideally like to be able to read/write files which originate from and/or will be read by a maximum number of other GeoTIFF-aware software packages. My primary compatibility target is ARC, however, so if there is anything especially peculiar about files written or read by ARC I would be particularly interested in those details. Also, I need to support only a relatively small number of projections, namely Mercator, UTM, polar stereographic and Lambert conic conformal in that order of importance. I am using a home-brewed projection package based closely on Snyder's USGS reference and code from the GMT package (as we need to maintain co- registration with GMT plots.) I have looked through the GeoTIFF spec at www.remotesensing.org and other related materials in some detail but am still confused on a number of points: (1) The GeoTIFF spec declares various lon/lat keys, almost all of them with deliciously circular definitions, e.g.: "ProjNatOriginLongGeoKey: Longitude of map-projection natural origin." Can someone explain to me the difference between natural origin, false origin and center lon/lat? My limited understanding of the math behind Snyder's projections includes knowledge of the fact that virtually all projections require a 'projection longitude' parameter, for instance. With regard to Mercator, this is the longitude at which all projected x-values will be 0 (likewise for UTM, before the 500000 false easting is applied). So, is this longitude the ProjNatOriginLong or the ProjCenterLong in GeoTIFF jargon? (2) If a GeoTIFF file contains no specified value for a key, e.g., ProjFalseEasting, is there an assumed default value for that key? If so are such values projection-dependent, e.g. default false easting might be 500000 for UTM but 0 for anything else? I have looked at a couple of GeoTIFF files generated by external software and there seems to be a wide variety of quantity of keys specified. The spec says nothing about default values but I suspect that various external readers/writers make many assumptions about these keys (which no doubt differ on a vendor-by-vendor basis). (3) As I noted I am primarily interested in reading ARC files. A sample Mercator GeoTIFF from ARC had a defined ProjectedCSTypeGeoKey of 3395, not listed anywhere in the GeoTIFF spec. This threw me for a while until I started digging around in the ancillary files distributed with libgeotiff and found the line 3395,"WGS 84 / World Mercator",9001,4326,19883,9804,1,0, 4400,8801,0,9102, 8802,0,9102,8805,1,9201,8806,0,9001,8807,0,9001,,,,,, buried in /usr/share/epsg_csv/pcs.csv. Is this file pretty much invariant, meaning that I can count on this entry never changing, or do I _really_ need to write code which parses these interconnected CSV databases everytime I encounter an unrecognized ProjectedCSType in an imported file? Like I said, I only need to support a handful of the most common projections. Thanks very much for any help in clarifying these points! Roger Davis Univ. of Hawaii


Collection of polygons from a collection of points

I have a set of points, spread over a wide geographical area. I need to be able to create a set of polygons which best represent the clustered points. And I would like to create the clusters based on the maximum number of clusters allowed and/or number of points allowed in a cluster. Any help would be greatly appreciated.


Creating a VB.net Dataset in Visual Studio 2010 from an SDE Geodatabase

I am building an ArcMap Addin that contains several Windows Forms with controls that need to be bound to a database. I am trying to decide whether or not to use a native SQL Server Database or an SDE Geodatabase. I would like to link the forms to the features on the map, which suggests I should use the geodatabase, but I have not found anyway to bind geodatabase tables and fields to WinForms controls at design-time. Has anyone successfully created a Dataset (xsd) in Visual Studio from an SDE Geodatabase?


Need to understand desc.workspaceType to use in conditionals

I need to differentiate between two possible types of workspaces for an arcpy script. So I check the `workspaceType`:               rootWorkspace = raw_input('Geodatabase workspace to analyze: ')     desc = arcpy.Describe(rootWorkspace)     wsType = desc.workspaceType     print 'Workspace Type: {}'.format(wsType)      which seems to work fine and prints the correct type. But, if I try to then check the type (so I can, eventually, do different things depending on what it is):               if wsType is 'FileSystem': print 'file system'     if wsType is 'LocalDatabase': print 'gdb'     if wsType is 'RemoteDatabase': print 'sde'     else: print 'not reading this correctly'      I _always_ get `not reading this correctly` (whether I'm inputting a directory or geodatabase). According to Arc help about Workspace properties, `workspaceType` should be a string result (not an Object etc.), so I am confused why a string comparison isn't working.


Best spatial statistics software for GIS?

I am searching for spatial statistics software which has many powerful features and supports a GIS interface. Can anyone give me some advice?


Zooming in close with mixed cached and dynamic services in ArcGIS flex

I have an application that uses a cached world basemap overlaid with more local and specific data coming from a dynamic map service. It works well for performance, but some users need to see some very detailed information in the dynamic map service. Is there a technique to allow users to zoom in past the closest scale range of the cached service?


Mapproxy plot with QGIS in 300 DPI

I have played around with mapproxy and have created a MBtiles file with tilemill. I then serve the mbtiles file as a wms with mapproxy and it works fine. My problem is that i want to be able to plot a map in a specific resolution like 300 DPI. In the documentations for MapProxy there is a note about this: "you need to understand that a scale will differ if you print a map (200, 300 or more dpi) or if you show it on a computer display (typical 90-120 dpi, but there are mobile devices with more than 300 dpi)." I have tried to define a "res" (resolution) in the yaml file in diffrent ways. Like: res: [1000, 500, 200] and also like: `res: [ # res level scale 26.4583333333, # 0 100000.00000000 13.2291666667, # 1 50000.00000000 6.6145833333, # 2 25000.00000000 2.6458333333, # 3 10000.00000000 ]` Every time i just get a blank map. I want to be able to use qgis to plot my map with overlayers. Only problem is that when i select resolution in qgis like 300 DPI I get a map in another scale so my road-names gets very small. Does anyone know how to set this up properly?


How to animate .olControlLayerSwitcher with Jquery?

Not know much about css but some how got strucked in setting css property. I am using Openlayers .olControlLayerSwitcher class. Here without using !important keyword, LayerSwitcher will not get move. Here is my code: Its working.But very fast. I want to move it with some speed intervals like jquery animate. Please suggest it.               $(".olControlLayerSwitcher").css("cssText", "top: 30px !important;");           $('.olControlLayerSwitcher').css("cssText", "top: 55px !important;");


Programmatically set layer properties Python Init function

Is it possible to set the layer properties Python Init function field programmatically? I've been looking through the qgis 2.2 api but can't seem to find anything on it. Hint, suggestions and examples are appreciated :)


How to create ''before''raster and ''after''raster layers for Cut Fill tool /in ArcMap 10.1?

I have an area which I want to calculate the volume surface. one of the goals is to measure fractures of the area. I want to hypothesized that erosion has been occurred in this area for example in year 1900 and 2000. Minimum elevation is 25 meter and Maximum is 140 meter. for instance i want to fill area below 35 meter and then calculate all fractures which have been filled. how is this possible?


Problem with projection in layer

I'm having problems with visualizing a layer which is in EPSG:4326 Apparently the geometry looks perfect, but I don't know why, it's not in real coordinates. I have projected it to 4326 with QGIS, re-projected with ogr2ogr, and the result is always the same, the coordinates shown in the box while I pass the mouse are not real. SRC of the project is in 4326, and 'on the fly' is set to on. Any idea what could be happening? I attatch the europe roads layer, if anybody wants to open it and check for some issues. Thanks a lot! Shapefile: https://dl.dropboxusercontent.com/u/64621273/roads.rar


My GeoJson will not display on a Vector Layer in Openlayers

I have geoJson from the the USGS that I am downloading to my server. It validates just fine with geojsonlint. When I past the JSON into this Openlayers example it says it is bad input json. My Code to display it on a vector layer is as follows where variable mapProjection is EPSG:900913. I have spent 3 days on this now, and cannot get it do display. What am I doing wrong? Added Information, I have tried this method:               vectorLayer = new OpenLayers.Layer.Vector("MyLayer");     map.addLayer(vectorLayer);          function handler(request) {          var geojson_format = new OpenLayers.Format.GeoJSON({         'internalProjection': map.baseLayer.projection,         'externalProjection': new OpenLayers.Projection("EPSG:4326")     });          vectorLayer.addFeatures(geojson_format.read(request.responseText));     }          var request = OpenLayers.Request.GET({         url: "geojson.json",         callback: handler     });      and have been able to see the json in variable request in the handler function. It has to be something to do with the format of the data. I am on a windows system and writing the data to a txt file, then serving it to my openlayers app via IIS. I have the correct mime types set up for json already. Thanks in advance Mark                                   var geojson_format = new OpenLayers.Format.GeoJSON({                                     'internalProjection': mapProjection,                                     'externalProjection': wgs84                                     });                          var newlayer = new OpenLayers.Layer.Vector(                                 layername,                                  {                                 style: style_mark,                                 projection: wgs84,                                                           strategies: [new OpenLayers.Strategy.Fixed()],                                 protocol: new OpenLayers.Protocol.HTTP                                         ({                                                 url: '/data/earthquake_day.json?' + forcedownload,                                                 format: geojson_format                                         })                                 }                         );                     map.addLayers([newlayer]);      This is the Geojson ..               {"type":"FeatureCollection","metadata":{"generated":1382079580000,"url":"http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.geojson?%2053324","title":"USGS Magnitude 2.5+ Earthquakes, Past Day","status":200,"api":"1.0.11","count":21},"features":[{"type":"Feature","properties":{"mag":4.9,"place":"69km WSW of Panguna, Papua New Guinea","time":1382072700910,"updated":1382074535000,"tz":600,"url":"http://earthquake.usgs.gov/earthquakes/eventpage/usb000kg7b","detail":"http://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/usb000kg7b.geojson","felt":null,"cdi":null,"mmi":null,"alert":null,"status":"reviewed","tsunami":null,"sig":369,"net":"us","code":"b000kg7b","ids":",usb000kg7b,","sources":",us,","types":",cap,general-link,geoserve,nearby-cities,origin,phase-data,tectonic-summary,","nst":null,"dmin":8.182,"rms":0.95,"gap":86,"magType":"mb","type":"earthquake","title":"M 4.9 - 69km WSW of Panguna, Papua New Guinea"},"geometry":{"type":"Point","coordinates":[154.9386,-6.6267,38.4]},"id":"usb000kg7b"},     {"type":"Feature","properties":{"mag":4.3,"place":"30km ESE of Jarm, Afghanistan","time":1382069641720,"updated":1382071013039,"tz":270,"url":"http://earthquake.usgs.gov/earthquakes/eventpage/usb000kg6q","detail":"http://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/usb000kg6q.geojson","felt":0,"cdi":1,"mmi":null,"alert":null,"status":"reviewed","tsunami":null,"sig":284,"net":"us","code":"b000kg6q","ids":",usb000kg6q,","sources":",us,","types":",cap,dyfi,general-link,geoserve,nearby-cities,origin,phase-data,tectonic-summary,","nst":null,"dmin":2.372,"rms":0.49,"gap":112,"magType":"mb","type":"earthquake","title":"M 4.3 - 30km ESE of Jarm, Afghanistan"},"geometry":{"type":"Point","coordinates":[71.1215,36.7111,215.63]},"id":"usb000kg6q"},     {"type":"Feature","properties":{"mag":4.4,"place":"37km ESE of Grande Anse, Guadeloupe","time":1382068917150,"updated":1382075936219,"tz":-240,"url":"http://earthquake.usgs.gov/earthquakes/eventpage/usb000kg6l","detail":"http://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/usb000kg6l.geojson","felt":1,"cdi":2,"mmi":null,"alert":null,"status":"reviewed","tsunami":null,"sig":298,"net":"us","code":"b000kg6l","ids":",usb000kg6l,","sources":",us,","types":",cap,dyfi,geoserve,nearby-cities,origin,phase-data,tectonic-summary,","nst":null,"dmin":0.927,"rms":1.03,"gap":187,"magType":"mb","type":"earthquake","title":"M 4.4 - 37km ESE of Grande Anse, Guadeloupe"},"geometry":{"type":"Point","coordinates":[-60.7685,16.1425,44.69]},"id":"usb000kg6l"},     {"type":"Feature","properties":{"mag":4.8,"place":"59km ENE of Raoul Island, New Zealand","time":1382060352340,"updated":1382062761000,"tz":-720,"url":"http://earthquake.usgs.gov/earthquakes/eventpage/usb000kg5r","detail":"http://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/usb000kg5r.geojson","felt":0,"cdi":1,"mmi":null,"alert":null,"status":"reviewed","tsunami":null,"sig":354,"net":"us","code":"b000kg5r","ids":",usb000kg5r,","sources":",us,","types":",cap,dyfi,general-link,geoserve,nearby-cities,origin,phase-data,tectonic-summary,","nst":null,"dmin":0.547,"rms":1.24,"gap":109,"magType":"mb","type":"earthquake","title":"M 4.8 - 59km ENE of Raoul Island, New Zealand"},"geometry":{"type":"Point","coordinates":[-177.3712,-28.9952,68.09]},"id":"usb000kg5r"},     {"type":"Feature","properties":{"mag":4.6,"place":"65km WSW of Manta, Ecuador","time":1382059956670,"updated":1382063766330,"tz":-300,"url":"http://earthquake.usgs.gov/earthquakes/eventpage/usb000kg5p","detail":"http://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/usb000kg5p.geojson","felt":3,"cdi":3.4,"mmi":null,"alert":null,"status":"reviewed","tsunami":null,"sig":327,"net":"us","code":"b000kg5p","ids":",usb000kg5p,","sources":",us,","types":",cap,dyfi,general-link,geoserve,nearby-cities,origin,phase-data,tectonic-summary,","nst":null,"dmin":3.14,"rms":0.76,"gap":105,"magType":"mb","type":"earthquake","title":"M 4.6 - 65km WSW of Manta, Ecuador"},"geometry":{"type":"Point","coordinates":[-81.3056,-1.0801,25.2]},"id":"usb000kg5p"},     {"type":"Feature","properties":{"mag":4.9,"place":"Central Mid-Atlantic Ridge","time":1382059845140,"updated":1382060754000,"tz":-180,"url":"http://earthquake.usgs.gov/earthquakes/eventpage/usb000kg5q","detail":"http://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/usb000kg5q.geojson","felt":0,"cdi":1,"mmi":null,"alert":null,"status":"reviewed","tsunami":null,"sig":369,"net":"us","code":"b000kg5q","ids":",usb000kg5q,","sources":",us,","types":",cap,dyfi,general-link,geoserve,nearby-cities,origin,phase-data,","nst":null,"dmin":13.904,"rms":1.17,"gap":79,"magType":"mb","type":"earthquake","title":"M 4.9 - Central Mid-Atlantic Ridge"},"geometry":{"type":"Point","coordinates":[-38.5333,7.9178,10]},"id":"usb000kg5q"},     {"type":"Feature","properties":{"mag":3.1,"place":"114km N of San Juan, Puerto Rico","time":1382057000700,"updated":1382075958596,"tz":-240,"url":"http://earthquake.usgs.gov/earthquakes/eventpage/pr13291001","detail":"http://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/pr13291001.geojson","felt":null,"cdi":null,"mmi":null,"alert":null,"status":"REVIEWED","tsunami":null,"sig":148,"net":"pr","code":"13291001","ids":",pr13291001,","sources":",pr,","types":",cap,geoserve,nearby-cities,origin,tectonic-summary,","nst":4,"dmin":1.23159025,"rms":0.21,"gap":306,"magType":"Md","type":"earthquake","title":"M 3.1 - 114km N of San Juan, Puerto Rico"},"geometry":{"type":"Point","coordinates":[-66.0585,19.4955,15]},"id":"pr13291001"},     {"type":"Feature","properties":{"mag":3.2,"place":"153km NNE of Vieques, Puerto Rico","time":1382056681300,"updated":1382074489829,"tz":-240,"url":"http://earthquake.usgs.gov/earthquakes/eventpage/pr13291000","detail":"http://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/pr13291000.geojson","felt":null,"cdi":null,"mmi":null,"alert":null,"status":"REVIEWED","tsunami":null,"sig":158,"net":"pr","code":"13291000","ids":",pr13291000,","sources":",pr,","types":",cap,geoserve,nearby-cities,origin,tectonic-summary,","nst":6,"dmin":1.39957521,"rms":0.28,"gap":309.6,"magType":"Md","type":"earthquake","title":"M 3.2 - 153km NNE of Vieques, Puerto Rico"},"geometry":{"type":"Point","coordinates":[-65.3018,19.7154,18]},"id":"pr13291000"},     {"type":"Feature","properties":{"mag":2.9,"place":"61km NE of Camalu, Mexico","time":1382048867000,"updated":1382051103563,"tz":-420,"url":"http://earthquake.usgs.gov/earthquakes/eventpage/ci11379962","detail":"http://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/ci11379962.geojson","felt":null,"cdi":null,"mmi":null,"alert":null,"status":"REVIEWED","tsunami":null,"sig":129,"net":"ci","code":"11379962","ids":",ci11379962,","sources":",ci,","types":",cap,general-link,geoserve,nearby-cities,origin,scitech-link,tectonic-summary,","nst":3,"dmin":0.24254513,"rms":0.14,"gap":194.4,"magType":"Ml","type":"earthquake","title":"M 2.9 - 61km NE of Camalu, Mexico"},"geometry":{"type":"Point","coordinates":[-115.6183,31.2453,6]},"id":"ci11379962"},     {"type":"Feature","properties":{"mag":2.9,"place":"26km NE of Soledad, California","time":1382048604900,"updated":1382061371165,"tz":-420,"url":"http://earthquake.usgs.gov/earthquakes/eventpage/nc72089726","detail":"http://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/nc72089726.geojson","felt":1,"cdi":1,"mmi":null,"alert":null,"status":"AUTOMATIC","tsunami":null,"sig":129,"net":"nc","code":"72089726","ids":",nc72089726,","sources":",nc,","types":",dyfi,focal-mechanism,general-link,geoserve,nearby-cities,origin,phase-data,scitech-link,tectonic-summary,","nst":null,"dmin":0.04491576,"rms":0.14,"gap":43.2,"magType":"Md","type":"earthquake","title":"M 2.9 - 26km NE of Soledad, California"},"geometry":{"type":"Point","coordinates":[-121.1617,36.6223,7.9]},"id":"nc72089726"},     {"type":"Feature","properties":{"mag":4.9,"place":"Mid-Indian Ridge","time":1382040756270,"updated":1382069714445,"tz":300,"url":"http://earthquake.usgs.gov/earthquakes/eventpage/usb000kfvj","detail":"http://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/usb000kfvj.geojson","felt":null,"cdi":null,"mmi":null,"alert":null,"status":"reviewed","tsunami":null,"sig":369,"net":"us","code":"b000kfvj","ids":",usb000kfvj,","sources":",us,","types":",cap,dyfi,geoserve,nearby-cities,origin,phase-data,","nst":null,"dmin":20.785,"rms":0.71,"gap":74,"magType":"mb","type":"earthquake","title":"M 4.9 - Mid-Indian Ridge"},"geometry":{"type":"Point","coordinates":[69.0736,-23.117,10]},"id":"usb000kfvj"},     {"type":"Feature","properties":{"mag":3.2,"place":"26km ESE of Cohoe, Alaska","time":1382037828000,"updated":1382066784427,"tz":-480,"url":"http://earthquake.usgs.gov/earthquakes/eventpage/ak10825881","detail":"http://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/ak10825881.geojson","felt":null,"cdi":null,"mmi":null,"alert":null,"status":"AUTOMATIC","tsunami":null,"sig":158,"net":"ak","code":"10825881","ids":",ak10825881,","sources":",ak,","types":",dyfi,general-link,geoserve,nearby-cities,origin,tectonic-summary,","nst":67,"dmin":0.40963177,"rms":0.68,"gap":72,"magType":"Ml","type":"earthquake","title":"M 3.2 - 26km ESE of Cohoe, Alaska"},"geometry":{"type":"Point","coordinates":[-150.8756,60.258,64.3]},"id":"ak10825881"},     {"type":"Feature","properties":{"mag":4.9,"place":"176km ENE of Hachinohe, Japan","time":1382028863680,"updated":1382057818725,"tz":600,"url":"http://earthquake.usgs.gov/earthquakes/eventpage/usb000kfnh","detail":"http://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/usb000kfnh.geojson","felt":null,"cdi":null,"mmi":null,"alert":null,"status":"reviewed","tsunami":null,"sig":369,"net":"us","code":"b000kfnh","ids":",usb000kfnh,","sources":",us,","types":",cap,dyfi,general-link,geoserve,nearby-cities,origin,phase-data,tectonic-summary,","nst":null,"dmin":1.191,"rms":1.37,"gap":175,"magType":"mb","type":"earthquake","title":"M 4.9 - 176km ENE of Hachinohe, Japan"},"geometry":{"type":"Point","coordinates":[143.529,40.8559,31.69]},"id":"usb000kfnh"},     {"type":"Feature","properties":{"mag":3.1,"place":"33km N of Fritz Creek, Alaska","time":1382027563000,"updated":1382056509941,"tz":-480,"url":"http://earthquake.usgs.gov/earthquakes/eventpage/ak10825772","detail":"http://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/ak10825772.geojson","felt":null,"cdi":null,"mmi":null,"alert":null,"status":"AUTOMATIC","tsunami":null,"sig":148,"net":"ak","code":"10825772","ids":",ak10825772,","sources":",ak,","types":",dyfi,general-link,geoserve,nearby-cities,origin,tectonic-summary,","nst":69,"dmin":0.31351203,"rms":0.87,"gap":86.4,"magType":"Ml","type":"earthquake","title":"M 3.1 - 33km N of Fritz Creek, Alaska"},"geometry":{"type":"Point","coordinates":[-151.1942,60.0298,87.9]},"id":"ak10825772"},     {"type":"Feature","properties":{"mag":3.6,"place":"14km ESE of Hyrum, Utah","time":1382026759900,"updated":1382079018263,"tz":-360,"url":"http://earthquake.usgs.gov/earthquakes/eventpage/uu60041537","detail":"http://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/uu60041537.geojson","felt":190,"cdi":3.2,"mmi":3.25,"alert":null,"status":"REVIEWED","tsunami":null,"sig":260,"net":"uu","code":"60041537","ids":",uu60041537,","sources":",uu,","types":",cap,dyfi,general-link,geoserve,nearby-cities,origin,shakemap,tectonic-summary,","nst":null,"dmin":0.07186522,"rms":0.14,"gap":57.6,"magType":"Ml","type":"earthquake","title":"M 3.6 - 14km ESE of Hyrum, Utah"},"geometry":{"type":"Point","coordinates":[-111.6838,41.6033,11.4]},"id":"uu60041537"},     {"type":"Feature","properties":{"mag":2.7,"place":"10km WNW of Shasta Lake, California","time":1382024460700,"updated":1382058287850,"tz":-420,"url":"http://earthquake.usgs.gov/earthquakes/eventpage/nc72089531","detail":"http://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/nc72089531.geojson","felt":1,"cdi":2,"mmi":null,"alert":null,"status":"AUTOMATIC","tsunami":null,"sig":112,"net":"nc","code":"72089531","ids":",nc72089531,","sources":",nc,","types":",dyfi,general-link,geoserve,nearby-cities,origin,phase-data,scitech-link,","nst":null,"dmin":0.06288207,"rms":0.13,"gap":90,"magType":"Ml","type":"earthquake","title":"M 2.7 - 10km WNW of Shasta Lake, California"},"geometry":{"type":"Point","coordinates":[-122.4883,40.7127,22.4]},"id":"nc72089531"},     {"type":"Feature","properties":{"mag":2.6,"place":"13km SSE of Volcano, Hawaii","time":1382022033300,"updated":1382022379514,"tz":-600,"url":"http://earthquake.usgs.gov/earthquakes/eventpage/hv60578296","detail":"http://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/hv60578296.geojson","felt":null,"cdi":null,"mmi":null,"alert":null,"status":"AUTOMATIC","tsunami":null,"sig":104,"net":"hv","code":"60578296","ids":",hv60578296,","sources":",hv,","types":",general-link,geoserve,nearby-cities,origin,","nst":null,"dmin":0.05389892,"rms":0.35,"gap":100.8,"magType":"Ml","type":"earthquake","title":"M 2.6 - 13km SSE of Volcano, Hawaii"},"geometry":{"type":"Point","coordinates":[-155.1912,19.3207,1.8]},"id":"hv60578296"},     {"type":"Feature","properties":{"mag":2.5,"place":"8km SSW of Volcano, Hawaii","time":1382019528300,"updated":1382055396752,"tz":-600,"url":"http://earthquake.usgs.gov/earthquakes/eventpage/hv60578286","detail":"http://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/hv60578286.geojson","felt":null,"cdi":null,"mmi":null,"alert":null,"status":"REVIEWED","tsunami":null,"sig":96,"net":"hv","code":"60578286","ids":",hv60578286,","sources":",hv,","types":",cap,general-link,geoserve,nearby-cities,origin,","nst":null,"dmin":0.00898315,"rms":0.1,"gap":54,"magType":"Ml","type":"earthquake","title":"M 2.5 - 8km SSW of Volcano, Hawaii"},"geometry":{"type":"Point","coordinates":[-155.2747,19.3675,31.6]},"id":"hv60578286"},     {"type":"Feature","properties":{"mag":3.1,"place":"19km W of West Bishop, California","time":1382017510600,"updated":1382072572313,"tz":-420,"url":"http://earthquake.usgs.gov/earthquakes/eventpage/nc72089491","detail":"http://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/nc72089491.geojson","felt":2,"cdi":2.7,"mmi":null,"alert":null,"status":"AUTOMATIC","tsunami":null,"sig":148,"net":"nc","code":"72089491","ids":",nc72089491,","sources":",nc,","types":",dyfi,focal-mechanism,general-link,geoserve,nearby-cities,origin,phase-data,scitech-link,","nst":null,"dmin":0.06288207,"rms":0.05,"gap":108,"magType":"Md","type":"earthquake","title":"M 3.1 - 19km W of West Bishop, California"},"geometry":{"type":"Point","coordinates":[-118.6773,37.3892,13.2]},"id":"nc72089491"},     {"type":"Feature","properties":{"mag":5.4,"place":"22km SSE of Lata, Solomon Islands","time":1382008392050,"updated":1382037346800,"tz":660,"url":"http://earthquake.usgs.gov/earthquakes/eventpage/usb000kfhi","detail":"http://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/usb000kfhi.geojson","felt":null,"cdi":null,"mmi":null,"alert":null,"status":"reviewed","tsunami":null,"sig":449,"net":"us","code":"b000kfhi","ids":",usb000kfhi,","sources":",us,","types":",cap,dyfi,geoserve,nearby-cities,origin,phase-data,tectonic-summary,","nst":null,"dmin":6.06,"rms":0.99,"gap":59,"magType":"mb","type":"earthquake","title":"M 5.4 - 22km SSE of Lata, Solomon Islands"},"geometry":{"type":"Point","coordinates":[165.9252,-10.8982,62.8]},"id":"usb000kfhi"},     {"type":"Feature","properties":{"mag":4.2,"place":"131km S of Puerto El Triunfo, El Salvador","time":1381997360900,"updated":1382026310261,"tz":-360,"url":"http://earthquake.usgs.gov/earthquakes/eventpage/usb000kfgf","detail":"http://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/usb000kfgf.geojson","felt":null,"cdi":null,"mmi":null,"alert":null,"status":"reviewed","tsunami":null,"sig":271,"net":"us","code":"b000kfgf","ids":",usb000kfgf,","sources":",us,","types":",cap,dyfi,general-link,geoserve,nearby-cities,origin,phase-data,tectonic-summary,","nst":null,"dmin":1.708,"rms":1.35,"gap":184,"magType":"mb","type":"earthquake","title":"M 4.2 - 131km S of Puerto El Triunfo, El Salvador"},"geometry":{"type":"Point","coordinates":[-88.5719,12.0947,40.04]},"id":"usb000kfgf"}],"bbox":[-177.3712,-28.9952,1.8,165.9252,60.258,215.63]}


Projecting OpenStreetMap raster base in other projections

I know that OSM WMS service works with EPSG:4326 and EPSG:900913   I need to have an OSM base layer projected in another Projection, for example **EPSG:32632**   Do you know some way to do this?   Even Reproject WMS service, or download new tiles for Geoserver.


How to determine Plane Height for given Volume?

I have delineated a watershed for a dam in ArcGIS. I am doing some analysis and for that I have a preset volume value that have to be stored behind the dam. Can I determine the plane height that would match the given volume?


Auto generate map from natural earth data with QGIS or other utility

I'm looking at natural earth data to generate each country and save it as a png. What I'm using is: `10m_populated_places`, `10m_admin_0_countries` and `10m_land`. The populates places is the first layer, then the countries and then the land. For each of the countries I want to: 1) Filter populated places to `FEATURECLA = 'capital'` & `ADM0NAME` = country 2) Filter countries to `ADMIN` = country 3) Set the said country in the middle of the screen and save it as an image. For this I need to zoom in but leave some space around the country. I'm a complete beginner, what is the easiest way to accomplish this with QGIS or some other GIS software?


CRS centered on the 180 meridian?

The problem I'm dealing with is the old 180 meridian problem, except I'm not trying to plot or render shapes that cross it, I need to do intersections of lines that cross it. The only spherical function available in geotools appears to be orthodromic distance, so I need to do the intersections in 2d. Can I take the naive approach and simply copy the WGS83 WKT and change the PM to 180? I can't use the UTM zones because my lines are long (airport to airport, i.e. Hong Kong to Vancouver).


Unwanted lines when cutting & merging polygons

I am using QGIS version 1.8.0. Sometimes when I cut or merge polygons I get unwanted lines left in them. On zooming in to them they do not appear to be slivers. Is there a way of getting rid of these line, some kind or tidy feature or plugin? Thanks


How to add a raster to ArcMap if file name is unknown?

I have a raster file for which I know the the workspace, but not the filename (it is a temporary file generated by operations from my program that randomizes its name on creation, i.e. "ras457"). I cannot store the raster at time of generation for various reasons, so is there a way to programatically grab the raster from the folder without knowing its exact name and store it in an IGeoDataset? The raster is stored in a temporary folder created when I run the program, so it will be the only item in the folder. One route I have considered exploring is using .NET's directory info class to get the names of the contents of the folder and extracting it from there, but there may be a simpler way to accomplish this that I have not considered.


How to improve the color matching between a scanned image of a map and the original?

When I scan a section of paper map using a Canon Lide 200 A4 scanner, the resulting image has colours which are not true to the original.   The most annoying is where the predominantly white paper background of a map is rendered as a greyish blue colour instead of pure white. Processing in ESRI ArcEditor 9.2 such as clipping the image so that it can be butt joined and geo-referenced, results in even darker shades, even less true to the original. I need a very simple solution to this problem as I'm too old to start learning how to use Photoshop or similar image processing software. In finding a solution cost isn't the issue - The learning curve is.   Can anyone offer advice?


I have a raster in Quantum GIS and I am just exploring it. How can I see average of raster value over certain area, marked by mouse? In other words:   1. How can I select particular area in QGIS?   2. How can I compute average of raster value over that area?


How can I put the name of file in add field with python?

In my script, I have to create field in 15 layers. The name that I wold like to set in this new field is the same of the file's name. But all attempts that I did were worng. My script:               proj=arcpy.mapping.MapDocument("C:\\analise_mestrado\\analise_215_070.mxd")     fclist= arcpy.mapping.ListLayers(proj)     [<map layer u'20060902_215_070'>, <map layer u'20080721_215_070'>, <map layer u'20090622_215_070'>, <map layer u'20100609_215_070'>, <map layer u'20110527_215_070'>, <map layer u'20010616_215_070'>, <map layer u'20000731_215_070'>, <map layer u'19860911_215_070'>, <map layer u'19870509_215_070'>, <map layer u'19870525_215_070'>, <map layer u'19880628_215_070'>, <map layer u'19930525_215_070'>, <map layer u'19940816_215_070'>, <map layer u'19941104_215_070'>, <map layer u'19850722_215_070'>, <map layer u'19970605_215_070'>, <map layer u'19730726_231_070'>, <map layer u'19960618_215_070'>, <map layer u'20110714_215_070'>]      # Error for first attempt               for fc in fclist:         arcpy.AddField_management(fc,fc,"DOUBLE",12,2)     Runtime error <class 'arcgisscripting.ExecuteError'>: ERROR 000840: The value is not a String.      # Other error, for second attempt               for fc in fclist:         arcpy.AddField_management(fc,str(fc),"DOUBLE",12,2)     Runtime error <class 'arcgisscripting.ExecuteError'>: ERROR 000313: The length of Field Name must not be larger than 10        # Other error               for fc in fclist:         arcpy.AddField_management(fc,str(fc[:6]),"DOUBLE",12,2)     Runtime error <type 'exceptions.TypeError'>: 'Layer' object is unsubscriptable      Is there anyone who can help me?


Can you create a layer containing years of daily data, then extracting a specific area and time frame

So I have a tone of .nc files containing gridded rainfall and precipitation data in daily time steps. The data spans from 1980 to 2005 for all of Ireland. Now what I am hoping to be able to do is to combine these into Gridded_Temp and Gridded_Percip, then layer then on top of a map of Ireland with a catchment area file i've already created and extract the data that falls under the catchment area (and if I can also be able to choose a time frame for the data to be extracted). What i've done so far is: Make the catchment file using Grass Combined my temp and precipitation files and attempted to layer these on to my current map (I have kept the files in .nc format so that they include coordinate data). I tried adding the Gridded_temp layer but it came out as a black outline of Ireland, indicating to me that all the daily values combined together. Next I was going to see if I can use the clipper to try and extract the catchment area but I'm not sure if what im doing is at all correct as i've only just started using any sort of GIS programs about 3 weeks ago. So I was hoping to get some input from people who actually understand what they're doing if my plan is sound or just a waste of time. If what im doing just wont work, does anyone have any suggestions on how else I could do this?


Python Script: Automatically georeference photographs (To be used in ArcMap)

I have 563 photographs that have been taken as part of a site survey. The only location information that I have is a single GPS location (lat,long) at which the photograph was taken. I'm looking for a Python Script (ArcGIS) that will use the GPS location of each Photograph (Point Feature Class) and then based on a given width and height georeference each photograph. It's important to read the raster properties to determine if the image is portrait or landscape. Any sample python code (ArcPy) will be appreciated and any other alternative methods are welcome. Regards


Calculating compass bearing between two GPS coordinates... with a twist

I'm building a virtual tour application that uses Google's streetview code to render the panoramas into a non-distorted view. Each panorama has 1 to _n_ links where the user can select to move on. I use the GPS coordinates of each location to calculate the compass bearing from the current location to the next. The issue has to do with StreetView's rendering of the link bearings. When a panorama loads, one of the data fields required is `centerHeading`. This determines the part of the image that is rendered smack dab in the middle of whatever element you're using as a map container. In addition, whatever value `centerHeading` has is what StreetView sees as due north. The link rendering locations are displayed relative to north, which causes quite a bit of inaccuracy with the link bearings. Check out `[http://130.111.148.131/JMCTour/testIndex.php][1]` for an example. The bearing from the start location to the next is 247 degrees, as calculated from the GPS coordinates of each location. Due to the way the image was taken, the `centerHeading` value is 175 degrees, and this throws off the actual links quite a bit. In order to have a correct link bearing, I have to manually replace the calculated bearing of 247 degrees with 0. Multiply this trial and error bearing testing by over 100 seemingly arbitrary heading definitions, and you just might get a headache. So my question is, is there a way to factor in the location's heading setting in the link bearing calculations?


ArcGIS javascript API Update Records of a Feature Layer

I'm new to ArcGIS javascript API, now I want to create a feature layer and then add an array of attributes or simply update the array of attributes of a specific field. I only need to replace the original values array as my own array. Is that possible? There's a method: attr(name,value), Can I use this? Can any one give me some hints or code? Thanks in advance!


How to resize a polygon (rectangle or circle) in Qgis?

Yes I used the Rectangles Ovals plugin to create a rectangle then rotate it and move it nto position. But if you want to resize it that is where the fun starts because it is just a polygon with four corners, you can move them all independently so it is very hard to keep proportion or angles correct. A rectangle is four lines at right angles. To make it longer or wider you just need to be able to increase the length of two of the sides. A circle has many more "sides" so this would be harder to implement using measurements alone, but it could be done this way. I don't know if anyone has implemented a plugin that can do this resizing. I just know dragging the nodes to new positions is very tedious especially trying to keep a circle circular. Something that let me lengthen the individual sides is a quick-and-dirty way of increasing a polygon but there may be some better option. But the Rectangles and Ovals plugin only lets me draw new ones and if the new one is the wrong size I have to start again.


Why are font and line sizes different in QGIS's Print Composer and how do I normalize them?

Why does my map look so different when I look at it in the QGIS print composer? The widths of lines change, the size of markers change, the size of fonts change. Is there any way to have the two always in sync? My goal is generated a printed map so it's frustrating to have to load the Print Composer and then go back and tweak everything in the regular view. Everything is always smaller in the editor view and bigger in the print composer view. I feel like there's something obvious I'm missing or not getting. ![QGIS View](http://i.stack.imgur.com/lifLZ.jpg) ![Print Composer View](http://i.stack.imgur.com/TKcqR.png)


What are some advantages to using ArcSDE in your organization?

This is somewhat a general topic, but I need some advantages to using ArcSDE in my organization. We actually have SDE for our webmapping software, but we are unable to edit it using ArcGIS basic licenses. I'm trying to put together some sort of spread sheet showing cost savings of using SDE to the President who doesn't know how ArcGIS works. What are some of the cost savings that purchasing Standard licenses would give us. My company is small and just wants to start with 3 standard licenses and move on from there.


how can I set the StartBounds, units, and tileSize correctly in OpenLayers?

how can I set the StartBounds, units, and tileSize correctly in OpenLaters?I can not make sure this parameters,for I use jsonp,and it will dynamticly read layerinfo from esri rest resources.                var maxExtent = new OpenLayers.Bounds(102.9702000357959, 26.573810737410064, 110.21822155809812, 29.11729567697843);         baseLayer = new OpenLayers.Layer.ArcGISCache("baseMap", layerURL, {             isBaseLayer: true,             //numZoomLevels: 11,             StartBounds: maxExtent,             zoom: 5,             layerInfo: layerInfo,             projection: 'EPSG:' + layerInfo.spatialReference.wkt         });         console.log(layerInfo.spatialReference.wkt);         //console.log(baseLayer.spatialReference);         map = new OpenLayers.Map('map', {             StartBounds: maxExtent,             initialExtent: baseLayer.initialExtent,             maxExtent: maxExtent,             units: (baseLayer.units == "esriFeet") ? 'ft' : 'm',             resolutions: baseLayer.resolutions,             tileSize: baseLayer.tileSize,             eventListeners: { //set event handler                 "moveend": moveEvent},             //displayProjection: baseLayer.displayProjection             projection: 'EPSG:' + layerInfo.spatialReference.wkt         });


How to get City, State, Numeration, etc from OSM roads by Geofabrik?

I'm really new in this GIS world. I downloaded a shp file from Geofabrik (http://download.geofabrik.de/osm/south-america/chile.shp.zip) and imported it to Postgresql using Postgis. If I see the road table, this is the info that I get: http://grab.by/fHa4 Looking in internet, I understood that geom can give me some geographic info that I need (lat, long per example). But, I need to know more specific information about this polyline: City, State, numeration, etc. Is this info in geom column? Or in other part in this .shp? How could I get this information?


How can I copy archive data from one server to another?

I have an SDE 10.0 server and an SDE 10.1 server and I am trying to migrate the layers from 10.0 to 10.1. (On a side note the 10.0 server is running SQL Server 2005 and the 10.1 server is running SQL Server 2012.) Some of the layers have archiving turned on and there seems to be no way to transfer the layer as well as all of the archival information. Is there a way to copy the layer and also its archive? Alternately, can I just turn on archiving on the new server after transferring the layer, then copy the rows from the old server into the newly created archival table with a SQL tool (Import/Export Data)?


How to obtain road classification type at a point via nominatim?

This is my first time posting here so please forgive me if i ask a trivial question. Is there a way of obtaining the type of road an object is settled in from a request via nominatim? (i have the geocoded sample) For example: http://nominatim.openstreetmap.org/reverse?format=xml&lat=52.5487429714954&lon=-1.81602098644987&zoom=18&addressdetails=1 does provide me with loads of info. yet, there is no info on the road the address is settled in. would like to obtain something like: rural road or even just grade*N* (where N stands for the level of hierarchy.) i hope what i'm looking for is understandable :) thanks in advance!


Using Qgis server with Ubuntu 12.04

I realise there had been many posts on this subject but unfortunately I need to post again. I've been banging my head against this all day. I'm trying to get qgis server working with Ubuntu 12.04 with no luck. I'm using Qgis 1.8 lisbora I used Synaptic package Manager to install all the necessary packages. Apache2 web server is running ok tested using [http://localhost/] returned "It Works!" Created a folder in /usr/lib/cgi-bin/ called project and copied qgis_mapserv.fcgi and wms_metadata.xml files into the project folder. /usr/lib/cgi-bin/ Created a .qgs project in desktop Qgis 1.8 and saved it directly to /usr/lib/cgi-bin/project Checked capabilities using: [http://localhost/cgi- bin/project/qgis_mapserv.fcgi?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities] in a browser url address bar. Get Capabilities shows the right CRS and the vector layer name but zero values for the bounding box and zero values for the lat/long bounding values. I've used absolute paths for the .qgs project file, changed the permissions for both the project file and the folder. I've also checked the path to the data files in the .qgs project file and it looks correct. I also removed the # at the first line of the httpd file. I think this is a problem with the bounding box and the lat/long bounding values. This was set in project properties dialogue box under >OWServer>Advertised extent> Use Current Canvas Extent. I'm at a loss as to what to do next. Any help would be greatly appreciated. Regards


How to import multiple textfiles in one step

Is ist possible to import multiple textfiles (csv, tsv etc.) as layers in one step or do i have to do it file by file?


Merging multiple tables to shape using for loop

I have to join multiple tables to a shapefile using a common field. I want to script this in python (i am using ArcGIS 10.1). Below is the script i am using. My question is As folks might notice, I am calling the tables one by one and merging them to the shape. I would like to put this in a for loop so the script reads all the tables (that have prefix dTable) and merge them to the shape. Just not sure how to proceed (I am very new to this. started just over a week ago). Any help will be appreciated.               #Redefine the workspace to the geodatabase          env.workspace = os.path.dirname(os.path.dirname(__file__))+'\\'+ out_name +'.gdb'     print "Workspace for GDB:"+ env.workspace          ################################################################################     #STEP 5: Start Joining Tables     # Set local variables          featureName = "temp_Streets"     layerName="Streets2"          outFeature = "temp_Streets2"     expression = "temp_Streets.FUNC_CLASS < 99"          ################################################################################     # Exclude centriod connectors from the shapefile before joining     try:          # Make a layer from the feature class         arcpy.MakeFeatureLayer_management(featureName,layerName)         print "Converting to Layer Done !"              # Select desired features from street layer         arcpy.SelectLayerByAttribute_management(layerName, "NEW_SELECTION", expression)         print "Selection Done !"              # Copy the layer to a new permanent feature class         arcpy.CopyFeatures_management(layerName, outFeature)         print "Copy to new layer Done !"              print "Step 5: Creating Streets file Done !"         print "#################################################"         arcpy.AddMessage("Creating Streets file Done !")     except:         print arcpy.GetMessages()     ################################################################################     joinTable1 = "dTable_HBW_csv"     layername1="j_Streets1"     outFeature1 = "temp_j_Streets1"     joinField = "CONNECT"          # Join the first CSV file     try:          # Make a layer from the feature class         arcpy.MakeFeatureLayer_management(outFeature,layername1)         print "Converting to layername1 Done !"              # Join the feature layer to a table         arcpy.AddJoin_management(layername1, joinField, joinTable1, joinField, "KEEP_ALL")         print "Join 1 Done !"              # Copy the layer to a new permanent feature class         arcpy.CopyFeatures_management(layername1, outFeature1)         print "Copy to new layer 1 Done !"              print "Step 5a: Joining Streets 1 file Done !"         print "#################################################"         arcpy.AddMessage("Joining Streets 1 file Done !")          except:         print arcpy.GetMessages()     ###############################################################################     joinTable2 = "dTable_HBO_csv"     layername2="j_Streets2"     outFeature2 = "temp_j_Streets2"     joinField2 = joinTable1+"_CONNECT"          # Join Second CSV file     try:          # Make a layer from the feature class         arcpy.MakeFeatureLayer_management(outFeature1,layername2)         print "Converting to layername2 Done !"              # Join the feature layer to a table         arcpy.AddJoin_management(layername2, joinField2, joinTable2, joinField, "KEEP_ALL")         print "Join 2 Done !"              # Copy the layer to a new permanent feature class         arcpy.CopyFeatures_management(layername2, outFeature2)         print "Copy to new layer 2 Done !"              print "Step 5b: Joining Streets 2 file Done !"         print "#################################################"         arcpy.AddMessage("Joining Streets 2 file Done !")          except:         print arcpy.GetMessages()


Mod Tile Cache Size

I am using Mod Tile, Renderd and Mapnik to creat a Tile Server. My question here is, does mod_tile have specific limits for the cache size? If yes, where can it be configured. And what mechanism it uses to regulate the cache? I mean removing older images and if yes then for what zoom etc.


How to auto-start a pyQGIS thread?

having build some (two) minor plugins, it's now time for me to link a few (perl-) applications to qgis. As there is no perl-interface in qgis I thought the best way to link both worlds together is a kind of messaging system. It should work like tis:   * the perl-app sends a message to a certain folder   * qgis starts a separete loop which looks every second, whether there is an incoming message in that folder   * Qgis performs the necessary stuff an deletes the message again.   * Or vice versa. My question is how to start such a loop in qgis and how to do this at qgis- startup. By the way - is there a possibility to "automate" QGis from external python applications? And if so is there any example code? Thanks and regards


PostGIS Group By Error

I am performing a pretty simple query in PostGIS 2.1.1 from within QGIS 2.2 for Windows (using the DB Manager plugin). I have a table with many columns and I am trying to perform a Group By function. However, PostGIS returns an error when I do not add all the columns from my SELECT call within the GROUP BY call (see below). **ORIGINAL QUERY**               SELECT city, state, city_abbr     FROM "public".footprints     WHERE city_abbr = 'nyc'     GROUP BY city      This query returns the following error:               column "footprints.state" must appear in the GROUP BY clause or be used in an aggregate      function     LINE 1: SELECT city, state, city_abbr      If I change my query to the following, it runs. **ALTERED QUERY**               SELECT city, state, city_abbr     FROM "public".footprints     WHERE city_abbr = 'nyc'     GROUP BY city, state, city_abbr      I do not want to have to add each column to my GROUP BY statement. Can anyone shed any light on why this would be happening. Thanks... **EDIT** Here is an example of the data in the table               gid   | city      | state   | city_abbr     ______________________________________     0        boston      ny         bos     1        manhattan   ny         nyc     2        brooklyn    ny         nyc     3        newark      nj         nyc     4        denver      co         den     5        seattle     wa         sea


Creating contiguous pixel based cartogram using ArcGIS for Desktop?

There are several types of cartograms out in the world, but I feel the best one are the continuous cartograms made with separate pixels. I recently made one on paper and then transcribed it to excel by filling in each cell with different colors. This was time consuming and disheartening. Is there a straightforward way of doing a similar cartogram in ArcGIS? Examples ![Credit: improving- visualisation.org](http://i.stack.imgur.com/sNnsn.jpg) ![Credit: Reuters electoral college map](http://i.stack.imgur.com/4KzQ4.jpg)


ArcGIS arcpy code fails in Toolbox mode

This code executes correctly in Python window but fails with > ERROR 000732: Input Table: Dataset JHJ does not exist or is not supported               # Import ArcPy and other required modules     import arcpy     from arcpy import env     import fileinput     import string     import os     env.overwriteOutput = True     filud=file(r"c:\temp\dum.txt","w")     # Open file for debug output     filud.write("Hello \n")     try:        # Will create shape file fcname.shp        arcpy.CreateFeatureclass_management(r"C:\temp\TestArcGis\FraFil","JHJ","Polyline")        filud.write(str(time.time()) + " After create \n")     except Exception as e:        filud.write(str(time.time()) + "Error: " + e.message + "\n")     try:        # Add fields for data        filud.write(str(time.time()) + " Before Addfield " + "JHJ" + "\n")        arcpy.AddField_management("JHJ","Sbet","TEXT")     except Exception as e:       print e.message       filud.write("Error: " + e.message)     filud.close()


Arcpy Subtracting rasters error - TypeError: 'unicode' object is not callable

I have a script which subtracts 2 versions of the same raster from each other (one newer than the other) and then extracts the additions & deletions that have happened. I created a simple test script which works:               # Import arcpy module     import arcpy     from arcpy import env     from arcpy.sa import *          # Check out any necessary licenses     arcpy.CheckOutExtension("spatial")               # Local variables:     New = "C:\\Data\\JOB_13\\tq03\\ABRdsText.tif"     Old = "D:\\Data\\Job_Backups\\JOB_13\\tq03\\ABRdsText.tif"     Addition_Raster = "C:\\Testing\\District_Editor\\QC_ChangePlots\\JOB_13\\tq03\\Additions\\output.tif"     Deletion_Raster = "C:\\Testing\\District_Editor\\QC_ChangePlots\\JOB_13\\tq03\\Deletions\\output.tif"          arcpy.MakeRasterLayer_management(New, "N")     arcpy.MakeRasterLayer_management(Old, "O")               # Process: Raster Calculator     RR = Raster("N") - Raster("O")          # Process: Extract by Attributes     arcpy.gp.ExtractByAttributes_sa(RR, "VALUE =-255 OR VALUE =0", Addition_Raster)          # Process: Extract by Attributes (2)     arcpy.gp.ExtractByAttributes_sa(RR, "VALUE =255 or VALUE=0", Deletion_Raster      I then replicated this into my main script:               #import the necessary modules     import arcpy     from arcpy import env     from arcpy.sa import *     import os          #Checkout the necessary Arc licences     arcpy.CheckOutExtension("spatial")          #Ask the user for the job number     #Job_Number = arcpy.GetParameterAsText(0)     # MANUAL OVERIDE TO GET TEST JOB_NUMBER     Job_Number = 13     Job = 'JOB_'+str(Job_Number)          ####################################################     #Folder where all data will be written to     OutputsDirectory = r"C:\Testing\District_Editor\QC_ChangePlots"          ####################################################     #Folder with the backed up data pre-editing i.e. old data     BackupDirectory =r"D:\Data\Job_Backups"          ####################################################     #Location of the QC Change plot Master mxd     ChangePlot_mxd = r"Y:\esriuk\OSBurnProcessGPTools\resources\mxdHolder\QC_ChangePlot.mxd"          ####################################################     #Location of the Job folder     DataFolder = os.path.join("C:\\Data\\",Job)          ####################################################          JobF = os.path.join(OutputsDirectory,Job)          for folder in os.listdir(DataFolder):         arcpy.env.workspace = DataFolder + "\\" + str(folder)         Ras = arcpy.ListRasters("*", "TIF")         for Raster in Ras:             #Set the output rasters             Additions = os.path.join(JobF + "\\" + str(folder) + "\\Additions\\"+ str(Raster))             Deletions = os.path.join (JobF + "\\" + str(folder) + "\\Deletions\\"+ str(Raster))                  #Set the file paths for the new and old rasters             New = os.path.join(str(DataFolder) +"\\" + str(folder) + "\\" + str(Raster))             Old = os.path.join(str(BackupDirectory) + "\\" + str(Job) + "\\" + str(folder) + "\\" + str(Raster))                  #Convert the Raster datasets into a temporary Raster Layer so that they can be used for a calculaion             arcpy.MakeRasterLayer_management(New, "N")             arcpy.MakeRasterLayer_management(Old, "O")                       #Raster Calculator - subtract the old raster from the new raster ( new - old)             CalculatedRast = Raster("N") - Raster("O")                            #Extract the Additions             arcpy.gp.ExtractByAttributes_sa(CalculatedRast, "VALUE =-255 OR VALUE =0", Additions)                       #Extract the deletions             arcpy.gp.ExtractByAttributes_sa(CalculatedRast, "VALUE =255 or VALUE=0", Deletions)      However, I get the error               Traceback (most recent call last):       File "C:\Python27\ArcGIS10.1\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 325, in RunScript         exec codeObject in __main__.__dict__       File "S:\Development\Dan\GIS\Code\District_Editor\QC_ChangePlots.py", line 204, in <module>         CalculatedRast = Raster("N") - Raster("O")     TypeError: 'unicode' object is not callable      Anybody able to suggest where I am going wrong and how to fix it? I'm fairly new to python, so it's probably something quite simple! The error seems to be here               CalculatedRast = Raster("N") - Raster("O")


Intersection of two lines tool

Is there any way to make intersection of two lines tool with extending lines option, so the result would be a point. the hardest part is when the lines have to be extended to intersect. the tool will intersect int the cases described in the picture below. this operation is a common CAD operation but i haven't found a tool or a snippet to do it in Arcobjects or Arcgis Engine 10.1. Any help please. ![enter image description here](http://i.stack.imgur.com/UMEuw.png)


Customized popup in Openlayers

I have done point layer overlay with openlayer. Whenever i click any point, its showing me all the data of the table(postgresql) in popup. How to control amount of data in the popup? All the columns are being displayed in popup. I just want location_name to be displayed in the popup. how to extract location_name from event.text? Code is:               ....     info = new OpenLayers.Control.WMSGetFeatureInfo({         url: 'http://localhost:8080/geoserver/layername/wms',  // geoserver point layer          title: 'Identify features by clicking',         queryVisible: true,         eventListeners: {             getfeatureinfo: function(event) {                 map.addPopup(new OpenLayers.Popup.FramedCloud(                     "ABCD",                      map.getLonLatFromPixel(event.xy),                     null,                     event.text,                     null,                     true                 ));             }         }     });     map.addControl(info);     info.activate();


From local tiles to WMS via Mapproxy

I have any local tiles (seed via Mapproxy) of any local area. May I configure mapproxy that I can use a local tile directory on my computer as a source and get the output then WMS ? I've already configured mapproxy.yaml which has this lines: services:               demo:       wms:         srs: ['EPSG:3857', 'EPSG:4326', 'EPSG:3395']         # image_formats: ['image/jpeg', 'image/png']         md:           # metadata used in capabilities documents           title: MapProxy WMS Proxy           abstract: This is the fantastic MapProxy.           online_resource: http://mapproxy.org/           contact:             person: Your Name Here             position: Technical Director             organization:              address: Fakestreet 123             city: Somewhere             postcode: 12345             country: Germany             phone: +49(0)000-000000-0             fax: +49(0)000-000000-0             email: info@omniscale.de           access_constraints:             This service is intended for private and evaluation use only.             The data is licensed as Creative Commons Attribution-Share Alike 2.0             (http://creativecommons.org/licenses/by-sa/2.0/)           fees: 'None'          layers:       - name: Testing tiles         title: Testing tiles         sources: [osm_cached]     caches:       osm_cached:         grids: [gmaps_grid]         sources: []         cache:          type: file          directory_layout: tms          grids:       gmaps_grid:         tile_size: [256, 256]         srs: EPSG:3857         origin: nw      But cannot see the results, just empty page whout scrolling Please explain should I use cache->directory_layoutORdirectory? If so how does it look?


Add a new field in a already created feature class

I have a feature class. On the basis of some calculation, I want to create a new field in that table and set value of that field. To do so, my algorithm is:               void UpdateFeatureClass(IFeatureClass featureClass, List<Edge> edges)     {         CreateField(featureClass);         UpdateDictionary(featureClass);         UpdateFieldValue(edges);     }      To add a field I use following code snippet:               private void CreateField(IFeatureClass featureClass)     {         IFields oldFields = featureClass.Fields;         IFieldsEdit fieldsEdit = (IFieldsEdit)oldFields;              IField field = new FieldClass();         var fieldEdit = (IFieldEdit)field;         fieldEdit.Name_2 = "Value";         fieldEdit.Type_2 = esriFieldType.esriFieldTypeInteger;         fieldsEdit.AddField(field);     }      Update dictionary basically creates a dictionary with all features of the feature class. The key of the dictionary is feature's OID and value of the dictionary is the feature. After that I am trying to update features with value in the value field. The code snippet is:               private void UpdateFieldValue(List<Edge> edges)     {         int fieldIndex = dictionary[0].Fields.FindField("Value");         if (fieldIndex != -1)         {             foreach (Edge edge in edges)             {                 var feature = _dictionary[edge.PolylineEdge.OID];                 feature.set_Value(fieldIndex, edge.Value);                 feature.Store();             }         }     }      Everything works fine for me except the feature.Store() command. Whenever this line executes, `'System.Runtime.InteropServices.COMException'` exception occurs. From my perspective, if there is any problem with set value, the error should occur in that statement. I couldn't find out any pointer why the store command creates the error. Can anyone please help me to find why the error is occurring? **EDIT :** I tried to store value in different fields of the feature and succeeded. Only updating the value of the newly created field, gives the exception.   * Error message: "Error encoding INFO item during save"   * Error code: (-2147220133) **EDIT :** I think the problem is the newly created field is not permanent. after adding the field, I go through the feature class and the newly created field is here. But whenever I close the ArcMap and open a new ArcMap, I find that the newly added field is vanished. So, I think the problem is the change is not permanent. So, My question is **how to create a field in a already created feature class permanently?** Thanks


PostGIS schemas doesn't show in QGIS

I try to use QGIS to display some data stored in PostGIS, some of schemas don't show except public; And it's a testing DB, so I have only one super user: postgres. I use PostgreSQL9.3. Anyone has some suggestion? Thanks.