title: Mapnik PGRaster Plugin creating 8x8 tiles with visible boundaries

text: I have used the latest addition to Mapnik PGRaster plugin (https://github.com/mapnik/mapnik/tree/2.3.x) by Strk(https://github.com/strk/mapnik/tree/2.3.x-pgraster) and merged recently. I am able to get the images properly projected on the Map. But the images are tiled into an 8x8 manner and I could see the boundaries of the images at certain zoom levels. ![enter image description here](http://i.stack.imgur.com/vJ0aF.jpg) I have added a Raster with a black patch so that the tiling boundaries would be more clear. I am using OSM, Mapnik(2.3.x branch), ModTile and Renderd. Also, when I run Renderd, I am getting logs like: > renderd[15011]: Rendering projected coordinates 14 4896 6056 -> > -8061966.247298|5205055.878110 -8042398.368057|5224623.757351 to a 8 x 8 > tile I have added a layer via layer-shapefile xml as follows:               <Layer name="MS-GIS" status="on" srs="+proj=utm +zone=18 +datum=WGS84 +units=m +no_defs">         <StyleName>raster</StyleName>         <Datasource>           <Parameter name="type">pgraster</Parameter>           <Parameter name="table">ms_test</Parameter>           <Parameter name="raster_field">rast</Parameter>           <Parameter name="dbname">gis</Parameter>           <Parameter name="estimate_extent">false</Parameter>           <Parameter name="extent">-20037508,-19929239,20037508,19929239</Parameter>         </Datasource>     </Layer>      How can I get the tiling to be smooth without boundaries? Any help greatly appreciated.


title: "construct points" troubleshooting

text: Apologies for the potential simplicity of this problem but I just cant find a solution! I need to create a series of points along a line at a specific interval. I am using ArcMap 10.2.1 and the obvious tool appears to be Construct Points. I have tried to follow the instruction steps given on the ESRI website. However, the Edit tool on the editor toolbar is not selectable so have used Editor > Start Editing and selecting the line feature instead. At no time is Construct Points selectable on the Editor drop-down menu even after trying various thing. What am I doing wrong?!


title: Qgis on MacOS. Color picker does not show?

text: Style palette in my Qgis does not work. When choose Properties, Style on a Shape layer and click Change color only an empty dialog of 1 X 1 cm shows up. What do I do wrong? Mac OS 10.6.8, Qgis 1.8


title: How to calculate the shortest distance for multiple source and targets using PgRouting?

text: I have a table with points and a road network which includes driveways (where you enter the highway). I want to find the point which is closest to a driveway. So I was thinking I can calculate the distance from all the points to all the driveways (maybe within a specific boundary). And from there I can find which point is closest to a driveway. I have joined the points with the network, so I know which ‘source’ I can use from the network. I also know the ‘targets’. And I can calculate the distance from one point (source-network) to one target using the source and target columns in the network. Using the following query:                   with subset as (     SELECT seq, id1 AS node, id2 AS edge, cost       FROM pgr_dijkstra(         'SELECT gid as id, source, target, st_length(geom) as cost FROM roadnetwork,         473384, 440012, FALSE, False       ) as di     )     select sum(cost)::decimal (8,2) from subset      But how can I calculate multiple sources to multiple target? So in the query above I want the numbers 473384 and 440012 to be ‘flexible’. Or is there any other way to calculate this? Hope someone can help me with this problem


title: Stop a Cursor loop when only 1 item is selected with Python

text: I am trying to create a Cursor that goes through a selection process and stops looping when only one feature is selected. Basically, as the Cursor loops it subsets a selection, and instead of going through every row of the table I'd like to save time and stop the Cursor when one item is selected. So it would look something like this:               for row in rows:         ... (selecting process) ...         if [number of features selected] = 1:             [stop cursor]         else:             rows.updateRow(row)     del row, rows      Any advice? I can't seem to even find any way to stop a cursor other than deleting it but I don't think I could do that type of command from within the cursor itself.


title: Automating script to set geodatabase?

text: I got some good help here yesterday. I'm basically trying to set up my script in such a way that once the user just puts in the workspace in the script tool in ArcGIS the script will do the rest. I have been able to create a geodatabase and now I'm trying to run the following code and I'm having trouble. I basically need to be able to change or reset the workspace halfway through to tell it to use the newly created GDB. This is the next piece of code that I'm trying to run:               # Create Raster Dataset     out_path = "Prog.gdb"     out_name = "R_Dataset"     # Run the Create Raster Dataset Script     arcpy.CreateRasterDataset_management (out_path, out_name, "", "8_BIT_UNSIGNED", "", "1", "", "PYRAMIDS -1 NEAREST DEFAULT 75 NO_SKIP", "128 128", "LZ77", "")     # Mosaic Rasters into a the Raster Dataset     inputs = arcpy.ListRasters("", "TIF")     # Set the target to the Raster Dataset that was already created     target = "R_Dataset"     # Run the Mosaic tool     arcpy.Mosaic_management (inputs, target, "LAST", "FIRST", "", "", "NONE", "0", "NONE")      The out_path is basically referencing the GDB that was just created in the workspace folder. It's telling me that this isn't a valid input etc. I was then trying to get it to sort through to Tiffs and automatically mosaic these into the newly created raster dataset. Any and all help greatly appreciated. Thanks **Edit:** @Aaron Below is the entire script that I want to use, basically if I can get the user to get the workspace as a parameter the script will then do everything else. Where I'm falling short is that basically the initial (and hopefully only) workspace they define is a folder. I then want the Mosaic to New Raster to select the 4 tiffs in the original workspace folder to create a new raster in the gdb I have already created. I think then if I could then somehow change the workspace to the gdb (as in the workspace they select + the name of the gdb I have created) it would work as everything from then on in the script happens in the gdb if that makes sense?                   # Create file Geodatabase     # Import ArcGIS modules     import arcpy, os     # Check out the ArcGIS Spatial Analyst Extension     arcpy.CheckOutExtension("spatial")     # Need to be able to OverWrite Outputs     arcpy.env.overwriteOutput = True     #Set the workspace     arcpy.env.workspace = out_folder_path = arcpy.GetParameterAsText(0)     # Set up variables)     out_name = "Prog.gdb"     # Execute CreateFileGDB     arcpy.CreateFileGDB_management(out_folder_path, out_name)     # Set local variables before importing shapefiles to Geodatabase     inFeatures =  arcpy.ListFeatureClasses()     outLocation = "Prog.gdb"     # Execute shapefile to Geodatabase     arcpy.FeatureClassToGeodatabase_conversion(inFeatures, outLocation)     # Remove _shp if it is present in feature class name     arcpy.env.workspace = os.path.join(out_folder_path, outLocation)     newFC = arcpy.ListFeatureClasses()     [arcpy.Rename_management(fc, fc.replace("_shp", "")) for fc in newFC if "_shp" in fc]     #Mosaic rasters to a new raster dataset     inputs = arcpy.ListRasters()     arcpy.env.workspace = Location = os.path.join(arcpy.env.workspace)     #Set Name     mosaic_name = "All_Mosaic.tif"     #Run the Mosaic Tool     arcpy.MosaicToNewRaster_management(inputs, Location, mosaic_name, "", "", "", 1, "", "")     #Inputs for the extract by mask tool     in_raster = "All_Mosaic.tif"     in_mask_data = "Study_area_extent"     #Extract by Mask     outExtractByMask = arcpy.sa.ExtractByMask (in_raster, in_mask_data)     # Save the output     outExtractByMask.save("T_Mask")     # Buffer the Thames feature class to create the Flood Risk Area     in_features = "Thames"     out_feature_class = "Flood_R_A"     # Run the Buffer Tool     arcpy.Buffer_analysis (in_features, out_feature_class, "300 Meters", "FULL", "ROUND", "ALL", "")     #Clip the Flood Risk Area to the Study Area Extent     # Set local variables     in_features = "Flood_R_A"     clip_features = "Study_area_extent"     out_feature_class = "Clipped_Flood_R_A"     xy_tolerance = ""     # Execute Clip     arcpy.Clip_analysis(in_features, clip_features, out_feature_class, xy_tolerance)     #Super Output Areas: Add field (this field will be used to calculate the population density of the each of the SOAs     inFeatures= "Super_Output_Areas"     arcpy.AddField_management(inFeatures, "Pop_Density", "DOUBLE", "", "", "", "", "NULLABLE", "NON_REQUIRED", "")     #Calculate field     #Set variables     inFeatures = "Super_Output_Areas"     fieldName1 = "Pop_Density"     arcpy.CalculateField_management(inFeatures, fieldName1, "!LSOA_POP! / !AreaSQKM!", "PYTHON", "")     # The Flood Risk Area and the SOA are going to be intersected in order try and find the population at risk     in_Features = (["Super_Output_Areas", "Clipped_Flood_R_A"])     intersectOutput = "Intersect"     arcpy.Intersect_analysis(in_Features, intersectOutput, "ALL", "", "INPUT")     #Add field. This will add a field to the Intersect file (intersection of SOAs and Flood Risk Area). This field will be used to calculate the population at risk.     inFeatures= "Intersect"     arcpy.AddField_management(inFeatures, "Pop_Risk", "DOUBLE", "", "", "", "", "NULLABLE", "NON_REQUIRED", "")     # Local variables:     Intersect = "Intersect"     # Process: Calculate Field     arcpy.CalculateField_management(Intersect, "Pop_Risk", "!Shape_Area! * !Pop_Density!", "PYTHON", "")     #Summary Statistics for the Total Population Effected     in_table = "Intersect"     out_table = "Pop_Risk_Sum"     stats = "SUM"     casefield = "Pop_Risk"     arcpy.Statistics_analysis(in_table, out_table, "Pop_Risk SUM", "")     # Process: Make Feature Layer     in_features = "Points_of_interest"     out_layer = "POIs_Layer"     arcpy.MakeFeatureLayer_management(in_features, out_layer, "", "", "OBJECTID OBJECTID VISIBLE NONE;Shape Shape VISIBLE NONE;CATEGORY CATEGORY VISIBLE NONE;NAME NAME VISIBLE NONE")     # Process: Select Layer By Location     in_layer = "POIs_Layer"     select_features = "Clipped_Flood_R_A"     arcpy.SelectLayerByLocation_management(in_layer, "INTERSECT", select_features, "", "NEW_SELECTION")     # Process: Copy Features     in_features = "POIs_Layer"     out_feature_class = "Copy_POI_LAYER"     arcpy.CopyFeatures_management(in_features, out_feature_class, "", "0", "0", "0")     # Process: Summary Statistics (2)     in_table = "Copy_POI_LAYER"     out_table = "POI_SUMMARY"     arcpy.Statistics_analysis(in_table, out_table, "CATEGORY COUNT", "CATEGORY")


title: Cross sections of two surfaces in Civil 3D

text: In Civil 3D I have calculated the volume between two surfaces. I would like to have corresponding cross sections of the first and second surface for all the study area. "Create superimposed profile" cannot solve the problem completely since it creates only profiles along one alignment and doesn't cover entire study area. I have did it in Land but I could not find the tools in Civil 3D. Any suggestion.


title: connect signal to function with arguments

text: Hello I have this function on python that take 2 arguments:                    def niveau(controName,idNiveau):                   ........      I want to connect it to this signal: `QObject.connect(dialog.findChild(QDialogButtonBox, 'buttonBox'), SIGNAL('accepted()'),niveau(control,1))` But I got this error: `Qt signal is not callable`. Does someone could help me please!


title: OD Cost Matrix Settings (Arcpy)

text: I have what is hopefully a fairly simple question. I am trying to run an OD cost matrix for every minute of a day for research I am performing. All of the settings will be the same for each run, except the time will change. I will be automating the process in Python. I know how to create a cost matrix with the settings, add the locations, and solve it all using Arcpy. However, I am hoping to be able to just change the time setting for each run without having to create a whole new cost matrix and add the locations again (similar to what you can do manually in ArcMap). I have not been able to find a way to do this in Python (if there even is a way). Any help would be appreciated. Thanks.


title: Adding an AddIns.Button to an Add-In Menu

text: I know the title sounds unwieldy but as I am beginning convert an existing COM interface to Add-Ins, I am having trouble adding a button to a root menu. I have an AddIn.Button that is used both as a button (in Add-In Controls) and an item in a rootmenu. The button works but when I add the namespace.classname to the .esriaddinx (as a Button refID="...", I get the modifier "static' and "internal" errors from the config.designer.cs. How do I reference this addin.button in the rootmenu so it can build the designer correctly?


title: How to speed up query through view in postgis?

text: I want to set up a postgis database that have some base tables, then the users interact with them through views (which restrict their viewable and acessible regions). The server runs PostgreSQL 9.2 on Ubuntu 12.04 and has been configured as recommended here. Result of `SELECT PostGIS_full_version();`               "POSTGIS="2.0.1 r9979" GEOS="3.3.3-CAPI-1.7.4" PROJ="Rel. 4.8.0, 6 March 2012" LIBXML="2.8.0""      I tested the above model with a road layer (polyline) with 6040 rows but the time it takes to select all rows through view is 13 seconds v.s. 2.2 seconds for selecting all rows on original table (nearly 6 times as much - this makes working with multiple postgis layer in Qgis at the same time terribly slow, except when zoomed in to a small region). My create view sql:               CREATE VIEW user_1_road AS     SELECT pk_id, geom, name, type, importance, notes, label_x, label_y, label_angle     FROM road     WHERE st_contains(( SELECT geom FROM regions where user_id = '1'), road.geom);      Is there anyway to improve execution speed?


title: GetLegendGraphic with bbox or filter

text: I have geoserver layer with sld style applied. The sld have like 50 rules using type attribute of the feature. Now i need to generate legend but only for specific area (i have bbox coordinates). I am doing this on server side and i can get all the features and their attributes of the choosen area (but i don't have access to style graphics ). The only way i can think of implementing this is to generate sld style (rules) dynamically and pass it to geoserver as SLD_BODY. It seems a lot of work so I wonder maybe there is a better way of doing this? Or maybe it is possible to pass some kind of parameter array to getLegendGraphic request like array of features ids or their type?


title: install opengeo on Arch Linux

text: I am trying to install the opengeo suite (community) for a project I have. The thing is that my Linux distribution is Arch Linux, for which the package manager is pacman and not apt-get as it is the case in Ubuntu. Is it possible to install it on Arch Linux? The installation manual says that it provides packages for both debian and red hat, but is possible to build a package from sources somewhere? I know they have a git repository, however, I cannot see how to build a package from it (my knowledge of writing PKGBUILDs is slim at best...) Thank you


title: Problem with save strategy

text: Below is my code which i am using for modifying features and drawing new features.               saveStrategy = new OpenLayers.Strategy.Save();     saveStrategy.events.register('success', null, ChangesSuccess);     saveStrategy.events.register('fail', null, ChangesFailed);          wfs = new OpenLayers.Layer.Vector("Edit Vagmitt Polyline", {              styleMap: StyleMap,         eventListeners: {             "featuresadded": ZoomToData         },         strategies: [new OpenLayers.Strategy.Fixed(), saveStrategy],         protocol: new OpenLayers.Protocol.WFS({             url: GEOSERVER_WFS,             featureType: "new_Vagmitt_polyline",             featureNS: "http://www.openplans.org/workspace",             geometryName: "the_geom",             srsName: "EPSG:900913",             version: "1.1.0",             extractAttributes: true,             isBaseLayer: false,             visibility: true         })          });      new OpenLayers.Control.DrawFeature(wfs, OpenLayers.Handler.Path, {displayClass: 'lineButton', title: 'Draw new line feature', handlerOptions: {style: sty}}); new OpenLayers.Control.ModifyFeature(wfs, {title: 'Edit line feature'}); The code works fine for modifyFeature control, but its gives error on save strategy when i draw a new feature. The changes are also saved back to Geoserver when i modify the feature (triggers ChangesSuccess). but in case of DrawFeature control, saveStrategy triggers ChangesFailed function. I could not understand, why ModifyFeature works but DrawFeature does't work. Can anybody explain, where is the problem ?


title: WMSgetFeatureInfo ProxyHost

text: Does WMSGetFeatureInfo need a proxyhost to allow remote server accessing the data? I use ProxyHost to allow WFS requests, but seems its not working with WMSGetFeatureInfo. the local machines retrieves data from GeoServer successfully but external machines doesn't! Here is the select feature code:                   control = new OpenLayers.Control.WMSGetFeatureInfo({             layers: [layer],             autoActivate: true,             maxFeatures: 3,             hover: false,             infoFormat: "application/vnd.ogc.gml",             eventListeners: {                 "getfeatureinfo": function (e) {                          var activeLayer = getActiveLayer();                     if (activeLayer != "") {                         var param = {                             REQUEST: "GetFeatureInfo",                             EXCEPTIONS: " application/vnd.ogc.se_xml",                             BBOX: map.getExtent().toBBOX(),                             SERVICE: "WMS",                             VERSION: "1.1.1",                             X: e.xy.x,                             Y: e.xy.y,                             INFO_FORMAT: 'application/vnd.ogc.gml/3.1.1',                             QUERY_LAYERS: activeLayer.params.LAYERS,                             Layers: activeLayer.params.LAYERS,                             FEATURE_COUNT: 6,                             SRS: 'EPSG:3857',                             STYLES: activeLayer.params.STYLES,                             WIDTH: map.size.w,                             HEIGHT: map.size.h                         };                              param.cql_filter = activeLayer.params.CQL_FILTER;                         //     if (activeLayer.params.LAYERS == 'AIS:favoriteVessels');                     //    param.Viewparams = 'UID:' + userid;                                   OpenLayers.loadURL(GeoServerWMS, param, this, setHTML, setHTML);                         OpenLayers.Event.stop(e);                     }                 }             }         });          map.addControl(control);     control.activate();      and the GeoServerWMS is specified by:               <php     if ($_SERVER['SERVER_NAME'] == 'MYPUBLICIP')       GeoServerWMS = 'http://MYPUBLICIP:8080/geoserver/wms'     else       GeoServerWMS = 'http://privateIP:8080/geoserver/wms'      here is my allowedHosts               allowedHosts = ['localhost', 'localhost:8080','localhost:80', 'localhost:8080/geoserver',                     'PrivateIP','PrivateIP:8080', 'PrivateIP:8080/geoserver',                     'PublicIP','PublicIP:8080', 'PublicIP:8080/geoserver',                      'www.openlayers.org', 'openlayers.org',                    ]      **EDIT** Even this event register is not working:               selectControl = new OpenLayers.Control.GetFeature({         id: 'selectControl',         protocol: OpenLayers.Protocol.WFS.fromWMSLayer(test, {         url: GeoServerWMS,             featureType: "layer"         }),         hover: false,         click: true     });      Here is the error I get: Some unexpected error occurred. Error text was > urlopen error [Errno 110] Connection timed out


title: Adding data at runtime into dataframes

text: I am trying to create an empty MXD to act as a template. I will have three dataframes for maps, each holding a different object from ArcSDE (1 raster object and 2 features). I know how to query all of the data frames, but I am having trouble finding out how to add actually data to the dataframes. Is there an online guide anywhere? Thanks for any help.


title: Map.MouseLeftButtonEvent not fired with EditGeometry in Silverlight

text: We have a Silverlight viewer using the ArcGIS 3.1 API. With the EditGeometry object, you're able to edit the objects in the map. You can ask the geometry after every action (moved, turned...), but I need the geometry at every moment while dragging the geometry. Therefore, I need to know when the dragging started. Normally, you do this by checking if a MouseLeftButtonUp event is fired after a MouseLeftButtonDown event. If not, you're grabbing the object. The problem is that the Map.MouseLeftButtonDown or FeatureLayer.MouseLeftButtonDown event is not fired anymore after your object is focused. You find a sample here: https://dl.dropboxusercontent.com/u/110352157/TestEditGeometry.zip, to reproduce my problem, you can use these steps: 1) Click on a ship. In the output window of VS, you see the Featurelayer.Buttondown, the Map.Buttondown, the Map.MouseButtonUp and the EditGeometry.Action.EditStarted are fired. The object is now focused and read to be dragged. 2) If you click again, you ONLY get LeftButtonUp event and EditCanceled action. So NO buttondown. 3) Click again on a ship to start editing, this gives the same as 1. 4) Click outside the focused object, you get the Map.ButtonDown and Map.ButtonUp 5) Hold your mouse left button down within the focused object. You see that there is NO Map.LeftButtonDown fired, nor a FeatureLayer.ButtonDown. 6) Drag the object and release: You get the MousLeftButtonUp and the GeometryMoved action. What I thus need I in step 5, a certain LeftButtonDown event. One of my thoughts was that from the moment you start editing, the object is transferred to a new object. And maybe I need NewObject.MouseLeftButton down. But I’ve no idea on how to find that object. Anyone an idea or trick to solve this? Thanks!


title: Show markers only at certain zoom levels

text: I'm building a cycle touring map in leaflet.js, with subjective information overlaid as markers, along the lines of "this is a great road", "this town is quite nice" etc. To avoid information overload, I want to only show the most prominent markers at a given zoom level (eg, show awesome roads highlighted at zoom 9, good roads at 11, and all road information, including negative comments, at 13+) I have two questions here:   1. Is there a recognised idiom or design pattern for this kind of thing? I'm quite happy to manually decide the prominence of each marker, so I don't need any kind of clustering algorithm. There'll be maybe a couple of hundred for the whole state, so it's manageable.   2. How can I implement this in Leaflet? My obvious thought is to attach a handler to map.zoomend() and simply show or hide the relevant markers. Is there a better way?


title: How to draw line by scratching on map using OpenLayers?

text: Is it possible to draw line by scratching on the map using OpenLayers? I tried some examples, all the examples are drawing by clicking. I want to draw by scratching, just like drawing in normal life on the paper. Is it possible to implement by OpenLayers? Thanks, in advance.


title: Rasterise heights from a 3D linestring

text: I have a 3D network of streams represented using linestrings with Z-coordinates. I would like to rasterise this feature, where the raster values represent the linearly interpolated Z-values between 3D coordinates from the linestring verticies. I have all open source and Esri tools available, but I don't see any simple solution. Did I miss an available tool to do this conversion, or do I need to make one myself? (I have a few ideas floating around my head, but it would probably take the better part of an afternoon to code out.)


title: count features in polygon shapefile A that fall within each feature of polygon shapefile B

text: I have two polygon shapefiles, each of which contain multiple (possibly overlapping) polygons. Is there some way, using GRASS, to calculate the number of polygons belonging to shapefile A that fall within each of the polygons that exist in shapefile B? Preferable would be a method that doesn't require rasterization, but I'm open to going down that route if necessary. (I'm aware that this can be done in R, using the `over()` function, but these are large files I'm referring to, and so I'd prefer to do it in GRASS.)


title: QGis problem with raster transparent

text: I am new to QGIS. I found the problem impossible to solve the parts of raster data that are in TIFF format should be made transparent. What do I do?


title: OpenLayers Google Closure externs file

text: Has someone written Google Closure Externs file for OpenLayers that I can use freely ? Externs file similar to those for jQuery, GoogleMaps, Underscore  ? Have to ask this before I create my own if none is available.


title: How to create complex map symbology using AutoCad Map object classes?

text: I'm trying to find the best way to transfer maps form ArcGIS to AutoCad Map. In ArcGIS map model is separated from it's representation. View is created by applying symbology and representation rules to underlying model. As far as I know this approach could be achieved in AutoCad Map using object definition classes. So I looking for a way to create complex topographic map symbology(like in ArcGIS) using AutoCad Map object classes. Official AutoDesk help describes this very poor. Is it really possible? Could someone provide links to some articles, how-tows about this issue?


title: Mapnik Server - Hardware recommendations

text: I'm looking for some suggestions for a Mapnik-TileCache server. How much hardware is really necessary? The dataset I use is about 380mb in osm raw format. My actual database is a bit more than 1GB. What would you suggest?   * QuadCore   * 8GB Ram   * SSD Harddrive for DB   * Bunch of disks for Cache What do you suggest? The server will have frequent trafic and let's say 300 - 500 people will work on that mapset. Thanks and Cheers! Martin


title: GeoJSON Styling information

text: As far as I can see there is nothing in the GeoJSON standard to store styling information, i.e. line colours, thicknesses etc. Am I missing something or is this just something that GeoJSON doesn't deal with?


title: Get all the points of a polyline

text: I have some polyline feature objects in python. Now I want to get all the points of polylines. For example, if a polyline has start point `[0,0]` end point `[5,5]`. Result: `[1,1];[2,2];[3,3];[4,4];[5,5]`. I want to find all the integer points on that line including end points. For straight line this is dead simple, but if polyline has Beizer Curve, Circular Arc, Elliptic Arc geometry types, then how can I do it? **EDIT:** I can only use those tools which are available in all versions of ArcGIS foe example ArcView


title: OpenLayers (allOverlays): Vector layer not rendered without raster layer beneath it

text: This is another newbie question. I'm trying to create a map using OpenLayers that comprises only of vector layers from a WFS server. However, I'm thwarted because my vector layer won't render unless it has a raster layer beneath it. I surmise this is because OpenLayers is deriving some setting(s) (resolution? minExtent?) from the raster layer that it's unable to do from the vector one, but I'm just guessing and I don't know what those settings are. The code below works beautifully, displaying both layers. If I remove the line to add the raster layer to the map, or add it after I've added the vector layer, the map displays nothing (calling oMap.zoomToMaxExtent() still shows nothing). What am I missing?               function initMap() {         var oRasterLayer,             oVectorLayer,             oBounds,             oSpatialProj,             oSphericalMercatorProj;              // Use MapBox dark theme for UI controls         OpenLayers.ImgPath = "http://js.mapbox.com/theme/dark/";              oSpatialProj           = new OpenLayers.Projection("EPSG:4326");         oSphericalMercatorProj = new OpenLayers.Projection("EPSG:3857");              oBounds = new OpenLayers.Bounds(-11, 49.6, 4, 62.6).transform(             oSpatialProj,             oSphericalMercatorProj         );              oMap = new OpenLayers.Map(             sMapDivId,             {                 numZoomLevels    : 10,                 maxExtent        : oBounds,                 restrictedExtent : oBounds,                 allOverlays      : true             }         );         oMap.addControl(new OpenLayers.Control.LayerSwitcher());              oRasterLayer = new OpenLayers.Layer.XYZ(             'Land',             sTilesUrl.replace(/\${layer}/, 'land'),             {                 projection        : oSphericalMercatorProj,                 wrapDateLine      : true,                 sphericalMercator : true             }         );              /* Add a postcode area selection layer. This is a vector layer, working         directly with data from PostGIS. */         oVectorLayer = new OpenLayers.Layer.Vector(             'Selection',             {                 projection        : oSphericalMercatorProj,                 wrapDateLine      : true,                 sphericalMercator : true,                 strategies        : [new OpenLayers.Strategy.BBOX()],                 protocol          : new OpenLayers.Protocol.WFS({                     url          : '/wfs',                     featureType  : 'areas',                     featureNS    : "http://gis.mediatel.co.uk",                     geometryName : 'wkb_geometry',                     srsName      : 'EPSG:3857'                 })             }         );              // SWAP THESE TWO LINES, OR COMMENT-OUT THE RASTER ONE, TO BREAK THE MAP:         oMap.addLayer(oRasterLayer);         oMap.addLayer(oVectorLayer);              oSelectControl = new OpenLayers.Control.SelectFeature(             oVectorLayer,             {                 clickout    : true,                 toggle      : true,                 multiple    : true,                 hover       : false,                 toggleKey   : 'ctrlKey',                 multipleKey : 'shiftKey',                 box         : false             }         );         oMap.addControl(oSelectControl);              oMap.setCenter( // Near London             new OpenLayers.LonLat(0, 51.5).transform(                 oSpatialProj,                 oSphericalMercatorProj             ),             9         );     }


title: mapserver how to get rid of unknown character from label

text: I am developing a gis system using mapserver and open scales library. GIS data is taken from a shape file. When i try to show the name attached to a place its showing unknown characters (not in english) along with its name in english. here is my .map file settings                LAYER        NAME city        TYPE POINT        STATUS ON              LABELITEM 'NAME'                 MAXSCALE 7500000       DATA "ndia_location.shp"              CLASS        EXPRESSION ( '[PLACE]'=='city' )              LABEL                            COLOR 0 0 0                 TYPE BITMAP                 SIZE SMALL                           POSITION CC             #MINFEATURESIZE 100             ENCODING UTF-8                 PARTIALS FALSE             BUFFER 0             END           END      Is there a way to show only English name for the label. I have tried with openlayers javascript library also.


title: Listen to edit events

text: I recently started working on ArcMap. I want to make some changes to the edit tools. For example I want to prevent the user from using the sketch tool when the time is between 1pm and 2pm But I don't know where to start. If anyone has a simple example I would appreciate it.


title: How to do Kernel density analysis in QGIS 1.7?

text: Do someone have some suggestion? We would like to tray Kernel Density analysis as we did with ArcGis using QGIS?


title: Standalone QGIS application - handling QgsVectorLayer load errors

text: I am creating an application with QGIS libraries, and in the event that the app can't add a specified layer (e.g. no connection to host, no password specified etc), it causes the app to crash, although I do get some output in the console, like QGIS displays in a message box:               credentials for dbname='testdb' host=testserver port=5432     message: fe_sendauth: no password supplied      This seems to be returned at the point where I create my `QgsVectorLayer` instance because the app becomes unresponsive and doesn't progress further. My script to load the layer:               def add_postgis_vector_layer(self, username, password, layer_name, label, geometry, id):         uri = core.QgsDataSourceURI()         uri.setConnection(HOST, PORT, DATABASE, username, password)         uri.setDataSource(SCHEMA, layer_name, geometry, '', id)         layer = core.QgsVectorLayer(uri.uri(), label, 'postgres', False)  # Error message occurs at this point         if layer.isValid():             self.canvas.setExtent(layer.extent())             self.canvas.zoomScale(self.canvas.scale() * 1.1)             self.canvas.setWheelAction(2)             # Set canvas map layers             layers = [gui.QgsMapCanvasLayer(layer)]             self.canvas.setLayerSet(layers)      The QApplication subclass:               class myApplication(QtGui.QApplication):         def __init__(self, args):             super(myApplication, self).__init__(args)             core.QgsApplication.setPrefixPath(qgis_prefix, True)             core.QgsApplication.initQgis()      How do I access this connection error? I can't call `layer.error()` (not sure if this would even work) because the app has crashed already and won't process any more code. Edit: I'm thinking I could avoid the error by performing a query using `psycopg2` with the parameters I am about to use. Still doesn't address the issue of retrieving any errors in the connection.


title: Configuring Mapproxy + Mapnik for using Getfeatureinfo

text: This is probably a duplicate of this question: How to configure mapproxy and mapnik for getfeatureinfo requests, however, that one is old and still unanswered. I'm trying to configure a Mapproxy using Mapnik and I need to make getfeatureinfo requests available. My configuration files are like this (parts that I believe are relevant): mapproxy.yaml:               services:       demo:       kml:       tms:       wmts:       wms:         srs: ['EPSG:4326', 'EPSG:900913']         image_formats: ['image/jpeg', 'image/png']          layers:       - name: poi         title: Pleno POIs         sources: ['poi_wms']       - name: vias         title: Pleno Vias         sources: ['vias_wms']          sources:       poi_wms:         type: mapnik         mapfile: mapnik/Mapnik.xml         transparent: true         layers: ['poi']       vias_wms:         type: mapnik         mapfile: mapnik/Mapnik.xml         transparent: true         layers: ['vias']      And my mapnik xml looks like this:               <Map ...>        <Style>...</Style>             <Layer name="vias"                srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over"                queryable="true">             <StyleName>vias</StyleName>             <Datasource>                 (...)             </Datasource>         </Layer>              <Layer name="poi"                srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over"                queryable="true">             <StyleName>poi</StyleName>             <Datasource>                 (...)             </Datasource>         </Layer>     </Map>      When I try to do a getfeatureinfo request, I get `"layer vias is not queryable"`. I've tried adding the `queryable="true"`, as one answer in old question I've linked suggested and had no success. Also, I had one layer on mapproxy using the 2 layers on mapnik, I changed to two to see if it would matter, still nothing. I'm using Mapproxy 1.5 and on its documentation (http://mapproxy.org/docs/1.5.0/sources.html) it says how to make a wms source queryable (add `wms_opts: featureinfo: true`). The problem is that it only works if you have `type: wms`. When you have `type: mapnik`, it says that the keys wms_opts or featureinfo are unknow and it doesn't work. I've tried several other stuff (like adding a key `mapnik_opts` with `featureinfo: true`) and couldn't get it to work, nor find any information about this on the web. Does anyone know how to solve this problem? (Or at least have some kind of workaround for it?) It seems like either mapproxy doesn't support getfeatureinfo requests when you're using mapnik or the information about how to do it is well hidden. :(


title: CartoDB: Can't find where to change Google Drive log in credentials

text: I'm trying to create a new table in CartoDB.   1. I click New Table   2. I click the Google Drive data tab   3. I click the connect with gdrive button   4. At this point it seems to be automatically logging in to the wrong Google Drive account. Is there a way to reset that so I can get into the right account? I'm trying to marry up my table with a Google spreadsheet. Thanks!


title: Comparing/Correlating NDVI Rasters with other index Raster

text: So, I've created two rasters. One for NDVI and one for another index for surface water from the same orthorectified World-View 2 image. I can visually see how the indexes are inversely proportional. Areas of higher readings in one raster correlate with areas of low readings in the other index and vis- versa. I'm doing the processing through ArcGIS 10.2. How would I show this to be the case in a quantifiable way?


title: Error when publishing Geoprocessing tool to ArcGIS Server

text: I've designed a model which compares some shapefiles to other shapefiles (I want to see if the files I get are the same as the files of my template). When I try to publish the toolbox (where the model is found) on the server I get this message " _Configuration can not be started. Server Object instance creation failed on machine....Geoprocessing service initialization failed. Invalid parameter: Tool..._ " SOC has full access to the folder where my toolbox is so this can't be it. Is it because I'm working with shapefiles? Or why would the parameters be invalid? I am using ArcGIS Server 10.0; ArcDesktop Editor 10.0. ![enter image description here](http://i.stack.imgur.com/mCp3B.png) Thank you


title: Why is there a shift between OpenLayers and vector layer in print?

text: Sorry for my poor english. I'm a very recent user of QGIS (QGIS 1.8; ubuntu 12.04). Does anybody knows why the `.tif` or `.jpeg` or `.pdf` files I generate with the QGIS composer have different layers completely shifted? For example, 2 layers: 1 open street map landscape and 1 layer of my GPS points. In the composer window, the points are exactly at the right place, the map is nice and ready to be saved or printed... But when I do `export to pdf` or `.jpeg` or `.tif` the picture that I obtain shows the map very small in a corner and the GPS point in the middle of a white picture. When I try to print, a white sheet of paper is produced. Any ideas? thank you very much


title: Is it possible to edit a layer in QGIS while there is an active query?

text: I am new to Quantum and I am digitizing polygon layers using the editing features. I would like to apply simple queries ('date > 2012/08/01'), however while the query is active I cannot edit the layer. Is this possible?


title: How to speed up Postgis raster layer display in QGIS?

text: i've been importing some digital orthophoto geotif files into postgis 2.0.1 via raster2pgsql tool (i also made 3 levels of an overview table - pyramid). Then i tried to import the layer into qgis via the postgis load raster plugin. It works, but the speed seems so slow its unusable at the moment. I found a post somewhere about this being a GDAL issue, but i couldnt find if a solution has been found yet. Did anyone get across this? Thanks


title: how to call click event on marker(may be a simple fill symbol elementt or picture symbol element) element using java arc objects

text: Hii I am new in GIS and java arcobjects. I have to call a click event on simple marker element   on mapbean using java arc objects but i dont know how to do it. in my application I put approx 200 markers in mapbean now i have to select few of them approx 6 marker which is selected by user but i dont know how to select this particular marker I think if i am able to call click event on marker. then I would select it . putiing a marker on mapbean code is there.               public static void  drawBlackPoint(IPoint fpoint, double hieght,double prev_hieght) {         try {                       ////for Starting point             ISimpleMarkerSymbol markerSymbol2 = new SimpleMarkerSymbol();             markerSymbol2.setStyle(esriSimpleMarkerStyle.esriSMSCircle);                       IRgbColor rgbColor2 = new RgbColor();             if (hieght!=prev_hieght) {                 count1++;             }             if(count1==1){                 rgbColor2.setRed(34);                 rgbColor2.setBlue(139);                 rgbColor2.setGreen(24);             }else if(count1==2){                 rgbColor2.setRed(0);                 rgbColor2.setBlue(0);                 rgbColor2.setGreen(205);             }else if(count1==3){                 rgbColor2.setRed(112);                 rgbColor2.setBlue(219);                 rgbColor2.setGreen(147);             }else if(count1==4){                 rgbColor2.setRed(255);                 rgbColor2.setBlue(255);                 rgbColor2.setGreen(0);             }else if(count1==5){                 rgbColor2.setRed(127);                 rgbColor2.setBlue(0);                 rgbColor2.setGreen(255);             }else if(count1==6){                 rgbColor2.setRed(138);                 rgbColor2.setBlue(69);                 rgbColor2.setGreen(19);             }else if(count1==7){                 rgbColor2.setRed(139);                 rgbColor2.setBlue(131);                 rgbColor2.setGreen(120);             }else{                 rgbColor2.setRed(255);                 rgbColor2.setBlue(255);                 rgbColor2.setGreen(255);             }             markerSymbol2.setColor(rgbColor2);             markerSymbol2.setSize(5.0);             IMarkerElement markerElementOne2 =  new MarkerElement();             markerElementOne2.setSymbol(markerSymbol2);          IElement elementOne2 = (IElement) markerElementOne2;             IElementProperties elementPropertiesTwo = (IElementProperties) elementOne2;             elementPropertiesTwo.setName("FP");             elementOne2.setGeometry(fpoint);                            ILayer layer;             int count = BasicViewer.getMapBean().getLayerCount();                            if (hieght!=prev_hieght) {                      ICompositeGraphicsLayer cgl=new CompositeGraphicsLayer();                 IGraphicsContainer gl=(IGraphicsContainer)cgl;                 gl.addElement(elementOne2, 0);                 layer = (ILayer) gl;                 layer.setName("hieght_"+hieght);                     BasicViewer.getMapBean().addLayer(layer, 0);                 BasicViewer.getMapBean().getActiveView().partialRefresh(esriViewDrawPhase.esriViewGeography,layer, null);                  }else{                           for (int i = 0; i < count; i++) {                     if(BasicViewer.getMapBean().getLayer(i).getName().equals("hieght_"+hieght))                     {                         System.out.println("--Layer Name- if-"+BasicViewer.getMapBean().getLayer(i).getName());                         layer=BasicViewer.getMapBean().getMap().getLayer(i);                              IGraphicsContainer gl=(IGraphicsContainer)layer;                              gl.addElement(elementOne2, 0);                          }                 }                  }              } catch (Exception e) {             System.out.println("Exception In drawPoint :: " + e.toString());             e.printStackTrace();         }     }      please suggest the solution.


title: What is the most efficient way to search a geodatabase for NULL-like records?

text: The problem: I have a geodatabase with several datasets and many more feature classes within. The fields within the feature classes have been populated through joins with shapefiles and manual edits. Often times string fields will become populated with whitespace (i.e. '', ' ', ' ', etc) or the string "Null", and numeric fields will become populated with a zero (0). I would like to find these records and replace them with a true NULL value. I have the following code, which uses an UpdateCursor, but it still very slow and doesn't catch all of the NULL-like records. Does anyone know of other ways to accomplish this task?               GDB = arcpy.GetParameterAsText(0) #input geodatabase     arcpy.env.workspace = GDB     datasetList = arcpy.ListDatasets() #list datasets          for dataset in datasetList:             arcpy.env.workspace = os.path.join(GDB, dataset)             fcList = arcpy.ListFeatureClasses()             for fc in fcList:                     arcpy.AddMessage("Processing %s..." % fc)                     #count features                     arcpy.MakeTableView_management(fc, "tempTableView")                     count = int(arcpy.GetCount_management("tempTableView").getOutput(0))                     if count > 0:                             fieldList = arcpy.ListFields(fc)                             for field in fieldList:                                     arcpy.AddMessage("...%s" % field.name)                                     rows = arcpy.UpdateCursor(fc)                                     for row in rows:                                             count = 0                                             if row.isNull(field.name):                                                     continue # if already null                                             elif field.type == "Text":                                                     value = row.getValue(field.name)                                                     if value.lstrip(' ') == '' or value.lower() == '<null>': # looks for whitespace or '<null>'                                                             row.setNull(field.name)                                                             count += 1                                             elif field.type == "ShortInteger" or field.type == "LongInteger" or field.type == "Float" or field.type == "Double":                                                     value = row.getValue(field.name)                                                     if value == 0:                                                             row.setNull(field.name)                                                             count += 1                                             if count > 0: # update row if records have changed                                                     rows.updateRow(row)                                     del rows                     else:                             arcpy.AddMessage("...NO RECORDS FOUND.")


title: Can I install GIS Software on RSS (informix server) running 11.7.fc6

text: I currently use ArcGIS Server 10.0 and consume data through a db2 database. I recently installed an RSS informix server and was hoping to pull data from this since it is updated real-time versus the nighly update of the db2. RSS Informix Server Version: 11.7.fc6 OS: AIX 6.1 GIS Server: 10.0 If I stay at Server 10.0, I would have to install ArcSDE (I assume) on the Informix Server. Can SDE be installed on an Informix Server running 11.7.fc6 OS: AIX 6.1? ** Edit: I see ArcSDE 10 isn't compatible with 11.7.FC6. But is it possible to install ArcSDE 10.1 on Informix (assuming Informix version is supported by 10.1) while still remaining at 10.0 Server with capability of publishing the Informix data as a service on Server 10.0? ** If I upgraded to 10.1 Server, the Informix capability is already there without installing SDE, BUT this link shows support for only FC8 and FC4. How would FC6 react or would I need an upgrade to FC8? http://resources.arcgis.com/en/help/system- requirements/10.1/index.html#//015100000071000000


title: Accessibility to developer of "Alter" and similar constructs in MapInfo MapBasic

text: Parts of the MapInfo MapBasic API are accessed as follows:                 Alter ButtonPad "Main"             Add ToolButton                 ID 101                 Icon 8                 Calling OnToolClicked                 HelpMsg "Custom Edit Tool.\nCustomTool"             Show      The `Alter ButtonPad` statement with nested `Add` and `Show` commands looks a bit like the builder pattern or a "fluent" interface in object oriented languages. I'm wondering if the Alter ButtonPad statement is defined with a language construct that a developer can take advantage of when building a MapBasic application. For example I'm developing an application that will dynamically populate a form with drop-down lists. It would be nice if I could build up the constraint lists with something like:               Create ConstraintCollection         Add Property             Name "property"             Add Value "value 1"             Add Value "value 2"             Add Value "value 3"      Is defining this `Create ConstraintCollection` statement something that is possible with MapBasic?


title: Geocoder leaflet for internal use in the company, which take addresses from any part of the street

text: I am making a personal application routing to be used internally in the company using machine leaflet route. The plugin uses nominatim geocoder, but he geocodificia according to the links of the OSM. I need to get the long / lat of arbitrary points, for example if the A Street No. 1234 is in the middle of the block on the corner geocode returns. That for purposes of mileage will make a difference to me. Would like suggestions of geocoder that meet this need, remembering that the application is built.


title: How to get all the FeatureClasses from IWorkspace?

text: Well i create a Geodatabse in my SQL Server using ArcCatalog then i create 5 new FeatureClass, i want to get all the FeatureClasses in this GDB, this is my function to get all the FeatureClasses from a workspace, my problem is that i can't get all the FeatureClasses (5) sometimes i get 2 and sometimes only 1 FeatureClass.                       public static List<ILayer> getLayersFromWokrspace(IWorkspace workspace)         {             List<ILayer> layers = new List<ILayer>();             IFeatureWorkspace fw = (IFeatureWorkspace)workspace;                        // i tried the both ways to get the datasets in the workspace (i tried the type "esriDatasetType.esriDTAny" too)             IEnumDataset datasets = workspace.get_Datasets(esriDatasetType.esriDTFeatureClass);             //IEnumDataset datasets = workspace.Datasets[esriDatasetType.esriDTFeatureClass];                       IDataset dataset = null;             while ((dataset = datasets.Next()) != null)             {                 if (dataset.Type == esriDatasetType.esriDTFeatureClass)                 {                     IFeatureClass featureClass = fw.OpenFeatureClass(dataset.Name);                     IFeatureLayer featureLayer = new FeatureLayerClass();                     featureLayer.FeatureClass = featureClass;                     ILayer layer = (ILayer)featureLayer;                     layer.Name = dataset.Name;                     layers.Add(layer);                 }                 dataset = datasets.Next();             }                  return layers;         }


title: Validity of ordinary kriging of polygon centroids

text: I'm in a discussion with a colleague who believes that kriging should not be used to interpolate a surface from polygon based data (i.e. with kriging applied to centroids), because this effectively translates the spatial uncertainty inherent in any polygon centroid into data error in the kriged surface. I'm sure he's right in principal but cannot help thinking that the uncertainty-error question should not be an absolute argument against the method give that uncertainty is (a) unavoidable and (b) a function of zone size and the degrees to which the data has already been aggregated. I'd be interested to hear views from others, particularly anyone with good experienced of kriging interpolation.


title: How to open a Data Reviewer 10.1 Batch Job in Data Reviewer 10.0

text: I have begun creating several reviewer batch jobs (RBJs) to use with electric and water utility data. The RBJs came as ESRI templates (electric and water) and I have been modifying them with Data Reviewer 10.1. I recently tried opening the RBJ with Data Reviewer 10.0, which subsequently gave me the following error: > Error opening batch job. This is an incompatible version of the Reviewer > Batch Job. The templates read as version 9.3/10.0, until I modify them and save in 10.1. Does anyone know of a way to downgrade or read the RBJs in 10.0?


title: Dynamic title in ArcMap

text: How can I have a dynamic title of the map, which changes depending on the layer chosen? Is this doable? It would save a lot of time and iterations since I should be producing several maps. To illustrate, I want the title to get the name of the first layer ticked if several layers are ticked. Any hint will be useful.


title: arcpy Problem with updateRow() when trying to update fields with UpdateCursor

text: I have a list of values which I am trying to add to an existing shapefile. The field where the values need to be inserted has been added via arcpy.AddField_management and thus the values of the rows are empty or 0. The variable expression1 is a list of floats with the length of the rows in the shapefile. To update the rows I use UpdateCursor:               import arcpy     import math     from arcpy import env     env.workspace = "S:/Black grouse modelling/shapefiles"     inFishnet = "fishnet_label.shp"     rows = arcpy.UpdateCursor(inFishnet)     fields = arcpy.ListFields(inFishnet)     for row, i in zip(rows, expression1):         for field in fields:             if field.name == "dist":                 print i                 row.setValue(field.name, i)                 rows.updateRow(row)     del rows     del row      The output I get is as follows:               1265.60109093          Traceback (most recent call last):       File "<pyshell#218>", line 6, in <module>         rows.updateRow(row)       File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\arcobjects\arcobjects.py", line 102, in updateRow         return convertArcObjectToPythonObject(self._arc_object.UpdateRow(*gp_fixargs(args)))     RuntimeError: ERROR 999999: Error executing function.      The value I want it to update with gets printed as requested (1265.60109093). And I think there isn't a problem with the row.setValue() line. The error comes when I am trying to update the row. I have thought it might be an issue with the float numbers. As these might be longer than the field allows for. However, I have tried rounding the numbers and then inputting those values into the rows but that doesn't work either. I have also tried the following code without setValue() but this doesn't work either:               for row, i in zip(rows, expression1):         print i         row.dist = i         rows.updateRow(row)      Any help is appreciated. EDIT: as requested the values of expression1:               expression1[:5]     [1265.6010909259928, 1247.9398102685327, 1232.0557693355686, 1218.0185004559901, 1205.8924977596705]      which is calculated via the following function:               def distFrom(self, other):             ox = other.x             oy = other.y             xDist = self.x - ox             yDist = self.y - oy             return (xDist**2 + yDist**2)**0.5      Obviously I do not need these values to be so accurate, but rounding them to 2 decimals for example does not solve the problem. I have also tried it with a different variable where the values are either True or False and converting these to strings. This does also not solve the problem. I am using python 2.6.5 and arcGIS 10.0


title: Get IWorkSpace from IGxObject

text: I am creating a tool that opens an `IGxDialog` which it's objects are filtered to show only workspaces, my question is how can I convert `IGxObject` to `IWorkSpace` or get the selected workspace without taking the selected object name and opening it using an `IWorkSpaceFactory` Thanks in advance


title: Geoserver WMST Date Format

text: There is table in SLQ-Server 2008 R2. In this table i have date column with date format like this `2006-09-08 14:39:41.000`. Now i make View from this table on Geoserver side but do nothing wiht date field. And make WMST layer. Now i go into Layer Preview and not see any features.   Okey i says. I take source table and publish it on geoserver but geoserver not see date column.   Whats wrong? In Geoserver docs i see that in WMST i gonna use ISO-8601 time format. How can i convert date format in view on Geoserver? **UPDATE** I make some tests.   I take Shape file with date field (i.e. 2002-08-20) put it into SQL-Server using `ogr2ogr`. SQL-Server says that my date field is date data type. Geoserver says it too. And in Layer Preview i see my features and after addin in address line `TIME=2002-08-21` parameter i can see features with other dates.   After i add `datetime` field in my table and put into dates like `2002-08-20 14.00.00.000`. Geoserver says that its `Timeswap` datatype. In Layer Preview i DONT GET any features addind `TIME=2002-08-21T14.00.00.0Z` not help. When i click on map i get error that `cant convert varchar into datetime`.


title: How do you update the maxFeatures setting of a WFS layer in OpenLayers

text: I have a WFS layer which a protocol in the definition. The protocol states that the maxFeatures returned should be 1 to avoid downloading a large amount of data. I can update the value for maxFeatures using layer.protocol.maxFeatures and this registers as updating successfully but when I then call a layer.refress({force:true}); command the actual WFS request still appears to be limited to 1. Is there a good example of how to modify a WFS protocol using javascript once the layer has already been loaded into the map? Many thanks


title: How to check if domain already exists?

text: I am trying to check the existence of domains in my file geodatabase which contains 4 domains (automatically populated after I created some annotation feature classes). My code is as follows:               import arcpy          workspace = env.workspace = r"Z:\Test.gdb"          desc = arcpy.Describe(workspace)     domains = desc.domains          for domain in domains:         if arcpy.Exists(domain):             print domain      The issue I have is the behavior of the 'Exists' method'. When I set a conditional sentence to:               if arcpy.Exists(domain):             print domain      the domains does not print. I'm thinking the code reads like 'If the domain exists, then print out the domain'. Because I have 4 domains, it should print these, but it doesn't. I tried the reverse:               if not arcpy.Exists(domain):             print domain      In this case, the domain gets printed out which seems counter intuitive. To me this reads like 'If the domain does not exists, then print the domain which should return nothing because it does not exist' I want to test if any domains exists, instead of using a conditional statement to test if specific domains exist. Thanks, Mike


title: How do I keep user from selecting a different tool when my custom tool is selected?

text: I am using VB.Net to write an add-in. I'd like to keep the tool that I created selected even when the user attempts to select a different tool, and only deselect when my tool is clicked on again.


title: Manually edit a raster to improve a classification?

text: I have a land cover classification derived from Landsat TM imagery - I created this classification using ENVI. I would like to edit individual and groups of cells in some areas of the classification in order to improve the accuracy of the output by comparing it with aerial imagery. Is there a way, using ENVI or ArcGIS, to manually edit large groups of cells by selecting them and assigning them to a new or existing class? I am aware of merging methods based on class statistics, but the area I'm classifying has a high amount of spectral confusion due to thin cloud cover - it seems like a manual edit is the only way to go.


title: How to calculate the angle at which two lines intersect in PostGIS?

text: I want to calculate the angle between two lines where they intersect in PostGIS. The starting point for angle calculations in PostGIS seems to be ST_Azimuth \- but that takes points as input. My first thought was to take the endpoints of the intersecting lines and performing an Azimuth calculation on those. That is not good enough, because most of the line features are not straight, and I am interested in the angle at intersection. So what I came up with is a nested operation that goes through the following steps:   1. Identify all the intersections between the two line feature tables.   2. Create a very small buffer around the intersection point   3. Identify the points where the line features intersect the buffer exterior (taking the first point if there are more than one - I'm really only interested in whether the angle is close to 0, 90 or 180 degrees)   4. Calculate ST_Azimuth for those two points. The full SQL is kind of long to post here, but I gisted it here if you're interested. (By the way, is there a better way than to carry over all the fields going down the WITH statements?) The results don't look right, so I'm clearly doing something wrong: ![output example 1](http://i.stack.imgur.com/MrtJU.png) ![output example 2](http://i.stack.imgur.com/NkpTM.png) EDIT I redid the calculations in EPSG:3785 and the results are a little different but still not right: ![output in 3785 #1](http://i.stack.imgur.com/Pc6uN.png) ![output in 3785 #2](http://i.stack.imgur.com/xipwN.png) My question is where the flaws are in this process. Am I misunderstanding what ST_Azimuth does? Is there a CRS issue? Something else altogether? Or maybe there's a much, much simpler way to do this?


title: Saving *.dbf as *.xls using Python?

text: i've been let loose in the workplace to learn python to do things in Arcmap10. so, i've learning python as i go and trying to remember the programming i have done. where i am in this project is converting a dbf, or csv, xls in a simple fashion. from there, all the files will be copied together into one file. i've got the all-in-one xls working, but i can't find an easy, simple dbf to xls solution. i condensed code found here: http://blog.gmane.org/gmane.comp.python.education/page=12 into:               from xlwt import Workbook     import dbfpy.dbf          input0 = '...file.dbf'     output = '...file.xls'          def test1():         dbf = dbfpy.dbf.Dbf(input0)         book = Workbook()         sheet1 = book.add_sheet('Sheet 1')         for row in range(len(dbf)):             for col in range(2):#chop to two for my purposes, gm                  sheet1.row(row).write(col, dbf[row][col])         book.save(output)          test1()      this works, minus the lack of field names.


title: managing postgresql database table using the pgadminIII sql tool

text: i have created a database using postgresql 9.1 and a table containing parcel information for a town council database on a windows 7 OS. i created the geometry column using the SELECT AddGeomatryColumn function and left the geometry column empty at first. now i want to insert the coordinates of each parcel using the sql tool from the general plan which is in a hardcopy. which query must i use to insert the coordinates one by one? i think i can insert coordinate for each parcel by specifying the erf number of the parcel. any help please


title: How to remove black background from geoserver imagepyramid?

text: I have a large ImagePyramid published in Geoserver (v 2.4). Each granule in the pyramid has nodata set to 0. I'm confused as to which layer parameter in GeoServer should I change to get a transparent background. I tried changing `BackgroundValues`; `InputTransparentColor` and `OutputTransparentColor` but nothing seemed to work. How can I make the background transparent? ![Black color in the background that I'd like to remove](http://i.stack.imgur.com/aOVvI.png)


title: 'The layer and specified base surface do not overlap in extent' error message

text: I am trying to change the base height of a jpg file to but it comes up with the message:'The layer and base surface do not overlap in extent. Verify they are for the same study area'. Both layers are in the same coordinate system. Can anyone help solve the problem? Thanks


title: Examples of evolving networks in GIS

text: I'm a master student working on networks analysis in general. A network is something that has nodes and there are links between the nodes. Nodes and links could have attributes. An evolving network is one that changes overtime (new nodes and links are added..etc). An example of that is Facebook. Nodes are users and links represent the friendship relationship. Users have attributes (gender, age ..etc). A Facebook network as you know is an example of a social network. The issue is that so many people studied traditional evolving networks like social networks, the web, or transportation networks. Currently I'm looking for novel examples of evolving networks to study them. So I thought there might be some examples in _GIS_ that could represent some kind of an evolving network. So my question: Can you give me examples in _GIS_ for evolving networks?


title: How to use Google Maps projection with GeoDjango/PostGIS

text: I am building a web service with GeoDjango which involves user submitted events including a location. I created a model field for my location using `django.contrib.gis.db`:               location = models.PointField(srid=900913)      I chose to specify `900913` as I read that this is the projection used by Google Maps and I am getting the location by placing a marker on a Google map. The coordinate is presented to me in lat/lng form. I am storing this point in a PostGIS DB using GEOS:               location = geos.Point(data['lng'], data['lat'], srid=900913)      If I want to view this point on a map, I get the lat and lng from my DB (e.g. `lat = location.coords[1]`) and use them to centre my map and this works fine. When I want to browse a map and display events from DB which lie inside the map bounds I use GeoDjango's `within` query and the maps bounds (in lat/lng format):                   bounds = geos.Polygon.from_bbox((swLng, swLat, neLng, neLat))         events = Event.objects.filter(location__within=bounds)      This appears to work fine and I display pins on the map corresponding to the lat/lng of these events. So far nothing would suggest that anything is going wrong, however I am completely new to this stuff and I want to ensure that I'm getting it right for when I inevitably want to use my location data in more complex ways. The reason I'm suspicious is that my Django admin pane does not display the location correctly on the OpenStreetMap. It shows a point which appears to correspond to the (0,0) point shown here. The displayed text version of the location field is `SRID=900913;POINT(-1.277482509613037 50.874104373286066)`, which is clearly still in lat/lng. As I move my mouse around the admin map I can see the displayed coords in the bottom right corner are in 900913 format, and not in lat/lng. Please can you explain how I can store my location points in the correct format, and what advantages this has over simply using lat/lng (my guess is that if I want to specify say a distance in km for lookups, I can't use my lat/lng locations).


title: Drawing irregularly shaped boundary polygon around set of LAS points using ArcMap?

text: I am working with a set of LAS data which is irregularly shaped, picture a starfish as the point coverage, surrounding the starfish may be water on one side, may be more land elsewhere but no points were collected for it. In fact most of the areas around this starfish of points is land without points collected, and inside the starfish shape is a little lake. I want to make a DEM of just the area where points were collected, and there are many ways of doing this, but most will interpolate all the no-point areas inbetween "arms" of the starfish data point pattern. Making the DEM by using a Terrain Dataset allows for the input of a bounding shape, to theoretically omit no-point areas from being interpolated and only geoprocessing inside of the boundary shape. However, I have difficulty coming up with a precise bounding polygon of the outside edge of the starfish to use as my geoprocessing limiting extent. I found a process online in a blog by Clayton Crawford which was picked up by ESRI and used as their help file for the process of turning LAS to DEM's, but it involves downloading a custom VBA script and several steps which went a bit over my head. So I am wondering if anyone out there has a suggestion on how to get that starfish pattern of LAS datapoints inside a bounding starfish-shaped polygon, without the use of VBA, or alternately if there's a way to go right from LAS to DEM raster with no-point areas end up as NoData. I'm using ArcGIS 10.1 for Desktop. Any suggestions on this are appreciated.


title: How to replicate ArcGIS coordinate transformation with ogr2ogr?

text: I need to be able to replicate with **_ogr2ogr_** a coordinate transformation that was executed in **_ArcGIS for Desktop_**. Both ArcGIS and ogr2ogr are based on **_EPSG standard definition_**. There's not only one way to transform data from a reference system **A** to a reference system **B** , but many transformations are possible **(T1, T2 ... Tn** ). After a lot of reading i understood that EPSG codes define, among many other things, CRS (coordinate reference systems, A and B in the previous example), and possible transformation between them (T1...Tn). When in gis one performs a coordinate transformation ArcGIS prompts the user with the choice of a transformation. On the other side ogr2ogr simply works specifying the source and destination CRS. two questions then arise:   * what kind of transformation does ogr2ogr performs? is it still based on the transformation defined within the epsg standard?   * Is it possible to force ogr2ogr to use a transformation specified via an epsg code? please keep in mind that my goal is to replicate a transformation executed in gis (thus identified by an epsg code), with a call to ogr2ogr.


title: Problem while inserting an object into ArcMap

text: I get this error, when I try to insert a pdf file into ArcMap Layout view. I have clicked on Insert - Object - create from file, browsed the geo pdf and pressed ok. I get this error: > Failed to create object. Make sure the object is entered in the system > registry < I searched for this error and found this: > http://support.esri.com/zh-cn/knowledgebase/techarticles/detail/27401 Where > can I find the script blocking option in Nod32? defence temporary disable is > not enough. Or the problem is not with the scripts running in background in > that time?


title: Is there Python library (other than ArcPy) for geoprocessing such as buffer?

text: Excluding ArcPy, is there any python library which can do geoprocessing, such as buffer/intersect, with shapefiles?


title: What coordinate system should be used to store geography data for celestial coordinates?

text: I am doing an astronomy project. I want to have the information about our images stored in a spatially enabled database. This, I would think, should be a very easy special case for GIS functions because the sky can be treated as perfectly spherical, and does not require an elliptical treatment like the surface of the earth. Unfortunately, I have not found a way to do this yet and I have been dodging mines with spatial functions that use an elliptical earth. (Pretty much any function that returns meters instead of degrees may be using an elliptical calculation. Luckily, many of the PostGIS functions I've needed appear to have incomplete implementations where the documentation explicitly states that the returned results are for a sphere and not for the ellipsoid. But that may change with future versions, which is a cause for concern.) Background: I am presently using PostgreSQL with PostGIS and WGS 84 coordinates (SRID=4326). This works fairly well. I am creating a closed POLYGON from the right ascension and declination of the four corners of the image. I have a lot of images (10k or more), covering a large area of the sky. Each images is about 1 degree square. From the set of these images, I am making mosaics from small subsets of 15 to 30 images. Each mosaic is about 1.5 degree square. Presently, I am storing the geography of the mosaics as a MULTIPOLYGON that consists of all the POLYGONS corresponding to each image that went into the mosaic. [A better solution would be to create a single POLYGON that describes the _perimeter_ of the union of all the individual polygons. I don't know if this can be done in spherical coordinates (i.e., that the geography type). This would also be an interesting answer for me too.] The date line and celestial poles may be included in an image in the dataset so I have been avoiding projecting to planar coordinates to the extent possible. My specific question is: What coordinate system ought I use for _celestial coordinates_ with PostGIS functions? I have looked at http://spatialreference.org/ but have not found anything so far. Google has turned up little. I am stumped. Basically, I want to ensure that if a function returns meters as a distance, it is meters along a great circle on a sphere. More generally, some advice for using celestial coordinates in a spatial database would also be appreciated. Have I erred by choosing PostGIS? Are there far superior commercial choices? FOSS choices? EDIT: I am using PostGIS 1.5.2. I have not yet tried PostGIS 2.0. I am curious if the ST_CoveredBy function works with a POLYGON and a MULTIPOLYGON of type geography. If anybody is running 2.0, could you tell me if you get the same error as this:               mydb=# select ST_CoveredBy(ST_GeographyFromText('MULTIPOLYGON(( (10.37795 -69.57926,8.9498 -69.54875,9.0178 -69.21643,10.4242 -69.24648,10.37795 -69.57926),(10.42436 -69.24618,9.01774 -69.2162,     9.08363 -68.88389,10.46914 -68.91344,10.42436 -69.24618)))'),ST_GeographyFromText('POLYGON((10.46915 -68.91315,9.08371 -68.88364,9.14755 -68.5513,10.5125 -68.58038,10.46915 -68.91315))'));     ERROR:  geography_covers: only POLYGON and POINT types are currently supported     CONTEXT:  SQL function "st_coveredby" statement 1      EDIT 2: I have tried PostGIS 2.0. This function still only works on points and polygons, not more general shapes. :-(


title: Does a Scanned Map have to be georeferenced in the projection of the original Source?

text: I have a historic paper map for the Indian Sub-continent which has been scanned. The Map is in Albers Equal Area Conical projection, and has the latitude and longitude grid on it. I was trying to georeference in the projection of the source, but I do not have all the required parameters for this projection. Only the two standard parallels are noted on the map. I don't know the Central Meridian or the Latitude of origin, or the datum for that matter. What should be done in this kind of situation? Since this is a map which spans 4000km by 4000km, I don't really think it is possible to get any kind of high accuracy output. I was thinking of georeferencing it in wgs84 Geographic coordinate system. Is this a good idea? Or is there something else which you would suggest?


title: What is relation- difference and/or similarities between PPP, SBAS, GNSS, RKT?

text: Recently i came across lot of terms such as IGS, GNSS, GPS,PPP, WAAS, EGNOS, GLONASS, CORS and many more ... I know some of them I can group them such as GPS, GLONASS, GALILEO . And then there is SBAS ...but can any one explain and provide useful links ? What is hierarchy can some draw it ?


title: Import GRD and count days with temperature below zero, using python

text: Minimum temperature of a year is given in GRD file. I have to read that file and then calculate the frost day (less than zero degrees celcius) from it in python.


title: Mapping latlng values to a point on a HRAP grid

text: I have a copy of some NWS rainfall data loaded into a PostGIS database. Given a lat lng point, I want to find the rainfall for that given day. > The original data are in XMRG format and projected in the Hydrologic > Rainfall Analysis Project (HRAP) grid coordinate system, a polar > stereographic projection true at 60°N / 105°W. Based on a description of the HRAP system I found from the NWS, the calculations for locating a point on the HRAP grid based on lat lng value are as follows: > RE = (EARTHR*(1+SIN(60)))/xmesh   >  R = (RE*COS(xlat))/(1+SIN(xlat))   >  WLONG = xlon+75   >  X = R*SIN(WLONG)+401   >  Y = R*COS(WLONG)+1601 > > EARTHR is the radius of the earth (6371.2 KM)   >  xmesh is the mesh length at 60° latitude (4.7625 KM)   >  xlat is the latitude of point to be converted (decimal degrees)   >  xlon is the longitude of point to be converted (decimal degrees) I wrote up a quick javascript implementation to test it:               var deg2rad = function (deg) { return deg * (Math.PI / 180); };          var hrap = function (xlon, xlat) {         var rxlon, rxlat, re, r, wlong, rwlong, x, y;         var earthr = 6371.2;         var xmesh = 4.7625;              rxlat = deg2rad(xlat);              with (Math) {             re = (earthr * (1 + sin(PI / 3))) / xmesh;             r = (re * cos(rxlat)) / (1 + sin(rxlat));                  wlong = xlon + 75;             rwlong = deg2rad(wlong);             x = round(r * sin(rwlong) + 401);             y = round(r * cos(rwlong) + 1601);         }              return [x, y];     };      I ran a couple data points from the 2013-05-17 data set through to test it, with the following results:               Lng        Lat      NWS X  NWS Y  Calc X  Calc Y      -76.5633  39.7478    958    571     369    2771     -124.6132  42.7528     34    572    -431    2308      Those numbers are nowhere close to correct, and I don't know why. Is the document wrong? Did I mess up the implementation? Is the test data bad? Am I missing a simpler solution? I'd appreciate it if someone could point out where this is going wrong.


title: How to use a .qpt made in another project?

text: I'm trying to make maps in print composer of several different projects. I would like the maps to look the same, just for different areas, so I tried to use the .qpt that I made in the first project in the second one, but GIS data doesn't display? I just get the legend, frame and scalebar from the first map to show? I read the manual, but the problem is that I still don't understand how to update the map with the information showing in the second project's map canvas? What am I missing?


title: How can I send a parameter with a RouteTask and get it back in RouteResult

text: I'd like to send a parameter with the Route Task and be able to get that same parameter in the RouteResult object. The goal is to be able to recognize the routes I receive from the server when I perform many solve operations on the same RouteTask.


title: Overlapping polygon outlines dashed at overlapping locations but solid elsewhere

text: In ArcMap 10.0, if one smaller polygon fits inside of another and shares a portion of the larger polygon's boundary, and they both are set to display thick outlines on the inside, is there a way to make them dashed where they overlap so that you can see where the outlines coincide? And then just have the outlines solid everywhere else?


title: ESRI Basemaps - World Imagery: Is it possible to bring certain imagery into foreground (change the viewing order)?

text: I have a basemap loaded in a map in which there are 4 overlapping images. I would like to either turn off 3 of the 4 images or bring the one i want (marked with X n the screen capture) into the foreground. Is this possible? Is there a workaround? I tried un-checking lower resolution layers in the TOC but a messages pops up saying that thisis not possible. ![enter image description here](http://i.stack.imgur.com/aZ0tZ.jpg)


title: gdalcontour output not aligned with the DEM

text: I use gdalcontour to generate the contour lines of a DEM in shapefile format. However the shapefile is not aligned with the DEM. Someone have a solution for this? GDAL version is 1.10 im using thins command:               gdal_contour -a height 012_merged.tif 012_contour.shp -i 25.0      ![enter image description here](http://i.stack.imgur.com/Y5TL4.png) gdalinfo:               Driver: GTiff/GeoTIFF     Files: 012_merged.tif            012_merged.tif.aux.xml     Size is 9601, 4801     Coordinate System is:     PROJCS["WGS 84 / Pseudo-Mercator",         GEOGCS["WGS 84",             DATUM["WGS_1984",                 SPHEROID["WGS 84",6378137,0,                     AUTHORITY["EPSG","7030"]],                 AUTHORITY["EPSG","6326"]],             PRIMEM["Greenwich",0],             UNIT["degree",0.0174532925199433],             AUTHORITY["EPSG","4326"]],         PROJECTION["Mercator_1SP"],         PARAMETER["central_meridian",0],         PARAMETER["scale_factor",1],         PARAMETER["false_easting",0],         PARAMETER["false_northing",0],         UNIT["metre",1,             AUTHORITY["EPSG","9001"]],         EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +     x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs"],         AUTHORITY["EPSG","3857"]]     Origin = (-7124459.006549800700000,6446293.880868392100000)     Pixel Size = (23.191010033770905,-35.712191611463290)     Metadata:       AREA_OR_POINT=Area     Image Structure Metadata:       INTERLEAVE=BAND     Corner Coordinates:     Upper Left  (-7124459.007, 6446293.881) ( 64d 0' 0.37"W, 50d 0' 0.37"N)     Lower Left  (-7124459.007, 6274839.649) ( 64d 0' 0.37"W, 48d59'59.54"N)     Upper Right (-6901802.119, 6446293.881) ( 61d59'59.80"W, 50d 0' 0.37"N)     Lower Right (-6901802.119, 6274839.649) ( 61d59'59.80"W, 48d59'59.54"N)     Center      (-7013130.563, 6360566.765) ( 63d 0' 0.09"W, 49d30' 9.16"N)     Band 1 Block=9601x110 Type=Int32, ColorInterp=Gray       Description = Mosaicked Band       Min=1.000 Max=305.000       Minimum=1.000, Maximum=305.000, Mean=66.113, StdDev=78.056       NoData Value=-32767       Metadata:         STATISTICS_MAXIMUM=305         STATISTICS_MEAN=66.11288340405         STATISTICS_MINIMUM=1         STATISTICS_STDDEV=78.056016483986


title: Can't load pgrouting extension, could not load library librouting_dd.ddl error 998 windows

text: I have a windows 7 machine 64-bit, I installed Postgresql 9.3 via the opengeo suite 4.0.2 in the program files (x86) folder, so I guess I have to install the 32-bit version of the extension. I am trying to load the 2.0.0 version of pg routing and I always get the mentioned error message. Anyone has suggestions in order to get work?


title: Autoincrementing Python Script is over writing all fields versus just fields that are null

text: Using ArcMap and the Field Calculator I have a python script that should autoincrement the FacilityID field if it is null. It works the first time through but the second run causes it to overwrite all of the fields versus just retreiving the last value that was used and only inserting the id to only the null fields. Can this be done in the field calculator? Here is my Python Script:               import arcpy     nullvalues = ["", " ", None, 0]     fac_id_values = []     def autoIncrement():      # Loop through and get Max value      fc= "C://GIS//Nambe_Data//nambedatabase//Nambe_ExistingInfrastructureSurvey_v1x0.gdb//CommunicationInfrastructure//cTelcomLine"      with arcpy.da.SearchCursor(fc, ['FacilityID']) as cur:          fac_id_values = [int(row[0][-4:]) for row in cur if row[0] not in nullvalues]           try:          max_value = max(fac_id_values)      except:          # Make an allowance for fac_id_values to be empty          max_value = 0      # Loop through and Calculate new values      with arcpy.da.UpdateCursor(fc, ['FacilityID']) as ucur:          for row in ucur:           if row[0] in nullvalues:               max_value += 1               row[0] = "COMLI1" + str(format(max_value,'04d'))               print row               ucur.updateRow(row)      ![enter image description here](http://i.stack.imgur.com/mhuPb.png) If you look at the first entry for FacilityID it should be COMML11001 but its COMML110346. The script should not overwrite the FacilityID's that aren't null. EDIT:               import arcpy     #nullvalues = ["", " ", None, 0] #not sure about none in a list lookup     #The where clause to subset just the records to be calculated     WhereClause = "FacilityID IS NULL or FaclityID in (\"\",\" \",\"0\")"     NotWhereClause = "FacilityID IS NOT NULL or FaclityID not in (\"\",\" \",\"0\")"     fac_id_values = []     def autoIncrement():      # Loop through and get Max value      fc= "C://GIS//Nambe_Data//nambedatabase//Nambe_ExistingInfrastructureSurvey_v1x0.gdb//CommunicationInfrastructure//cTelcomLine"      with arcpy.da.SearchCursor(fc, ['FacilityID'],NotWhereClause) as cur:          fac_id_values = [int(row[0][-4:]) for row in cur if row[0] not in nullvalues]          #What's happening here? I can't tell.. is something missing??      try:              max_value = max(fac_id_values)      except:          # Make an allowance for fac_id_values to be empty          max_value = 0      # Loop through and Calculate new values      # Use the where clause to just get the rows you want      with arcpy.da.UpdateCursor(fc, ['FacilityID'], WhereClause) as ucur:          for row in ucur:           #if row[0] in nullvalues or row[0] == None: #That's how I'd do it, but it can be skipped               max_value += 1               row[0] = "COMLI1" + str(format(max_value,'04d'))               print row               ucur.updateRow(row)      Ok I ran the script again today and this is the error I got.               Messages     Executing: CalculateField "Communication\Telecommunications Line" FacilityID autoIncrement() PYTHON_9.3 "import arcpy\n#nullvalues = ["", " ", None, 0] #not sure about none in a list lookup\n#The where clause to subset just the records to be calculated\nWhereClause = "FacilityID IS NULL or FaclityID in (\"\",\" \",\"0\")"\nNotWhereClause = "FacilityID IS NOT NULL or FaclityID not in (\"\",\" \",\"0\")"\nfac_id_values = []\ndef autoIncrement():\n # Loop through and get Max value\n fc= "C://GIS//Nambe_Data//nambedatabase//Nambe_ExistingInfrastructureSurvey_v1x0.gdb//CommunicationInfrastructure//cTelcomLine"\n with arcpy.da.SearchCursor(fc, ['FacilityID'],NotWhereClause) as cur:\n     fac_id_values = [int(row[0][-4:]) for row in cur if row[0] not in nullvalues]\n     #What's happening here? I can't tell.. is something missing??\n try:\n     max_value = max(fac_id_values)\n except:\n     # Make an allowance for fac_id_values to be empty\n     max_value = 0\n # Loop through and Calculate new values\n # Use the where clause to just get the rows you want\n with arcpy.da.UpdateCursor(fc, ['FacilityID'], WhereClause) as ucur:\n     for row in ucur:\n      #if row[0] in nullvalues or row[0] == None: #That's how I'd do it, but it can be skipped\n          max_value += 1\n          print row[0] + " to COMLI1" + str(format(max_value,'04d')\n          "     Start Time: Tue May 20 09:44:24 2014     Failed to execute. Parameters are not valid.     ERROR 000989: Python syntax error: Parsing error SyntaxError: invalid syntax (line 25)     Failed to execute (CalculateField).     Failed at Tue May 20 09:44:24 2014 (Elapsed Time: 0.00 seconds)


title: How to perform a "mostly within" selection?

text: I'm looking for a way to determine if a polyline is "mostly within" a polygon. Since mostly within is arbitrary, I would need be able to enter a percentage at its execution. I thought there might have been an option in ArcMap using Select By Location, but there doesn't seem to be. There are similar methods, such as "completely within" but I don't see how I can use any of them to achieve what I'm looking for. I'm open to suggestions that use either built in ArcMap functionality or ArcPy. Does this functionality or a method exist to achieve this?


title: QGIS 2.2. raster color ramp

text: I have just upgraded from QGIS 1.8 to QGIS 2.2 and I am missing very much 1-band raster color ramp plugin that I had easily colorized my DEMs by using pre made color brewer such as DEM screen or DEM print or DEM poster. I have not found the solution yet in QGIS 2.2.. Is there something like 1-band raster color ramp for QGIS 2.2 or any other solution? Thanks Cengiz


title: How to get all selected features from a specific feature class in C#

text: I am looking for a way to get all selected features from a map which belongs to a specific feature class (shape file, geo database,…). To be more specific and to give you a real case for my question: I want check if the feature class of selected feature has a special field. If this is the case I want to get the value of this field from the selected feature and add this value into a combobox. This process should be repeated for all selected features. I tried the following but it crashed with an object reference error.               List<string> list = new List<string>();     IMap Pmap = doc.FocusMap;     IEnumFeature pEnumFeat = (IEnumFeature)Pmap.FeatureSelection;     pEnumFeat.Reset();     IFields fields;     try     {       IFeature pfeat = pEnumFeat.Next();       while (pfeat != null)       {         fields = pfeat.Fields;         int x = fields.FindField("ID_K");         if (!x.Equals(-1))         {           list.Add(pfeat.get_Value(x).ToString());         }         pfeat = pEnumFeat.Next();         }     }     catch (Exception e)     {       Console.WriteLine(e.Message);     }      Thanks a lot! **UPDATE:** I've found a solution. Here is the working code:               List<string> list = new List<string>();     IMap Pmap = doc.FocusMap;     IEnumFeature pEnumFeat = (IEnumFeature)Pmap.FeatureSelection;     IFields fields;     pEnumFeat.Reset();     IEnumFeatureSetup enumFeatSetup = (IEnumFeatureSetup)pEnumFeat;     enumFeatSetup.AllFields = true;     try     {        IFeature pfeat = pEnumFeat.Next();             while (pfeat != null)        {           fields = pfeat.Fields;           int x = fields.FindField("ID_K");           list.Add(pfeat.get_Value(x).ToString());                pfeat = pEnumFeat.Next();         }      }      catch (Exception e)      {         Console.WriteLine(e.Message);      }      These two line are especially important.               IEnumFeatureSetup enumFeatSetup = (IEnumFeatureSetup)pEnumFeat;     enumFeatSetup.AllFields = true;      If you dont use them you've only the shape file included (default) and not the other fields and values. Thank you all for your responses!


title: Not able to save edits to vector layer in QGIS

text: I have a vector layer with about 200 features. So far I have been able to add polygons to this layer just fine, now it is giving me trouble. When I draw the polygon and try to save edits, the polygon disappears. In a few cases the polygon is saved successfully though it is rare. Then occassionaly the polygon disappears but the attributes that are assigned do appear in the attribute table. Any suggestions how to get through this?


title: Limit Zooming Geometry Features in OpenLayers

text: I draw flag feature on my map as follows:               myVectorLayer = new OpenLayers.Layer.Vector("Flag Geometry", {     renderers: renderer,     isBaseLayer: true,     projection: new OpenLayers.Projection("EPSG:900913"),     styleMap: new OpenLayers.StyleMap({         "default": new OpenLayers.Style(OpenLayers.Util.applyDefaults({             fillColor: "red",             strokeColor: "gray",             label: "${label}",             fontColor: "${favColor}",             fontSize: "12px",             fontFamily: "Courier New, monospace",             fontWeight: "bold",             labelYOffset: 2 //for flag         }, OpenLayers.Feature.Vector.style["default"])),             "select": new OpenLayers.Style(OpenLayers.Util.applyDefaults({         }, OpenLayers.Feature.Vector.style["select"]))     })     });          var pointList = [];     var xs = [0, 0, 240, 240, 8, 8, 0];     var ys = [0, 280, 280, 120, 120, 0, 0];          for(var p=0; p<6; ++p) {         var newPoint = new OpenLayers.Geometry.Point(camera.get('latitude') + xs[p],             camera.get('longitude') + ys[p]);              pointList.push(newPoint);     }     pointList.push(pointList[0]);     var linearRing = new OpenLayers.Geometry.LinearRing(pointList);     var flagVector = new OpenLayers.Feature.Vector(             new OpenLayers.Geometry.Polygon([linearRing]));          flagVector.attributes= {         label: 'label',         favColor: 'blue', //favorite color         align: "cm"     };     myVectorLayer.addFeatures([flagVector]);      This zooms by default when zooming the map but when zooming out the feature becomes so small that it disappears. Is there a way to limit this zooming effect for the feature so that it stops zooming out the feature after a certain level?


title: Arcpy does not execute "CopyFeatures_Management" to write a featureclass to an ArcSDE database

text: I have some problems with my Python script. The script gets an JSON with different information about images. The information includes general information about images and also the gps position of them. Wih this information a featureclass should be generated that shows the location of the pictures as point geometry. The other information should be stored in the attribute table. The script runs very well and is already deployed on ArcGIS Server 10.1. Now the problem is, that at the first start the featureclass has to be created. As the featureclass consists of about 92 attribute fields the process of creating the featureclass is done with the option "in memory" as this option guarentees a fast creation of the featureclass - it is at least faster then directly running `arcpy.addfield_management()` on a feature class that was created the other way. The disadvantage is that I want to store the featureclass permanently in a ArcSDE geodatabase. For this I have to run one of the tools `arcpy.featureclasstofeatureclass_conversion` or `arcpy.copyfeatures_management`. If the script is trying to run on of these lines I get the error message 000210 that is telling me that the output cannot be generated. The connection to the ArcSDE works fine, this cannot be the problem. I have full write and read access. Does anybody know what the error message is about and what could be one solution? The script works fine if I am not using the "in memory" option for the feature class. So this error must have his origin in the "in memory" option. The log file of the Database gives only an general error message: "Oracle : ORA-3137[3149]".


title: Coordinate extraction in a different projection in MapInfo

text: I have a .TAB file of polyline objects in British Grid Coordinate. I need to extract the end points/nodes of each polyline and find their latitude/longitude (WGS84). Would really appreciate some help. Thanks


title: Drawn figure looks stretched

text: I have written some code which offset a certain latitude and longitude with a distance in centimeters. What I am trying to do is based on a coordinate and a vector create two new points along the line described by the vector. I believe I have succeeded in doing this but the results I am getting are a bit odd. I am not very experienced with map coordinates and projections so I am posting here to see if my results 'look' right. The following link shows an image I have of two lines: ![https://dl.dropboxusercontent.com/u/4467680/LineCheck.png](http://i.stack.imgur.com/qo9Wv.png) One extends mostly along the longitude and the other mostly along the latitude. Both lines should have a length of 1 meter. However the red line is noticeably longer than the green line. The lines are located around longitude 6.080695759673799 and latitude 52.501029191616425 (The Netherlands). I know with the projection I am using (Web Mercator I believe) landmasses become stretched along the poles. Is this what I am seeing with the red line? Is the red line stretched because we are closer to the poles than we are at the equator? I use a combination of two functions to offset the latitude and longitude. I found the code in this forum post: https://sharpmap.codeplex.com/discussions/395118 I've then rewritten the code to Javascript like this:               function toMercator(latLong)     {         var x = latLong.y * 20037508.34 / 180;         var y = Math.log(Math.tan((90 + latLong.x) * Math.PI / 360)) / (Math.PI / 180);         y = y * 20037508.34 / 180;              return {x: x, y: y};     };          function toLatLong(mercator)      {         var lon = (mercator.x / 20037508.34) * 180;         var lat = (mercator.y / 20037508.34) * 180;              lat = 180/Math.PI * (2 * Math.atan(Math.exp(lat * Math.PI / 180)) - Math.PI / 2);              return {             x: lat,             y: lon         };     };      To offset the point I do this:               var lat = 2;     var long = 5;          var xOffsetCM = 50;     var yOffsetCM = 50;          var mercator = toMercator({x: lat, y: long});     // Add offset     mercator.x += normalizedVector.x * (50 / 100); // divide offset by 100 to get meters     mercator.y += normalizedVector.y * (50 / 100);          var latLong = toLatLong(mercator);      After the last function call latLong should contain the new coordinate.