adding a column containing buttons in dojo grid arcgis jsapi

I am using ArcGIS jsapi to develop a web application where I use a synchronous geoprocessing service that return a shapefile. I used the shapefile table to populate 2 dojo grids depending on the value of a field: "Status" which have two values: "U" and "M". I was able to show the attributes in the grid, but i needed now to add a column that contain a button in each row in one of the tables, when I tried I got an error: the table where I didn't add the column is working fine, but the other table is not. can you please help I don't what I'm missing, here's the code sample:               function formatter(){             var w = new Button({                 label: "Click me!",                 onClick: function() {                     alert("Thanks for all the fish.  ");                 }             });             w._destroyOnRemove=true;             return w;         }                 var layout = [       { name: 'FID', field: 'FID', width: "50px" },             { name: 'street', field: 'Base_Name', width: "250px" },             { name: 'ville', field: 'ville', width: "175px" },             { name: 'quartier', field: 'Quartier' },             { name: 'commune', field: 'Commune' },             { name: 'Status', field: 'Status' },             { name: 'Score', field: 'Score' }         ];       var layout2 = [       { name: 'FID', field: 'FID', width: "50px" },             { name: 'street', field: 'Base_Name', width: "250px" },             { name: 'ville', field: 'ville', width: "175px" },             { name: 'quartier', field: 'Quartier' },             { name: 'commune', field: 'Commune' },             { name: 'Status', field: 'Status' },             { name: 'Score', field: 'Score' },       {name: 'Message', field: 'message', width: 8,              formatter: formatter    /*Custom format, add a button. */       }         ];     function featureSetToStore(jobInfo) { //jobinfo of the geoprocessin service         //create items array to be added to store's data         var itemsM = []; //all items to be stored in data store         var itemsU = []; //all items to be stored in data store         dojo.forEach(jobInfo.features, function(feature, index) {             if (feature.attributes["Status"] == "U") {    //find features where "Status=U"                           itemsU.push(feature.attributes);  //append each attribute list as item in store             } else {   //here the features where "status=m"                 itemsM.push(feature.attributes);  //append each attribute list as item in store             }         });              //create data object to be used in store              var dataM = {             identifier: "FID",             //unique id             label: "FID", //label: featureSet.displayFieldName, //name field or display             items: itemsM         };              var dataU = {             identifier: "FID",             //unique id             label: "FID", //label: featureSet.displayFieldName, //name field or display             items: itemsU         };              //create datastore using feature set and set to grid         storeM = new dojo.data.ItemFileReadStore({ data: dataM });         storeU = new dojo.data.ItemFileReadStore({ data: dataU });              tc = dijit.byId("mainTabContainer");         tc.selectChild(dijit.byId("tab1"));              if (gridMatched) {             gridMatched.setStore(storeM);             dijit.byId("tab1").controlButton.attr("label", "Matched " + "(" + storeM._arrayOfAllItems.length + ")");         } else {         gridMatched = new dojox.grid.DataGrid({             id: "gridMatched",             store: storeM,             structure: layout,             onRowDblClick: function(evt) { zoomGraphicbyOID(gridMatched.getItem(evt.rowIndex).FID); },             onRowClick: function(evt) { highlightFlag(gridMatched.getItem(evt.rowIndex).FID, true); },             onRowMouseOut: function(evt) { highlightFlag(gridMatched.getItem(evt.rowIndex).FID, false); }         }, document.createElement('div'));             dojo.byId("tab1").appendChild(gridMatched.domNode);             gridMatched.startup();             dijit.byId("tab1").controlButton.attr("label", "Matched " + "(" + storeM._arrayOfAllItems.length + ")");         }              tc.selectChild(dijit.byId("tab2"));              if (gridUnmatched) {             gridUnmatched.setStore(storeU);             dijit.byId("tab2").controlButton.attr("label", "Unmatched " + "(" + storeU._arrayOfAllItems.length + ")");         } else {             gridUnmatched = new dojox.grid.DataGrid({                 id: "gridUnmatched",                 store: storeU,                 structure: layout2,             onRowDblClick: function(evt) { createEditor(); },             onRowClick: function(evt) { destroyEditor(); },             onRowMouseOut: function(evt) { highlightFlag(gridMatched.getItem(evt.rowIndex).FID, false); }             }, document.createElement('div'));             dojo.byId("tab2").appendChild(gridUnmatched.domNode);             gridUnmatched.startup();             dijit.byId("tab2").controlButton.attr("label", "Unmatched " + "(" + storeU._arrayOfAllItems.length + ")");         }              tc.selectChild(dijit.byId("tab1"));     }


How do I assign parameters for gdal proximity in QGIS?

I used to use the `Proximity (Raster distance)` option from the QGIS Raster menu a lot, which evidently corresponds to the commandline command, `gdal_proximity.py`. I'd like to be able to now use this tool from the Python console, and am trying to use `gdalogr:proximity` for this purpose but am unable to figure out how to enter the parameters correctly. I think it might be the values parameter that is giving me difficulty, since that parameter is optional for `gdal_proximity.py` and is not included in the Raster menu GUI tool, but it's hard to tell whether it might be one of the other parameters catching me up. The behavior I'm experiencing seems related to this closed bug report: http://hub.qgis.org/issues/8248: like the users in the discussion, I get an entirely null raster when I enter "0" for the values parameter. My input raster has cell values of 0 and 0.999, and I'd like to generate a raster of distances from the 0.999 cells. I've tried entering "0", "", "0.999", or 0.999, for values, but nothing has worked so far. The tool from the Raster menu still works fine, though. How do I get this to work?


Is there a method to write feature class attributes and counts to an excel workbook in Python?

I have a feature class with 3 fields that I would like to reference later in an excel workbook. They are all represented in 3 different maps. Essentially, I would like to show the the attribute counts for these 3 fields in Excel. The purpose of this is to ultimatelly create an automated process with Adobe Indesign for map book creation. The ideal process would be:   1. Select feature class attribute to be shown on map.    2. Python automation to show the number of features displayed on map, written to text file or excel workbook.    3. I don't want every column or row written, only the attribute displayed in layout or data view in ArcGIS.    4. I would like to complete this from the Python window in ArcGIS for QA/QC purposes.


Geographically weighted regression for GPS tracking data

I am hoping some one might be able to help me with the following question. The study I am working on has GPS locations at 4 hourly intervals of 5 lions in 3 National Parks over roughly 2 years in Namibia. I have been applying Geographically weighted regression analysis to the data. The study area is broken up into 11988 1 x 1km grid cells and for each grid cell I have calculated the frequency of lion occurrences. This count data I then log transformed to improve the skewness and kurtosis values of the data. The total number of grid cell with lion occurrences is 1460. For each grid cell in the study area I then calculated the distance to park boundary, distance to nearest settlement, distance to major road and distance to river. These are then the factors I then use as explanatory variables in the geographically weighted regression and the dependent variable is then the log transformed lion count. My question is, most of the literature I found using geographically weighted regression was usually for planned surveys with transects and systematic data collection, so if there is a survey point which has zero values it is included in the analysis. Can I apply the same principal to the grid cells with zero value in the study area or should I be running the geographically weighted regression only on the grid cells which actually have lion readings as I did not confirm there is no lion activity in those grid cells which have zero GPS readings from the collar information? I have run the GWR using all grid cells and lion only grid cells with a bandwidth of 125 neighbours, and the lion only analysis has a significant better AICc value. If it is easier to include a table of my results I can do that too. Any help on this matter will be greatly appreciated.


How do I solve this dependency error in openSUSE 13.1 when installing QGIS (master)?

I am running OpenSUSE 13.1 and downloading via Yast I get the following error: nothing provides libpq.so.5()(64bit) needed by qgis-master140102-1.2.x86_64 I get three of these errors, for each of the three qgis downloads (master, grass plugin, master-devel). I have two options under Conflict Resolution: 1-do not install... 2-break...by ignoring some of its dependencies What would you folks recommend? Is there something wrong with QGIS in openSUSE?


Using arcpy.GetParameterAsText() or arcpy.GetParameter() to pass datetime.timedelta to script?

I have a function that takes a `datetime.timedelta` as an argument in a script that I want to use in ModelBuilder. I don't see an option for that as a parameter type, so for now I have a solution that involves setting the parameter as a `String` in ModelBuilder and the following code:               ...     startOffset = eval('datetime.timedelta(' + arcpy.GetParameterAsText(0) + ')')     ...      Which works, but relies on inputting a valid set of `timedelta` arguments for the parameter in ModelBuilder (e.g. `days=0,hours=3`) and just seems like a bad idea in general. Is there a better way to get a `timedelta` into a script from a Model using only one parameter?


How to add files within file geodatabase (*.gdb) folder into ArcMap?

I'm trying to use ArcMap to make a basemap and I currently have an unzipped folder full of files including .atx, .gbdindexes, .gdbtable, .gdbtablx, and .spx. I'm well aware that these files cannot be 'added' into the ArcMap database as is. So I've made a .gdb file and I can find the .gdb in both the Catalog and 'Add Data' menus. However, I am not sure how to add the files mentioned above (atx, gdbindexes, etc) into the .gdb in order to add map data into the map. Can someone help me out please? I'm sure this is an easy task - I'm just not familiar with these other file types and how the folders work together. Any help would be much appreciated, thanks!


How to create a custom Attribute Inspector for mobile app using the ESRI JS API

I am making a mobile version of a JS web application I developed. I'm noticing though that the `AttributeInspector` widget by default uses standard `dojo/form` controls. This means that the form within the widget does not work correctly on a mobile browser. Is there a way to change the `AttributeInspector` so that it uses the `dojox/mobile` controls? Right now, I am simply providing the `LayerInfos` object to constructor without specifying the `FieldInfos` object. I'd like to avoid that if I can because I'd like the app to be able to use different layers with different fields. Here is how I create the `AttributeInspector`:               var layerInfos = this.layers.map(function(layer) {         return {             featureLayer : layer.layerObject,             showAttachments : true,             isEditable : layer.layerObject.isEditable()         };     });          this.attInspector = new AttributeInspector({         layerInfos : layerInfos     }, this.inspectorDiv);     this.attInspector.startup();      Here is what it looks like on my Android phone: ![Android Snapshot](http://i.stack.imgur.com/CYHeU.png) As you can see, the fields get cut off. Also, the dropdown lists do not appear as they should on a mobile device. Is there anyway to do this without writing a lot of code to account for different field types and domains?


What format is this data in?

I ran into a file today that is in a format I'm unfamiliar with, and I'm hoping that someone can identify it. The file extension is CTZ, but the only file type I found on Google with that extension was the "Custody Toolbox Zip" file extension (which is software unrelated to GIS). Here are a couple of lines from the file (all of the lines are in this format). The whitespace is all space characters, not tabs.               00000 000       0000CANADA                          +1285448500+4308048100+0001891000+0728293500+7050177200+0002341100+0557155000+7257869800+0001302700     10000 000       0000NEWFOUNDLAND - TERRE-NEUVE      +0024419500+0340743500+0001395400+0014446000+0243530500+0001685800+0009974000+0097218800+0000974700     10000 000       6999NFLD./T.-N. CT - SR S/TOTAL     +0007789500+0138134200+0001773300+0004317000+0093599600+0002168200+0003472500+0044536500+0001282500      ...               59935A9350005.002412VICTORIA                        +0000188000+0003855300+0002050700+0000096000+0002484500+0002588000+0000092000+0001372500+0001491900     59935A9350006.002413VICTORIA                        +0000109500+0002311900+0002111300+0000056000+0001599600+0002856400+0000053500+0000709900+0001326900      Thanks! Update: After some more Googling, I found this mailing list post of a person with very similar data, but I couldn't garner the format from that conversation. Update 2: The data was acquired via the Statistics Canada Data Liberation Initiative. It sounds like it came from an FTP site that requires authentication, so I can't provide access to the files.


Having trouble finding out what coordinate system a map is using, and how to convert it

I'm using Small Area shapefiles in Ireland from the Central Statistics Office (CSO) website. The link to these is here http://census.cso.ie/censusasp/saps/boundaries/ED_SA%20Disclaimer1.htm (Look for the small area ones) I can't seem to convert the coordinates to latitude longitude, can anyone see what I'm doing wrong? I've loaded these in using R maptools package using the following code:               cte<- readShapePoly("Shapefile/Census2011_Small_Areas_generalised20m.shp")       But when I check the `cte@proj4string` it reurns NA. Then I found this document which suggests the projection used is EPSG:3035 http://www.cso.ie/en/media/csoie/census/documents/census2011griddataset/1%20Km%C2%B2%20Grid%20dataset%20User%20Guide%202011.pdf I then found a site which gives the proj4 string for EPSG:3035. I then tried to set the coorinates as this string.               cte@proj4string <- CRS("+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +units=m +no_defs" )      Finally I tried to transform the object to latlong coordinates using the following:               cte <- spTransform(cte, CRS("+proj=longlat +datum=WGS84"))      I also tried:               coordinates(cte) <- project(cte, "+proj=longlat +datum=WGS84")      The first transformed it to new coordinates, but they don't seem to be correct. The second one just put everything as infinite. Can anybody let me know what I'm doing wrong? Thanks.


Does Geoserver automatically calculate parameters of a layer in a coverage store (REST API)?

[RESOLVED] Is it possible to use the Geoserver REST API to automatically create a layer on the basis of an existing coverage store (with the specified path to a file geotiff)? Will Geoserver automatically calculate the Bounding Boxes and Coordinate Reference Systems? Please note: **_the coverage store is already created_**.


Why doesn't PostGIS use gist index when doing a ST_DUMP(ST_UNION)?

My query:               DROP TABLE IF EXISTS tmp;     CREATE TEMP TABLE tmp AS SELECT *, ST_BUFFER(the_geom::GEOGRAPHY, 3000)::GEOMETRY AS buffer FROM af_modis_master LIMIT 20000;     CREATE INDEX idx_tmp_the_geom ON tmp USING gist(buffer);      EXPLAIN SELECT (DUMP(ST_UNION(buffer))).path[1], (DUMP(ST_UNION(buffer))).geom FROM tmp;      Output from EXPLAIN:               Aggregate  (cost=1705.52..1705.54 rows=1 width=32)       ->  Seq Scan on tmp  (cost=0.00..1625.01 rows=16101 width=32)      Seq Scan means it is not using the index, right? Why not? UPDATE: Even adding a where clause that filters based on the buffer causes a Seq Scan:               ANALYZE tmp;     EXPLAIN SELECT (DUMP(ST_UNION(buffer))).path[1], (DUMP(ST_UNION(buffer))).geom FROM tmp WHERE ST_XMIN(buffer) = 0.0;      (This question was also posted here. Apologies for cross-posting but the community there is a bit more active (maybe just on PostGIS query topics?), so perhaps wil provide an answer quicker.)


How to include streaming media into an OpenGeo system to monitor live-tracked animals?

I am wondering how to include streaming media (video), or camera feeds, into an OpenGeo system to monitor live-tracked animals. I am currently doing so with different applications, but I want to do it in a whole system (open and free), preferably under OpenGeo suite and QGIS, or other open possibilities (may VLC be an solution?). For media and GPS tracking, we are currently using cheap Chinese "dashboard cams" and pet GPS collars, since we can catch these animals almost daily (that's ethology study about domesticated badgers), but we have to postprocess all the info and manually add data in the whole database, when it could be done automatically. I think we have 2 possibilities, being the 2nd the preferred:   1. Streaming and server-side recording, which is safer since data loss is minor;   2. On-collar recording, with on-demand live camera feeds plus server-side recording (somehow as geotagged shots/stills, an option if we do m-jpeg feeds, but not the best, I think). I have read some stuff, since I have very limited knowledge on these topics. Open streaming servers are a first step, but I am not just wondering if it is the best match, but if it is the right schema I am thinking about. As example, one really nice, propietary option is Skyline that merges everything in a whole platform (but for UAV military purposes). Ideas?


update a field based on another field in python

I need to update a field based on another layers field. I could do this in arcmap manually by joining the two layers together and then using field calculator. Is there a way I can do it with a script? I.e just enter the field as an input and run it and it will calculate the field I need. I was thinking along the lines of               inputFC = arcpy.GetParameterAsText(0)          searchcursor, updatecursor?       all I want is the average of a field in one layer to be entered into one row/column in another. I should also add I want this as a script so it automatically creates a new field in the polyline and puts the average of the other layers field in it.


Where can I find information concerning rivers?

I'm looking for information I can visualize in Google Earth concerning rivers, such as rapids, put-in points, take-out points, campsites, etc. Any idea how I can look for this kind of information?


filter / generalize elevation points on the basis of some conditions

I wanted to generalize many elevation points in a rectangular area (about 700 square km). I need to take about 3 points for square km. These points must satisfy some conditions: One of these conditions is to find the highest point in a buffer of 500m: I would loop on all the points / "raster cell" (I think vector analysis will be too heavy, so I thought to do a "raster approach" creating an elevation grid from points) and give a score of "5" to the highest points / "raster cell" 500m around each. I wanted to do it in an Arcgis model builder flow. Could you please help me? Thanks in advance! Paolo


Simple band arithmetic on GDAL virtual rasters (VRT)

I want to calculate the difference of two bands. I have the individual bands stored somewhere, but I was thinking that maybe there's a way of producing a VRT file that is the result of this difference. I know that you can use pixel functions in GDAL, but this limits the use (C++, and only available when the function is linked in...). It would be nice if simple "virtual" operations were available!


Why do classic google maps and the modern google maps show different types of driving times?

As I am currently working on a project, where driving times are quit important, I've noticed that classic google maps and modern google maps show different types of car driving times. While the modern google maps shows driving times with and without traffic, the classic gui shows only driving times with traffic and one figure, which is not further specified. BUT: driving time with traffic is always lower than the not further specified figure. How can this be? How can low traffic be faster than calculating the driving speed without traffic? Has anybody any ideas? Am I getting something wrong? Thanks in advance jan


QGis, how to overlay and correctly position and scale a KML and image onto a Google base map

Being totally new to the entire GIS subject I managed to install and get runnning QGis (2.2.0 on Mac) properly, get my Google Maps showing (I set the the CRS to WPSG:3857) and I also got my KML file of the island of Phuket. Now I have to show the KML correctly positioned and scaled on the corresponding Google Map section of Phuket to then amend that KML with further details (KML needs a little fine-tuning, i.e. slight re-positioning of some of the coordinates to make them a bit more correct and I need to add to the island's outline also the inner "district boundaries". Sorry for this so basic question, but any pointer to some links/tutorials where that subject (superimposing a KML/image, correctly positioned and scaled on top of a Google base map to edit a KML) is covered so that I can read and take it from there would be EXTREMELY helpful! Seems I don't have the proper pro's lingo yet as my Google searches don't really return any links which precisely enough cover that subject. THANKS !


Applying Spatial Clustering test using R?

I’m very new to R so please bear with me: I have a set of area infested by a disease (AIS) annually data and I want to apply some cluster methodology to detect regions with similar (AIS) patterns. I have a data set of annually data files running from 2000-2013 and want to apply clustering. Here’s a sample not containing all the years, and in each year it means the AREA INFESTED In each year: ![enter image description here](http://i.stack.imgur.com/muEWp.png) I have tried some clustering methods, but I didn’t include the LATITUDE- LONGITUDE columns! So is there any clustering method that includes also the latitude and longitude data and understand them as spatial data, and would do a better clustering representation of the data presented here? Can I calculate the clusters for all the years at the same time with the same table, or do I have to find it for each column? I also want to know if there are a way to present these clustering on a geographical map of these regions and the clustering contained! Can you suggest me document or a way to do it?


QGIS how to patch a plugin on local machine

I want to make a minor modification to a plugin (to change a field width in Table Manager). I edited the .py file and the .ui file and changed what I think are the right numbers but this seems to make no difference when I restart QGIS. I observed that the .pyc file does not get up updated so I removed it but that does not make any difference. Is the plugin cached somewhere? I have been reading the docs for writing plugins and they seem to imply that changing the source and restarting QGIS is all that is necessary. Of course I may have not understood the code and everything is working exactly as it should!


Rasterizing polyline data with QGIS/GDAL: custom line width

I need to make a raster from a polyline shapefile. However, when I use gdal_rasterize (either directly or through QGIS), all my lines are drawn one pixel wide, while I need them to be drawn with the stroke weight of 3. I've examined the documentation at http://www.gdal.org/gdal_rasterize.html, but couldn't find a parameter to do so. I have in mind some workarounds, but is there a simpler way to do so? My workarounds are: - render a raster 9 times smaller and blow it up - write a script that reads the raster and outputs a 3x3 block into another raster whenever it reads a non-zero pixel


Hillshade is block grey ArcGIS

So I am trying to create a hillshade on my DEM because I need to be able to distinguish features which I can't do in its current state (see picture). However, when I add the hillshade, it adds a block grey image over the top. I'm not great with ArcGIS (learning slowly!) so do not really have any idea why it would be doing this. Any advice would be greatly appreciated. Many thanks, Katie ![With out hillshade](http://i.stack.imgur.com/QTEdU.jpg) * * * So I tried the hillshade again. When I use a stretched render the DEM doesn't appear. I have tried altering the values but it appears to make no difference. So, the same thing still happens, I try adding a separate hillshade layer and it is still a block colour - sometimes grey, sometimes black. Any ideas as to how I can get the relief on? ![With a hillshade layer @ 60%](http://i.stack.imgur.com/Jiqb4.png)


Performing Mutiple Correspondence Analysis (MCA) using R?

I want to apply MCA (multiple correspondence analysis) to a data table containing regions as individuals, and INFESTED AREA as variable and degree infested also and the type of trees infested , and I want to apply MCA to it using XLSTAT or any program, but I have problem in organizing this data, here a sample of it: A sample for the year 2013 ![IMAGE SHOWING THE DATA I HAVE FOR THE YEAR 2013](http://i.stack.imgur.com/YcvNP.png) And other for 2012: ![IMAGE SHOWING THE DATA I HAVE FOR THE YEAR 2012](http://i.stack.imgur.com/BmRjG.png) I want to fing a way to organize these data, make them as categories to better fit for MCA analysis ? And I want to know if I can apply MCA for different years on the same table ? Any hint or help would be appreciated! Thank you for your time and consideration!


Problem defining the tiling starting point

We are tiling a image datasets. However, we want to specifically define custom windows. To do this, we are using -te option during warping. The warped output is then tiled. The problem though is that after tiling and checking the bbox of the first tile, we have noticed that the starting coordinate is shifted as illustrated below: ![enter image description here](http://i.stack.imgur.com/M00g0.png)   1. The blue grid represent the original dataset with cellsize (a).    2. The black grid represent the new dataset with cellsize (b).   3. The cellsize of both datasets can be the same or not [(a) .eq. (b) or (a) .ne. (b)].   4. The red polygon represent the bbox which fit to the new cellsize and tilesize. We would like to start tiling exactly at the upper left corner of the red polygon.How we can force gdal to clip the raster exactly according to our well defined bbox? In some cases, GDAL picks the right Bbox startpoint, in other cases it doesnt. Is this some how related to the difference in the input and output data resolution(cellsize)? We cant figure out why it is ignoring our definitions. Could someone help shade some light to what is happening here? Thanks, Moses


How to add Google,Bing map layer as a Base map in uDig?

I'm working on uDig, a Desktop GIS Viewer. Which is fantastic except, I can't add Google or Bing Mapping services to my application. I searched through their(uDig's) mailing list and found reply which says it's the issue of Licencing! But I personally think that if other GIS viewers like QGIS can provide such functionality, then why it's not available for uDig. Well if anyone have any kind of trace regarding this issue then please help me out. Even any useful guidelines regarding the new plugins development which will able add the Google map as base layer are also much appreciated. Thanks in Advance.


ArcPy script error - NoneType object has no attribute X

I'm familiarising myself with using scripting in ArcMap 10.2 and as part of this I'm using the following to extract vertices from some polygons.               ...      ... import arcpy     ... from arcpy import env     ... env.workspace = "C:/WORKING"     ... fc = "Dist_Footprint.shp"     ... cursor = arcpy.da.SearchCursor(fc, ["OID@", "SHAPE@"])     ... for row in cursor:     ...     print("Feature {0}: ".format(row[0]))     ...     for point in row[1].getPart(0):     ...         print ("{0}, {1}".format(point.X,point.Y))      It chugs through pulling out co-ordinates ok until I get the following error message.               Runtime error      Traceback (most recent call last):       File "<string>", line 11, in <module>     AttributeError: 'NoneType' object has no attribute 'X'      I've had a look at a few previous questions to try to get some answers eg. http://stackoverflow.com/questions/19946947/tkinter-nonetype-object-has-no- attribute-pack-still-works. These flag that there is a variable whose value is None, and the script is trying to do None.X(), or NoneType means that the data source could not be opened. UPDATE 1) The script does not finish the first polygon. I have displayed the Python- generated co-ordinates in ArcMap and know which polygon it is. Also have run the geometry check on the polygon by itself. No apparent issues. ArcGIS still says no issues with main file. I have checked with QGIS which says there are some issues but NOT related to the polygon flagged by Python. In QGIS I get 4 invalid geometry errors along the lines of "segment 0 of ring 0 of polygon 0 intersect 0 of ring 0 of polygon 2 at X, Y location" related to other polygons. 2) I have run the script on a previous version of the problem file and it gets to Feature 16 before falling over. Running the original script on some simple polygons works fine so looks like the script is ok. Back to the drawing board with the original file (not sure where to go as the check geometry tool says it's ok).Anybody suggest what other tools I can use to work out where the problem is? Thanks


Uses for "Calculate Geometry" option

Is there another use for "Calculate Geometry" aside from calculating area, length and points? I already read the help section ArcGIS Help (10.2, 10.2.1, and 10.2.2) and it's very informative. However I was told today that you can use calculate geometry to check that the coordinates of a feature are correct. If you have features with coordinates and they're displayed in the correct location, why would you need to use calculate geometry to check that. So although this makes not sense to me, I went ahead and used calculate geometry to check that the feature (points) was accurately displayed. CALX & CALY are the new x, y coordinates using the calculate geometry option. ![enter image description here](http://i.stack.imgur.com/pGDmR.jpg) So my questions are: 1) Is this a valid/correct alternative use of "calculate geometry"? 2) If so, why are my new coordinates different from the original x & y?


Determine minimum number of polygons from shapefile to cover an area of interest

I have a large number shapefiles representing areas of interest for an analysis that will be conducted using various sources of satellite imagery (IKONOS, RapidEye, etc.). Unfortunately, the imagery doesn't use a pathrow system like Landsat for example, so the extents vary greatly. I have shapefiles clipped to each AOI representing the extents of different imagery acquisitions, all of which have already been deemed acceptable. Some of these shapefiles have 500 or more polygons. I need to find an approach, preferably one that can be automated (Python and ArcInfo 10 preferably, FOSS would be acceptable as well) to determine the fewest number of polygons to cover each of my areas of interest.


Cannot select a feature using ArcObjects because coordinate systems differ

I'm using ArcMap 10 and Bing Maps Road as base map. Then we have our adding which is programmed using C#. What I'm trying to do is to select a feature (A) that intersects another feature (B, from a different feature class). I can achieve this with ArcMap's **Select By Location** function. But when I try to do the same with ArcObjects, I cannot find anything because feature A _seems_ to have a different coordinate system than feature B! Bing Maps Road uses WGS 1984 and my feature classes **should** use EUREF_FIN_TM35_FIN. An interesting thing is, that when I manually modify feature class' geometry and save it, then both features are using EUREF (as they should in the first place)! If I right click the Layers and take Data Frame Properties, it shows "WGS_1984_Web_Mercator_Auxiliary_Sphere" (and this is when error happens). If I change it to EUREF_FIN_TM35_FIN then everything works. Code sample:               IFeatureClass featureClass = ((IFeatureWorkspace)m_workspace).OpenFeatureClass(name) as IDataset;          // Here I can see the feature.Shape.SpatialRef changes     IFeature feature = featureClass.GetFeature(oid.Value);      Now I would like to know is this a bug in ArcObjects or am I doing something wrong? I'm quite new to GIS and ArcMap, so there might be some simple thing I don't get. In a nutshell:   * I want to select feature B that intersects feature A    * When I try to do that in ArcMap, it works    * In ArcObjects it doesn't, except when I modify a geometry and save   * It has something to do with the base map's coordinate system **Edit** : Here's how to reproduce this issue:   1. Preparation On the map and in same data frame (data frame spatial ref wgs)     * layer1 (from fgdb) - spatial reference EUREF     * layer2 (bing maps) - spatial reference wgs   2. Start editor   3. Using arcobjects open layer1 from workspace opened using workspacefactory      * ((IFeatureWorkspace)workspace).OpenFeatureClass("name of layer1);   4. Find feature from layer1   5. layer1 feature geometry has spatial reference _WGS_   6. use geometry to find (spatial query) other object _FAILS_   7. Edit the geometry using editor and save edits   8. repeat steps 2-3   9. layer1 feature geometry has spatial reference _EUREF_   10. use geometry to find (spatial query) other object _SUCCEEDS_   11. Stop editor & Repeat from 1. (always repeatable)


Tilecache seeding with mapserver doesn't generate tiles

I'm attempting to seed my tile cache on the server for use within OpenLayers for a few zoom levels, however the script doesn't seem to be working at all and everything I try I just get the same output. The data displays fine when I view it in a browser using OpenLayers and the cache is generated based on what I look at. The server is running Ubuntu 12.04.1 LTS which has nothing but Mapserver, Apache, Tilecache, and the required libs for that installed on. My config files are as follows - Tilecache Config               [cache]     type=Disk     base=/home/tilecache          [streetview]     size=256,256     srs=EPSG:27700     type=WMS     url=http://localhost/cgi-bin/mapserv?map=/home/mapadmin/data/tm/out/comp/tm.map     layers=streets     mapfile=/home/mapadmin/data/tm/out/comp/tm.map     bbox=600000,200000,660000,30000     extension=png     mime_type=image/png     maxresolution=234.375     extent_type=loose     levels=20     expire=3600      Mapserver Config               MAP             IMAGETYPE       PNG             EXTENT          600000.000000 200000.000000 660000.000000 300000.000             SIZE            800 600             SHAPEPATH       "/home/mapadmin/data/tm/out/comp/"             IMAGECOLOR      255 255 255                  PROJECTION                     "init=epsg:27700"             END                  WEB                     METADATA                             "ows_enable_request"   "*"                             "wms_title"             "WMS Street Test"                             "wms_onlineresource"    "http://192.168.1.126/cgi-bin/mapserv?map=/home/mapadmin/data/tm/out/comp/tm.map&"                             "wms_srs"               "EPSG:27700"                     END             END                  LAYER                     NAME            streets                     STATUS          on                     TYPE            RASTER                     TILEINDEX       "tm.shp"                     TILEITEM        "LOCATION"                          PROJECTION                             "init=epsg:27700"                     END                          METADATA                             "wms_title"     "Streetview"                             "wms_srs"       "EPSG:27700"                     END             END     END      Output from terminal               mapadmin@mapserver:/etc$ sudo tilecache_seed.py "streetview" 04 09 -b "600000, 200000, 660000, 30000" -p 1 -f -c /etc/tilecache.cfg     Config file set to /etc/tilecache.cfg     ###### (0, 0, 4), (16, -45, 4)     ###### (0, 0, 5), (32, -90, 5)     ###### (0, 0, 6), (64, -181, 6)     ###### (0, 0, 7), (128, -362, 7)     ###### (0, 0, 8), (256, -725, 8)     mapadmin@mapserver:/etc$      Any help on this would be great as it's really driving me nuts now, I've spent hours trying to work out why it's just not working. Thanks


How to infinitely extend MapInfo grid layer?

We use a semitransparent grid layer (.mig file) to show 'hotspot' intensity in MapBasic (MapInfo. Because the grid is just a rectangle, this looks ugly. See for instance: ![http://download.sentient.nl/files/Images/20100809Hotspot.png](http://download.sentient.nl/files/Images/20100809Hotspot.png). Now MapInfo allows grid cells to be invisible (NULL), which would result in round-like hotspot regions.   But we would prefer to extend the grid. Of course we could just add extra rows and columns, but that would require a lot of extra memory. And it would still show a boundary at some zoom level. Is it possible to infinitely extend a grid layer with a constant value?


How to re-project coordinates in a gml on-the-fly in Geoserver?

I am using Geoserver to get featureinfo, but sometimes I want to re-project the native SRS in the output gml. The request is a (WMS) "GetFeatureInfo" with INFO_FORMAT: application/vnd.ogc.gml. I am aware of the option to set the "declared SRS" when publishing a layer in Geoserver, see below:   ![geoserver settings](http://farm5.static.flickr.com/4097/4874971469_f7df6bf6e9.jpg) But is there a way to re-project the coordinates on-the-fly? EDIT: Below is two diffrent WMS GetFeatureInfo requests that shows the problem. The first request has Srs=EPSG:4326 and bbox in the same srs and the second request has in Srs=EPSG:900913 and the bbox in in the same srs.   1. `http://demo.opengeo.org/geoserver/wms?REQUEST=GetFeatureInfo&EXCEPTIONS=application/vnd.ogc.se_xml &BBOX=-139.848137,18.549615,51.852863,55.778385&X=351&Y=193 &INFO_FORMAT=application/vnd.ogc.gml&QUERY_LAYERS=topp:states &FEATURE_COUNT=50&Layers=topp:states&Styles=&Srs=EPSG:4326 &WIDTH=780&HEIGHT=330&format=image/png`   2. `http://demo.opengeo.org/geoserver/wms?REQUEST=GetFeatureInfo&EXCEPTIONS=application/vnd.ogc.se_xml &BBOX=-15567823.399227962,2101981.4669995294,5772234.305333375,7514424.280422591 &X=352&Y=220&INFO_FORMAT=application/vnd.ogc.gml&QUERY_LAYERS=topp:states &FEATURE_COUNT=50&Layers=topp:states&Styles=&Srs=EPSG:900913 &WIDTH=780&HEIGHT=330&format=image/png` Both requests return the same gml with coordinates in EPSG:4326. I would expect the second request to have coordinates in EPSG:900913. As mentioned I can set the "declared SRS" in Geoserver, but what if I want to get the gml in another srs then the one declared. By on-the-fly I meant: Ask in one srs get the coordinates in the same srs without setting the declared srs. I hope that the question in more clear now.


Auto zoom on multipolygon with leaflet

I have a geojson with a multipolygon and I want to fit this multipolygon to the map. The map center only on one polygon not on the multipolygon. Here is my script                   var map = L.map('map',{ zoomControl:false })                   .setView([<?php echo $lat; ?>, <?php echo $lng; ?>], 12);                           var zoomFS = new L.Control.ZoomFS();          map.addControl(zoomFS);              var defaultLayer = new L.TileLayer.MapBox.Light({minZoom: 10, maxZoom: 16});         map.addLayer(defaultLayer);              var info = L.control();              info.onAdd = function (map) {             this._div = L.DomUtil.create('div', 'info');             this.update();             return this._div;         };              info.update = function (props) {             this._div.innerHTML = '
Massifs forestiers près de
' +  (props ?                 '' + props.LLIB_FRT +'
'                 : 'Survolez une zone colorée');         };              info.addTo(map);                   // get color depending on population density value         function getColor(d) {             return d == 'OUI' ? '#238B45' :                    d == 'NON'  ? '#74C476' :                    '';         }              function style(feature) {             return {                 weight: 1,                 opacity: 1,                 color: 'white',                 dashArray: '',                 fillOpacity: 0.7,                 fillColor: getColor(feature.properties.CDOM_FRT)             };         }              function highlightFeature(e) {             var layer = e.target;                  layer.setStyle({                 weight: 3,                 color: '#666',                 dashArray: '',                 fillOpacity: 0.7,                 fillColor: '#C7E9C0'             });                  if (!L.Browser.ie && !L.Browser.opera) {                 layer.bringToFront();             }                  info.update(layer.feature.properties);         }              var geojson;              function resetHighlight(e) {             geojson.resetStyle(e.target);             info.update();         }              function zoomToFeature(e) {             map.fitBounds(e.target.getBounds());         }                   function onEachFeature(feature, layer) {             layer.on({                 mouseover: highlightFeature,                 mouseout: resetHighlight,                 click: zoomToFeature             });         }              geojson = L.geoJson(foret, {             style: style,             onEachFeature: onEachFeature         }).addTo(map);                      map.fitBounds(map.getBounds());              var legend = L.control({position: 'bottomright'});              legend.onAdd = function (map) {              var div = L.DomUtil.create('div', 'info legend'),                 grades = ['OUI','NON'],                 labels = [],                 from, to;                           labels.push(                     ' Forêt domaniale
' + ' Autre forêt'                      );                       div.innerHTML = labels.join('
') + '
Source ONF';             return div;         };                   legend.addTo(map);      And My Geojson call before the script :               var foret = {"type": "FeatureCollection","features": [{ "type": "Feature","id":"28", "properties": { "LLIB_FRT":"Forêt communale d'Hinsingen", "CDOM_FRT":"NON"}, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 6.9943980558132, 48.946433094078 ], [ 6.994620292006, 48.946654797086 ], [ 6.9946440493621, 48.946769064939 ], [ 6.9942757111879, 48.947051596133 ], [ 6.994525224939, 48.947130121777 ], [ 6.9949682000749, 48.946963549201 ], [ 6.9953766392947, 48.947023616958 ], [ 6.9957374325074, 48.946813022271 ], [ 6.9965129612099, 48.946224218666 ], [ 6.9961325523574, 48.945968748319 ], [ 6.9957770974676, 48.945782611345 ], [ 6.9957646870665, 48.945668975401 ], [ 6.9959606190443, 48.945511036547 ], [ 6.9946195521361, 48.94466102012 ], [ 6.994630665892, 48.944546885841 ], [ 6.9947706431545, 48.944451927805 ], [ 6.9943890358713, 48.943557180488 ], [ 6.9939647083228, 48.942850378597 ], [ 6.9936098649794, 48.943031218817 ], [ 6.990978273955, 48.944169736953 ], [ 6.9907916915416, 48.944275487598 ], [ 6.9906590303195, 48.944540260439 ], [ 6.9903122282768, 48.945515871105 ], [ 6.9899779107984, 48.945891734939 ], [ 6.9897536964784, 48.946062513595 ], [ 6.9906082903887, 48.946007229028 ], [ 6.9907530326376, 48.946038714842 ], [ 6.9908245833021, 48.94612737104 ], [ 6.9909366304299, 48.946984068611 ], [ 6.9928842027716, 48.947039217107 ], [ 6.9929248400957, 48.946763159392 ], [ 6.9930024317067, 48.946669408079 ], [ 6.9931592044754, 48.946642240938 ], [ 6.9939125945186, 48.946695983544 ], [ 6.9940803721788, 48.946467213889 ], [ 6.9942616812201, 48.946401938807 ], [ 6.9943980558132, 48.946433094078 ] ],[ [ 7.0132518064932, 48.954701866676 ], [ 7.0130792746756, 48.955281720291 ], [ 7.0131097085661, 48.955406738419 ], [ 7.0134535050459, 48.956019942767 ], [ 7.0136768179147, 48.956641121897 ], [ 7.0136432241135, 48.956891471012 ], [ 7.013391660559, 48.95756050072 ], [ 7.0164377304443, 48.958126765886 ], [ 7.0173343130064, 48.958220743678 ], [ 7.0180405329659, 48.958235207654 ], [ 7.0180712371346, 48.957763530194 ], [ 7.018466890148, 48.957337559452 ], [ 7.0183245760167, 48.957321560691 ], [ 7.0182167345232, 48.957234693134 ], [ 7.0176940753708, 48.955926500229 ], [ 7.0171570061764, 48.955918750115 ], [ 7.0170252455885, 48.955885108994 ], [ 7.0165780794306, 48.955358357152 ], [ 7.016549105281, 48.955117411187 ], [ 7.0159152497559, 48.95481071823 ], [ 7.0155138192773, 48.954679378104 ], [ 7.015287839558, 48.954917146081 ], [ 7.015151253069, 48.954947663459 ], [ 7.0142533774551, 48.954711047176 ], [ 7.012862311613, 48.954409014242 ], [ 7.013130198481, 48.95455616266 ], [ 7.0132518064932, 48.954701866676 ] ] ] ] } }]};      Thanks for your help!


Migrating data from Python to PostGIS

I have pandas DataFrame with these columns:                                                  point            datetime      value     1   Point(-24.6064453125 26.3683280945) 2014-09-11 19:00:00  24.885258     2   Point(-24.6472167969 26.4629898071) 2014-09-11 19:00:00  24.854557     3   Point(-24.6881408691 26.5576820374) 2014-09-11 19:00:00  24.822819     ...      with types: string, datetime and float. What would be the easiest way to migrate this data to a new table in PostGIS enabled database? Pandas has `to_sql` function (working through sqlalchemy connector, which is based on psycopg2), but I don't think there is an option for declaring geometry/geography data type.


Add GEOJSON layer in tilemill EACCES symlink Error

I'm trying to add a GEOJSON layer to Tilemill [ _Version 0.10.2 (v0.10.1-293-g697c86c)_ ], installed on ubuntu 14.04. I've confirmed that the ID used is unique and attempted to load the file into my project via 'Add Layer'. I've tried to select the file on the local file system, and after I select and click on `Save`, I get the error, `EACCES symlink [filepath]`. This is intended to replace an existing `.shp` labels file. In Tilemill the `.shp` file is successfully assigned and displayed, but when I put the newly created `.json` file into the layers directory where the `.shp` file is and give the `.json` file the same permissions I still get the `EACCES symlink` error. I've even attempted to serve the file via http on localhost. I get see that the file is retrieved with a 200, but the same error is seen. Is this a bug, or am I missing something? BTW - the geojson I'm trying to load is the output of Dymo, so I'm creating the format myself. I've confirmed that the target json file can be loaded by python's json library, so it seems there is not a problem with the format.


Deleting QGIS CRS

I've created a new CRS on QGIS but I assigned a wrong name mistakenly to CRS's name. Now I have the CRS defined but the name of the CRS is wrong, or not easily identifiable. I was wondering if there's a way to delete CRS or just customize them? Thanks for your help


Merge Multipart Feature Line

I'd try to merge multipart feature line, but didn't work. would you please teach me how to merge multipart feature line? I work in version environmental and geometry network. Regards,


Autocorrelation: Best way to assess mixed uses and building scales?

I am trying to find the best way to measure the spatial distribution and scale of "mixed-uses". i.e. the mix of different building use categories such as residential, commercial, industrial, etc. I am specifically trying to contrast two things:   1. The quantity or degree of mixed-uses present;   2. The scale that mixing of uses occurs at. e.g. as defined from a pedestrian point of view vs. a car driver's point of view. I am new to spatial analysis, but my understanding thus far is that spatial autocorrelation measures like Moran's I and Geary's C are meant for interval data. Whereas methods like Join Counts can be used for categorical data, but of the binary type. So I'm wondering what kind of method I could use in ArcGIS 10.2 for assessing the degree of mixed-uses based on categorical data? And what workflow to use to assess the impact of scale?


How to export a map to a single page pdf?

I want to export my 900 x 800 mm map to a PDF file and all I'm getting is a file with 31 page of parts of my map. How do I create a single page - whole map pdf?


Novel ways of filling in missing values in a raster

I am looking for robust ways to fill in missing values in some rasters. They all have a single layer. Missing values consist of single pixels to medium sized patches. Rasters are around 1000 x 1000 pixels in size and the largest patches are like 20x20 pixels. I'm tempted to use aregImpute in the Hmisc R package. Has anyone used it for this purpose? this approach looks seems very cool but I think it is only meant to produce aesthetically pleasing corrections. Detailed explanation of this: All the rasters (I have 36 in total) share the same extent, they overlap and are aligned. Each raster is a different variable, I gathered variable from various sources (remote sensing, topographic and climatological). The original rasters come in various resolutions. The smallest being 30m. From there up they get as high as 1km. I resampled everything using cubic convolution (all the variables are continuos) to 1km. I have another 1km raster where I have data of a variable of interest for some sampled points. So I trained a model using those points and the other rasters as covariates to be able to generate a full raster of that variable. Unfortunately most covariate rasters have some missing values in them, actually not much but I would want to eliminate the problem entirely. Thank you. p.s. I would preferably like to use R for this.


Simplify table of linestrings

I have a PostGIS table of linestrings representing a road network. I want to simplify the geometries such that only lines that connect road junctions are stored. At the moment the table has a large number of road segments that make up a single road. I want to join as many of these as possible into a single linestring. Such that:-               x----x----x----x becomes x------------x      and:-                    x                        x          |                        |     x----x----x----x becomes x----x--------x      It is important that I retain the points in each linestring so I am not looking to simplify to a topology.


Where to upload layers in geoexplorer?

I just install opengeo suite (boundless) in my machine and try to explore it. I followed the instruction in user manual and I encountered a problem. In "Load your data with GeoExplorer" part, after clicking the plus sign, I did not find the upload layers option like the **user manual said**. The only option is "add layers", no "upload layers". Can anyone help me and tell me what happens here?


Does OSM2po handle squares and places?

OSM2po is converting data from OSM to postgresql. But how is it handled with places or squares? Not every places, square has pedestrian way routes on it. But for routing I need nodes and pedestrians can walk through places without restriction, if there are no obstacles between. But we can consider only "empty" places. Therefore the shortest distance is to walk through the place. How is osm2po handling area=yes or highway=footway for areas, respectively.


Overlay points over gadm map

This is a crosspost with stackowerflow and I hope for understanding and that it will no be closed as it concerns both cartography and R. I have already asked about plotting points dependent on region, but now my question is about overlaying points given by coordinations over gadm map. I want to show different meteostations, using data based on this site or here is data used in code I've tried using such code:               require(ggplot2)     library(maptools)     library(rgdal)     library(RColorBrewer)     library(gpclib)     library(rgeos)     library(PBSmapping)     gpclibPermit()     rus<-load("C://RUS_adm1.RData")     proj4.str <- CRS("+init=epsg:3413 +lon_0=105")     gadm.prj <- spTransform(gadm, proj4.str)     rus<-gadm.prj          met <- read.csv2('C:\\meteo.txt')               cds <- data.frame(                       Longitude=met$Long,                       Latitude=met$Lat)          k<-as.matrix(cds)                    popSP <- SpatialPointsDataFrame(coords=k,met["Elevation"], proj4string=proj4.str)          spplot(popSP, sp.layout=list('sp.polygons', gadm.prj))      , following advice from already mentioneed question, but it ends up with plotting points w/o gadm layer ![enter image description here](http://i.stack.imgur.com/7msj8.jpg), I guess it's because of non- mentioning regions Sorry, if question is dumb, but I will be grateful for any help


Repository for .prj files

Do you know any repository where can i find .prj files? I am looking for local coordinate system: Warszawa 75 (Warsaw 75) I found myself this repository but the .prj which i found there seems to be broken.


OpenGeo/GeoServer WFS - getting only as much data as is needed

There's probably a term for this that I'm missing that would help me find the answer... My question is similar to a previous question of mine. I am using GeoServer (as part of the OpenGeo stack) as a WFS server. Currently when I load my map it downloads the entire layer - roughly 10MB per layer, roughly 10 layers...it takes a while. I would like it to work in the way that WMS does - only download enough to show what is needed. I need to use WFS rather than WMS as I need to be able to click on polygons, edit their attributes etc. Is there a word for this? Is it possible with GeoServer/OpenGeo/GeoExt?


How to create bilingual composite address locator in ArcGIS 10?

I'm fairly new to geocoding in ArcGIS and stumbled upon first problem. I'm working with GeoPost data from Swiss Post. As long as I'm using their default locator everything works flawlessly. I also received additional table with alternative street names (French <-> German) that I can link to main data by unique street ID. They exist for small subset of main dataset. However, there is no way to add alternative street names using the Swiss Post locator. I browsed through ESRI's docs but it didn't help much in this case. I've tried building two separate locators (one with German names, one with French) and wanted to combine them into composite locator. Unfortunately I get general error message without any further pointers :/ Is there a way I could use this additional data to build composite address locator that will use both language versions of street names? Is there any other potential solution?


Export shp spatial data to Corel

Hi I need an printable administration map of a country. I would like to use it in Corel Draw for some colour manipulations and poster printing. I have found the map on http://www.diva-gis.org/ but it is in shp format. How can I convert it to any acceptable vector format like svg/cdr/eps/pdf. Thank you


QGIS Server does not display test WMS

I'm having a similar problem to this post: Using Qgis server with Ubuntu 12.04 I am using Mint 15 desktop and QGIS 2.0.1. I read the above post and decided to go back a step or two and followed this tutorial: http://docs.qgis.org/2.0/html/en/docs/user_manual/working_with_ogc/ogc_server_support.html I only got to the testing part. I am able to connect to localhost/cgi- bin/qgis_mapserv.fcgi using the 'Add WMS/WMST Layers' tool and I can see 'wfslayer' in the list. The 'Add' button is greyed out and the dialogue says Coordinate Reference System (0 available). When I create my own QGIS project the 'Add' button is also greyed out unless I add the shapefile's CRS to Project Properties>'CRS Exclusions' list. If I add the CRS then I can add the layer to the TOC but it does not render. I started to check if my web server (apache2) configuration was correct as per: http://karlinapp.ethz.ch/qgis_wms/configuration/index.html but am having the following issues:   1. I have two fcgid.conf so do I edit both?   2. I do not know the 'syntax' of 'DefaultInitEnv LD_LIBRARY_PATH' for apache2.conf or fcgid.conf   3. I used /usr/lib/qgis for QGIS libraries (is this correct?) but cannot determine the path to 'qt libraries'. Do I need to configure these 3 conf files? Are they the likely cause of not being able to add the test WMS layer?


HTML5 local storage for tile maps and feature layers using ArcGIS Java Script API

I am developing a mobile arcgis application I want to store data locally so that when a user is offline he/she can use the maps. I want to store tile layers,feature layers and a table data. Any sample code appreciated Platform : ArcGIS java script API and HTML5


Raster menu does not have any tools in QGIS

in raster menu in QGIS, only raster calculator is available, how to get other tools, like wrap (reproject) please see the image for help. help me ![enter image description here](http://i.stack.imgur.com/dieHp.jpg)to get this.


QGis Making Column Value of Attribute table unique

For a shapefile, I have a field named _id_ with the following contents in it:               1     1     2     2      I want to make these values unique such as:               1     2     3     4      Is there any way to achieve this in Quantum GIS (using any plugin or other means) ?


Problem with setCenter in openlayers

I'm working with MapServer/Postgis using OpenLayers to display map! I'm trying setCenter map but it not working! My code:               var bounds = new OpenLayers.Bounds(107.567139, 12.326586, 108.258591,             12.890796);     var options = {         controls : [],         maxExtent : bounds,         maxResolution : 0.0010217594533836,         projection : "EPSG:4326",         units : 'degrees',         allOverlays : true     };          map = new OpenLayers.Map('map', options);     .....     //Declare some layers wms     .....     map.addLayer(wms_RanhGioi);     map.addLayer(wms_GiaoThong);     map.addLayer(wms_ATM);     map.addLayer(wms_Cafe);     map.addLayer(wms_KhachSan);     map.addLayer(wms_NhaHang);     map.addLayer(wms_TramXang);          map.addControl(new OpenLayers.Control.LayerSwitcher({         'ascending' : false     }));     map.addControl(new OpenLayers.Control.PanZoomBar({         position : new OpenLayers.Pixel(2, 15)     }));     map.addControl(new OpenLayers.Control.Navigation());     map.addControl(new OpenLayers.Control.Scale($('scale')));     map.addControl(new OpenLayers.Control.MousePosition({         element : $('location')     }));     map.zoomToExtent(bounds);     map.setCenter(new OpenLayers.LonLat(12.67812, 108.04401), 5);      Somebody can help me! Thanks!!!


How can I create an animation with raster data in qgis?

I have 4 raster images showing different coniditions of air flow distribution at different times. I'd like to create an animation to show the change from image 1 to image 4. How can I do this? I tried Time Manager Plugin because I read it works also with raster but it didn't work (error message). I'm working with qgis v. 2.0.1.


Add Z and M values to stream network produced from DEM

I created a stream network from an existing DEM. My ultimate project goal is to be able to select a river from my stream network and use the 3D analyst to generate stream profile (Elevation by Distance). The polylines I've created so far don't have M or Z values and I'm not sure how to add these. I have a DEM and I know I can add surface information which would add a z-max, z-min, and z-mean to the attribute table but that doesn't actually make it a polyline Z. As of now to create a stream profile I only know how to use the 3D analyst by manually picking points/lines along the DEM. For my area this is very tedious and time consuming. Any ideas?


Why is geometry being dropped when outputting to a MapInfo Writer in FME?

In some instances geometry is being unexpectedly dropped when writing to a MapInfo writer. This occurs when FME has a conflict with the Format Attribute of 'mapinfo_type' which has been attached to a feature from a non-mapinfo source such as SQL Server Spatial. The conflict arises when the mapinfo_type is point or line but the feature it has been passed to is a polygon. Sorry I don't have enough reputation to post an image of a simple workbench so hope the URL works or the following description: ![Example workbench](http://i.imgur.com/7KrX9F1.png) Description: It will happen if we use a SpatialRelator transformer to perform a simple 'point INTERSECTS polygon' exercise. If the base polygon features come from a SQL Server Spatial reader but the point candidates originate from a native MapInfo reader the 'mapinfo_type' format attribute of the points is transferred to the base polygon features (as this attribute did not already exist on the base feature). The result when writing out to a MapInfo writer is that FME sees a mapinfo_type of point on a feature which is actually a polygon and drops the geometry of any polygons that intersected. We've worked around it by the following:   1. Write to SQL Server instead, or if native Mapinfo output is required do any one of the following:   2. Expose mapinfo_type on any offending MI input datasets then remove it just prior to writing to output,or,   3. add a Geometry_Coercer transformer to the MI input dataset and force it to polygons. * * * Any comments on better solutions?


How to convert a set of points to a polygon based on a specific field in QGIS

I am having a point shapefile that consists of a number of point sets. I need to convert these points to a polygon based on a particular field in attribute table say for example locality . How can i do this in Qgis? I also tried points2one plugin, but it gives me the result in a clumsy way.


How to extract the US from a North America Shapefile?

I have a north america shapefile, downloaded from ftp://ftp.epa.gov/wed/ecoregions/cec_na/NA_CEC_Eco_Level2.zip How can I get a new shapefile from this showing only us? Is there a way doing this in QGIS? Thanks


KML with text AND polygon

I'm working on applying some KML files to a google map on a mobile device, and have really been impressed with how easy everything is (so long as you stay inside the norm). I have run into some trouble, however, in trying to display some text next to the polygon I define in the KML. I would rather not use any more libraries if at all possible. In example I have seen the name attribute appear next to a marker, but not next to a polygon. Thanks in advance for your time and please let me know if you want some more info! Brad


How to build an optimization model?

I want to make a model using QGIS. Is it possible? Then how can I develop a model. can anyone help me?


Arcgis 10 vs Arcgis 9.3 data compatibility

I have been doing some calculations such as slope in ArcGIS 9.3 but I needed to use ArcGIS 10 for fuzzy tool. My problem is when I open my data in ArcGIS 10, it shows me some wrong and extreme numbers like -3*10^38 to 3*10^38 while it is supposed to be 0 to 84. What might be the problem? I would appreciate any help on this issue. Thank you! Suoz


QGIS 2 problems with Plugins

Rough English (Translated by a user): > When trying to access plugins I am told `Unable to open the Python console`. > When I start qgis, the message also shows up but I don't know what it means. > The problem is that I have no access to the Add Delimited Text Layer plugin. Original Spanish: > al intentar acceder a complementos me dice que No se pudo abrir la consola > de Python . al iniciar qgis tambien aparece el mensaje pero lo ignoro . el > problema esta en que no puedo acceder a complementos de Add Delimited Text > Layer. ayuda por favor. ![enter image description here](http://i.stack.imgur.com/YKyZm.png)


QGis Filtering postgis layer with boundbox

I know It is possible to split a polygon feature by interactively drawing a line over it in QGIS 2.0 with the Split Feature command.The issue i have is that postgis layer i am trying to work on is rather large(over 500k polygons),accessed remotely and takes forever to load and move,zoom etc.Since i need to work only on the small part of the layer i should be able to load only what i need.I was reading about filtering import with boundbox but there are so many different examples about that and none worked for me.What is the proper syntax,way to do it?I am newbee when comes to QGis. UPDATE: I am using this syntax geom && ST_SetSRID(ST_MakeBox2D(ST_Point(14,43),ST_Point(16,46)),4326) with proper coordinates for what i need.Query builder now shows 11k polygons but the strange thing is that ,once again,whole layer gets added.Is this some kind of bug or...?


MapFish Installtion Problem

I am trying to install mapfish on windows7. When i run the commands then it gives error " -- always-copy -U setuptools failed with error code 1. I am getting following errors when installing mapfish. ![enter image description here](http://i.stack.imgur.com/BYNHQ.png)


Which ArcGIS product gives full 3D terrain navigation and (flight) simulation?

I looked at the ArcGIS ESRI website and find that 100% of the screenshots depicts a 2D map with at most relief shading. Is there any product ArcGIS or not that gives real 3D terrain visualisation capable of things like flight simulation? Thanks.


ArcGIS for Server 10.2.1 cache scale greyed out in Service Editor and not all scales available in Manage Map Server Cache Tiles

I am using ArcInfo desktop 10.2.1, with an admin connection to ArcGIS for Server Standard 10.2.1 I have used the "Create Map Server Cache" tool in ArcToolbox to prepare all the underlying structure for the cache of an existing un-cached basemap service. I've used a predefined tiling scheme, which tells it to generate cache tiles at 3 scales - 1:8000, 1:5000, 1:2000. I've set the tile cache format the "PNG" and the Storage format to "Compact". This tool runs without any problems. The problem comes when I come to actually generate the cache using the "Manage Map Server Cache Tiles" tool from the toolbox. Only 2 of my 3 scales are visible in the "Scales" box. ![enter image description here](http://i.stack.imgur.com/uUrjr.png) In Catalog, if I right click on my service > Service Properties > Caching, the slider shows the full extent of the 3 scales I want to cache at. ![enter image description here](http://i.stack.imgur.com/owIEX.png) If I click on the Advanced Settings tab, I can see the 3 scales, however one of them is greyed out. This is the one that's missing from the "Managae Map Server Cache Tiles" tool. ![enter image description here](http://i.stack.imgur.com/XUUvU.png) Is this a bug in the software? Or is there something I have missed? I've also tried it with ArcInfo 10.1 and I get the same problem. Is there a limit to the number of tiles a single cache scale can hold? Or a size limit? If this is a bug, is there a workaround?


grass region resolution error

I am working on a raster, but I can't set a correct region for it.   In the **Set region to match this raster map** field, I select my raster map to change current region, but its resolution does not change. once I run an analysis command on my raster, I see the following error:                elevation file's resolution differs from current region resolution!      please help me to change current region resolution to match my raster map.


Batch tool to identify coordinate system in dwg files

I am trying to ingest 1000's of DWG files into ArcGis. Some of them are clearly georeferenced (that is, if I view them in ArcMap I can see that there are in the right place relative to my other GIS data). Many of them are not geo referenced. I don't know own a copy of AutoCad but I have the free TrueView DWG viewer installed. Is there a tool that I can use to scan all of the DWG files and list which of them have a coordinate system assigned (and hopefully tell me what CS is defined). Thanks,


Dynamically created toolbar doesnt show in Toolbar in ArcMap

I am trying to troubleshoot an application that allows creation of a tool bar based on a config file, which contains information about the tool bar like Name, ProgId, ESRIType, CLSID, Tooltip etc. Everything works fine in dev environment and tool bar shows properly in ArcMap. In Test environment, this isn't the case. I can see that tool bars are properly registered and visible in ESRI Mx CommandBars (Via Component Category manager). When I go to customize option, it doesn't list the tool bar, seems like it is being registered but something is missing.


How to exclude stations from IDW interpolation?

I have the following problem: I need to calculate an average precipitation amount on a catchment using an IDW interpolation. The interpolation is performed in a loop since each precipitation station contains several years of daily measurements (10000 and more interpolations). I have managed to solve this problem by overwriting precipitation value in attribute table of the station shapefile using `UpdateCursor()`. The problem is that some of the stations have missing values. In this case I would like to interpolate only those stations with measurements and thus I need to somehow exclude stations with missing values from interpolation. This is my code:               import arcpy     from arcpy import env       from arcpy.sa import *          # Check out the ArcGIS Spatial Analyst extension license     arcpy.CheckOutExtension("Spatial")          # Set environment settings     env.workspace = r"C:/Users/peter.valent/Documents/ArcGIS/Data/Vah po LM/Test"          # Set local variables     inPointFeatures = r"zrazkomerne_stanice_buffer_0km.shp"     zField = r"P"     cellSize = 100     power = 2     searchRadius = RadiusVariable(10, 150000)     extent=r"polygon_okolo_povodia.shp"     mask=r"Vah_po_LM.shp"     prec_table=r"tabulka.gdb\bez_udajov2"     rows = arcpy.SearchCursor(prec_table)          # Get names get names of all fields in prec_table     field_names = []     sFields=arcpy.ListFields(prec_table)     for field in sFields:         field_names.append(field.name)     field_count=len(field_names)          field_names=field_names[2:field_count]     station_count=field_count-2          # Main     # Get precipitation amounts for one day     prec_list=range(station_count)     day_count=int(arcpy.GetCount_management(prec_table).getOutput(0))     meanP=range(day_count+10)     j=0     for row in rows:         for i in range(0,station_count):             prec_list[i]=row.getValue(field_names[i])              idx=0         uptShape=arcpy.UpdateCursor(inPointFeatures)         for station in uptShape:             station.P=prec_list[idx]             uptShape.updateRow(station)             idx=idx+1              del station         del uptShape              outIDW = Idw(inPointFeatures, zField, cellSize, power, searchRadius)         outIDWMask=ExtractByMask(outIDW, mask)         meanPrec=arcpy.GetRasterProperties_management(outIDWMask, "MEAN")         meanP[j] = meanPrec.getOutput(0)         print meanP[j]         j=j+1      **My questions are:**   1. How to exclude some stations from interpolation?   2. Is there a way how to write nodata to the attribute table? Thanks


Could you please help me with this error: **Traceback (most recent call last): File "C:\DDPeX\Export_GroupPDF.py", line 19, in finalPdf.appendPages(tempPdf) NameError: name 'finalPdf' is not defined Failed to execute (CFAsGroupDDP).**               import arcpy     import os     mxd = arcpy.mapping.MapDocument("CURRENT")     output_folder = arcpy.GetParameterAsText(0)     ddp_lyr = mxd.dataDrivenPages.indexLayer     pdf_field = "CFA"          #Get a list of unique values to group by     pdf_list = set([row[0] for row in arcpy.da.SearchCursor(ddp_lyr,pdf_field)])          for pdfName in pdf_list:         finalPdf = arcpy.mapping.PDFDocumentCreate(os.path.join(output_folder,pdfName + ".pdf"))         for i in range(1, mxd.dataDrivenPages.pageCount + 1):             mxd.dataDrivenPages.currentPageID = i             cur = str(mxd.dataDrivenPages.pageRow.getValue(pdf_field))             if cur == pdfName:                 tempPdf = os.path.join(output_folder,"temp_" + cur + str(i) + ".pdf")                 arcpy.mapping.ExportToPDF(mxd, tempPdf)                 finalPdf.appendPages(tempPdf)                 os.remove(tempPdf)                 finalPdf.saveAndClose()                 del finalPdf, tempPdf


How to call a mapserver mapscript?

The docuentation leaves me in the dark about this. We used to call static mapfiles directy by:                http://www.domain.com/cgi-bin/mapserv?map=/var/www/mapfiles/mf.map?[parameters]      But now I want to call a mapscript instead of the mapfile directly. How do I do this? **EDIT** : i'm using PHP mapscript 4.10, on mapserver 5.03. PHP is not configured to run as CGI.


Font Issues Upon Export From QGIS 1.9

I'm using QGIS 1.9.0-Master, code revision 1570240. I know I shouldn't be using it for 'production' but I'm working on a map layout, and all of the new composer features are very helpful! As of the version available in OSGEO4W (I think) last Thursday, I was able to export my map properly to either PDF or an image. However, when I try with a version from yesterday or today, the font is not being exported properly. See examples below of proper exporting (top image) and the current export (bottom image): ![enter image description here](http://i.stack.imgur.com/DRCDQ.png) ![enter image description here](http://i.stack.imgur.com/Mld3C.png) I tried via OSGEO4W to roll back to a previous version, but it did not install properly for some reason. Thoughts?


pgRouting：how to use reverse_cost？

I add a new column, naming it "reverse_cost", and give it the same data in the shape_leng column. ![enter image description here](http://i.stack.imgur.com/bxOyP.png) But as I run the shortest path algorithm in pgadmin, I got an error message. ![enter image description here](http://i.stack.imgur.com/DHuvT.png) here's my sql code               SELECT * FROM shortest_path('                 SELECT gid as id,                          start_id::int4 AS source,                           end_id::int4 AS target,                          shape_leng::double precision as cost                         FROM network',                 10, 17, true, true);      and here's the error               Error:  Error, reverse_cost is used, but query did't return 'reverse_cost' column          ********** Error **********          Error: Error, reverse_cost is used, but query did't return 'reverse_cost' column     SQL status: XX000      As I change the code to this one, everything went well,               SELECT * FROM shortest_path('                 SELECT gid as id,                          start_id::int4 AS source,                           end_id::int4 AS target,                          shape_leng::double precision as cost                         FROM network',                 10, 17, false, false);      ![enter image description here](http://i.stack.imgur.com/M2lBY.png) so I want to know how to use reverse_cost in PostGIS？


What to set spatial reference to after projecting to GCS_WGS_1984

I have a shapefile containing some sort of vectors or polygonal chains. This file is in the `GCS_CH1903` geographic coordinate system (it is not specified though... if I import it into ArcMap it says `Unknown`). I want to project it to the `GCS_WGS_1984` coordinate system and display it on a basemap(also in `GCS_WGS_1984`).   So I used `Define Projection` from the ArcToolbox on my imported layer and set it to `GCS_WGS_1984`. I think the projection is working, because the size of the lines seems correct, but there is no spatial reference so it was displayed somewhere west of Equatorial Guinea in the sea. I tried `Create Spatial Reference` but nothing happens if I select either `GCS_WGS_1984` or `GCS_CH1903`. Layer properties:               Projected Coordinate System:    WGS_1984_Web_Mercator_Auxiliary_Sphere     Projection: Mercator_Auxiliary_Sphere     False_Easting:  0.00000000     False_Northing: 0.00000000     Central_Meridian:   0.00000000     Standard_Parallel_1:    0.00000000     Auxiliary_Sphere_Type:  0.00000000     Linear Unit:    Meter          Geographic Coordinate System:   GCS_WGS_1984     Datum:  D_WGS_1984     Prime Meridian:     Greenwich     Angular Unit:   Degree      The information provided in this link is probably necessary but I have can't figure out where to enter it: http://www.swisstopo.admin.ch/internet/swisstopo/en/home/topics/survey/sys/refsys/swiss_grid.html


Batch Dissolve Polygons based on Attributes in QGIS or FWTools

I was wondering if anyone can help with batching a dissolve. I have a few hundred polygon shapefiles that I want to dissolve based on an attribute. I would like to do this in QGIS or FWTools. Any batching help would be really appreciated. Thank you, Ryan


I can't connect QGIS with postgresql

I can create a connection to the database in qgis and the test connection is successful. However when I actually connect to the database to export shape files I get the following error: `the connection is failed, check the configuration.` Thanks, Paulo Praça


IF (there are three or more developed cells in the Moore Neighbourhood of a cell) THEN (the cell is developed)

Hi I need to create an expression for that principle, so far I have figured out CON ("FocalStatisticsSum" >= 3,"FocalStatisticsSum"="FocalStatisticsSum"+1) Although I pretty sure I am missing things, and I am not including the requirment of More neigbourhood in the expression (I don't know how to). Also I am not sure that >= 3 is Ok for this purpose. Finally, how would I translate "developed" Could somebody tell me what would be a good expression for this. Note: Moore neigbourhood is ![enter image description here](http://i.stack.imgur.com/lBLks.jpg)


Install PostGIS 2.0.3 on PostgreSQL x64 9.1 on Windows Server 2008 R2

I just try to install the PostGIS 2.0.3 on PostgreSQL x64 9.1 on the Windows Server 2008 R2. I got the error message "Error openning file for writing" C:\Program Files\PostgreSQL\9.1\bin\libiconv-2.dll. Should I click "Abort", "Retry" or "Ignore"? Thanks. :)


Global address datasets for testing?

Are there any free global address datasets I can use to test my geocoding application? I'm looking for a dataset that contains residential addresses from countries around the world. I don't need a name, just a street address, region, country, and postal code (if the country uses postal codes). If it has a latitude and longitude for each address, that would be a plus. I saw this question but I'm wondering if anything has changed since it was answered. Thanks.


"ArcGIS encountered a serious application error" problem

I need to perform regression analysis for some data. Whenever I use Ordinary Least Squares (OLS) tool (spatial statistics tools>Modeling spatial relationships>Ordinary Least squares), initially the tool works fine and generates corresponding output. But after generating output, when I close the OLS process window, there appears an error message "arcgis encountered a serious application error and needs to close" and application get closed. I searched this error on google and came to know that this might be due to file permissions. I couldn't figure this out much as data file on my laptop in .csv file format have full access rights. Is there any solution except re- installing the software? I am using ArcGIS v10.1 on windows 8 (64-bit machine).


How to save MapServer output to a file?

How can I save the results from a MapServer file as an image? I would like to be able to write a png file as a result of a query. My query which I can display in browser is the following:               http://mysite.com/mapserv.cgi?map=../../mapfiles/demo.map&layer=land&mode=map&FORMAT=image/png      I have tried the following (which does not seem to work):               wget http://mysite.com/mapserv.cgi?map=../../mapfiles/demo.map&layer=land&mode=map&FORMAT=image/png       and also               wget http://mysite.com/mapserv.cgi?map=../../mapfiles/demo.map&layer=land&mode=map&FORMAT=image/png >> myfile.png      I have seen the shp2img function but that appears to be used just for testing mapfiles. In this case I would like to use a SQL filter with my mapfile, which I don't think I can do using shp2img. EDIT: Included first `wget` attempt that I tried.


How to update shapefile data source in multiple dataframes and mxds using lyr.replaceDataSource and Python dictionary?

After reorganizing the file structure for some of our GIS base data files I need a script to update the data sources for ~ 100 shapefiles in about 50 mxd files. Some of the mxds have multiple data frames. I have a list of the shapefile names and their new file paths that I'd like to use in a dictionary to define the workspace_path parameter in the lyr.replaceDataSource method. After researching on this forum and others, I put together the code below, which runs smoothly (i.e., no errors and returns the "Workspace path is updated" print statement for each of the 3 layers in each dataframe) but the datasources are not actually updated when I open the map. I'm relatively new to Python so maybe I'm missing something obvious here. Any insights or suggestions would be greatly appreciated.               #Select map     map_path = r'C:\Test\0102HomeRangeCopy.mxd'          #define dictionary          PathDict = {         "SouthCarolina_SMA_geoN83_line": r"R:\Data\GIS\ManagedAreas\SMA",         "SEUS_SMA_Offshore_line_geo": r"R:\Data\GIS\ManagedAreas\SMA",         "LocalPorts_Alb": r"R:\Data\GIS\Shipping\Ports"}          import arcpy          mxd = arcpy.mapping.MapDocument(map_path)          for df in arcpy.mapping.ListDataFrames(mxd):         for lyr in arcpy.mapping.ListLayers(mxd,"",df):             layername = lyr.datasetName             if layername in PathDict.keys():                 new_path = PathDict[layername]                 lyr.replaceDataSource(new_path,"SHAPEFILE_WORKSPACE", str(lyr.datasetName))                 if lyr.workspacePath == new_path:                     print "Workspace path for " + layername + " is updated."                 else:                    print "Path not updated for " + lyr.datasetName          mxd.save()     print "Map Saved"     del mxd      Here are some additional notes:   * If I run the lyr.replaceDataSource method on its own for an individual file in the Python window as in the ArcGIS resources example, the datasource is updated as expected. It seems as though the issue might be with using the dictionary to define the parameters for different shapefiles or with iterating through the dataframes and layers   * I've tested the the layers to ensure that the DATASOURCE and WORKSPACEPATH features are supported   * The files are on a network and I've tried using UNC file paths, but this does not make a difference   * none of the shapefile names have been changed   * I'd like to avoid using lyr.findAndReplaceWorkspacePath so that I don't have to define the old path names in addition to the new path names for each shapefile   * I'm working in Arc 10.0 service pack 4 on a Windows 7 64-bit machine * * * Thanks for your suggestions everyone! After seeing that @blah238 could run the script in 10.1, I tried updating to service pack 5 and that solved the problem.


Is there a free source of U.S. time zone borders?

I have a mapping app in which I need to display the borders between U.S. time zones. The easiest and most accurate way would be to feed in a list of lat/long coordinates representing the vertices of these borders, and "connect the dots". So, the question, simply put, is whether a publicly-available, free database of these geocodes exists, and where?


Append, Insert or load Data into geodatabase table field

I am attempting to calculate point stationing (footage) along a pipeline at a set interval via python script, thing is I'm just now learning to code in Python, I come from a VBA programming background. In regards to this exercise I will be creating an empty file geodatabase, within this database I will be creating an empty feature class table. This feature class table will contain an empty field/column named, "Calculated Footage". My desired result is to populate the content of my feature clas table via Python script such as the ones below. I have been successful in obtaining the desired results within a python list as shown below but when attempting to do so in a file geodatabase I seem to be at a lost. Simply put how do I go about applying the logic below to the "Calculated Footage" field in my feature class table? In other words how do I populate the "Calculated Footage" field with the result of my while loop? I'm simply trying to append, load or insert data into the field in question               B_Measure = 0; E_Measure = 5280     Curr_Measure = 0; Interval = 1000     My_List=[]          C_Measure = 0          # Body of the Main program     while abs(E_Measure-C_Measure)>Interval:         if My_List==[]:             My_List.append(C_Measure)             print C_Measure         else:             C_Measure=C_Measure + Interval             My_List.append(C_Measure)             print C_Measure[/CODE]      I've done this exercise in Excel as well, using the following VBA Code.               Sub Calculate_Footage()     'Declaring variables     Dim X, Y, Beginning_Point, Ending_Point, Interval, Current_Point As Integer          'Assigning initial value to variables      X = 2      Y = 1      Beginning_Point = 0      Ending_Point = 5280      Interval = 1000      Current_Point = 0          'Assign Field/Column Name     Cells(1, 1).Value = "Calculated Footage"          'This While Loop will populate my "Calculated Footage" field     Do While (Ending_Point - Current_Point) > Interval     Current_Point = Current_Point + Interval     Cells(X, Y).Value = Current_Point          'Move to the next row but same column     X = X + 1     Loop          End Sub      **Current Python Code** # Import system modules import arcpy from arcpy import env               # Set workspace in which to create geodatabase     env.workspace = "C:/data"          # Set local variables     out_folder_path = "C:/data"      out_name = "fGDB.gdb"          # Execute CreateFileGDB     arcpy.CreateFileGDB_management(out_folder_path, out_name)          # Set environment settings for Table in geodatabase     in_database = out_folder_path+"/"+out_name     table_Name = "Custom_Stationing"     arcpy.CreateFeatureclass_management(in_database, table_Name)          # Set workspace for Add Field     in_Table = in_database+"/"+table_Name          Field_Names=["Route_Id","Route_Code","Series","Measure","Calculated_Field"]     for n in Field_Names:         arcpy.AddField_management(in_Table, n)      I would like to apply the following code sample to insert rows located hereINSert Cursor


How to copy single polygon and paste multiple times to same layer in Arcmap 10?

I'm attempting to copy a single polygon and paste it 113 times to make "parcels" for a condominium building.


Geodjango transform introduces large errors

Apologies for the possibly naive question. I'm trying to understand how Geodjango (running on PostGIS) deals with coordinate transformations, and am experiencing some unusual behaviour. Let's say I have a very simple model with a geometry field, with SRID 27700 (OSGB):               from django.contrib.gis.db import models     class MyGeoClass(models.Model):         point = models.PointField(srid=27700)      I create an entry in this coordinate ref system:               from django.contrib.gis import geos     m = MyGeoClass(point=geos.Point([527860, 184660], srid=27700))     m.save()      Now, if I load the entry and transform it to a different coordinate system and back again, it introduces a slight error               m = MyGeoClass.objects.all()[0]     m.point.coords     >>> (527860.0, 184660.0)     m.point.transform(4326)     m.point.transform(27700)     m.point.coords     >>> (527860.0007865971, 184659.99966225715)      No surprise there - I guess this is just numerical rounding error. But if I instead leave the point in SRID 4326 and issue a `save()` call, Geodjango automatically transforms it for me, with a much larger error:               m = MyGeoClass.objects.all()[0]     m.point.coords     >>> (527860.0, 184660.0)     m.point.transform(4326)     m.save()         m = MyGeoClass.objects.all()[0]     m.point.srid     >>> 27700     m.point.coords     >>> (527861.48656512, 184654.1590452015)      So, the transform-transform pathway introduces an error of around 0.001 metres, whereas the transform-save pathway introduces an error of 1.4 metres in the x-dimension and 5 metres in the y dimension.


How do I use Arcpy to label based on two different expressions, then convert to annotation?

I am trying to open an mxd and turn on labels before converting them to annotation. I would like to turn on labels with 2 different classes, based on 2 different expressions, then convert them to 1 annotation feature class. Here is an Example of what I have so far:               import arcpy          mxd = arcpy.mapping.MapDocument(r"C:\Users\Desktop\TEST\Untitled.mxd")     layer = arcpy.mapping.ListLayers(mxd)[0]     arcpy.Select_analysis(in_shp, outshp, """ "label" = 'HERE' """)     if layer.supports("LABELCLASSES"):         for lblclass in layer.labelClasses:             lblclass.className = "classhre"             lblclass.expression = "[label]+ [FID]"             layer.showLabels = True     mxd.save()          arcpy.Select_analysis(in_shp, outshp, """ "label" = 'EVERYWHERE' """)     if layer.supports("LABELCLASSES"):         for lblclass in layer.labelClasses:             lblclass.className = "classevrythre"             lblclass.expression = "[FID] +[label]"             layer.showLabels = True          arcpy.TiledLabelsToAnnotation_cartography(r"C:\Users\Desktop\TEST\Untitled.mxd", "Layers", "C:\Users\Desktop\TEST\TEST.gdb\ExtentAnno","C:\Users\Desktop\TEST\TEST.gdb", "GroupAnno", "Anno", "", "", "", "", "", "","GENERATE_UNPLACED_ANNOTATION")               mxd.save()      Any help with this would be greatly appreciated. Thanks everybody.


Is editing geometric network in versioned geodatabase any different from when such data is stored elsewhere?

I need to work on "Checked Out" version of a geodatabase, editing geometric networks. What will be the difference in terms of the working process of the editor ?-do i need to use some special toolbars ? is it possible to work on versioned GDB with ArcEditor 10.1 ?


How to select Qgis features through Python Plugin

Hi I am very new to Python so this may be a bit basic. I am trying to find a way to select and zoom to the features in a QGIS layer. I have created a plug in and built a custom form. I have 3 values from the form which I need to place in a query but as I am new don't know how.                       aExchange = self.dlg.EXCHANGE_1141_CODE.currentText()             aPCP = self.dlg.BT_OBJECT_CLASS.currentText()             aObject = self.dlg.BT_OBJECT_ID.text()      The filter on the Attribute table is like this… "EXCHANGE_1141_CODE" = 'IH' AND "BT_OBJECT_CLASS" = 'PCP' AND "BT_OBJECT_ID" = '10' I have tried... alayer.SetSubSetString ('EXCHANGE_1141_CODE = \'IH\'') But this seem to just change the filter on the layer source. which isn't what I want. I want to be able to search for a feature and go to it. Can anyone suggest something as I am running out of ideas.


Printing large size with OpenLayers plugin basemaps?

trying to print A0, with one of the maplayers from the openlayers plugin, the resulting print misses tiles and is corrupted. any scale i choose there's no way except (i need >= 1.50.000) I tried to edit the network settings (timeout and number of tiles) but still the same result. Anybody know how to fix this?


Thematic Legends in MapInfo

Does anyone know if it is possible to make a range label go over more than one line in MapInfo when doing thematic maps? My legend has a limited width and I have not been able to find a way to get MapInfo to do this. The customize legend dialog doesn't seem to allow you to add text over two or more lines. In the example below each item is wider than the frame on the layout that contains the legend. The frame is 7cm wide, and the legend items need 10cm when the text is on the same line. ![alt text](http://i.stack.imgur.com/KoFhb.jpg)


How do you connect to a SDE instance on EC2?

We are exploring using Amazon EC2 with ArcGIS Server - and none of us has any experience with it. The question "How can we, from within our intranet, connect to the remote SDE instance in the EC2 cloud?" has come up. Do you just do a direct connect and instead of the server name, use the IP of the EC2 instance? Something like `sde:sqlserver:<ip_address>` instead of `sde:sqlserver:HOU-SQLPRD10`? Surely connecting to the remote instance is possible, huh?


Convert IEnvelope - ArcMapControl to X,Y screen coordinates

Does anyone know how to do the following. Say I have a map and I draw a rectangle over the state of Texas. ArcMapControl.TrackRectangle returns the lat,lon of this. However, what I'd like is to actually get the X,Y coords of the screen. For instance if the map was 500 px wide and 450 tall I'd expect something like top = 257 bottom = 242 left = 146 right = 167 Anyone know if there is an easy way to convert this?


Uisng Directed force graphic to connect terminals in CartoDB?

I am starting using SQL for my internship, we are creating a map for terminals (points representating a port, train station or logistic centre) and what I would like to do is use the Directed force graphic, so that all conncetions between the specific terminals in my database are shown in the map- I would like it to look like this http://philogb.github.io/jit/static/v20/Jit/Examples/ForceDirected/example1.html Can you please give me some tips on how to proceed? Again, I am super beginner, but would like to understand it.


Ghosting and Map Functionality Loss in Map View C# Arcobjects

I'm writing a C# add-in and trying to implement a piece where a user can add points to a graphics layer on the map view. The points are drawing, however the map pane has serious ghosting issues and I lose the ability to scroll zoom in and out. I assume the problem is in the way I am refreshing the display. Any input would be great. Thanks,               protected override void OnMouseDown(MouseEventArgs arg)         {                  base.OnMouseDown(arg);             IGeometry pointcreate = drawPoint(ArcMap.Document.ActiveView, arg.X, arg.Y); //This creates the point but does not actually place it on screen             IRgbColor newColor = new RgbColorClass();             newColor.Red = 128;             IMap thisMap = getMap(ArcMap.Application);             addGraphicToMap(thisMap, pointcreate, newColor,newColor); //this actually places the graphic on screen.             IPoint newPoint = ScrCoordToMapCoord(arg.X, arg.Y, ArcMap.Document.ActiveView);             ArcMap.Document.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null); //This is the refresh in question, I think.      }


libLAS las2las scrubs ground point data on Ubuntu?

I am trying to use las2las from libLAS on Ubuntu 14.04 entering the following code into the terminal:               las2las --input merged.las --output ground.las --keep-class 2      This outputs a LAS file which has bounds -214.XX, -214.XX,-214.XX,-214.XX. Just to make sure the merged.las file was good, I was able to open it up and view it in ArcGIS 10.2.2 on a Windows 7 machine. I've also tried a variant where --input was changed to -i and likewise for --output, but got similar results. Has anyone else encountered this problem? Is there something wrong in my code? **EDIT: After more testing, I found out my real issue is lasmerge. I have tried the following two lines of code**               ls *.las > lidardata.txt     lasmerge -i lidardata.txt -o indianhill.las      I have also tried:               lasmerge -i 640.las -i 641.las -i 686.las -i 687.las -o indiantwo.las      Both of them result in incorrect bounds. I have also tried the -verbose flag, which the help/manual suggest lasmerge should have. But, I get an error saying that it is _not_ a command.