How to get Native Bounding Box minx,miny,maxx,maxy using openlayers?

I am trying to develop GIS application using GEO SERVER and OPEN LAYERS i want to get bounds from geo server Native Bounding Box data of a layer instead of manually hard code               var map;     var key = 0;     var fromNo = "";     var toNo = "";     var colorId = "";     var count = 0;     function init(){          format = 'image/png';        if(map)     map.destroy();     var bounds = new OpenLayers.Bounds(         8568700.4305088, 1677704.30921461,                         9195694.68892519, 2070938.3484273     );          var options = {         controls: [],         maxExtent: bounds,         maxResolution: "auto",         projection: "EPSG:900913",         units: 'degrees',         minZoomLevel: 0, numZoomLevels:15,maxZoomLevel:15        };     var  click_ap ;     var values = new Array();     map = new OpenLayers.Map('map', options);              $('.selectionTable tr').each(function() {                  fromNo  =  $(this).closest("tr").find(".fromNo").val();             toNo    = $(this).closest("tr").find(".toNo").val();             colorId = $(this).closest("tr").find(".colorSelect option:selected").val();             apZoomLevel1 = new OpenLayers.Layer.WMS(                        "ap",                         "http://localhost:8090/geoserver/scmapWithSelectColor/wms??request=getCapabilities ",                         {'layers': 'scMapQuery',                          viewparams: 'fromNo:'+fromNo+';toNo:'+toNo+';colorId:'+colorId+';',                         'transparent': true,isbaselayer:false},{                            singleTile: true,opacity: .5                         }                   );                   values.push(apZoomLevel1);          });          click_ap = new OpenLayers.Control.WMSGetFeatureInfo({      url:'http://localhost:8090/geoserver/scmapWithSelectColor/wms',       title: 'Identify features by clicking',      layers: [apZoomLevel1],      queryVisible: true,      eventListeners: {      getfeatureinfo: function(event) {          if (ContentFilterAp(event.text,'hos').length>0){     //alert("localitieslevel3");         map.addPopup(new OpenLayers.Popup.FramedCloud(             "apZoomLevel1",              map.getLonLatFromPixel(event.xy),             null,             ContentFilterAp(event.text,'hos'),             null,             true                 ));}             }             }         });                    gmap = new OpenLayers.Layer.Google     (         "Google Streets"       );          ghyb = new OpenLayers.Layer.Google     (        "Google Hybrid",        {type: google.maps.MapTypeId.HYBRID}     );         map.addControl(new OpenLayers.Control.Navigation());              map.addControl(new OpenLayers.Control.LayerSwitcher({'div':OpenLayers.Util.getElement('layerswitcher')}));         map.addLayers([gmap,ghyb]);         var length = values.length;         if(length > 0)         {             for(i=0;i<length;i++)             {                 //debugger;                      map.addLayers([values[i]]);             }         }                   map.addControl(new OpenLayers.Control.PanZoomBar({              }));         map.addControl(new OpenLayers.Control.Navigation());         map.addControl(new OpenLayers.Control.Scale($('scale')));         map.addControl(new OpenLayers.Control.MousePosition({element: $('location')}));              map.zoomToExtent(bounds);              map.addControl(click_ap);         click_ap.activate();         map.events.register('zoomend', this, function (event) {          }); }      actually above bounds are hard coded but actually apzoomlevel1 have native bounds how to get those one ? actually those bounds usefull in `map.zoomToExtent(bounds);` based on that map zoom will change


how to cast integer to float in an ogrinfo sql statement?

I have a shapefile for which I would like to add the values in a column. As the sum exceed the capacity of an integer, I need to cast values to a float. I tried the following:               ogrinfo -sql "SELECT sum(cast(POP as float(10,0))) FROM Settlement_points" Settlement_points.shp      ogrinfo returns error messages like:               ERROR 1: Invalid index : -1     More than 1000 errors or warnings have been reported. No more will be reported from now.     OGRFeature(Settlement_points):0       SUM_FIELD_1 (Real) = 0      1./ How can I correct my sql statement? 2./ What is actually processing the sql statment in ogrinfo; are there some limits?


How to interpret the OSGeo4w software version under Advanced Install option?

When choosing to install QGIS Desktop using the OSGeo4w advanced install option, I noticed that there are what looks like ambiguous software versions to choose. For example, currently QGIS Desktop is: 1.8.0-4 or if you click on the version, it changes to 1.8.0-3 and under the libraries to choose: OGR FileGDB Driver (Is this the ESRI API) 1.9.2-1 or if you click on the version, it changes to 1.9.0-1 What does the number after the hyphen refer to? It seems like it could install any number of versions, but likely it has a specific meaning. Thanks! (I'm going to install QGIS Desktop with FGDB support, and I think GDAL 1.9.0 is the one that's been proven to work with QGIS)


Free GIS workshops, tutorials, and applied learning material

_**Note 1:** Please enter answers separately **or** feel free to edit this post directly_ _**Note 2:** Please report on any broken links so they can be removed_ This thread lists free as in $0 workshops in GIS and related fields that have their material available to view or download online. The list is not limited to FOSS GIS, as GISers usually use a combination of open and closed source tools to accomplish their tasks. Some of these tools are easier than others and some are better documented. This list will be a great benefit to the community especially for new comers to the field. # General GIS   * GIS Tutor: Beginner / Intermediate Level GIS thanks to radek   * BostonGIS thanks to simo   * ELoGEO Repository thanks to radek   * Lectures on GIS for the Social Sciences thanks to ubernatural # Open-source GIS   * OpenGEO Education Center thanks to radek   * QGIS Videos (faunitalia) thanks to simo   * GIS SE Question: Geoserver Tutorials thanks to com   * GIS SE Question: Open Source Training Materials thanks to Mark Ireland   * QGIS for Newbies thanks to Ian Allan # ESRI Products   * ArcGIS Geoprocessing thanks to radek   * GIS SE Question: Best place for (structured) ArcGIS tutorials thanks to robintw   * ArcGIS Automation and Programming thanks to Bethany # Transportation These links include either theoretical or applied transportation knowledge in transportation planning   * GIS primer for Transportation   * Three years worth of webinars and workshops on Transportation Modeling   * Transit Capacity and Quality of Service Manual   * UrbanSim: FOSS Urban development, socio economic, and land use planning package   * MOVES(Motor Vehicle Emission Simulator) Workshop and technical background   * Transit GIS tutorials   * Remote sensing in transportation workshop   * Florida's CBT planning model explained # Disaster Management   * Geo-information Technology for Crisis Management  # Databases   * Spatial Database Course Material thanks to radek # Geo Statistics   * Learn R Lectures and Classes   * Geodatabase Mining Course thanks to radek   * A Practical Guide to Geostatistical Mapping


MySQL to GeoJSON - Formatting Issue

I'm trying to make a select on a mysql table and then write it out to a geojson file. I'm getting close but there are a few issues. Here's what I have so far:               <?php     require("dbinfo.php");          // Opens a connection to a mySQL server     $connection=mysql_connect ($hostname, $username, $password);     if (!$connection) {       die('Not connected : ' . mysql_error());     }          // Set the active mySQL database     $db_selected = mysql_select_db($database, $connection);     if (!$db_selected) {       die ('Can\'t use db : ' . mysql_error());     }          // json output     $query = 'SELECT * FROM markers LIMIT 5';     $dbquery = mysql_query($query);     // $rows = array();     // while($r = mysql_fetch_assoc($dbquery)) {     //  $coords = $rows['lng'] . ", ";     //     // $rows[] = $r;     // }          if(! $dbquery )     {       die('Could not get data: ' . mysql_error());     }          // Parse the dbquery into geojson      // ================================================     // ================================================     // Return markers as GeoJSON     $geojson = array(         'type'      => 'FeatureCollection',         'features'  => $feature      );          while($row = mysql_fetch_assoc($dbquery)) {         $feature = array(             'type' => 'Feature',            'geometry' => array(             'type' => 'Point',             'coordinates' => array($row['lng'], $row['lat'])                 ),           'properties' => array(                 'name' => $row['name'],             'comment' => $row['comment']                 )             );         array_push($geojson, $feature);     };     mysql_close($connection);          // // Return routing result         header("Content-Type:application/json",true);         //header("Location:map.html");         echo json_encode($geojson);     ?>      The result I get is:               {"type":"FeatureCollection","features":null,"0":{"type":"Feature","geometry":{"type":"Point","coordinates":["-122.677811","45.569889"]},"properties":{"name":"Bear on a Box","comment":"Bear on a box."}},"1":{"type":"Feature","geometry":{"type":"Point","coordinates":["-122.653770","45.542503"]},"properties":{"name":"test","comment":"aksdhvah"}},"2":{"type":"Feature","geometry":{"type":"Point","coordinates":["-122.675400","45.515690"]},"properties":{"name":"Bike Art","comment":"Bike pile."}},"3":{"type":"Feature","geometry":{"type":"Point","coordinates":["-122.688789","45.517735"]},"properties":{"name":"Goose","comment":"lipsumLorem ipsum dolor sit amet, consectetur adipiscing elit. Nam ut urna dolor. Sed iaculis velit quis nis"}},"4":{"type":"Feature","geometry":{"type":"Point","coordinates":["-122.649132","45.513401"]},"properties":{"name":"Goose","comment":"lorem ipsum"}}}      So, the issue is that the "features" item does not hold the rest of the info as an array. It remains 'null'. Then, it appears the array position is written into the result which I don't want either. Lastly, I need to get rid of the quotes around the coordinates so it can be read properly by Leaflet's GeoJSON constructor. I'm flailing with arrays and probably not getting it. I mean, does everything that gets pushed into an array have to be surrounded by quotes? Thanks in advance for any help.


How do you use folders as input/output parameters

What I want to do is to go into a folder, find a layer file, pull it into an MXD, then export a jpeg in an output folder. Everything is great except I don't know how to set the input/output folders.               state =  arcpy.GetParameterAsText(0)     In_Folder = arcpy.GetParameterAsText(1)     Out_Folder = arcpy.GetParameterAsText(2)               lyrfile_o = arcpy.mapping.Layer(In_Folder + str(state) + "_O.lyr")     lyrfile_d = arcpy.mapping.Layer(In_Folder + str(state) + "_D.lyr")     lyrfile_lane = arcpy.mapping.Layer(In_Folder + str(state) + "_Lanes_.lyr")     lyrfile_poly = arcpy.mapping.Layer(In_Folder + str(state) + "_Lanes_Polys1.lyr")      and I get an error like:               <type 'exceptions.ValueError'>: Object: CreateObject Layer invalid data source>      It's written in a text editor then brought into a toolbox and parameters set, both types as folders, the first one (state) is a string. Any ideas?


Large Open Street Map OSM file to Shapefile. Is there any hope for 32-bit FME?

I have a large OSM XML file (around 8 GB) that I was hoping to process in FME. I have a workbench that I previously used to process smaller files (500 MB) into feature type-specific Shapefiles (e.g. waterway_line, waterway_polygon etc.). In this workbench I simply added the OSM reader, left everything as default, and FME helpfully grouped the features into useful categories - sending each to the appropriate Shapefile. Unfortunately my 32-bit OS cannot manage the larger file. Because the entire XML file has to be read at the start of the transformation the memory just builds and builds until the process limit is reached before FME has even read all the incoming features. One of the things FME does by default is build polygons from lines (raw OSM data doesn't recognise polygons), so if I break the area up into smaller files I could end up with polygons that are artificially split (e.g. landuse areas) and end up being labelled twice and having spurious borders through the middle. One option is to load my OSM file into PostGIS, and FME can read data from PostGIS (I'm assuming this will help overcome the memory limit as the database can be read row-by-row) but then FMW won't know to group features into those useful categories and which Shapefiles they should end up in. Essentially, it looks like I simply can't use FME to process a big OSM file to Shapefiles. What I really want to know is:   1. Is there any way I can convince FME to do what I want?   2. Are there other tools that can create similar convenient Shapefile groupings of feature types?   3. **EDIT** How do Cloudmade and GeoFabrik create their huge Shapefiles? Are they using a different tool I don't know about? Any input much appreciated. (note: I don't have access to a 64-bit FME machine, and the pre-processed Shapefiles from Cloudmade / GeoFabrik are insufficient for my requirements)


How to configure QGIS and SAGA on Ubuntu (12.04 and others)?

During the past weeks, I have tried QGIS to recognize SAGA via the processing toolbox, both being installed from the ubuntugis-unstable repository. I have tried this on several virtual ubuntu operating systems which I specifically set up for using QGIS. However, I always get the same "Missing dependency.This algorithm cannot be run" (sic) error message. Here's some more information:   * I have tried (l)ubuntu 12.04, 13.04 and 13.10 (each 64bit), installing packages from the respective repos. I    * I am now an ubuntu 12.04 32bit VM   * I am well aware of this post, and yes, this workaround would do the trick! However, installing from the qgis repositories is not an option for me, as I also need the orfeo toolbox packages, which are not provided there :(   * Package versions are `qgis 2.2.0-1`, `saga 2.1.1` and `python-saga 2.1.1`. I had the same problem with the preceding QGIS version.   * I checked the `PATH` variable and successfully launched `saga_cmd`, so everything seems to be in its place. Any help is appreciated -- including first guesses on what may be the problem :)


Returning gps points in the form of gpx files in pgrouting

I am trying to create a service that returns the shortest path for a given start and end destination. What I did was used shortest path query provided by pgrouting to calculate the vertex and edges that form the shortest path. Then for each of the edges I calculated their corresponding coordinates and send them as points in a gpx file. Now when I plotted the coordinates and joined them by a straight line, it gave me a path but not the curve that I needed. I am wondering what is the best way to send that information, I mean the path information. Currently I am just sending the coordinates. So lets say for a long curve path, do I need to actually send all the intermediate points in the curve to actually plot it like a curve or is there other way. What is the standard procedure? Thanks


Looking for best practices for GIS file systems

> **Possible Duplicate:**   >  Organization and tidiness issues - How do you deal with multiple copies of > layers? I'm trying to organize my GIS data in a file system. I work with DTED (0,1,2), raster images (geotiff, jpeg..), shapefiles, DEM. I have to define a file system with a list of directories and a file name conventions. The solution must be simple and clear. Is there a standard? Has someone any idea? Thanks very much!


Set unique values to different groups programmatically

I have a polyline feature layer. After doing some computation, I update a field of that layer and want to set unique color for different value of that field. We can do this from symbology using unique values. But I want to do it programmatically. I know there should be a very easy way to do this thing with arcObjects. But I couldn't find the way. ![enter image description here](http://i.stack.imgur.com/d3EUg.png) I go through How to define a renderer for your layer document. But I did not find the way to set **"Value Field"** and **"Add All Values"** options here. And of course I have tried to use IUniqueValueRenderer.AddReferenceValue Method. But the document is not giving me all necessary information. **Question :** How to set unique color value for different value of a specific field using c#? It will be vary helpful if anyone can give me some pointer about this. Thanks.


Roadmap to creating a GIS?

Got asked that today in a job interview, I replied with the usual :   * **Gather Data** : what data do we want, do we possess it ? If not how to do we acquire it, etc.   * **Database** : after we have successfully accomplished the first step, we want new data to be implemented in a DB, that'll allow an easier, faster access to data let alone making it questionable and queryable.    * **Design the software** : what traitement do we want, what functional needs do we want to answer, what processes should our GIS use in addressing those issues ? (Business Layer design)   * **Development** : code it.  I have dropped the modeling of the spatial phenomena, which is not always necessary. What other steps have I missed ? What are some details I should know ? I am a fresh engineer, having zero experience yet, so I am hoping for experienced people to make me gain some time and point me to some good reads. As you can notice, most of what I cited is coming from an almost purely software development perspective, I feel like I am missing the GIS part in it. Regards.


Is there a CASE Tool for modelling spatial databases?

Does anyone knows if there is a CASE Tool that would be possible for modelling spatial tables? I need to create a model and export it to SQL or a database directly. I´m using PostGIS. Thanks in advance.


IStepProgressor in While Statement

I have implemented DBScan in vb.net (forced to...). I am using a progress bar to track other parts of this tool. These all are implemented in `For` loops. Therefore, incrementing the tracker is not problem. Set the step to 1 and check for cancel at the conclusion of each loop. One key item in DBScan is that it pops _n_ elements off the stack as it generates a cluster. This means that it is not a one iteration to one element mapping. I tried reassigning the step value with each iteration, but this results in the progress bar recomputing and redrawing occasionally. What techniques have others used to implement an progress bar outside of a `for` loop? I am not worried about total accuracy, but would like a relatively close approximation that can scale across a range of input data sizes and total cluster sizes.


How to create points around edge of viewshed results?

Is there a tool or module, or multiple tools, in ArcGIS that will allow you to automate the creation of points around the outer edges of a viewshed? What I am trying to do is gather data about the elevations on the farthest parts of a viewshed. If I have points, then I can extract the elevation values to the attribute table and then do rise/run calculations from the original point to possibly create a horizon diagram in something like excel. Is this possible?


How to Export to PDF after zooming to extent of each feature that meets SQL where clause?

I realize that I've asked two similar questions recently, but following suggestions in the comment chain, I'll make this a separate question (separate as it is not the no output problem in ArcPy: (SearchCursor/export to tiff ) with no output or the produces empty feature problem described Arcpy: SQL error in select_analysis produces empty feature). To be clear, the question is explicitly stated as: **How to print a .pdf layout for each record that meets a where clause**. Based on suggestions from @PolyGeo, I'm trying the approach of using a definitionQuery to get the values and then a combination of a search cursor with a panToExtent to print each record. Here is the code:               import arcpy          mxd = arcpy.mapping.MapDocument("C:\\temp\\Graffiti_DM1.mxd")     df = arcpy.mapping.ListDataFrames(mxd, "*")[0]     outpdf="C:\\temp\\1003_zip4.pdf"     where_clause='"Incident_Z" = ' + "'10033'"     graffitidata="C:\\temp\\itscomplicated.shp"          cursor = arcpy.UpdateCursor(graffitidata)          graffitilyr=arcpy.mapping.ListLayers(mxd, "itscomplicated", df)[0]     graffitilyr.definitionQuery=where_clause     for cur in cursor:         cur.rotation = "0"         cur.scale = "1000"         outFile = expdir + "\\" + cur.name + ".pdf"         cur.panToExtent(graffitilyr.getSelectedExtent())         arcpy.mapping.ExportToPDF(mxd,outpdf)               del cursor      However, I'm running into the following problem.               Traceback (most recent call last):       File "C:\temp\defquery_for_in.py", line 15, in <module>         cur.rotation = "0"       File "C:\Program Files\ArcGIS\Desktop10.1\arcpy\arcpy\arcobjects\_base.py", line 35, in __setattr__         return setattr(self._arc_object, attr, ao)     RuntimeError: ERROR 999999: Error executing function.      If anyone has any suggestions concerning the above error, or suggestions concerning the general setup of the code (specifically the addition of the search cursor within the where clause) I'd be greatly appreciateive. This is the current version of what I'm working with as suggested by @PolyGeo, however it is producing pdfs that have the layout but no data (see comment below).               import arcpy     mxd = arcpy.mapping.MapDocument("C:\\temp\\Graffiti_DM1.mxd")     df = arcpy.mapping.ListDataFrames(mxd, "*")[0]     graffitilyr=arcpy.mapping.ListLayers(mxd, "itscomplicated", df)[0]     where_clause = '"Incident_Z" = ' + "'10003'"     graffitilyr.definitionQuery=where_clause     features = arcpy.SearchCursor(graffitilyr)     count = 1               for feature in features:             df.rotation = "0"             df.extent = graffitilyr.getSelectedExtent(True)             df.scale = "1000"             outpdf="C:\\temp\\" + str(count) + ".pdf"             arcpy.mapping.ExportToPDF(mxd,outpdf)             count = count+1          del features


How much error in a transformation?

I've been working in GIS for about a year and have a functional grasp of Projections and Transformations from within ArcGIS (10.0). Geosoft Oasis is another program we use. In working with our data we primarily use NAD83 Zone 13 and 14 North. Although WGS84, NAD27, and NAD83(CSRS) often join the mix. With each of these different Coordinate Systems, there are many transformation options to go from one to the other. I would really like to have a better understanding of how much of an error is created in each transformation. To do that, could someone tell me the best way to test this out? As an example, we often have data that spans Zones. What happens when we using Zone 13 projection in our arc project in an area that should be Zone 14, but we don't want to break the data up? How much of a penalty is there if I work in WGS84 and then transform the data into a NAD83 projection (or a NAD27 one)? Are the errors cumulative? If I switch back and forth 50 times will my data move? Or if I switch between 3 Projections using 3 Transformations? I'm not sure of a good method for finding an answer to these questions. I would like to be able to work through it myself instead of taking someone's word for it, but that might be a more technical task than I'm able to do... Any help is appreciated, thanks, Thomas


How to get a correct scalebar in QGIS?

I apparently have a problem with getting meaningful scalebar values referred to a shapefile in QGIS. I think I tried all solutions suggested in other discussions, but still I don't get it. I use QGIS 1.8.0 Lisboa. The shapefile was downloaded from a reliable source (DIVA-GIS.org), it is a typical administrative areas polygon. In case anyone wants to try it, here it is: http://gadm.org/data/shp/CHN_adm.zip When it was downloaded it came set with WGS84. I set the Project settings to: on the fly projection enabled, Project CRS WGS84/UTM ZONE 33N. I set the layer CRS to WGS84/UTM ZONE 33N. Then I "zoomed to layer" extent and added the scalebar: it reads 10 meters. Whole China seems to span east to west about 60 meters. I also tried to "save as" the shapefile with WGS84/UTM ZONE 33N, got a new shapefile and the new shapefile behaves just the same. There must be a mistake I am doing, but I can't find what. I would really appreciate any help... Thank you!


How to estimate the area of rooftops of buildings after detection?

![Sample image attached](http://i.stack.imgur.com/uMQpn.jpg)Presently, i need to find out the area.I have made an gui in which i change thresholds and find out the rooftops as white portion. I have identified the rooftops which are the white regions in the image attached below . Is there any way to get the area of the white portions either by clicking on it or any other way ? Also, how do i save this image from the gui ?


When trying to convert an .e00 file into a shapefile with ogr2ogr, getting "ERROR 4: This looks like a compressed E00 file"

When I ran this command:               ogr2ogr topo.shp flowe86hyp.e00      I got this error:               ERROR 4: This looks like a compressed E00 file and cannot be processed directly. You may need      to uncompress it first using the E00compr library or the e00conv program.     FAILURE:     Unable to open datasource `flowe86hyp.e00' with the following drivers.       -> ESRI Shapefile       -> MapInfo File       -> UK .NTF       -> SDTS       -> TIGER       -> S57       -> DGN       -> VRT       -> REC       -> Memory       -> BNA       -> CSV       -> NAS       -> GML       -> GPX       -> LIBKML       -> KML       -> GeoJSON       -> Interlis 1       -> Interlis 2       -> GMT       -> SQLite       -> DODS       -> ODBC       -> PGeo       -> MSSQLSpatial       -> OGDI       -> PostgreSQL       -> PCIDSK       -> XPlane       -> AVCBin       -> AVCE00       -> DXF       -> Geoconcept       -> GeoRSS       -> GPSTrackMaker       -> VFK       -> PGDump       -> OSM       -> GPSBabel       -> SUA       -> OpenAir       -> PDS       -> WFS       -> HTF       -> AeronavFAA       -> Geomedia       -> EDIGEO       -> GFT       -> SVG       -> CouchDB       -> Idrisi       -> ARCGEN       -> SEGUKOOA       -> SEGY       -> XLS       -> ODS       -> XLSX       -> ElasticSearch       -> PDF      I've done some research on `e00compr` & `e00conv` so far, not a lot, but some, and have so far not been able to find a simple download that lets me build/make/install the program(s) on a mac. The `e00compr` I found here (https://github.com/fd00/yacp) on github had some kind of weird makefiles (apparently according to its README) for cygwin but none that I was able to use for the `make` command on my mac. And I found some e00compr source code at one point but it was all microsoft builds. Anyway, I'm looking to use something like Grass, ogr2ogr, or some other command line tool to convert this e00 into shp and apparently am needing to uncompress it somehow. I've gone ahead and hosted a sample of the `.e00` file on google drive here: (https://drive.google.com/file/d/0B5inC0VAuhH1Qm9OUGhGUFNOdk0/edit?usp=sharing) in case any of you would like to inspect it.


Computational time of well-known compression algorithm

I have googled for get information about computational time of some compression algorithms but information seems contradict each other. I need worst case performance of the following algorithm Sliding Window, Open Window, Threshold and STTrace. All algorithms should have quadratic time. Do you confirm?


problem with "Con" conditional expression

I created a python script where I use Con (Spatial Analyst). Till now I passed the where clause value as `value>1000` and it worked fine for me. But recently I found some raster on which `Con` statement does not work and says that the expression is not valid or something like that. Now I put space before and after `>` sign and the expression is now `value > 1000`. The weird thing is the script works fine now. `Con` does not work when con expression is `value>1000`, for raster files that are big in size, but works fine when con expression is `value > 1000`, for my case, it was 50MB. Only putting two spaces solves the problem **Question:** I go through Con (Spatial Analyst) documentation. I do not find anything that can explain why is this happening. Can anybody explain Why is this weird thing happening?


Adding parameters to a category in a script tool

There is plenty of documentation on how to add parameters to a category in a python toolbox, (See the bottom of http://resources.arcgis.com/en/help/main/10.1/index.html#/Defining_parameters_in_a_Python_toolbox/001500000028000000/) But I haven't found a way to do this for a script tool. Can this be done? Thanks


Convert latitude longitude coordinate to x y coordinate?

I'm using a postgis database and java to develop my application. I need to transform my geographic data currently in latitude/longitude format into a x/y format. I found solutions based on UTM coordinates, however points in different zones are a problem. I'm looking for a java library or a algorithm that does exactly this: http://www.whoi.edu/marine/ndsf/cgi- bin/NDSFutility.cgi?form=0&from=LatLon&to=XY Given two lat/lon coordinates, one of them for origin, the output is x and y in meters. Thank you for your time


selectedFeatureCount vs featureCount?

I do               from qgis.core import *     layer = QgsVectorLayer(r"D:\file.shp", "boundingBoxes", "ogr")     layer.featureCount()      outcome is 428               layer.select(layer.pendingAllAttributesList())     layer.selectedFeatureCount()      outcome is 0 Why the results are not equal?


OpenLayers labels overlapped

I have a problem with OpenLayers rendering close labels. When two labels are close, it will render the labels texts unreadable. My goal is that when two labels with text overlap each other, one could see the text clearly on a white background. So, if two labels overlap each other, one should be able to read the text of the one on top correctly. For this I used the following characteristics:               pstyle.label = txt;     pstyle.fontColor = "#000000"        pstyle.fontOpacity = 1;     pstyle.fontFamily="Arial";     pstyle.fontSize = "12 px";  //16px     pstyle.fontWeight = "bold";     pstyle.labelYOffset = -10;          pstyle.graphic = false;          pstyle.backgroundGraphic = "/ddrt_WEB/img/WhiteBackground.png";     pstyle.backgroundYOffset = 1;     pstyle.backgroundHeight = 20;     pstyle.backgroundWidth = 180;     pstyle.backgroundGraphicZIndex = 1      Which properties do I have to use to avoid this problems?


How do you explain what a .lyr file is?

My organization uses .lyr files consistently as a means for our users to view the data and build their mxds. It works great for our purposes, but we have run into an issue where we don't think the users actually understand what a .lyr file does or why its used, and we spend a lot of time dancing around an issue because of miscommunication in definition/terms. How do you explain what a .lyr file is? Assume the user has light/moderate GIS knowledge?


Partially cached maps

Have anyone tried to set up a tilecache for a certain area of a map, leaving the areas outside of the tiles boundingbox to pure wms calls? Background is I have a map where about 10% of it is accessed way more frequently than others and it would be good to have it cached but at the same time I can not cache the map as a whole due to space restrictions. Can I do this in any tilecaching solution or do I have to split the map in two?


Plugging in population data into a map of provinces

Have shapefiles for provinces in several countries in an Asian region, but currently trying to plug in animal population data for each province with graduated symbols displayed the data. Am trying to work off a Microsoft Excel Chart that I have made with the data (basically with one row for provinces and the other row for populations)- however, importing via a delimited text layer isn't working. I'm pretty new to GIS, and am wondering if there as an elementary error I am making - do I need to enter vector data for each province in my excel file before these will display? Is there an easy way to elicit this from the shapefile(s) that I have that display the provinces in the country? Thank you so much for your time - I'm trying to learn this as well as I can!


OpenLayers: Load Markers dynamically from Text file

I am trying to load set of markers dynamically from a text file using OpenLayers.Layer.Text. The problem is that no markers is shown after rendering the page. Below is the JavaScript file that is responsible for drawing the layers and loading the markers.               var mapPanel, tree;     function drawmap() {     var argv = drawmap.arguments;     var source=argv[0];     var target=argv[1];     var size = new OpenLayers.Size(21,25);     var offset = new OpenLayers.Pixel(-(size.w/2), -size.h);     var icon = new OpenLayers.Icon('http://www.openlayers.org/dev/img/marker.png', size,    offset);          mapPanel = new GeoExt.MapPanel({         border: true,         region: "center",         map: new OpenLayers.Map({allOverlays: false}),        center: [44.3869825, 33.3209735],         zoom: 13,         layers: [                       new OpenLayers.Layer.WMS("BaseMap", "http://localhost:8080/geoserver/wms",                     {                         layers: 'Layers:baselayer',                         isBaseLayer: true,                         visibility: true                     },                     {                         buffer: 0,                         visibility: false                     }                 ),     new OpenLayers.Layer.WMS( "Path", "http://localhost:8080/geoserver/wms",                         {                             transparent: 'TRUE',                             layers: 'layers:roadlayer',                              viewparams: 'source:'+source+';target:'+target,                              isBaseLayer: false,                              visibility: true                         }                      )        ]     });           var textlayer= new OpenLayers.Layer.Text( "MarkersText", {   location:"./markers.txt",projection: mapPanel.map.displayProjection});     mapPanel.map.addLayer(textlayer);                                                                  var LayerNodeUI = Ext.extend(GeoExt.tree.LayerNodeUI, new GeoExt.tree.TreeNodeUIEventMixin());           var treeConfig = new OpenLayers.Format.JSON().write([{         nodeType: "gx_baselayercontainer"     }, {         nodeType: "gx_overlaylayercontainer",         expanded: true          }], true);          // create the tree with the configuration from above     tree = new Ext.tree.TreePanel({         border: true,         region: "west",         title: "Layers",         width: 200,         split: true,         collapsible: true,         collapseMode: "mini",         autoScroll: true,         plugins: [             new GeoExt.plugins.TreeNodeRadioButton({                 listeners: {                     "radiochange": function(node) {                         alert(node.text + " is now the active layer.");                     }                 }             })         ],         loader: new Ext.tree.TreeLoader({             // applyLoader has to be set to false to not interfer with loaders             // of nodes further down the tree hierarchy             applyLoader: false,             uiProviders: {                 "layernodeui": LayerNodeUI             }         }),         root: {             nodeType: "async",             // the children property of an Ext.tree.AsyncTreeNode is used to             // provide an initial set of layer nodes. We use the treeConfig             // from above, that we created with OpenLayers.Format.JSON.write.             children: Ext.decode(treeConfig)         },         listeners: {             "radiochange": function(node){                 alert(node.layer.name + " is now the the active layer.");             }         },         rootVisible: false,         lines: false,         bbar: [{             text: "Show/Edit Tree Config",             handler: function() {                 treeConfigWin.show();                 Ext.getCmp("treeconfig").setValue(treeConfig);             }         }]     });          // dialog for editing the tree configuration     var treeConfigWin = new Ext.Window({         layout: "fit",         hideBorders: true,         closeAction: "hide",         width: 300,         height: 400,         title: "Tree Configuration",         items: [{             xtype: "form",             layout: "fit",             items: [{                 id: "treeconfig",                 xtype: "textarea"             }],             buttons: [{                 text: "Save",                 handler: function() {                     var value = Ext.getCmp("treeconfig").getValue()                     try {                         var root = tree.getRootNode();                         root.attributes.children = Ext.decode(value);                         tree.getLoader().load(root);                     } catch(e) {                         alert("Invalid JSON");                         return;                     }                     treeConfig = value;                     treeConfigWin.hide();                 }             }, {                 text: "Cancel",                 handler: function() {                     treeConfigWin.hide();                 }             }]         }]     });          new Ext.Viewport({         layout: "fit",         hideBorders: true,         items: {             layout: "border",             deferredRender: false,             items: [mapPanel, tree, {                 contentEl: "desc",                 region: "east",                 bodyStyle: {"padding": "5px"},                 collapsible: true,                 collapseMode: "mini",                 split: true,                 width: 200,                 title: "Description"             }]         }     });     };      Additionally, the marker text file is :               lat lon title   description icon      33.3253191  44.3850879  title   description     http://www.openlayers.org/dev/img/marker.png          Thank you in advance for your help.


"Session has expired" Problem in Geoserver as WAR in Tomcat

I have Geoserver installed as WAR in Tomcat. My html/openlayers files are served from the www folder of /webapps/geoserver/data and I had "beautiful moments" experiencing WMS from there. The problem is this: Each time, after working nicely and smoothly for only minutes, GeoServer user interface becomes too slow and get blocked. When I want to edit sth I get msg like "The session has expired..." So I need then to force the "org.apache.catalina.bootstrap" to quit as it doesn't respond to "/Library/Tomcat/bin/shutdown.sh" command, then I restart it "/Library/Tomcat/bin/startup.sh". This didn't happen before, but I don't know what I did that caused such thing. Also I don't think it's related to WFS because I've tried this and it worked fine:![enter image description here](http://i.stack.imgur.com/PUtML.png)


Create a square grid polygon shapefile with python

i have the following coordinates minx,maxx,miny,maxy = 448262.080078, 450360.750122, 6262492.020081, 6262938.950073 i wish to create a square grid of size 1 m using python.               import math               minx,maxx,miny,maxy = 448262.080078, 450360.750122, 6262492.020081, 6262938.950073     size = 1          def set_bbox(minx, maxx, miny, maxy, distx, disty):         nx = int(math.ceil(abs(maxx - minx)/distx))         ny = int(math.ceil(abs(maxy - miny)/disty))         new_maxx = minx + (nx*distx)         new_miny = maxy - (ny*disty)         return ((minx, new_maxx, new_miny, maxy),ny,nx)          # shift the bottom (right - down)     coord, ny, nx = set_bbox(minx,maxx,miny,maxy,size,size)     # left-up origin     origin = coord[0],coord[3]     # number of tiles     ncell = ny*nx


Creating new layers using ArcPy to define Definition Query for each field value?

I am trying to set multiple definition queries for one layer based on one field using python. ie. I have a City layer with a field that holds the city name. I want a copy of the layer in an MXD with the Definition query set for each value in the City field. So essentially, I have one source layer, with a copy of the layer as many times as there are values in the City field. The query would look like this: CITY = 'Atlanta' Any help is appreciated.


Split lines at intersections in PostGIS (must be simple but...)

I'm usually closer to my answer than now, but I've looked at all the answers here and couldn't adapt one to work on my data and I'm stuck. I have oriented polylines (Montreal's train network) and stops (train stations). My network looks like this: ![Train Network](http://i.stack.imgur.com/v7h4I.png) (closer look): ![Train stations](http://i.stack.imgur.com/d6lbh.png) I'd like to split my tracks at each stations and ideally add fields FromStation, ToStation to my new Train tracks table. I've used ST_Snap to snap my points to my tracks so there's an intersection. There's no guaranty though that there's a node where it intersects. I tried some variation using ST_Split. No error, but no results either. Just empty geometry in the end. :( My data comes from the gtfs, so for now, I have a shape_id, trip_headsign and route_short_name on each line. If I could have a resulting table like               shape_id fromstation tostation     2_1      VRM1B       SLR3B     2_1      SLR3B       SLR2B     2_1      SLR2B       SLR1B     etc.      (shape_id 2_1 is the blue line west bound), that would be ideal. I need somehow to use that to create a personnel allocation model for our inspectors and agents on the network. Each segments will be considered a road in Network Analyst with usage restriction to match the train schedule at each train station... Never found anything like that done, but I've been given the task to at least try ;) Any help would be much appreciated. Thanks!!


Osmconvert command-line window closes when I press Return

I am dealing with Open street map Data.   I want to convert some of these .o5m files to .osm format so that I can process them in QGIS. So, I have downloaded Osmconvert to run on my Windows XP operating system.   I run the osmconvert.exe file and a black command-line window opens.   But, whatever I type into the command-line, when I press Return or Enter the window disappears and the program closes! Please could anyone suggest what sort of problem this is that I've run into.   I'm new to command-line computing so apologies if its very obvious. Many thanks   Martin


QGIS, point clouds and photogrammetry

I'm trying to use photogrammetry and Structure from Motion to record buildings, and I'm looking for a way to bring these into a format usable in GIS, in particular pointclouds and models of terrain, buildings, and objects. I would like to be able to import the pointcloud, model or rectified photographs into QGIS and manipulate it in terms of georeferencing and fixing axis (for creating rectified, scaled views of vertical walls/ objects). The software I'm using is QGIS, Agisoft Photoscan and Meshlab. Does anybody have any suggestions regarding file formats, alternative (preferably opensource) software and workflow, or whether GIS is the proper format to do this in?


R - color SpatialLines by attribute

I have a `SpatialLinesDataFrame` dataset of rivers in R. The dataset consists of lines (river segments) with a "Turbidity" attribute. I want to create a map and legend, where:   * Turbidity between 0 and 10 is yellow   * Turbidity between 10 and 20 is orange   * Turbidity between 20 and 30 is red Here is my sample dataset:               library(sp)          #create the sample SpatialLines with 3 lines and 1 attribute     x1 <- c(15.10,15.20, 15.25)     y1 <- c(48.9, 49.1, 49.0)     Line1 <- Line(cbind(x1, y1))     LineString1 <- Lines(list(Line1), ID=1)          x2 <- c(15.25,15.21)     y2 <- c(49.0, 49.12)     Line2 <- Line(cbind(x2, y2))     LineString2 <- Lines(list(Line2), ID=2)          x3 <- c(15.21,15.12)     y3 <- c(49.12, 49.05)     Line3 <- Line(cbind(x3, y3))     LineString3 <- Lines(list(Line3), ID=3)          spLines <- SpatialLines(list(LineString1, LineString2, LineString3))     spLinesDF <- SpatialLinesDataFrame(spLines, data.frame(Turbidity=c(5, 24, 16), row.names=c(1, 2, 3)))          #this is the color breaks that I want to use in map and legend     breaks = c(0, 10, 20, 30)     colors = c("yellow", "orange", "red")          #this doesn't assign the correct colors to my line values     plot(spLinesDF, col=colors)      What commands do I use to match the color breaks (0, 10, 20, 30) with the colors(yellow, orange, red) and with the Turbidity attribute values in my map and in the legend? I know that for raster I could use simple commands like:               brk <- c(0, 10, 20, 30)     col <- c('yellow', 'orange', 'red')     plot(raster, col=col, breaks=brk)      But for SpatialLines, the `plot` doesn't appear to support the color breaks parameter.


Publish rasters stored in PostGreSQL with GeoServer

we are trying to publish some raster images stored in our Postgres database. First, they were generated from satellite images (spectral indexes). Then we uploaded them with raster2psql as tables. So far so good, the problem is that we want to publish them with GeoServer and we found some problems. I have been told that there is still no plugin for GeoServer to perform such task. Do you know what should we do to publish them? any hint will be very appreciated, thanks in advance.


Are there any known issus opening a QGIS Desktop project on Android?

Does anyone else have trouble when they try to open a project which was worked on in the QGIS desktop version 1.8 (I understand this is the most up to date version for the desktop) and try and open it up and work on it in the Android version of QGIS (I understand the most up to date version is 1.9). Is it possible to have projects that work in both the desktop and Android version or could the problem be that the original project is in an earlier version? Thanks Carl


How to contribute for pgrouting.org

I wanna to contribute for algorithms, that's why i chose pgrouting can anyone help me out and suggest me more organisations to which i can contribute. Thnks.


I am developing custom geoprocessing tool (class-library project) on ArcGIS 10.2. This project uses Oracle.DatAccess from ODP.NET 1.0 . This is a simple tool which queries - oracle 10g database and returns a distinct records from a specific table. This tool is working fine from tool box but when this tool is published in REST, it throws below error: _Error:The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception_ ArcGIS server 10.2, Visual Studio 2012. Server: Windows 2012 -6bit Operating system Oracle client : installed both oracle 32 and oracle 64 bit (C:\oracle\product\10.2.0\Client_32,C:\oracle\product\10.2.0\Client_64) PATH: c:\oracle\product\10.2.0\client_64\bin;c:\oracle\product\10.2.0\client_32\bin; Any pointer on this issue? **April 29: Additional details** To begin with, this custom GP tool project was working in ArcGIS 10.0 for last 2 years successfully. As part of technology migration activity, I am upgrading this project to 10.2. As mentioned, am using Windows 2012 server (64 bit OS) where ArcGIS Desktop and ArcGIS server 10.2 has been installed in same box. Oracle client 32, 64 bit has been installed. Path is set as above.


Geoserver 2.5 and gatein portal 3.6 login

I have included the geoserver interface in gateien using a iframe portlet. What I want is to log in into geoserver using de gatein log in,this is, with a single log in I want to log in into geoserver and gatein. Gatein is running on JBossAs7. I have already try to make a j2ee log in, but don't worked for my intent. Another question is, how i compile de .war file from the source code of geoserver? Thanks in advance. Greetings, Sam


Same size polygons giving different overall areas

I am currently working with multiple shape files that I have clipped to the exact same extent, but when I calculate area (acres) within each polygon.   I am getting different results between the different shape files.   Each file represents a different variable, ie: I am working with a slope polygon, aspect, vegetation, etc.   The acreage results (from calculate geometry) are similar, but not the same (9015, 10294, 8999).   There are multiple geometries, each different for each shapefile, and I am comparing the acreage sums across each shapefile that I have clipped to the same size.   The plotted clipped extents are mostly just squares with some irregular shaped polygons. Fixing the topology errors did not make the acreage's equal. They are all on the same projection. Fixing geometry errors did not work either.


Creating an Origin/Destination (OD) cost matrix using ArcPy

I have created a python script that runs an OD cost matrix over five years from 1999 to 2004. I have set up an OD cost matrix for each year, which I think is very cumbersome. Is there someone who can show me how I can do this with a loop in python (arcpy) instead of setting up the OD cost matrix for each year? In my origins and Destinations I also have a field called HOSPITALS. In the OD cost matrix, this field should be connected to each other so there will only be an analysis of each origins to Destination. How is this done?               import arcpy          from arcpy import env          arcpy.env.overwriteOutput = True     #Set environments     arcpy.env.workspace = "C:\Tom\OPPDRAG_2013\Sykehus"               #Check out the Network Analyst extension license     arcpy.CheckOutExtension("Network")          #Set local variables     inNetworkDataset = "C:\Tom\Elveg\ELVEG_Nettverk_2013\ELVEG_Nettverk_2013\ELVEG_Nettverk_2013.gdb\ELVEG_Nettverk\ELVEG_Nettverk_ND_2013"     outNALayer_1999 = "Pasienter_til_Sykehus_Matrix_1999"     outNALayer_2000 = "Pasienter_til_Sykehus_Matrix_2000"     outNALayer_2001 = "Pasienter_til_Sykehus_Matrix_2001"     outNALayer_2002 = "Pasienter_til_Sykehus_Matrix_2002"     outNALayer_2003 = "Pasienter_til_Sykehus_Matrix_2003"     impedanceAttribute = "Drivetime"     accumulateAttributeName = ["Minutes"]     inOrgins = "Pasienter_10.shp"     inDestinations = "Tre_Sykehus.shp"     outLayerFile_1999 = "C:\Tom\OPPDRAG_2013\Sykehus" + "/" + "outNALayer_1999" + ".lyr"     outLayerFile_2000 = "C:\Tom\OPPDRAG_2013\Sykehus" + "/" + "outNALayer_2000" + ".lyr"     outLayerFile_2001 = "C:\Tom\OPPDRAG_2013\Sykehus" + "/" + "outNALayer_2001" + ".lyr"     outLayerFile_2002 = "C:\Tom\OPPDRAG_2013\Sykehus" + "/" + "outNALayer_2002" + ".lyr"     outLayerFile_2003 = "C:\Tom\OPPDRAG_2013\Sykehus" + "/" + "outNALayer_2003" + ".lyr"          #arcpy.ImportToolbox("C:\Tom\Toolboxes\ArcPyToolBox.tbx")               #########################################               # Process: Make Feature Layer (2)     #arcpy.MakeFeatureLayer_management(inOrgins, "PasienterLyr", "\"SYKEHUS\" = '%SYKEHUS%'")               ########################################          arcpy.MakeFeatureLayer_management (inOrgins, "Pas_Lyr1999")     arcpy.SelectLayerByAttribute_management ("Pas_Lyr1999", "NEW_SELECTION", " f_aar = '1999' ")          #Create a new OD Cost matrix layer.     arcpy.MakeODCostMatrixLayer_na(inNetworkDataset, outNALayer_1999, "Minutes", "", "", "Minutes")                                            #Load the locations as origins.     arcpy.AddLocations_na(outNALayer_1999, "Origins", "Pas_Lyr1999", "Name f_aar #","1000 Meters", "SYKEHUS")          #Load the locations as destinations      arcpy.AddLocations_na (outNALayer_1999, "Destinations", inDestinations, "Name SYKEHUS #","1000 Meters", "SYKEHUS")               #Solve the OD cost matrix layer     arcpy.Solve_na(outNALayer_1999)          #Save the solved OD cost matrix layer as a layer file on disk with relative     #paths     arcpy.SaveToLayerFile_management(outNALayer_1999, outLayerFile_1999,"RELATIVE")          #####################################          arcpy.MakeFeatureLayer_management (inOrgins, "Pas_Lyr2000")     arcpy.SelectLayerByAttribute_management ("Pas_Lyr2000", "NEW_SELECTION", " f_aar = '2000' ")          #Create a new OD Cost matrix layer.     arcpy.MakeODCostMatrixLayer_na(inNetworkDataset, outNALayer_2000, "Minutes", "", "", "Minutes")                                            #Load the locations as origins.     arcpy.AddLocations_na(outNALayer, "Origins", "Pas_Lyr2000", "Name f_aar #","1000 Meters", "SYKEHUS")          #Load the locations as destinations      arcpy.AddLocations_na (outNALayer, "Destinations", inDestinations, "Name SYKEHUS #","1000 Meters", "SYKEHUS")               #Solve the OD cost matrix layer     arcpy.Solve_na(outNALayer_2000)          #Save the solved OD cost matrix layer as a layer file on disk with relative     #paths     arcpy.SaveToLayerFile_management(outNALayer_2000, outLayerFile_2000,"RELATIVE")          #####################################          arcpy.MakeFeatureLayer_management (inOrgins, "Pas_Lyr2001")     arcpy.SelectLayerByAttribute_management ("Pas_Lyr2001", "NEW_SELECTION", " f_aar = '2001' ")          #Create a new OD Cost matrix layer.     arcpy.MakeODCostMatrixLayer_na(inNetworkDataset, outNALayer_2001, "Minutes", "", "", "Minutes")                                            #Load the locations as origins.     arcpy.AddLocations_na(outNALayer, "Origins", "Pas_Lyr2001", "Name f_aar #","1000 Meters", "SYKEHUS")          #Load the locations as destinations      arcpy.AddLocations_na (outNALayer, "Destinations", inDestinations, "Name SYKEHUS #","1000 Meters", "SYKEHUS")               #Solve the OD cost matrix layer     arcpy.Solve_na(outNALayer_2001)          #Save the solved OD cost matrix layer as a layer file on disk with relative     #paths     arcpy.SaveToLayerFile_management(outNALayer_2001, outLayerFile_2001,"RELATIVE")          #####################################          arcpy.MakeFeatureLayer_management (inOrgins, "Pas_Lyr2002")     arcpy.SelectLayerByAttribute_management ("Pas_Lyr2002", "NEW_SELECTION", " f_aar = '2000' ")          #Create a new OD Cost matrix layer.     arcpy.MakeODCostMatrixLayer_na(inNetworkDataset, outNALayer_2002, "Minutes", "", "", "Minutes")                                            #Load the locations as origins.     arcpy.AddLocations_na(outNALayer, "Origins", "Pas_Lyr2002", "Name f_aar #","1000 Meters", "SYKEHUS")          #Load the locations as destinations      arcpy.AddLocations_na (outNALayer, "Destinations", inDestinations, "Name SYKEHUS #","1000 Meters", "SYKEHUS")               #Solve the OD cost matrix layer     arcpy.Solve_na(outNALayer_2002)          #Save the solved OD cost matrix layer as a layer file on disk with relative     #paths     arcpy.SaveToLayerFile_management(outNALayer_2002, outLayerFile_2002,"RELATIVE")          #####################################          arcpy.MakeFeatureLayer_management (inOrgins, "Pas_Lyr2003")     arcpy.SelectLayerByAttribute_management ("Pas_Lyr2003", "NEW_SELECTION", " f_aar = '2000' ")          #Create a new OD Cost matrix layer.     arcpy.MakeODCostMatrixLayer_na(inNetworkDataset, outNALayer_2003, "Minutes", "", "", "Minutes")                                            #Load the locations as origins.     arcpy.AddLocations_na(outNALayer, "Origins", "Pas_Lyr2003", "Name f_aar #","1000 Meters", "SYKEHUS")          #Load the locations as destinations      arcpy.AddLocations_na (outNALayer, "Destinations", inDestinations, "Name SYKEHUS #","1000 Meters", "SYKEHUS")               #Solve the OD cost matrix layer     arcpy.Solve_na(outNALayer_2003)          #Save the solved OD cost matrix layer as a layer file on disk with relative     #paths     arcpy.SaveToLayerFile_management(outNALayer_2003, outLayerFile_2003,"RELATIVE")


How to change an OpenLayers vector layer from automatic to manual get request?

I have a web server that returns a `FeatureCollection` in JSON. I was getting this using the code below, which works perfectly:               var vectorLayer = new OpenLayers.Layer.Vector('geoJSON', {         strategies: [new OpenLayers.Strategy.Fixed()],         protocol: new OpenLayers.Protocol.HTTP({             url: '<%= Url.Action("Vectors", "Maps") %>',             format: new OpenLayers.Format.GeoJSON()         }),         styleMap: new OpenLayers.StyleMap(style)     });      I want to convert this into a manual async get request as part of something else (I'm displaying routes and want to do several requests, one for each route so I can display them as they are calculated, avoiding a large delay). So, I've changed the above to the code below:               OpenLayers.Request.GET({         url: '<%= Url.Action("Vectors", "Maps") %>',         async: true,         success: function(e) {             var features = new OpenLayers.Format.GeoJSON().read(e.responseText);             vectorLayer.addFeatures(features);         }     });      However, when I run this although the callback is called, the `e.responseText` looks ok and the features variable seems to contain the correct objects and they do get added to the `vectorLayer`, **they appear in the wrong place; Right next to the origin**. On OSM's max zoom they are barely apart from each other, when they should be scattered around the UK. Any idea why since the change to a manual GET they are appearing in the wrong places? * * * See below for my current code listing:               var map, layer;     map = new OpenLayers.Map(element.id);     baseLayer = new OpenLayers.Layer.OSM('Simple OSM Map');               var context = {         getColor: function(feature) {             return feature.attributes['Colour'];         },         getImageURL: function(feature) {             return feature.attributes['ImageURL'];         },         getLabel: function(feature) {             return feature.attributes['Label'];         }     };          var template = {         externalGraphic: '${getImageURL}',         pointRadius: 5,         strokeWidth: 3,         strokeColor: "${getColor}"     };                    var style = new OpenLayers.Style(template, { context: context });          /*var vectorLayer = new OpenLayers.Layer.Vector('geoJSON', {     strategies: [new OpenLayers.Strategy.Fixed()],     protocol: new OpenLayers.Protocol.HTTP({     url: '<%= Url.Action("Vectors", "Maps") %>',     format: new OpenLayers.Format.GeoJSON()     }),     styleMap: new OpenLayers.StyleMap(style)     });*/          var vectorLayer = new OpenLayers.Layer.Vector('geoJSON');     vectorLayer.styleMap = new OpenLayers.StyleMap(style);          OpenLayers.Request.GET({         url: '<%= Url.Action("Vectors", "Maps") %>',         async: true,         success: function(e) {             var features = new OpenLayers.Format.GeoJSON().read(e.responseText);             vectorLayer.addFeatures(features);         }     });          map.addLayers([baseLayer, vectorLayer]);     map.setCenter(         new OpenLayers.LonLat(-4, 55).transform(             new OpenLayers.Projection("EPSG:4326"),             map.getProjectionObject()         ), 6     );      An example of the JSON that gets returned (and hasn't changed since it worked):               { "features" : [ { "geometry" : { "coordinates" : [ -0.72766602400000002,                     51.273638529999999                   ],                 "type" : "Point"               },             "properties" : { "Colour" : "#ffffff",                 "ImageURL" : "/360Scheduling/Content/Images/ByBox.png"               },             "type" : "Feature"           },           { "geometry" : { "coordinates" : [ [ -0.82559629999999995,                       51.296390000000002                     ],                     [ -0.72766602400000002,                       51.273638529999999                     ],                     [ -0.82559629999999995,                       51.296390000000002                     ]                   ],                 "type" : "LineString"               },             "properties" : { "Colour" : "#{72:x2}{241:x2}{152:x2}",                 "ImageURL" : null               },             "type" : "Feature"           },           { "geometry" : { "coordinates" : [ -0.82559629999999995,                     51.296390000000002                   ],                 "type" : "Point"               },             "properties" : { "Colour" : "#ffffff",                 "ImageURL" : "/360Scheduling/Content/Images/Home.png"               },             "type" : "Feature"           },           { "geometry" : { "coordinates" : [ -0.41132172900000002,                     50.821081319999998                   ],                 "type" : "Point"               },             "properties" : { "Colour" : "#ffffff",                 "ImageURL" : "/360Scheduling/Content/Images/ByBox.png"               },             "type" : "Feature"           },           { "geometry" : { "coordinates" : [ [ -0.47245280000000001,                       50.817610000000002                     ],                     [ -0.41132172900000002,                       50.821081319999998                     ],                     [ -0.47245280000000001,                       50.817610000000002                     ]                   ],                 "type" : "LineString"               },             "properties" : { "Colour" : "#{206:x2}{155:x2}{66:x2}",                 "ImageURL" : null               },             "type" : "Feature"           },           { "geometry" : { "coordinates" : [ -0.47245280000000001,                     50.817610000000002                   ],                 "type" : "Point"               },             "properties" : { "Colour" : "#ffffff",                 "ImageURL" : "/360Scheduling/Content/Images/Home.png"               },             "type" : "Feature"           },           { "geometry" : { "coordinates" : [ 0.074993041999999996,                     51.270947649999997                   ],                 "type" : "Point"               },             "properties" : { "Colour" : "#ffffff",                 "ImageURL" : "/360Scheduling/Content/Images/ByBox.png"               },             "type" : "Feature"           },           { "geometry" : { "coordinates" : [ [ 0.075924359999999996,                       51.268300000000004                     ],                     [ 0.074993041999999996,                       51.270947649999997                     ],                     [ 0.075924359999999996,                       51.268300000000004                     ]                   ],                 "type" : "LineString"               },             "properties" : { "Colour" : "#{99:x2}{146:x2}{254:x2}",                 "ImageURL" : null               },             "type" : "Feature"           },           { "geometry" : { "coordinates" : [ 0.075924359999999996,                     51.268300000000004                   ],                 "type" : "Point"               },             "properties" : { "Colour" : "#ffffff",                 "ImageURL" : "/360Scheduling/Content/Images/Home.png"               },             "type" : "Feature"           },           { "geometry" : { "coordinates" : [ -0.24428876999999999,                     51.583668719999999                   ],                 "type" : "Point"               },             "properties" : { "Colour" : "#ffffff",                 "ImageURL" : "/360Scheduling/Content/Images/ByBox.png"               },             "type" : "Feature"           },           { "geometry" : { "coordinates" : [ [ -0.251608,                       51.580390000000001                     ],                     [ -0.24428876999999999,                       51.583668719999999                     ],                     [ -0.251608,                       51.580390000000001                     ]                   ],                 "type" : "LineString"               },             "properties" : { "Colour" : "#{188:x2}{122:x2}{221:x2}",                 "ImageURL" : null               },             "type" : "Feature"           },           { "geometry" : { "coordinates" : [ -0.251608,                     51.580390000000001                   ],                 "type" : "Point"               },             "properties" : { "Colour" : "#ffffff",                 "ImageURL" : "/360Scheduling/Content/Images/Home.png"               },             "type" : "Feature"           },           { "geometry" : { "coordinates" : [ -1.4948717600000001,                     53.68926664                   ],                 "type" : "Point"               },             "properties" : { "Colour" : "#ffffff",                 "ImageURL" : "/360Scheduling/Content/Images/ByBox.png"               },             "type" : "Feature"           }         ],       "type" : "FeatureCollection"     }


Google maps white striations / false artifacts

What are the common white striations running from NW to SE visible when you zoom in around 5mi scale? For example at (+81, -80)? But they appear 'all over'. Are they snow drifts? or satellite sweeps? ![Screen shot](http://i.stack.imgur.com/eBB89.png) Generally: Where can I find documentation on Google Maps false artifacts?


Can I use Google Maps API and substitute Openstreet map as base layer?

This Question is based on below requirements. 1 - our application will need to use functionalities of Google Maps API like custom marker/Info pop up/Routing etc. 2 - our application wants to use Openstreetmaps or our ownmaps as the base layer. Now , can we use Google maps API for functionalities and Openstreet map as base layer,so that I am not charged for using google data ? do they specifically charge for API usage ? isnt the 2500 request limit for http requests to google image/map server ? Adarsh


Requesting remote data using openlayers for multiple URLS and storing respose value according to URL

I have problem creating feature count window. I have urls stored in as json object. I iterate it with jquery and send request to remote data. The I have featureStore which is initially set to 0. When the request is done i try to update it with new feature count but it only updates the last url of array here "S". The console of handler has always last value of the array here "S". Is there any way I can synchronize this? I think there are mulitple request and some request returns value faster than other without considering which url request is send. How do I synchronize so that I can update featureStore eaxctly as the elements in URL.                               var current ;                              var featuresStore =                                          {                                          "F" : 0,                                          "S" : 0                                          };                                    var urls =                                              {                                              "F" : "http://192.168.69.88:8080/geoserver/wfs?request=GetFeature&typename=Data:sites_2&version=1.1.1&resultType=hits&filter=(<Filter><PropertyIsEqualTo><PropertyName>Vendor</PropertyName><Literal>TE</Literal></PropertyIsEqualTo></Filter>)",                                              "S" : "http://192.168.69.88:8080/geoserver/wfs?request=GetFeature&typename=Data:sites_3&version=1.1.1&resultType=hits&filter=(<Filter><PropertyIsEqualTo><PropertyName>Vendor</PropertyName><Literal>TE</Literal></PropertyIsEqualTo></Filter>)"                                                };                            //Feature Store before                        console.log(featuresStore);                             //reads nof of features                         var LegendHandler = function (request) {                               var noOfFeature;                                  try {                                         var xmlFormat  = new OpenLayers.Format.XML();                                         var data  = xmlFormat.read(request.responseText);                                         var format = new OpenLayers.Format.WFST.v1_1_0({});                                         var result = format.read(data, {output: "object"});                                         noOfFeature = result.numberOfFeatures;                                          }catch(e){                                         $("#messageText").val("Error "+e);                                         console.log("Error "+e);                                         noOfFeature = 0;                                     }                                        featuresStore.current = noOfFeature;                                        console.log("The current value is "+current);                                 }                 //Iterating over each URLs                            $.each(urls,function(i){                                     current = i;                                     console.log("The current value is "+current);                             var request = OpenLayers.Request.GET({                                         url: urls[i],                                         callback: LegendHandler                                     });                                    });                                         //Feature Store after                                console.log(featuresStore);


Create WMS service from existing image tiles

I have image tiles (jpg image files with txt georeference info files; see picture) stored in catalog (about 12GB, size one image tile ~ 275*466 meters). It possible create WMS service of the tiles to load it into QGIS and its use by multiple users in a network. As I understand it can be done with MapServer, GeoServer, PostGIS. Is there a manual how I should load this image tiles in MapServer (or GeoServer, PostGIS)? ![enter image description here](http://i.stack.imgur.com/PhYx7.jpg)


How to setup leaflet map to display a WMS layer in ESRI:102012 projection?

I have a WMS server that serves layers in ESRI:102012 projection. http://spatialreference.org/ref/esri/102012/ It accepts GetMap requests with srs=EPSG:102012 parameter. My goal is to display a map in this projection with some WMS layers on it. I'm using a proj4leaflet plugin (https://github.com/kartena/Proj4Leaflet) to setup a map for this projection, but I'm stuck with defining L.Transformation, scale and resolution parameters. Can anybody tell me what to put in those parameters, or give a working example of leaflet map in this projection?


Centered label halos in ArcMap 10.1

When I use label features with halos in ArcMap, whether using the standard or Maplex labeling engine, the halos in the exported map (PDF) are always shifted vertically, so that instead of the halo being evenly spaced around the text it is flush with the bottom and excessive on the top. I know others have had this issue: Export Map to PDF Halo Labels shifts Halo to latter width at the end of Label Problem, but the proposed fix doesn't work, because the option to change vertical text alignment is grayed out. Has anyone else found a way to add halos to maps?


lyr design cut from shape

I have a river line shapefile (20 rivers) and its associated layer file. It contains the main rivers as thicker lines. I need only the main lines separated out into another shapefile without the thinner confluent lines. How can I export only the main river lines? The problem is that the rivers are composed from many segments. Any idea?


Other than the methods stated on the Desktop 10 Sharing Tools section, are there any other ways to distribute custom toolscripts?

Essentially I want to be able to distribute a custom script and it seems that I cannot create a .tbx file, so I looked into the other methods, but they are all only for Python modules it seems. What I want to be able to do is have the user still be able to pull up the dialog box prompting for input when they click on the tool, how do I go about packaging the external libraries that I used for this script and distribute it such that the user can simply import the tool into his toolbox and click on it and it will pull up the dialog box for user input?


QGIS: graphical-modeler to calculate area of polygons

I'm trying to calculate the area of polygons using the field-calculator in QGIS (2.0.1). If I do this manualy it works fine, but if I do this using the graphical-modeler I get NULL as area for every Polygon. I just typet `$area` in the Formula field. Field-type is integer and length is 10.


Why is my mosaic of rasters a big, black rectangle?

I downloaded NED rasters from USGS, and I now want to mosaic all of the rasters into one. I used the Mosaic to New Raster tool, but the output is a big, black rectangle. Am I missing something? I feel like I might be making a rookie mistake. Thanks for any help you can provide!


SQL Query to Reverse Geocoding in PostGIS

I try to do Reverse Geocode from my shapefile on the database. I'd already try with Spatialite and PostGIS to put shapefile (.shp) into it. But I'm still can't delivered my objection about reverse geocode from my shapefile on the database. My shapefile (.shp) is content with district polygon, all I want is simple: Pass some coordinate, and check that coordinate is in what district polygon from shapefile, then return the district name. That's all. Does anybody know the SQL Query to do that reverse geocode in PostGIS or Spatialite? Thanks before. :(


How can I see the overlay of two features (point & polygon)?

I am trying to open two digitized layers, one containing points in a region and second which I have downloaded separately for the region as polygon layer. I would like to overlay two of these layers to see which point belongs to which area. The problem is, I can not see an overlay of layers (points on polygon).


What does Scale mean in the reference of Desktop GIS or WebGIS?

I'm having trouble understanding the meaning of the concept of scale when it comes to maps on screen, i.e. either in a Desktop GIS or in a WebMap. When it comes to paper maps, the idea is very clear. The Scale is the ratio of a particular distance on the map, to the same distance on the ground. But when it comes to maps on screen, the same concept cannot be applied. Firstly different screens do not have the same pixel size. It might be that a 14 inch monitor and a 24 inch monitor could have the same resolution (in terms of pixels). Then comes the issue of dpi. An iOS device with retina display has a dpi several times that of my work-station monitor. So 1 cm on my screen might show a different distance than 1 cm on your screen. So what does the scale of a map in digital cartography mean? What does it mean, when I see the scale of a map is 1:180,000 in ArcMap? * * * _Aside_   This question came about because of several ArcMap Documents I received from a client who publishes paper maps.   The paper map is published at 1:180,000, but at that scale the map looks terrible. It's only when I zoom in, does the map look good. With trial and error, I found that the map looks best on screen at about 3 times the scale, i.e. at 1:60,000


GPS Coordinates to WKID 102100

I'm currently creating a project for ios and I'm using the latest ArcGIS IOS api. I have a mapView that is using the spatial reference skid 102100 and i am receiving lat long coordinates from an external GPS device (NMEA 0183 messages). I believe NMEA 0183 uses WGS84. I want to display the location from the GPS to my mapView. I tried creating a AGSPoint based on the GPS lat long with WGS84 spatial reference and projecting it to my mapView's spatial reference but the point seems to be at the middle of my map, which i assume is wrong because im in Canada. Can anybody help me pls? I think the reason could be that my mapView has a unit of measure of Meters and the GPS is sending dddmm.mmmmmmm data (d=degrees, m=minutes). here is my projection code:               AGSPoint *tempPoint = [[AGSPoint alloc] initWithX:longitudeValue y:latitudeValue spatialReference:[AGSSpatialReference wgs84SpatialReference]];         AGSPoint *projectedPoint = (AGSPoint *)[self.geometryEngine projectGeometry:temp2 toSpatialReference:self.mapView.spatialReference];      Do still need to convert the lat/long to meters before i project it? if yes, how? Thanks.


How to restore a back up file into pgadmin III

My backup file containing about 50-60 tables , but I am able to just load only 6 tables for a new db and 31 tables for postgis dbase . And this was the error when I restore a backup file.               pg_restore: [archiver (db)] Error while PROCESSING TOC:     pg_restore: [archiver (db)] Error from TOC entry 1393; 0 0 SHELL TYPE box2d postgres     pg_restore: [archiver (db)] could not execute query: ERROR:  type "box2d" already exists         Command was: CREATE TYPE box2d;      I should I resolve this problem. I am using PostgreSQL 9.1 and please help me how can I load all tables without any errors.my backup file contains 90 MB.


"could not get any sources: no image returned from source WMS" error in mapproxy demo

I am trying to connect my mapserver to MapProxy. First part of the map file is shown below               MAP     FONTSET "fonts.lst"     IMAGETYPE png     MAXSIZE 4000     SIZE 800 800     EXTENT -20000000 -20000000 20000000 20000000     UNITS meters     IMAGECOLOR 153 179 204     WEB        METADATA           "ows_enable_request" "*"           "wms_srs" "EPSG:4326 EPSG:3857 EPSG:2154 EPSG:310642901 EPSG:4171 EPSG:310024802 EPSG:310915814 EPSG:310486805 EPSG:310702807 EPSG:310700806 EPSG:310547809 EPSG:310706808 EPSG:310642810 EPSG:310642801 EPSG:310642812 EPSG:310032811 EPSG:310642813 EPSG:2986"           "labelcache_map_edge_buffer" "-10"           "wms_title" "osm france"        END        IMAGEPATH "/tmp/ms_tmp/"        IMAGEURL "/ms_tmp/"     END     DEBUG 1     CONFIG "MS_ERRORFILE" "stderr"     CONFIG "PROJ_LIB" "/home/mwh/osm-demo/basemaps"     PROJECTION        "init=epsg:3857"     END     LAYER        TYPE POLYGON        STATUS ON        GROUP "default"        DEBUG 1        NAME "land0"        PROCESSING "APPROXIMATION_SCALE=full"        PROJECTION            "init=epsg:4326"        END        MINSCALEDENOM 332808204        MAXSCALEDENOM 99999999999        DATA "data/TM_WORLD_BORDERS-0.3.shp"        CLASS            STYLE                COLOR 242 239 233            END        END     END     LAYER        GROUP "default"        STATUS ON        MAXSCALEDENOM 99999999999        MINSCALEDENOM 332808204        TYPE LINE        NAME "borders0"        PROJECTION          "init=epsg:4326"        END        DATA "data/boundaries.shp"        CLASS           STYLE              WIDTH 0.5              COLOR "#CDCBC6"           END        END     END      I followed the Tutorial given in MapProxy website to start my proxy by starting the proxy. The tutorial example works fine. But when I use my own .map file it shows an error " **could not get any sources: no image returned from source WMS** " My mapproxy.yaml is shown below               services:       demo:       wms:         md:           title: MapProxy WMS Proxy           abstract: This is the fantastic MapProxy.           online_resource: http://mapproxy.org/           contact:             person: Your Name Here             position: Technical Director             organization:              address: Fakestreet 123             city: Somewhere             postcode: 12345             country: Germany             phone: +49(0)000-000000-0             fax: +49(0)000-000000-0             email: info@omniscale.de           access_constraints:             This service is intended for private and             evaluation use only. The data is licensed             as Creative Commons Attribution-Share Alike 2.0             (http://creativecommons.org/licenses/by-sa/2.0/)           fees: 'None'          sources:       test_wms:         type: wms         req:           url: http://osm.omniscale.net/proxy/service?           layers: osm            mapserver:         type: wms         supported_srs: ['epsg:3857', 'epsg:4326']         req:           url: http://localhost/cgi-bin/mapserv?           layers: default           map: /home/mwh/osm-demo/basemap/osm-google.map           transparent: true         coverage:           bbox: -20000000.0,-20000000.0,20000000.0,20000000.0           bbox_srs: 'epsg:3857'          layers:       - name: mapserver         title: Mapserver Test Layer         sources: [mapserver]      Currently I am stuck in this problem please help me to find some answer. Thank you.


Get Conflict Value from ConflictWindow

When I reconcile a version in Arc Map, if it has any conflicts it will stop the reconcile operation and open a window. The window shows the conflicts of that particular version with red dots. My task is to read those values and generate a report which contains only conflict fields.


How do I create a line between two points with a common field?

Does anyone know how I could create a line between two points that have a common code? For example: I have the start and end point of a pipe as a lat/long for a network of pipes, each with a different ID. I want to create a line feature for each of those with the pipe ID which I can then calculate the length from. Anyone know of any arcscript tools in ESRI software or QGIS tools I could use to accomplish this without coding? Thanks!!


How to configure GeoWebCache that it can generate tile files conform Slippy Map format

The tile files generated by GeoWebCache using gridset 900913 are like: \EPSG_90013_6\02_02\0032_42.png, etc. How can I configure GeoWebCache that it is generating the files conform slippy map format? That is \6\32\21.png, etc.


My map is little bit off

I am pretty new in GIS things and i have been learning how to use QGIS. Most of the maps are fine, but yesterday I went to GIS center at my University and I got the maps of my country that I will be using for my study. But when I add them in QGIS they are not on the right spot. I checked the coordinate system and it is WGS 84. when I add the species, they are on the right place and map is little bit diagonally towards the right upper corner. I checked the species with the other map that I downloaded from internet and they are on the right place. Also the species and the other map that I downloaded from internet are WGS 84. Any suggestions how can I correct this?


Best practice for aerial photo stitching and georeferencing

I need to georeference 53 air photos from 1981 (1:25,000 scale) and was wondering what would be the most efficient, defensible, and accurate option. For context, the air photos are following a highway taken along a valley bottom and therefore the relief would not be significant as would be the case if mountains were involved. Essentially, I want to quantify the change in surface area around this highway from 1981 photos to current day; how do I process the former images? Typically, one would georeference each air photo using current satellite imagery. However, in my case, I feel this would be difficult because the area of interest has changed through time, and therefore I fear I will not have enough reference points from current satellite imagery to georeference each air photo from 1981. Therefore, I thought I could first stitch the 53 air photos together using control points from the adjacent air photo taken the same day; essentially creating a mosaic from 1981. Then I could georeference the entire mosaic using current satellite imagery; I think on a larger scale I could find enough reference points to accurately geofrerence the mosaic. Would this process cause too much local distortion that I would no longer be able to accurately quantify surface area? Lastly, I'm curious if orthorectifying the image would significantly improve the surface estimation? I'm not looking for complete precision, but would like it to be accurate enough for a publishable manuscript.


How do I change graduated color class values with python?

I am trying to use python to adjust my graduated color symbols' class breaks and labels. The layer is a query layer tied to an SQL DB and I want to be able to execute my python (after the database has been updated) to automatically author a map and have the layer/legend reflect the changes made in the database. I've tried this script but it doesn't work and I get an error I don't recognize.               import arcpy     mxd = arcpy.mapping.MapDocument("current")     df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]     lyr = arcpy.mapping.ListLayers(mxd, "Unsafe_Driving", df)[0]     if lyr.symbologyType == "GRADUATED_COLORS":         lyr.symbology.valueField = "CSA.DBO.%Unsafe_Driving_1.VARIANCE"         lyr.symbology.classBreakValues = [-.01, .01, .0866]         lyr.symbology.classBreakLabels = ["-8.66% to -1.00%", "-.99% to 1.00%","1.01% to 8.66%"]           arcpy.RefreshActiveView()      > Runtime error Traceback (most recent call last): File "", line 7, in File > "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\arcobjects_base.py", > line 87, in _set return setattr(self._arc_object, attr_name, cval(val)) > RuntimeError The goal here is to have 3 classes:   1. Lowest value to -1.00%    2. -.99% to 1.00%   3. 1.01% to the highest value.  Since the lowest and highest values can change, do I need to use a query to dynamically insert those into the lyr.symbology.classBreakValues? Any suggestions or code examples would help tremendously.


Return features based on users credentials Geoserver WFS

We are using LDAP based authentication with geoserver which is connected to a PostGIS database. Users insert rows (features) into the table (layer) using WFS-T after authentication. Now when users query for data from this layer (also after authentication), we would like to return data that is applicable to this user based on their credential (i.e) only view data that was inserted by that user or group. We are storing the username in the table. We get the username because this is defined as non-null column in our table and users are required to provide it as a part of their WFS-T insert. I read about service level security and layer level security, but what we need seems more like row level or feature level security. We can use JDBC based authentication instead of LDAP if needed, but do not know if this will solve the problem. I am pretty comfortable with Java and some what knowledgeable on spring security and hence can deal with customizations if needed. Please advice.


going from hillshade to percent shaded (gdaldem)

I assumed hillshades output percent shaded (scaled to 255) at the given azimuth and altitude but this is incorrect. A flat raster at 80 degrees altitude has a maximum value of 251 instead of 255. How can I go from a hillshade to percent shaded and can I simply divide by the cosine of the 10 degrees in this case to get the correct value or is it more complicated? Here is some `R` code with `gdaldem` that may help you see what I'm seeing:               library(raster)     r <- raster(ncol=100,nrow=100)     values(r) <- rep(1,ncell(r))     writeRaster(r,"flatelevation.tif")     system("gdaldem hillshade -az 180 -alt 80 flatelevation.tif hillshade_flat.tif")     hs <- raster("hillshade_flat.tif")     summary(values(hs))     summary(values(hs)/cos((90.0-80.0)*pi/180.0))      I will try to parse the source code but it's been ten years since I've used C++... In the meantime if someone with general knowledge about hillshades can point me the right direction it would be greatly appreciated. ADDED: So I thought I could get a "percent of the tile that is shaded" from running a hillshade. Upon further reading a hillshade outputs the illuminance of each tile. So, the cosine is only part of the equation, I would need to pull in the slope and aspect as well for additional trigonometric readjustments, and maybe more. Turns out there are tools that are functionally equivalent for that I need called "shadow masks" that only output 1 or 0, indicating whether the tile is shaded. This nail biting article referenced in `gdal`'s source code helped enlighten me, in addition to this question on cloud shading, this question on solar maps, and this question on r.sun where a contributor indicates that r.sunmask is slow. A couple available tools: GRASS r.sunmask RSGISLib Elevation Module: shadowmask USGS ISIS Shadow Of course I need the speed of `gdal`'s hillshading so I'll keep this question up until I or others come up with a solution that can process a 1000 square mile area in a second.


I would like to reverse Geocode from the infowindow

I am just learning the ropes with CartoDB and am curious to know if this is possible. I have a CartoDB map with points and I am entering data into this map through the CartoDB editor. I would like to be able to Google reverse geocode the street address of my point automatically. Ideally I would create a link on the infowindow labeled 'Find address' this would then run a script which would find the address of that point and INSERT it into that points specified column on my table. I would like this to run entirely from the CartoDB Editor as this is where I update my data from. Does anyone know if this is possible and if so where is the best place to start? If this won't work are there any other reverse Geocode solutions out there?


How to solve jpeg2000, jp2. crash & errors on arcgis 9.3.1 windows 7 64-bit

I have several problems at work. One is that jpeg2000 crashes ArcMap but mostly ArcCatalog when trying to read them. This is only occurs on machines with Windows 7 64-bit (we don't have Windows 7 32-bit). What can cause this? I have deleted templates, re-installed, everything in my power. But there is obviously some compatibility issue, because it works great on Windows XP.


Buttons (Ok, Cancel) disappear in "Apri Modulo" from Attribute Table in QGIS 2.0.1

QGIS 2.0 has changed the visualisation of a form opened from the attribute table: instead of opening the form in a separate window, the form is opened in the same one. This is not a problem, **but all the buttons disappear...** I created my own form with Qt4 and all the logic with PyQt and the majority of the constraints are associated to the Ok button: now my logic is no longer useful. It is possible to re-enable these buttons? Thank you, Elisabetta **- Update -** I'm trying to do this, for the moment I have no update... I copy here part of my code, maybe someone can help me.               from PyQt4.QtCore import *       from PyQt4.QtGui import *       from definizioni import *          myDialog = None     denominazione = None     denominazioneCheck = None          def formOpen(dialog,layerid,featureid):       global myDialog       myDialog = dialog            global denominazione, denominazioneCheck       denominazione = myDialog.findChild(QLineEdit,"denominazione")       denominazione.textChanged.connect(denominazione_onTextChanged)       if (denominazione.text() == "NULL"):         denominazione.setText("")       else:         temp = denominazione.text()         denominazione.setText("null")         denominazione.setText(temp)            buttonBox = myDialog.findChild(QDialogButtonBox,"buttonBox")       # Disconnect the signal that QGIS has wired up for the dialog to the button box.       buttonBox.accepted.disconnect(myDialog.accept)       # Wire up our own signals.       buttonBox.accepted.connect(validate)       buttonBox.rejected.connect(myDialog.reject)       self.connect(buttonBox, SIGNAL("accepted()"), self.accept)          def denominazione_onTextChanged(text):       global denominazioneCheck            if not validateStringNotNull(text):         denominazione.setStyleSheet("background-color: rgba(255, 107, 107, 150);")         denominazioneCheck = -2       else:         if not validateAlpha(text):           denominazione.setStyleSheet("background-color: rgba(255, 107, 107, 150);")           denominazioneCheck = -1         else:           denominazione.setStyleSheet("")           denominazioneCheck = 1          # Valido la form     def validate():       if denominazioneCheck == -2:         messageBoxErrore(myDialog,"La denominazione di un comune non puo' essere vuota")       else:         if denominazioneCheck == -1:           messageBoxErrore(myDialog,"La denominazione di un comune non puo' contenere numeri")         else:           # Return the form as accepted to QGIS.           myDialog.accept()      I need that the field of the form respect some constraints, as you can see. **In case that constraints are not fulfilled I don't want that the record is stored in the database (I don't want accept() signal is called!).**


OpenLayers programmatically select base layer

I have several base layers added to a map in an OpenLayers based application. There is only one that can be displayed at a time, as they are all base layers. When the user changes the selected base layer, I store the name of the selected layer as a HTML5 local storage item (an improved cookie). When re- opening the application, I want to programmatically set the same base layer be displayed. It works fine with `layer.visibility = true` if `isBaseLayer` is `false`, but not in the case when `isBaseLayer` is set to `true`. Is there anything else I could try for this?


ArcMap Text Annotations Display in Proportion to Map Scale

My question is probably of an 'easy fix' however I've been struggling with it for a while! I'm trying to set up an annotation labels for several feature classess in a map and would like them to display proportionally - relatively to map scale. I use ArcGIS v 10.1 and Maplex label engine. So - as an example, I am working on a regional map at a scale of 1:700K. My annotation on a FC (within GDB) is set to 12pt size. When I zoom in to a larger scale of 1:350K my annotations appear exactly the same size and are consequently tooo big! I understand one can work with map document annotation or geodatabse annotation. I've seen some posts about setting a data frame reference scale to zero (eg http://forums.arcgis.com/threads/74004-Annotation-labels-at- different-scales), which should make mxd annotations display proportionally to map scale. However cannot seem to add custom reference scale of '0' to the customized list. I'd greatly appreciate your comments on best practices or any other advices you may have! Many thanks, Magda


Convert polyline to presence absence raster in arcpy

I have a polyline that I am converting to a raster in arcpy. This is occuring within a loop and at each iteration I change the processing environment to a different area of interest. In this case it is a specific polygon (like below)               whereClause = '"FID" = ' + str(poly.FID) # Create a clause to select only the current record     arcpy.MakeFeatureLayer_management(shapefile, "currentPolygon", whereClause)             arcpy.env.extent = "currentPolygon"      At each iteration I would like to create a raster where cells containing the polyline are given a value of 1 and cells without polyline are given a 0 within the bounds of the env.extent. What is the key to creating the 0 values? Does it come from the arcpy.env.nodata parameter? I can make the conversion in my loop but cannot quite get the binary format I am envisioning.               arcpy.FeatureToRaster_conversion("roadsLayer", "VALUE", "roadsGrid.tif",)


ArcObjects 10.1 IDatabaseCompact lock file

I'm trying to automate one of task by creating code that will execute the IDatabaseCompact.Compact method to a GDB file. Everything seems to work fine but there is always a .lock file generated after the Compact method is called. I am planning to do something else after the Compact process but it errors out because of the lock file. Is there any way to close/delete the lock file? BTW, this is how my process works: first, i bind and initialize my system using: ` ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.EngineOrDesktop) _ao = New ESRI.ArcGIS.esriSystem.AoInitialize() _ao.Initialize(ESRI.ArcGIS.esriSystem.esriLicenseProductCode.esriLicenseProductCodeBasic) ` I then call my compact method:               Public Sub CompressFileGDB(gdbFilePath As String)         Dim dbCompact As IDatabaseCompact         Dim ws As IWorkspace = FileGdbWorkspaceFromPath(gdbFilePath)              If (TypeOf ws Is IDatabaseCompact) Then             dbCompact = CType(ws, IDatabaseCompact)             If (dbCompact.CanCompact) Then                 Dim didFinish As Boolean = True                 Try                     dbCompact.Compact()                 Catch ex As Exception                     didFinish = False                 Finally                     dbCompact = Nothing                     ws = Nothing                     _ao.Shutdown()                          RaiseEvent OnProcessDone(didFinish)                 End Try             End If         End If     End Sub      The compact method works, there is a significant change in the GDB file size. I also tried to set my attributes to Nothing after the process but it doesn't seem to help that much.


Merging h5 files from VIIRS to gtiff

I am trying to mosaic all the data from VIIRS of a day into a single gtiff. I've already done it with MODIS data using GDAL. The problem it seems is that the coordinates of each h5 files doesn't seem to be in the same file as the data. Which gives this as an error when I try a gdalwarp: > ERROR 1: Unable to compute a transformation between pixel/line and > georeferenced coordinates for > > > HDF5:SVI01_npp_d20140812_t0007456_e0013260_b14451_c20140812061326517212_noaa_ops.h5://All_Data/VIIRS-I1-SDR_All/Radiance. > > There is no affine transformation and no GCPs. Do you have an idea what could be done to get the localisation data and to merge them together ?