How to build tile server from Openstreetmap data for beginner?

I am a beginner at GIS and I am developing a Java Application which needs a map. (The map would specifically be of just one city in the Philippines.) I have researched on different ways to do this and I have found that I will need a tile server to put the map because I need to be able to access this without the connection of the internet. I am a beginner and most of the tutorials I have seen have been complicated and have steps that I do not know how to do yet. Does anyone know of any tutorials or can help me start creating the tile server considering that I am a beginner at this?


ArcMap Image Difference: Help interpreting/utilizing results

I'm working for the first time with ArcMap's relatively new image analysis window, and am using the "image difference" function to calculate change between two images which I have performed a supervised classification on. Each of the two images have only two types of land cover, forest and pasture; however, when I conduct the "image difference" analysis, I receive a raster with a ramp of 1 to -1. My question is how to interpret it? I.e. I'm looking to be able to symbolize where forest remains forest, forest changes to pasture, pasture remains pasture, and pasture changes to forest. I know this should be easy, and is so in ERDAS, but can't figure it out in ArcMap. Thanks in advance for any suggestions, David


Find points within a distance using MySQL

I have a mySQL table with user name, latitude and longitude of the user. I would like to get a list of user who are inside the circle or square of a given latitude and longitude with given distance. For example my input Lat= 78.3232 and Long = 65.3234 and distance = 30 miles. I would like to get the list of users who are inside 30 miles distance from the point 78.3232 and 65.3234. Is it possible to solve this with single query? Or can you give me a hint start solving this query? I am new to the geo based information.


MapInfo 12 Legend settings

Does anyone know how (if) I can set the defaults within Legend Designer? I want my rectangles for each layer to default to a 20x20 square, not a rectangle. At the moment I have to change it manually for each layer. Have now found the answer - defaults can be set using the Options>Preferences>Legend Window


MapProxy accessin by Flash Client

Where can I put the 'crossdomain.xml' file in the MapProxy virtual enviroment ? [UPDATE] [NEED TAGS for question: mod-wsgi, ogcserver too] Need to be more specific: i'm using mapproxy 1.4 in mod-wsgi. The same problem I had found in OGCServer (mod-wsgi). Where have i to put the crossdomain.xml in a mod-wsgi server like Mapproxy or OGCServer? Thanks again.


Problem with converting rasters to arrays and adding them to main array, then converting to raster via NumPyArrayToRaster : output is NoData values

I have a process that aims to loop through a list of rasters (testing with only 3) covert each raster to an array, add the array to an existing 'template' array, then save the final array back to a raster. I'm not getting errors, but all of the test output is NoData Values. Thanks for your help! * * *               #import modules     import arcpy, numpy, os, time          #set workspace     arcpy.env.workspace = r"C:/GIS/project/test_rasters"          #set snap raster environment     template = "C:/GIS/project/rast01_0"     arcpy.env.snapRaster = template          #define in raster     template_raster = arcpy.Raster(template)          #set output location     outpath = r"C:/GIS/project/out_rasters/rast01_x"          #create an array to serve as the frame for additional arrays.     template_array = arcpy.RasterToNumPyArray(template_raster)     template_array = numpy.float64(template_array)     main_array = template_array * 0          #check array type     print main_array.dtype.name     #start counter     count = 0          #get a list of rasters in workspace     rasters = arcpy.ListRasters()     #for each raster in the workspace     for raster in rasters:         print "processing: " + raster + " " + time.asctime()         #make each raster an array, add it to main raster array         array = arcpy.RasterToNumPyArray(raster)         main_array = main_array + array         #count number of raster/arrays added to the main array         count = count + 1         print count          #print final count of summed arrays     print count     #save array of sums to raster     part_sum_raster = arcpy.NumPyArrayToRaster(main_array)     part_sum_raster.save(outpath)          print"script completed:  " + time.asctime()


What is the best public geoservice for getting data about buildings?

What is the best public geoservice for getting data about buildings, which is free? Or maybe it's better to ask "does exist such a public service?" I want to add some 3d polygons to my 3d plane, which I render in WebGL project and I want to get such a service, which may help me with getting detailed information about buildings. What protocol will respond me an answer on query (WFS or another) - doesn't matter. I can't google such a service, so ask you in this topic about it.


Leaflet Legend fixed image? not SLD?

I have a style pulled from my GeoServer and have created a basic legend, with a fixed PNG. However I was wondering if it is possible to have this legend be pulled from the layers SLD? so that if the SLD is changed the legend will update too? **This is the Legend code**                   var legend = L.control({position: 'bottomright'});              legend.onAdd = function (map) {         var div = L.DomUtil.create('div', 'info legend');                  div.innerHTML +=             '<img src="SymbolDelete.png" alt="legend" width="134" height="147">';              return div;         };              legend.addTo(map);


calculate the needed space for a raster pyramide withqgis

how can i calculate (or where can I find information to calculate) the required disk space for a raster map of 36GB which should be in a pyramide of 10 levels ? Regards, D3


Strange black pixel on edge when generating with gdaldem -hillshade

I'm getting a strange result when I'm generating an hillshade with the gdaldem hillshade command. Here is my command (see the compute_edges parameter):                   /Library/Frameworks/GDAL.framework/Versions/1.10/Programs/gdaldem hillshade -compute_edges -alt 90 -z 8 -s 111120 /Users/jflegendre/Documents/GDAL_PROJECTS/MP/01-DEM_MERGED/out.tiff /Users/jflegendre/Documents/GDAL_PROJECTS/MP/02-HILLSHADED_DEM/hillshaded_dem.tiff      Here is a section of the output raster: ![enter image description here](http://i.stack.imgur.com/92Qph.png) I've also tried to clip the result with a perimeter shapefile, but there still had some black pixels. I've tried too the nearblack gdal command without effect. The image that you can see in this post is the result of the nearblack command. So I'm stuck actually. Can someone help me on this? Regards


giving a java program access to network analyst calculations

I have a fire department simulator written in Java that simulates a year of fire department responses. There is a Java method/function that calculates time between two coordinates using a fairly simple equation that assumes a gridded street system. I am trying to improve the simulation results by figuring out a way in which the Java program could pass out start/end coordinates and have ArcGIS / Network Analyst calculate and return the drive time required. Is there any way to build this interaction between a Java program and ArcGIS for Desktop (or Server)?


Converting geojson to wkt with OpenLayers

I was just wondering if there was a good way to convert GeoJson data to WKT data using OpenLayers. The method I've tried is to create a Feature.Vector with the GeoJson and then tried using WKT.write(feature) to get the WKT but it's not working, I'm obviously missing something.               var geojson_format = new OpenLayers.Format.GeoJSON();     var testFeature = geojson_format.read(val);     var wkt = new OpenLayers.Format.WKT(wkt_options);     wkt.write(testFeature);      Could anybody point me in the right direction? Thanks in advance My GeoJson is               {      "type": "FeatureCollection",         "features":          [             {"type":"Feature", "geometry": {"type":"MultiPolygon","coordinates":[[[[-0.12072212703174,51.51899157882951],[-0.119842362474856,51.51708218165009],[-0.117203068804201,51.51314296254295],[-0.117803883623537,51.51300942372214],[-0.118125748705324,51.51283582266979],[-0.118533444475588,51.51254203476644],[-0.118855309557375,51.51192774484595],[-0.118898224901614,51.51126002901546],[-0.117846798967776,51.50983108425668],[-0.119220089983401,51.50931024277883],[-0.120335888933596,51.508549002215815],[-0.121151280474123,51.5077610380613],[-0.122095418047365,51.50653232100095],[-0.126429867815432,51.50729359525858],[-0.127266717028078,51.507440506370465],[-0.127266717028078,51.507801104364084],[-0.127266717028078,51.508094922841394],[-0.127331090044436,51.50848222612105],[-0.127567124437746,51.50939037262451],[-0.128146481584963,51.509764310040985],[-0.128511262010989,51.51021837277772],[-0.128597092699465,51.51120661132621],[-0.128597092699465,51.51191439062526],[-0.129004788469729,51.51260880491084],[-0.129584145616946,51.51374388239237],[-0.130120587419924,51.51494569831],[-0.130614113878664,51.51653471734371],[-0.126794648241457,51.51701541806259],[-0.125507187914309,51.51718900318654],[-0.121001076769289,51.519178508517115],[-0.12072212703174,51.51899157882951]]]]}}         ]     }


How to display KML image overlays in OpenLayers?

I am working on displaying Ground Overlays on OpenLayers by parsing KML manually. To do so, I was trying to add an image on top of Google Map by looking at GroundOverlay section from code.google.com/apis/kml/documentation/KML_Samples.kml file.               <GroundOverlay>           <name>Large-scale overlay on terrain</name>           <description>Overlay shows Mount Etna erupting                on July 13th, 2001.</description>           <Icon>             <href>http://code.google.com/apis/kml/documentation/etna.jpg</href>           </Icon>           <LatLonBox>             <north>37.91904192681665</north>             <south>37.46543388598137</south>             <east>15.35832653742206</east>             <west>14.60128369746704</west>             <rotation>-0.1556640799496235</rotation>           </LatLonBox>         </GroundOverlay>      On Google maps it looks like this Now following is the code I am playing with to display the image in a similar fashion on top of Google Maps layer in OpenLayers:                 //-------create base map------------------------------         map = new OpenLayers.Map('map',{             projection: new OpenLayers.Projection("EPSG:900913"),             displayProjection: new OpenLayers.Projection("EPSG:4326")         });              var gmap = new OpenLayers.Layer.Google(             "Google Streets", // the default             {                 numZoomLevels: 20             }             );              map.addLayer(gmap);                        var point = new OpenLayers.LonLat( 14.93,37.70);          var zoomLevel=7;         point.transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject());          map.setCenter(point, zoomLevel);                        map.addControl( new OpenLayers.Control.LayerSwitcher() );         map.addControl(new OpenLayers.Control.MousePosition());                                  //-------add an image------------------------------         var proj = new OpenLayers.Projection("EPSG:4326");         var bounds = new OpenLayers.Bounds(37.91904192681665, 37.46543388598137, 15.35832653742206, 14.60128369746704)         bounds.transform(proj, map.getProjectionObject());              var graphic = new OpenLayers.Layer.Image(             'Large-scale overlay on terrain',             'http://code.google.com/apis/kml/documentation/etna.jpg',             bounds ,             new OpenLayers.Size(453, 339) ,             {                 'opacity': 0.5,                  'isBaseLayer': false,                  'visibility': true,                 projection: new OpenLayers.Projection("EPSG:900913")             }                  );         map.addLayer(graphic);         Now with above code, the layer name gets added to the layer switcher control, but no image is displayed. Could you please see if I am setting the projection, size and other parameters correctly? Also how do an image rotation?


Grass 7 voronoi vertices error

I tried the voronoi diagram for area function and got the message "ERROR: Found 0 vertices" - any suggestion ?


How to create leaflet legend for points

I have points like this in a leaflet map. ![enter image description here](http://i.stack.imgur.com/Atppi.png) The points come originally from a GeoJSON file and I used `L.circleMarker` to convert them to circles. How can I create a legend for these points? Based on the Interactive Choropleth Map Example I was able to generate a legend like this: ![enter image description here](http://i.stack.imgur.com/AgCIV.png) The code I used is this:               var legend = L.control({position: 'bottomleft'});          legend.onAdd = function (map) {            var div = L.DomUtil.create('div', 'info legend');                        categories = ['STX','HHX','HF','STX/HF'];              for (var i = 0; i < categories.length; i++) {             div.innerHTML +=                 ' ' +                  (categories[i] ? categories[i] + '
' : '+');         }              return div;      But I like to also match the form (circles) to the legend, and not only the color.


How to access M-values in QGIS?

I am working with Linear Reference Systems and I know is very easy to get M coordinate (M-value) from a shapefile in ArcGIS. But, how to get the M-value in QGis? If you have doubts about my issue, please look how ArcGIS works with M-value: http://resources.arcgis.com/en/help/main/10.1/index.html#//003900000006000000


What's the conversion coefficient between millimeters and QSize units in Qgis?

What is the conversion coefficient between millimeters and QSize units in Qgis ? What i have in mind is to set the paper size (via setPaperSize()), knowing the size of the composed image. That is why i need such a conversion factor.


Unable to make infowindow work in CartoDB runtime layer

I'm trying to personalize a layer created with CartoDB. The layer is created at runtime and the problem is that I cannot make work even easy things like custom infowindow or legends or click interactions. No errors shown in the js console. I tried with other layers (the ones used with the CartoDB tutorial) and those are working. What it's wrong with mine? Here's the code I'm using:               function main() {           var map;           var urbino = new google.maps.LatLng(43.7292108173, 12.6530746836);           var mapOptions = {             zoom: 15,             center: urbino,             mapTypeId: google.maps.MapTypeId.ROADMAP           };           map = new google.maps.Map(document.getElementById('map'),  mapOptions);       cartodb.createLayer(map, {         user_name: 'my_user',         type: 'cartodb',         infowindow: true,         legends: true,         sublayers: [{           sql: "SELECT * FROM raw_output",           cartocss: '#raw_output { marker-opacity: 0.9;}'           }]     })     .addTo(map)     .on('done', function(layer) {        var sublayer = layer.getSubLayer(0);             sublayer.infowindow.set('template', $('#infowindow_template').html());             sublayer.on('featureClick', function(e, pos, latlng, data) {           alert("Hey! You clicked " + data.cartodb_id);         });       }).on('error', function() {         console.log("some error occurred");       });       } Seems that using runtime layers is not that flexible as using predefined visualizations with the UI...Am I wrong?


Resampling with Python console (QGIS): number of parameters

I am trying to resample two raster layers with Python console in QGIS with this code:               outputs_0=Processing.runAlgorithm("saga:resampling", 'G:/DOCTORAT/2014/Incendis/Dades/LST/LST_TERRA/Tiff/2012/UTM30N/2012153_day.tif', True, 0, 0, 0, "-81084.51, 1138915.49, 3972094.6, 4861094.6", 1000.0, 'G:/DOCTORAT/2014/Incendis/Dades/LST/LST_TERRA/Tiff/2012/FINALS/2012153_day_FINAL.tif')      I got this: > Error: Wrong number of parameters However, it seems to contain all needed parameters:               INPUT <ParameterRaster>     KEEP_TYPE <ParameterBoolean>     TARGET <ParameterSelection>     SCALE_UP_METHOD <ParameterSelection>     SCALE_DOWN_METHOD <ParameterSelection>     OUTPUT_EXTENT <ParameterExtent>     USER_SIZE <ParameterNumber>     USER_GRID <OutputRaster>      Someone could please help me? Thanks!


Changing original source projection

I am attempting to match up 2 raster layers, both a OS survey map and some independent survey data. The map I know to be in the correct position, However the survey data shows a layer extent of (layer original source projection)- 0.0000000000000000,-5500.0000000000000000 : 8500.0000000000000000,0.0000000000000000 Which is ofcourse equal to its dimensions but placed on the base line of the CRS. How do I manually change the coordinates to re-project the data in the correct position? Rookie question I know, but any help would be appreciated.


ExtJS datagrid with openlayers features

I need to populate a extjs datagrid with a openlayers features. Can anyone help me with a source code example?


UpdateGeometrySRID and ST_Transform are the same thing?

UpdateGeometrySRID actually transforms the coordinate system of my data? For in the PostGIS documentation it appears the trim ST_Transform (Returns a new geometry with its coordinates transformed to the SRID referenced by the integer parameter.). What is the difference between these functions? Another thing the sql below really redesigns same data? So no need to use UpdateGeometrySRID               ALTER TABLE lotacao ALTER COLUMN geom TYPE geometry (MULTILINESTRING, 101020) USING ST_Transform (ST_SetSRID(geom, 101010), 101020);


TreeLayer GeoExt2

I have a map with several layers and I want to have each layer in separate folder below the root. Can anyone help me with js source code to do that? (geoext2 documentation only separate layers between base layers and overlay layers).


Delete a line between two polygons so I have one polygon

I have two polygons that are coincident. I want to merge them in to one polygon and delete the line that is between the two polygons; the merge didn't do it; it kept the line in between them. How do I get rid of this stupid line in ArcGIS 10.


How to merge polygons into a single item where an attribute is same?

I have a shapefile of a area .It consists of list of fields in which sub locality is also a field.Under the sub locality field all the areas are common say for example: perungudi,perungudi,perungudi. My problem when I export this shapefile in Post Gis in the sublocality field each attribute is represented as a separate shapefile. So I want all the attributes in the sublocality field to have common boundary. How can I do this?


Distance between Polygone and Point

I am working on a query to find the closest point between polygone and point Can I use this operator to calculate the distance:               SELECT a.point, b.poly FROM tableA a, tableB b      WHERE ST_Distance_Sphere( ST_Transform(a.point,4269), ST_Transform(b.poly,4269)) < 50      ORDER BY a.point<-> b.poly     LIMIT 1;      But it run and take a very long time without results or error message.


DotSpatial.Projections Vs. ProjNET4GeoAPI

DEAR PEOPLE FROM THE FUTURE: Here's what we've figured out so far… I have been facing the issue of transform coordinates from a custom spatial reference to a well known spatial reference (let's say WGS84). To do that using ArcObjects is quite straigthfoward, but I am trying to do it without that library. I must use some library designed for .NET so making a little research I found **DotSpatial.Projections** and **ProjNet**. Both of these open source alternatives lack extensive documentation, so some effort is required to understand the process of implementation, although is not all that difficult to. My question is: In your experience, Which one is better? taking into account ease of use, performance, maintainability (of the library), and support. Any other suggestion is welcome.


How to create a QGIS Action which loads a raster?

I am following an article here:Actions HowTo , specifically the piece about an action to load a raster:               Python type         Add Raster Layer                 qgis.utils.iface.addRasterLayer('PATH_FILE','NAME_FILE_IN_QGIS')       Can anyone advise what i need to do to open a raster based on a value in the vector table (essentially I have a grid with a field containing a field of Grid_Ref for all items where a raster image exists). I have been fiddling with the example above and got as far as an Action of Type Python, Named OpenRaster, with the following action:               qgis.utils.iface.addRasterLayer('E:\Plot Sheet Devt\1974-1984\1250k\' + "Grid_Ref" + '.TIF',"Grid_Ref")       The Python error that I am getting on running this is > File "", line 1 qgis.utils.iface.addRasterLayer('E:\Plot Sheet > Devt\1974-1984\1250k\' + "Grid_Ref" + '.TIF',"Grid_Ref") ^ > > SyntaxError: EOL while scanning string literal How should I go about forming the open 'PATH_FILE' and 'NAME_FILE_IN_QGIS' so that it picks the information from the Grid_Ref field in the underlying vector data? As always, thanks for your time Mark


ArcGIS - Cell Content Deletion

I have a really simple question I can't find the answer to. I'm looking to delete a range of values from an attribute table in ArcGIS 10. I'm looking for a quick way to delete about 3000 records. The idea is to have some blank records so when I do a dissolve in order to form polygons, the 3000 tiny polygons are no longer there and only larger polygons are dissolved to form bigger polygons on the basis of the same column contents. So I basically have 2 questions:   1. How do I delete a range of 3000 records from the attribute table, by FID range or any other efficient method?   2. Will blank cell contents prevent records from being included in a dissolve? (Or 3., is there any way of creating a conditional dissolve which avoids a range of records according to FID/other column value?)


How to join CSV data to SHP without ArcGIS?

I'd like to create a chloropleth map displaying quantitative data for an upcoming event. Using TileMill, MapBox. I am having trouble joining my data to a .shp because the #'s correspond to COUNTY level data. I have the .shp for every county but have had absolutely no luck trying to georeference it or join it to the data without ArcGIS or a comparable program (on a Mac and work won't let me DL any additional programs)! Or, should I try and convert my .shp to .csv to manually join?


getting error while reading shape file (The following locker still has a lock)?

I am working with reading and writing shapefiles. I can read and write a shapefile but while reading it the warning message below is coming in the console, no error is coming. reading > 29 Aug, 2013 12:03:08 PM org.geotools.data.shapefile.ShpFiles > logCurrentLockers SEVERE: The following locker still has a lock: read on > file:/C:/Users/Administrator/Desktop/irumbaishp/irumbaishp/Irumbai_Lands.shp > by org.geotools.data.shapefile.shp.ShapefileReader 29 Aug, 2013 12:03:08 PM > org.geotools.data.shapefile.ShpFiles logCurrentLockers SEVERE: The following > locker still has a lock: read on > file:/C:/Users/Administrator/Desktop/irumbaishp/irumbaishp/Irumbai_Lands.shx > by org.geotools.data.shapefile.shp.IndexFile 29 Aug, 2013 12:03:08 PM > org.geotools.data.shapefile.ShpFiles logCurrentLockers SEVERE: The following > locker still has a lock: read on > file:/C:/Users/Administrator/Desktop/irumbaishp/irumbaishp/Irumbai_Lands.dbf > by org.geotools.data.shapefile.dbf.DbaseFileReader Stopped reading 29 Aug, > 2013 12:03:08 PM org.geotools.data.shapefile.ShpFiles logCurrentLockers > SEVERE: The following locker still has a lock: read on > file:/C:/Users/Administrator/Desktop/irumbaishp/irumbaishp/Irumbai_Lands.shp > by org.geotools.data.shapefile.shp.ShapefileReader 29 Aug, 2013 12:03:08 PM > org.geotools.data.shapefile.ShpFiles logCurrentLockers SEVERE: The following > locker still has a lock: read on > file:/C:/Users/Administrator/Desktop/irumbaishp/irumbaishp/Irumbai_Lands.shx > by org.geotools.data.shapefile.shp.IndexFile 29 Aug, 2013 12:03:08 PM > org.geotools.data.shapefile.ShpFiles logCurrentLockers SEVERE: The following > locker still has a lock: read on > file:/C:/Users/Administrator/Desktop/irumbaishp/irumbaishp/Irumbai_Lands.dbf > by org.geotools.data.shapefile.dbf.DbaseFileReader Stopped reading Stopped > reading 29 Aug, 2013 12:03:08 PM org.geotools.data.shapefile.ShpFiles > logCurrentLockers SEVERE: The following locker still has a lock: read on > file:/C:/Users/Administrator/Desktop/irumbaishp/irumbaishp/Irumbai_Lands.shp > by org.geotools.data.shapefile.shp.ShapefileReader 29 Aug, 2013 12:03:08 PM > org.geotools.data.shapefile.ShpFiles logCurrentLockers SEVERE: The following > locker still has a lock: read on > file:/C:/Users/Administrator/Desktop/irumbaishp/irumbaishp/Irumbai_Lands.shx > by org.geotools.data.shapefile.shp.IndexFile 29 Aug, 2013 12:03:08 PM > org.geotools.data.shapefile.ShpFiles logCurrentLockers SEVERE: The following > locker still has a lock: read on > file:/C:/Users/Administrator/Desktop/irumbaishp/irumbaishp/Irumbai_Lands.dbf > by org.geotools.data.shapefile.dbf.DbaseFileReader Stopped reading Stopped and the code to read the shapefile is:               import java.io.File;          import org.geotools.data.shapefile.ShapefileDataStore;     import org.geotools.data.simple.SimpleFeatureCollection;     import org.geotools.data.simple.SimpleFeatureIterator;     import org.geotools.data.simple.SimpleFeatureSource;          public class GeoOpen      {              private static SimpleFeatureIterator simpleFeatureIterator;         private static String fileName = "C:\\Users\\Administrator\\Desktop\\irumbaishp\\irumbaishp\\Irumbai_Lands.shp";         public static boolean openShapeFile() throws Exception         {             File dataFile = new File(fileName);             dataFile.setReadOnly();             ShapefileDataStore store = new ShapefileDataStore(dataFile.toURL());             SimpleFeatureSource source = store.getFeatureSource();             SimpleFeatureCollection featureCollection = source.getFeatures();             simpleFeatureIterator = featureCollection.features();             return true;         }         public static  boolean iterate()         {             while(simpleFeatureIterator.hasNext())             {                 simpleFeatureIterator.next();             }              simpleFeatureIterator.close();             return true;         }         public static void main(String[] args) {             try {                 for(int i=0;i<5;i++){                 System.out.println("reading");                 GeoOpen.openShapeFile();                 GeoOpen.iterate();                 System.out.println("Stopped");                 }                  } catch (Exception e) {                 // TODO Auto-generated catch block                 e.printStackTrace();             }         }     }


From PostgreSQL to QGIS

I have conected to PostgreSQL and imported the layer to QGIS. The names of columns are written using English letters. Can the names of columns be automatically renamed using another language?


Count of raster cells as variable in arcgis 10 modelbuilder

I want to use a cell count of an integer raster as a variable in Arcgis 10 modelbuilder (and later in a python script), but can't seem to find how to access this information. Is there a (python) function that will return a cell count for a particular value? eg. something like               count([raster], value)?       Or how do I access the count column for a particular value in the raster table? Many thanks


ST_GeomFromText in Where Clause SQL

Can I use `ST_Geom_from_Text` in a where clause? Specifically:               Select column from schema.table where  ST_DWithin( ST_GeomFromText('POLYGON((-71.1776585052917 42.3902909739571,-71.1776820268866 42.3903701743239,-71.1776063012595 42.3903825660754,-71.1775826583081 42.3903033653531,-71.1776585052917 42.3902909739571))'), the_geom)      Postgre seems to throw an error at the bracket right after ST_GeomFromText . Here i am trying to find all the points in the table inside the given polygon - table has geometry column the_geom .


OpenLayers vector layer remove all features

I have a map (using OpenLayers) and a vector layer containing features(points). Sometimes I need to remove all features from the vector layer. When I use               vectorLayer.removeAllFeatures()      then it removes all features from only one zoom level. When I change zoom level, I see all my features again. How can I remove all features from all zoom levels?


How to deal Leaflet map control checkboxes?

I add some geojson layers to the map control once a layer is loaded and the control can show all the layer names. But I notice that all the checkboxes are unchecked by default. So that once I click the control to uncollapse it, all the layers disappear. And I have to check them one by one to display them again. The code is like:               ctrl = L.control.layers([aBaseLayer]); ctrl.addOverlay(aGeoJsonLayer, 'ageojsonlayer');       Then I can control the aGeoJsonLayer, but unlike the aBaseLayer, the aGeoJsonLayer is not checked by default in the control panel. So every time after the layer is loaded, when I click the control, the layer will be gone until I check it in the control panel. Any way to fix this?


Why IEnumFeature in ArcObjects returns duplicate features?

During development of ArcGis AddIn I've found strange behaviour of MapSelection when there are a lot of selected features. When I tryed to get selected features I've received duplicate features. So the code below throws an exception "Key already exist" . I have no idea why this happens and how to fix it. Can anybody hekp me?                 IEnumFeature enumFeat = (IEnumFeature) ArcMap.Document.FocusMap.FeatureSelection;       IEnumFeatureSetup enumSetup = (IEnumFeatureSetup)enumFeat;       enumSetup.AllFields = true;       enumFeat.Reset();       IDictionary<int, int> dicIds = new Dictionary<int, int>();       while ((feat = enumFeat.Next()) != null)       {         dicIds.Add(feat.OID, num);       }


How to filter or query data in GRASS?

I have a PostGIS dataset with just over 2 million rows. Each row has a PostGIS geometry point value and several attributes. I'd like to do some analysis on certain subsets of the data, but I can't figure this out. Is there a way of querying data once you have it in GRASS GIS? Alternately, is it possible to leave the attribute data back in Postgres, and then do queries or filters based on this data? For example, suppose that my 2+ million rows had a boolean column **X**. How would I run GRASS analysis on the entire dataset, then immediately do the same analysis on only the data where this column is set to **false**?


ESRI Flex API - Modify Style of Draw Toolbar Tooltips

Can anyone tell me how I can change the styling of the Draw Toolbar's tooltips in the ESRI Flex API? If I use apply the style shown below - ALL of the application's tooltips inherit this style. I am trying to target only the Draw toolbar here. I have also tried intercepting the TOOL_TIP_CREATE event of various components with no luck. That event does not fire on the map, at least when Draw toolbar tips are shown. I can't figure out how to register that listener on the toolbar itself.               map.addEventListener(ToolTipEvent.TOOL_TIP_CREATE,onToolTipCreated);          <fx:Style>             @namespace mx "library://ns.adobe.com/flex/mx";               mx|ToolTip             {                 backgroundColor: black;                 backgroundAlpha: 1.0;                 cornerRadius: 0;                 color: white;             }         </fx:Style


How to display features one by one in Map Book?

I'm using "Data Driven Pages" Tool to create a map book in ArcMap. I want to display buffer circles **one by one** in each page, but the "Data Driven Pages" Tool displays all features around it. How can I display one buffer circle without others in one page? Can ArcMap do that? Or I need to learn ArcPy? What I get: ![enter image description here](http://i.stack.imgur.com/jcUP5.png) What I want: ![enter image description here](http://i.stack.imgur.com/eJOQy.png)


Issues with osgeo - qgis.core and arcpy modules

Is it possible to have the python shell from either qgis or argis to load (import) both qgis.core and arcpy? I am developing a metadata creation tool and have completed the core functionality using arcpy for formats that arcgis reads but want it to handle .tab files as well without having to convert the files to shp and then analyse them as in this post How to read MapInfo .tab files in ArcPy? === Thanks to RK I got some of this working (see code below) BUT I can't figure out how to get the projection and other important info...http://www.gis.usu.edu/~chrisg/python/2009/docs/ogr.pdf includes a GetSpatialReference, GetGeometryType( self ) and GetGeometryName( self ):but how do you use them?               import osgeo, os     from osgeo import ogr     os.chdir(r'L:\\Data_Admin\\QA\\Metadata_python_toolset\\test\\Local_Govt\\TRC\\TAB')     os.getcwd()          driver = ogr.GetDriverByName('MapInfo File')     fn='trc_boundary.tab'     dataSource=driver.Open(fn,0)     layer = dataSource.GetLayer(0)     feature = layer.GetFeature(0)     extent=layer.GetExtent()     numFeatures=layer.GetFeatureCount()     #id = feature.GetFieldAsString('id') # this didn't work     geometry = feature.GetGeometryRef()     x=geometry.GetX()               #delete datasets from memory     #feature.Destroy()     #dataSource.Destroy()      And is there a tool similar to arcpy.ListFeatureClasses() if not I guess we can use glob as anyway for ogr the driver has to be specified.


How can i use alias of field insteed of field name in arcgis silverlight API?

I developed a webgis using ArcGIS silverlight API . I'm using ArcGIS 10 and silverlight API 3.1 .I want to show alias name insteed of field name of a feature class. How can i use alias names in my webgis? Thanks for advance


QGIS, Installation on Linux Mint 15 Mate

I've just tried to install the latest version of QGIS on Linux Mint 15 Mate using 'sudo apt-get update' and 'sudo apt-get install qgis'. However, QGIS gives me the error message 'Couldn't load PyQGIS. Python support will be disabled.'. Also, the installed QGIS version turns out to be 1.7.5 while I would prefer 1.8.0 or even 2.0. I am pretty new to the world of Linux in general, so any advice how to get the latest QGIS version including a working Python plugin would be highly appreciated. Best regards, T.


I'm not able to save edited layer connected via PostGIS in QGIS

I have project and i was doing editing layers in `QGIS`. These layers are connected in QGIS via `PostGIS`. 1 layer of the 4 layers was saved correctly but other layers gave me error message. Error message looks like this. Thanks for advices: > ERROR: 15 geometries not changed. ERROR: LineString must have at least two > points CONTEXT: SQL function "st_geomfromwkb" statement 1


generate 1-18 simple worldmap with mapnik

I have postgresql with postgis and mapnik, I need to generate a tiled world map with only country contours and country name that are displayed at all zoom levels, no extra info. How can I do it without using osm2pgsql importing all the planet.osm (20gb)? I generate a map using for example cyprus.osm but the area of Cyprus is now of course filled with additional information not required that slow down the generation process. If i start the generate_tiles.py utility without use osm2pgsql I get many errors.. there is nothing like a void osm file? How can I configure the map style to display only country contours and name, at all zoom levels? Thanks very much!


ESRI - add graphics from a different spatialReference

I want to know if I'm approaching this incorrectly. We are attempting to create an esri-based map where we add graphics to a map thru the javascript API. The points that we're adding are lat/lng coords(wkid:4326). Part of our requirements are to be able to show these items regardless of the spatialreference of the map. So we tried to use the geometry service that esri provides to project the 4326 coords to the map spatialreference. That all works fine, unless we have a lot of points to project. If the geometry service is fed too many points at a time it returns Error:"timeout exceeded". We've split out the amount we give the service and called it iteratively, but it also errors out if we call it too many times too quickly. So we've tried to spread the interval between calls to limit that. The more I do this, the more I feel like I'm digging myself into a deep hole.   1. Should we be approaching this problem in another way? If so, any suggestions?    2. Should we homebrew our own geometry projection service to bypass the limitations we notice with the esri implementation?      1. If so, any resources that would help with the required algorithms?


Comparison of open data portal solutions

For many organizations, such as local/county/state governments, providing public access to GIS data is a challenge. Simply knowing what data is **available** , what it is, who owns and maintains it, and where to get it is probably the most immediate challenge. Therefore a GIS data inventory is a necessity. Of course, creating one is one thing, getting people to maintain it (and assume responsibility for their data) it is quite another. Therefore **getting buy-in** from internal stakeholders is also very important. Another important consideration is a solution's support for **metadata**. If the data cannot be described, it is almost useless. With some solutions there may be limited support for metadata in the form of a limited number of proprietary fields. Support for metadata in its full and _original_ form seems to be rare. There may be **limitations** on the size, number of records/attributes, field lengths, or the geometric complexity of common GIS data, such as address points or parcel data that might make some solutions unusable. Often, the sheer size of some types of data (e.g. LiDAR, aerial imagery) makes it difficult or impossible to host them over the internet in their raw form, and instead they must be delivered via physical media (e.g. hard drives). At best, these large files may be hosted on something like an FTP server or Dropbox/Box, but it may be quite costly to do so. Additionally, in many implementations, the **spatial nature** of the data may not considered to be important - or considered at all - making finding, viewing and using spatial data _spatially_ difficult or impossible. Things like being able to **symbolize** the data in any useful way may be nonexistent. Lastly, **keeping the data up-to-date** is vital. If there is no automated way to update data then the whole thing becomes unworkable for non-trivial amounts of data. ### So with that out of the way, the **main question** is:   * **What open data portal solutions are available and how do they compare?** ### Side questions:   * What are the _most important_ considerations when deciding on an open data portal solution?   * Are there scenarios where using _more than one_ portal is beneficial (and cost-effective)?   * Can spatial _and_ non-spatial data be successfully integrated into the same portal?   * Are there any examples of open data portal _implementations_ you would consider to be successful or _exemplary_?     * A list of some implementations is in List of US government free GIS data online as well as the Wikipedia article on geoportals. ### Addendum:   * A list of portal solutions that we are currently evaluating:     * ArcGIS Online     * ArcGIS Open Data     * Portal for ArcGIS Server (on-premises)     * Socrata and Mondara     * Google Maps Engine and Gallery   * Other portals we haven't yet considered:     * DataHub     * CKAN     * DKAN     * OpenGeoportal   * Not really portals but work well for serving flat files:     * Dropbox     * Box     * FTP (on-premises)   * Rolling your own, either using hosted storage/servers or on-premises In our case, because we have an ESRI ELA and have an ArcGIS-based spatial data infrastructure, it seems quite likely that at least one of the ArcGIS solutions will be selected. Personally, I'd rather see us use more open source software, but it seems unlikely we'd be able to put something together that could compete with ESRI's offerings, at least not without a paradigm shift in the way people use GIS in our organization. However, I hope that this question becomes a useful resource to anyone looking to improve access to public data.


How to query which features of all vector layers intersect with a given bounds?

I am writing a Openlayers map app, and wondering whether there's a better practice to query which features of which vector layers intersect with a given bounds.. It's certainly not a good idea to iterate features... thanks for any replies! **UPDATE** In this scenario, vector layers are already added to map, so I assume I don't need to request features from remote GeoServer again... then'll just do intersect check on the fly


How to concatenate geometries?

I use the sql below it returns me several geom_way:               SELECT St_astext(geom)FROM pgr_fromAtoB('ways',-51.1995,-30.0487604,-51.2157942,-30.0469069);      Return:               LINESTRING(-51.1995 -30.0487604,-51.2010166 -30.0495917)     LINESTRING(-51.2010166 -30.0495917,-51.2025687 -30.0503647)     LINESTRING(-51.2025687 -30.0503647,-51.2038761 -30.0510814)     LINESTRING(-51.2038761 -30.0510814,-51.2052346 -30.0517926)     LINESTRING(-51.2052346 -30.0517926,-51.2053382 -30.0517299,-51.2055086 -30.0514995)     LINESTRING(-51.2055086 -30.0514995,-51.2065542 -30.052029)     LINESTRING(-51.2065542 -30.052029,-51.2070887 -30.0518558,-51.2074272 -30.0517254)     LINESTRING(-51.2074272 -30.0517254,-51.2081763 -30.0514558)     LINESTRING(-51.2081763 -30.0514558,-51.208337 -30.0513539,-51.20844 -30.0512648,-51.2085687 -30.0511236,-51.2088256 -30.0507909,-51.2090106 -30.0505536)     LINESTRING(-51.2090106 -30.0505536,-51.2098613 -30.0494869,-51.2100104 -30.0494252)     LINESTRING(-51.2100104 -30.0494252,-51.2102327 -30.0494958,-51.2108592 -30.0498549)     LINESTRING(-51.2108592 -30.0498549,-51.2116327 -30.0494558)     LINESTRING(-51.2116327 -30.0494558,-51.2130232 -30.0486757)     LINESTRING(-51.2130232 -30.0486757,-51.2133473 -30.048497)     LINESTRING(-51.2133473 -30.048497,-51.2134741 -30.0478809,-51.2135209 -30.0477931)     LINESTRING(-51.2135209 -30.0477931,-51.2136382 -30.0478068)     LINESTRING(-51.2136382 -30.0478068,-51.2136545 -30.0477302,-51.2136611 -30.0476998)     LINESTRING(-51.2136611 -30.0476998,-51.2137138 -30.047454)     LINESTRING(-51.2137138 -30.047454,-51.2137818 -30.047341)     LINESTRING(-51.2137818 -30.047341,-51.213891 -30.0473541,-51.2147429 -30.0474634)     LINESTRING(-51.2147429 -30.0474634,-51.214929 -30.0467988)     LINESTRING(-51.214929 -30.0467988,-51.2157942 -30.0469069)      I try:               SELECT ST_Union(St_astext(geom))FROM pgr_fromAtoB('ways',-51.1995,-30.0487604,-51.2157942,-30.0469069);      But returned a geometry .. I need the lat / long               010500000016000000010200000002000000A8C64B37899949C00257C38F7B0C3EC0007A75E9BA9949C02EA7A90AB20C3EC0010200000002000000BCD86AC5ED9949C0735F73B3E40C3EC0D0F7AE9C189A49C0146FAEAB130D3EC001020000000300000038C2FDDBC09A49C0F0B1AA14F10C3EC018192EBCDC9A49C09714692CAB0C3EC0F2E8EB9EE19A49C028994121A70C3EC0010200000002000000007A75E9BA9949C02EA7A90AB20C3EC0BCD86AC5ED9949C0735F73B3E40C3EC001020000000....


Which data format typically displays fastest in ArcMap?

My organization is working on an application running on ArcGIS Engine. Previous versions of the application used primarily Shapefiles for displaying roads, parcels, buildings, etc. Since I was taught to avoid Shapefiles when managing data at my college job, I suggested moving to file geodatabases. Esri claims file geodatabases are optimized for performance and storage. My co-worker remembers hearing that Shapefiles usually draw faster. I didn't come across an article directly talking about this topic, so I thought I would ask the community. I'm leaning towards file geodatabases, but it would be nice to know if I'm missing out on anything that Shapefiles offer.


How to match two feature classes with same geography and use part of the name of one to name the other

So I have a polygon feature classes with unique identifying names to them that I want to use to rename some other feature classes that are of the point feature type and have the same geography of one of the matching polygon feature classes. Basically the points from the second feature class fit within the polygon feature class. The point feature class has no name identify to it so I would like to change that and add at least part of the name of the polygon feature class to the name based on that fact they share the same geography. I was thinking I could use the Select by Location tool but the problem is I basically just have a bunch of unnamed point feature classes in a folder so it's not like I can select individual feature classes. So some how I need to iterate thru all point feature classes and rename them based on the polygon feature class they match up to. I'm guessing I may use Arcpy to do this. Any help or direction would be appreciated.


How to SUM field and then insert into NULL column?

I am only in the beginning stages of learning Python. I have a column, 'QUANTITY_SOLID', that I want to take the sum of all of its rows. I understand I can do this with 'SUMMARY_STATISTICS', but i'm not trying to create another entire table nor do anything other than simply SUM up that column. Once I have it summed up, I want to insert the sum into a new NULL field that I have created - I am attempting to do this via the 'CALCULATE_FIELD' tool. ![QUANTITY_SOLID](http://i.stack.imgur.com/KzLZe.jpg) ![QUANTITY_SOLID_SUM](http://i.stack.imgur.com/Npw20.jpg) ![CALCULATE_FIELD](http://i.stack.imgur.com/kYKTZ.jpg) Any helpful suggestions on where to go from here would be greatly appreciated, thank you!


How to turn on all fields before appending?

I'm using append on model builder, no test schema type. In order that field will match they need to be at the same order, **and visble**. How can I turn on all fields of input layer before appending inside model builder ?


Can the units of the measure tool in QGIS be changed?

All, I'm trying to do some error-checking with some rasters I'm creating, and want to measure line distances on the map in feet, rather than meters - which is what the measure line tool seems to be 'stuck' at. Thanks! -mb


ST_transform postgis

SQL within that zone is a point               SELECT         "public".zona.zts     FROM         "public".zona     WHERE         ST_Within (             ST_Transform (                 ST_GeomFromText (                     'POINT(-30.033514 -51.226828)',                     4326                 ),                 3857             ),             zona.geom         );      I tested in a single step and in separate steps. But the result is always no record. This pair of coordinates of the point I'm getting via google maps api in a single page geocode addresses, this is my geocode:               <!DOCTYPE html>                     <meta name="viewport" content="initial-scale=1.0, user-scalable=no">         <meta charset="utf-8">         <title>Google Maps JavaScript API v3 Example: Geocoding Simple</title>         <link href="https://developers.google.com/maps/documentation/javascript/examples/default.css" rel="stylesheet">
           <input id="address" type="textbox" style="width:60%" value="Rua Joao Neves da Fontoura,7-Porto Alegre">           <input type="button" value="Geocode" onclick="codeAddress()">           <input type="text" id="lat"/>           <input type="text" id="lng"/>

                  She gives me coordinates in decimal degrees and my postgis table is in UTM EPSG: 3857 how can I do this conversion? The way I did in the above sql does not work. Out of curiosity I have sinned a point of a polygon that forms a zone and put as parâmentro and it worked.


How can my current mapview as bookmark in geomajas application

I am new to Geomajas(open source gis web application). i configured my data(Mumbai data) as shape file on top of googlemaps. its configured perfectly but how to set my current map view as bookmark.


Get points along a polyline at defined distance c#

I need to store into my array the points along the polyline at each defined distance. Example: The Polyline length is 50m, I set the interval to 5m. I have to store in the array all the points along the polyline each 5meter.(points on 0m-5m-10m-15m....). I'm using C#. Any function to get these points? Thanks,


Is there a way to convert L.circle to a geodesic polygon in Leaflet

Reference: How to make a predetermined Polygon (Circle) From 4 Coordinates, The Radius and Center Longitude and Latitude in Openlayers Openlayers uses this function : createGeodesicPolygon Question: How is it done using Leaflet?


Are there any attempts to replace the shapefile?

Recently I've been spending a lot of time converting perfectly good field names like "Percent of citizens age 25 and over with a bachelor's degree or higher" into things like "edbchogtr" to meet the DBF's 10 character field name limit. In another thread (“Oddities” in the Shapefile technical specification), geospatialpython commented that "Despite the shapefile format's flaws, oddities, and limitations it persists stubbornly in and around the field of GIS. Every other attempt to replace it has been too bloated for simple vector storage or too proprietary." This activity coupled with Mr. Lawhead's comment has me wondering: have any explicit attempts ever been made to replace the shapefile as GIS's ubiquitous data storage and interchange format? Are there any contenders? If there have been competing formats, why have they failed? Has ESRI refused to support them, or is the story simply one of technological inertia? If there haven't been attempts... why not? It seems like we could do a little better for ourselves, both as GIS developers and users. (I got a really interesting history lesson from the "Oddities" thread. Please feel encouraged to drop any relevant tidbits about defunct products or companies that you have bouncing around.)


Are there known issues about UPPER, LOWER SQL functions in ArcGIS 10, file GDB?

Platform: ArcGIS 10 SP3, .NET I use: IQueryFilter queryFilter = new QueryFilterClass(); with ArcGIS .NET SDK and build a query... **Does anybody had problems using UPPER(stringField) and LOWER(stringField) functions on esri file geodatabases?** If so, please share links to some "confirmed-will-fix-in-2-years" pages... I know we have some "old" warnings in our codebase about that. Like we though UPPER(stringField1)=UPPER(stringField2) doesn't work on file gdb. Last week I ran into it again but it seems I could not get even UPPER(stringField)=('STRING-IN-mixedCACE'.toUpper()) query to find anything in gdb. UPPER(stringField)='STRING-IN-UPPERCACE' works, but the UPPER should be better named NOOP. Example. There is a record in fgdb where stringField='Abc'. The query UPPER(stringField)='ABC' returns 0 records. (Error: Should be 1!) PS. Such UPPER/LOWER queries seem to work correctly in ArcMap when using feature layer definition query. Example 2.               Table (id, stringField)     1, 'Abc'     2, 'ABC'          QueryFilter: where UPPER(stringField)='ABC'     returns: (2, 'ABC')     should-return: (1, 'Abc'), (2, 'ABC')


How to install QGIS on Ubuntu 12.04?

Has anyone had any luck with getting QGIS working on Ubuntu 12.04? I have tried the stable and unstable versions and with not luck. I also get the following:               "Some packages could not be installed. This may mean that you have     requested an impossible situation or if you are using the unstable     distribution that some required packages have not yet been created     or been moved out of Incoming.     The following information may help to resolve the situation:          The following packages have unmet dependencies:     qgis : Depends: qgis-providers (= 1.8.0-1~precise1) but 1.9.90+git20120502+6229eec~precise1 is to be installed         Depends: qgis-common (= 1.8.0-1~precise1) but 1.9.90+git20120502+6229eec~precise1 is to be installed         Recommends: qgis-plugin-globe but it is not going to be installed         Recommends: qgis-plugin-grass but it is not going to be installed     E: Unable to correct problems, you have held broken packages."


What is XYZ format in QGIS?

Basic question, but I have been asked to export data to an XYZ format. Is this the same as CSV files. I am using QGIS 1.8.0. So i am presuming i select the data I want to export, right click its parent file in the window on the right and save selection as...CSV??


Offline Map - QGraphicsGeo

I’ve realized a desktop application based on Qt Mobility for displaying maps and adds some landmarks in real-time (like QGeoMapObject). I've to see the track of some vehicles... I've used the code that can be downloaded here. To manage the map, I've used a QGeographicsGeoMap object. I want to have a cache for using my program also without an internet access. Is it possible? What is the way to do this?


how to buffer a raster cell using Visual Basic ArcObjects in ArcMap

I am new in visual basic, I have a question about creating a buffer zone based on a raster layer. I have a raster layer named "Value_Raster", I have a textbox in the userform, I also create a tool button. In the mousemove event under this toolbutton, I want to create a buffer area that the origin is the raster cell value when I move my cursor on the cell, the buffer area can be a square (or rectangular) shape , when the sum of the raster values in the buffer zone is equal to the textbox value in the userform, the buffer will stop. finally the sum of the buffered area is displayed in the msgbox. please help me out! thanks a lot. Emma


How do I install PyProj module for Python 2.7 on Windows 7?

I am having trouble installing the pyproj module for Python 2.7 on Windows 7. I have tried both the 32 and 64 bit installers from this list but the install crashes each time I run it. I have the Python 2.7 version that installs with ArcMap 10.2.2 loaded on my machine. I need pyproj to run the Scanaerial plugin in JOSM to locate water sources in my county. Any ideas on what could be causing the crash, or how to install pyproj properly?


How to preserve line segment ObjectIDs in point output from line Intersect?

I am using the Intersect tool in ArcGIS for Desktop 10.1 to identify all the intersections in a polyline shapefile. The tool generates a point shapefile, but when I inspect the data it does not preserve the ObjectIDs from the original polyline file. How can I preserve the two line segment ObjectIDs that create the intersection?


How do I password protect a CartoDB Visualization

We have some data and a visualization that we would like to make available to a small user community. How do I password protect a CartoDB visualization without making it public.


Where to start with great circle maps in CartoDB?

I've pulled together a series of maps in R based on Nathan Yau's excellent Great Circles tutorial and a nice zipcode package The maps show how many people from many zip codes descended on a single zip code. Here's one example: ![sample map](http://i.stack.imgur.com/0s1aJ.png) I'd like to reproduce the maps in CartoDB (which uses PostGIS, I believe), but I'm not sure where to start. My read of what I was doing in R was generating a matrix called "inter" that was full of lat/long points, drawing the line connecting those points and then starting over. So one solution that occurs to me is to have R store each line as a map line and take that series of lines to CartoDB. But I'm wondering if there's a reasonable way to just generate the maps in CartoDB directly, given an end point and a series of starting points.


Openlayers vector layer don't draw well on chrome (single tile)

I have singleTiled layer in OL (using chrome). The layer don't draw completely unless I pan the map slowly to the south (here is example how the layer keep drawing itself each time I pan) : ![enter image description here](http://i.stack.imgur.com/S1DQe.png) ![enter image description here](http://i.stack.imgur.com/eEhdP.png) ![enter image description here](http://i.stack.imgur.com/X7AFz.png) This is how I create the layer :               var vectors = new OpenLayers.Layer.Vector('vectors', {         isBaseLayer: false,         singleTile: true,         layerName: 'vectors',         displayInLayerSwitcher: true,         styleMap: roadsStyleMap     });      Any idea why it happens in chrome only ? (in FF I don't have this problem)


GeoTools ImageMosaic info

I wish I could merge several images georeferenced using a java application. in this link I saw that I can achieve my goal using the library "imagemosaic" of GeoTools. I can not find any guide or example of using this library (in Java). anyone knows how to help me understand more? requires the use of a GeoServer?


Imported GPX files into QGIS ver 2.0.1-fields missing?

Just imported GPX file into QGIS.Opened attribute table. where are the following fields? Latitude,Longitude,,symbol,and time . Am I missing something??I used a Garmin Oregon 300 to collect the data. Verified that all the listed fields have info in them using other ![enter image description here](http://i.stack.imgur.com/eiDxT.jpg)both Mac and Windows GPS programs.


Debug/Improve Performance of GRASS v.in.ogr

I'm trying to import shapefiles (in this case, OpenStreetMap data) into GRASS (grass70-svn) using `v.in.ogr`; and it is painfully, brutally slow. At first I thought this was because I was using the default sqlite database on an NFS mount. But, trying sqlite on a local disk and trying MySQL to separate server both failed to improve performance. I'm getting a consistent read/write of ~125Kbps/~550Kbps no matter which shapefile or which database I use. I cannot see any bottlenecks anywhere, as the two `python /path/to/grass-gui` processes are averaging 10% of one core combined, the network utilization is below 10% consistently, and the DB server is almost quiescent. To give an example of how painful this is:               v.in.ogr dsn=/home/justin/downloads/osm_CA/places.shp                                WARNING: All available OGR layers will be imported into vector map <places>     Check if OGR layer <places> contains polygons...     Importing 7020 features (OGR layer <places>)...     -----------------------------------------------------     Building topology for vector map <places@OSM>...     Registering primitives...     7020 primitives registered     7020 vertices registered     Building areas...     0 areas built     0 isles built     Attaching islands...     Attaching centroids...     Number of nodes: 0     Number of primitives: 7020     Number of points: 7020     Number of lines: 0     Number of boundaries: 0     Number of centroids: 0     Number of areas: 0     Number of isles: 0     (Fri Jan 31 19:01:08 2014) Command finished (4 min 38 sec)      Any guidance on how to remediate this problem, or at least find the bottleneck? I'm stumped.


How to export and import gps points from Garmin 62S and QGIS

I'm pretty new to using QGIS and I'm curious about how to import and export GPS points created in QGIS. I have QGIS 2.0.1 dufour on windows XP and a Garmin 62s. Any suggested walk throughs would be great. Thanks


How can I display a spatialLite view in a custom data sheet with print composer

I created a spatiaLite Database with a point layer (every point is a tree). Additional I created several tables to fill the columns of the spatial layer with attributes using the editing widget “value relations”. I need this because I want to speed up data entry! For some other attribute fields the data entry occurs via “line edit”. I also designed a custom form like Nathan Woodrow describes it in his blog. This works pretty good. However, for output I want to create several custom data sheets with the print composer - one for every tree. Because I want to display the values from my linked tables and not the common keys I created a view that is composed of all attributes I need inclusive the geometry column (geom) of the spatial layer.                CREATE VIEW tree_attrib1 AS SELECT baumkataster.ROWID AS ROWID,      baumkataster.baum_ID, baumkataster.geom AS geom, gattung.gattung AS gattung, art.art AS      art FROM baumkataster JOIN gattung ON baumkataster.gattung = gattung.gattung_ID       JOIN art ON baumkataster.art = art.art_ID;      To use the atlas generator in the print composer I need to “convert” my view into a point layer. My questions now are: 1: How can I display my view as an point layer in qgis? 2: A view is stored only temporary. Will this new point layer be updated when I insert new features (trees)?


How to merge intelligently GPS sensors?

I'm working on an application with a lot of GPS sensors, for each vehicle and person in a scene. I want to show a vehicle and his occupants in the same marker. But I can't get the vehicle occupants list from the system, I only have GPS positions and object type (firetruck, policeman, car driver, etc…). I'm looking for an existing model or library doing this kind of merge. The simple approach can be to merge closest sensors from a vehicle into it, but sometimes you have a lot of people outside of a vehicle. I can use the historical data, if some sensors are moving at the same speed and are near since a long time, I can consider that they are in the same vehicle. But it's a homemade system and it's maybe not very good. Is there a good way?


Geowebcache tiles showing only when seeding and not when viewing the map

I have created a map with geoserver and postgresSQL. I have managed in geoserver to seed the layers into tiles but for some reason as you view across the map, it does not create those tiles. For instance, if I seeded the layer till zoom 11 and wanted to view at zoom level 20, I could but it does not seem to create the tiles for a later stage nor make it more effective or faster. Also when I set a bounding area in the seeding form section, it gives me http 500 error and I'm not sure why. I have set up geoserver and placed the folder for the tiles for the geowebcache. I am using the intergrated geowebcache that comes with geoserver. The logs don't seem to show if there is something wrong. Any help will be grateful.


How to set a map's extent to the envelope in miles

I want to set extent of the map into envelope which sizes are defined by user in miles(kilometers, whatever human readable unit). How to make it? I wrote the following code:               static void ZoomToPoint(IActiveView focusMap, ExportJson2Feature.Geometry geom)     {         IPoint point = new PointClass();         point.PutCoords(geom.X, geom.Y);              IEnvelope newExtentEnvelope = point.Envelope;         newExtentEnvelope.Expand(1, 1, false);         ((IGeometry)newExtentEnvelope).Project( ((IMap)focusMap).SpatialReference );         focusMap.Extent = newExtentEnvelope;     }      How to make it know that sizeX/sizeY are in miles?


How to publish Web Map on the internet?

I'm trying to use IIS 7 Manager to publish a web map on the internet except I have the folowing problem: ![enter image description here](http://i.stack.imgur.com/DV5Gx.jpg) I installed the ArcIMS web ADF for Java, and created a new webpage which depends on ArcIMS services (using ArcIMS admin), and then deployed it. When I opened the URL using another PC the page did not load. To summarize, I have ArcIMS 9.3 (with servlet 5.0), ArcIMS web ADF for Java. What can i do to publish my web map ?


Problem with raster calculator

When working with raster calculator there is an error 000539? The program failed to create a common raster map. I don't know what to do. I did the same in school without any problems. But now, on my computer the raster calculator will not make a map.


ArcObjects: How to get the size of the formatted text part only of a TextElement whose text contains formatting tags?

I'm working in ArcGIS 10.0 and Python 2.6.5. I have a string, say `'mMx'`, that I want to enter into a TextElement (in the data view). The lowercase letters are to be substituted with a graphical symbol through use of the usual html-style formatting tags. We'll assume that the regular font is Arial (specified in the TextSymbol) and that the sybolic font is Wingdings. So, I build a formatted string like so:               <FNT name="Wingdings" size="48">m</FNT>M<FNT name="Wingdings" size="48">x</FNT>      This string is what I set as text for my TextElement. Now, what I want to get is the bounds of the _formatted_ text _only_ , as it would appear on the screen with full symbology. The text appears fine -- with symbology -- on the screen. The problem is that the bounds of the text element include the length of the whole input string, formatting tags and all. In map units, the text is maybe 50' long, but the bounds are 1000'. I have tried QueryBounds and QueryOutline (both of which say they take symbology into account) and also ITextSymbol.GetTextSize. They all return the same crazy dimensions. ArcGIS is processing the formatting tags just fine as far as the text itself is concerned, but the bounds include the tags. I don't get it. This is a big concern, because I absolutely need to know the onscreen-text-only size of the TextElement for use in subsequent calculations. Does anyone have any insights on this problem? Thank you all for the help ... and I apologize for asking such a specific ArcObjects question here, but I get exactly NO response from ESRI forums anymore. **Solution found:** Well, I just found the problem, and it has to do with the way the format string I show above was made in Python. I have been doing a lot of HTML code block output in Python lately, and I have been used to using triple quoted strings. That is what I did when building the format string. So the following is the actual line of code that builds the format string. (Lesson learned. I should always include a code snippet.)               fmtchar = """<FNT name="Wingdings" size="48">""" + eachChar + """</FNT>"""      It should be:               fmtchar = '<FNT name="Wingdings" size="48">' + eachChar + '</FNT>'      I find it interesing that ArcGIS would process the formatting tags and also count the tag characters as part of the text. Hmmm. BTW, let me know if I should put this solution in an answer to my own question.


Allow user to add notes to an OpenLayers map

I am looking for any ideas here. I want a user to be able to interact with a map. I know I can use HTML5 canvas to allow the user to draw over a map. But what about if I want something simpler? For instance, the user can click on the map, which will add a textbox and pinpoint - the user can then write notes for any locations they place this point. Is there a library which will allow me to do this? Thanks!


Intersecting 3 tables with Spatial SQL

I have three tables I need to intersect but not sure how to get the third Heres what I have so far:               SELECT nyc_neighborhoods.name, SUM(nyc_census_blocks.popn_total) AS POP     FROM nyc_neighborhoods     JOIN nyc_census_blocks     ON ST_Intersects(nyc_neighborhoods.the_geom, nyc_census_blocks.the_geom)     WHERE nyc_neighborhoods.boroname = 'Manhattan'     Group By nyc_neighborhoods.name      I need to incorprate subway stations with in Manhattan from our ny_subway_stations table How do you insterect/join 3 tables? Thanks, Adam


How to create a solar intensity map for a garden plot?

I'm interested in creating a raster surface that depicts the average solar intensity per unit area for a small garden plot. I imagine the inputs into the model would be the following:   * Plot area--for simplicity sake, let's assume the garden plot is circular.   * Average tree height of surrounding forest edge   * Solar intensity at various sun angles   * The average sun angle in relation to the garden plot over time. I ultimately want to show the best location for plant growth within garden plots that are surrounded by trees. Could anyone point me toward a solution for this analysis? I'm sure someone has done this already, although I cannot find any references. Edit: For example purposes, the attached image shows a 1 acre garden plot surrounded by an even-aged stand of conifers. To further simplify this analysis, let's assume we're interested in only the solar zenith and intensity during the gardening season from June to October. Felling trees is not an option! ![enter image description here](http://i.stack.imgur.com/e9aGj.jpg)


Layer not showing up need ideas

I tried to replicate the example at OpenLayers WFS protocol: work with filters if the protocol is defined out of layer constructor and can't get it to work. I copied the html page into a web application and ran it on the same server that geoserver was deployed to but can't duplicate it. Can anyone give me ideas on things to try to get it to work.


AGS10 Soap Geometry/Project function vanishes

So I am doing a pretty simple process that looks a lot like right out of the SOAP API/SDK for AGS10. My webservices takes a Lat/Lon coord from a mobile app, I reproject it to Web- Mercator to identify against my mapservice data and return a result. Pretty simple, but for some reason that I am not seeing any place, the project method is returning blank, no exception raised, no errors on the server/service side.                           SpatialReference inputSpatialReference = new GeographicCoordinateSystem();                 inputSpatialReference.WKID = 4326; //WGS 84                 inputSpatialReference.WKIDSpecified = true;                      PointN llPnt = new PointN { X = lon, Y = lat, Z = 0 };                 llPnt.SpatialReference = inputSpatialReference;                      SpatialReference outputSpatialReference = new ProjectedCoordinateSystem();                 outputSpatialReference.WKID = 3857; //Web Mercator (Auxiliary Sphere)                 outputSpatialReference.WKIDSpecified = true;                      Geometry[] inputGeometry = new Geometry[] { llPnt };                      bool transformForward = false;                      GeoTransformation transformation = new GeoTransformation();                 // NAD1983_To_WGS1984_1                 transformation.WKID = 108100;                 transformation.WKIDSpecified = true;                      EnvelopeN extent = null;                      Geometry[] outputGeometry = geometryService.Project(inputSpatialReference, outputSpatialReference,                                                                     transformForward, transformation, extent,                                                                     inputGeometry);                      PointN wmPnt = outputGeometry[0] as PointN;            Now; when my defining my points works great; I am able to see the point, my X, Y and Z values as well as my existing coordinate system look great. So I define where my coordinates are going, to, define my transformation since I need to get from Lat/Lon to WebMercator and then after that, fire the GeometryService.Project call.      Now when I look at the output in the debugger of the outputGeometr the point is blank; not even the existing coordinates the new point is null.      So I look to the server, to see what it says; no errors listed, so I am very puzzled. Any thoughts or suggestions?


Arcobjects: Zoom to first queried feature

I'm attempting to query a feature class for all features that meet a certain criterion (in this case, the `Status` field is `NULL`). However, I'm not getting very far into the attempted method before ArcMap crashes completely. I have no reasonable idea on how to trace errors that cause a program crash, for starters, so I'm more confused than necessary, I expect. I'm building this in VS 2008 Express, for what it's worth.                public void PerformAttributeQuery(ESRI.ArcGIS.Geodatabase.IFeatureClass fc)         {             ESRI.ArcGIS.Geodatabase.IQueryFilter queryFilter = new ESRI.ArcGIS.Geodatabase.QueryFilterClass();             queryFilter.WhereClause = "[Status] IS NULL"; // create the where clause statement       Everything is fine for that first couple of statements, but this query causes a crash:                       // query the table passed into the function and use a cursor to hold the results             ESRI.ArcGIS.Geodatabase.IFeatureCursor featurecursor = fc.Search(queryFilter, false);      It crashes before reaching the next line (I put in debug message boxes for testing), but I'll put it here for propriety:                       ESRI.ArcGIS.Geodatabase.IFeature feature = (ESRI.ArcGIS.Geodatabase.IFeature)featurecursor.NextFeature();             ESRI.ArcGIS.ArcMapUI.IContentsView currentContentsView = ArcMap.Document.CurrentContentsView as IContentsView;             ESRI.ArcGIS.Carto.IFeatureLayer featureLayer = (ESRI.ArcGIS.Carto.IFeatureLayer)currentContentsView.SelectedItem;             ESRI.ArcGIS.Carto.IFeatureSelection fSelection = featureLayer as ESRI.ArcGIS.Carto.IFeatureSelection;             fSelection.Add(feature);             FindCommandAndExecute(ArcMap.Application as ESRI.ArcGIS.Framework.IApplication, "{AB073B49-DE5E-11D1-AA80-00C04FA37860}");         }      I cannibalized the `PerformAttributeQuery` snippet to work with FeatureClasses instead of Tables (or so I had hoped), if you'd like a proper reference. My questions are: 1) How can I get better reporting of crash errors? 2) Where did I go wrong? **Answer** : I must shamefacedly admit that I used the wrong characters to denote the location of the feature table I was querying. Changing the `[Status]` in my `queryFilter.WhereClause` to `\"Status\"` quite literally solved all obvious problems. Thank you Kirk!


Configuring ArcMap applications to display data from postgis/geoserver

I'm afraid im quite new to geoserver and i have been set the task of configuring ArcMap applications to display data from postgis/geoserver. I realize that I will need to set up a WMS service in geoserver but I'm not really sure how one goes about doing this. If any one can give me some pointers or step by step guide it would be much appreciated. I have tried googling it but haven't had much luck. Thanks in advance


Style editor in uDig

I added layers from Geoserver, I have line objects. But when I open style editor in uDig, I have only WMS Named Style. I thought I could change for example colors by attributes, but I don't how to do it when it offers me only WMS Named Style. I'm working with uDig and Geoserver for the first time so please help me. Thank you.


ArcObjects DataStat Error

I have some code that adds a bunch of group layers into ArcMap based on a table within ArcMap. The code works fine in VBA, however in VS 2010 I get an error on the **"pEnumVar = pDataStat.UniqueValues"** line (see code below). ERROR: InvalidCastException was unhandled by user code Unable to cast object of type 'System.Runtime.InteropServices.CustomMarshalers.EnumeratorViewOfEnumVariant' to type 'ESRI.ArcGIS.esriSystem.IEnumVariantSimple'. I'm guessing .NET does not like to use the IEmumVariantSimple object? Does anyone have a suggestion of how I can work around this or update this line with a different enumeration object? Thank You!                       Dim pEnumVar As IEnumVariantSimple, value As Object                  Dim pODGSLyr As New ODGSLayer                  'Start             'Find the Layer Files metadata table             pStdTableColl = m_map             For i = 0 To pStdTableColl.StandaloneTableCount - 1                 pStdTable = pStdTableColl.StandaloneTable(i)                 If pStdTable.Name = "ODGSLAYERS" Then                     pTable = pStdTable                     lngFldLayerName = pTable.FindField("LAYERNAME")                     lngFldPath = pTable.FindField("PATH")                     lngFldGroupOrder = pTable.FindField("GROUPORDER")                     lngFldGroupName = pTable.FindField("GROUPNAME")                     lngFldGroupTOCOrder = pTable.FindField("GROUPTOCORDER")                     lngFldGroupVis = pTable.FindField("GROUPVISABLE")                 End If             Next i                  If pStdTable Is Nothing Then                 Exit Sub             End If                  'Sort the Table             pTableSort = New TableSort             With pTableSort                 .Fields = "GROUPTOCORDER, GROUPNAME"                 .Ascending("GROUPTOCORDER") = True                 .Ascending("GROUPNAME") = True                 .QueryFilter = Nothing                 .Table = pTable             End With             pTableSort.Sort(Nothing)                  pCursor = pTableSort.Rows                  'Find Unique Values in the Table             pDataStat = New DataStatistics             pDataStat.Field = "GROUPNAME"             pDataStat.Cursor = pCursor                  pEnumVar = pDataStat.UniqueValues '<<<<<<<<<< ERROR HERE             value = pEnumVar.Next      **Update 1** Update 1 is an update from @Kirk Kuykendall comment. The new error is on the **"lngGroupTOCOrder = pRowLyrs.Value(lngFldGroupTOCOrder)"** line (see code below). I'm not sure what I need to do next. ERROR: NullReferenceException ws unhandled by user code Object reference not set to an instance of an object.                pEnumVar = pDataStat.UniqueValues             value = pEnumVar.MoveNext             Do Until IsNothing(value)                 'Now resort the table based upon the layer order in the group                 pQf = New QueryFilter                 pQf.WhereClause = "[GROUPNAME] = '" & value & "'"                 pLyrCursor = pTable.Search(pQf, False)                 pTblSortLyrs = New TableSort                 With pTblSortLyrs                     .Fields = "GROUPORDER"                     .Ascending("GROUPORDER") = True                     .QueryFilter = pQf                     .Table = pTable                 End With                 pTblSortLyrs.Sort(Nothing)                      'Get the newly sorted rows and create the new Group and Layers inside the Group                 pLyrCursor = pTblSortLyrs.Rows                 pRowLyrs = pLyrCursor.NextRow                      'Create the new Group                 lngGroupTOCOrder = pRowLyrs.Value(lngFldGroupTOCOrder) '<<<<<<< NEW ERROR                 blnGroupVis = pRowLyrs.Value(lngFldGroupVis)


Python Efficiency -- Need suggestions about how to use OGR and Shapely in more efficient way

I'm looking for some suggestions about how to make my python code more efficient. Normally efficiency doesn't matter for me but I am now working with a text file of US locations with over 1.5 million points. With the given setup it is taking about 5 seconds to run operations on one point; I need to get this figure way down. I'm using three different python GIS packages to do a few different operations on the points and output a new delimited text file.   1. I use OGR to read a county boundary shapefile and get access to the boundary geometry.    2. Shapely checks to see if a point is within any of these counties.    3. If it is within one, I use the Python Shapefile Library to pull attribute information from the boundary .dbf.    4. I then write some information from both sources to a text file. I suspect that the inefficiency lies in having a 2-3 tiered loop... not quite sure what to do about it. I'm particularly looking for help with someone experienced in using any of these 3 packages, as it is my first time to use any of them.               import os, csv     from shapely.geometry import Point     from shapely.geometry import Polygon     from shapely.wkb import loads     from osgeo import ogr     import shapefile          pointFile = "C:\\NSF_Stuff\\NLTK_Scripts\\Gazetteer_New\\NationalFile_20110404.txt"     shapeFolder = "C:\NSF_Stuff\NLTK_Scripts\Gazetteer_New"     #historicBounds = "C:\\NSF_Stuff\\NLTK_Scripts\\Gazetteer_New\\US_Counties_1860s_NAD"     historicBounds = "US_Counties_1860s_NAD"     writeFile = "C:\\NSF_Stuff\\NLTK_Scripts\\Gazetteer_New\\NewNational_Gazet.txt"          #opens the point file, reads it as a delimited file, skips the first line     openPoints = open(pointFile, "r")     reader = csv.reader(openPoints, delimiter="|")     reader.next()          #opens the write file     openWriteFile = open(writeFile, "w")          #uses Python Shapefile Library to read attributes from .dbf     sf = shapefile.Reader("C:\\NSF_Stuff\\NLTK_Scripts\\Gazetteer_New\\US_Counties_1860s_NAD.dbf")     records = sf.records()     print "Starting loop..."          #This will loop through the points in pointFile         for row in reader:         print row         shpIndex = 0         pointX = row[10]         pointY = row[9]         thePoint = Point(float(pointX), float(pointY))         #This section uses OGR to read the geometry of the shapefile         openShape = ogr.Open((str(historicBounds) + ".shp"))         layers = openShape.GetLayerByName(historicBounds)         #This section loops through the geometries, determines if the point is in a polygon         for element in layers:             geom = loads(element.GetGeometryRef().ExportToWkb())             if geom.geom_type == "Polygon":                 if thePoint.within(geom) == True:                     print "!!!!!!!!!!!!! Found a Point Within Historic !!!!!!!!!!!!"                     print str(row[1]) + ", " + str(row[2]) + ", " + str(row[5]) + " County, " + str(row[3])                     print records[shpIndex]                     openWriteFile.write((str(row[0]) + "|" + str(row[1]) + "|" + str(row[2]) + "|" + str(row[5]) + "|" + str(row[3]) + "|" + str(row[9]) + "|" + str(row[10]) + "|" + str(records[shpIndex][3]) + "|" + str(records[shpIndex][9]) + "|\n"))             if geom.geom_type == "MultiPolygon":                 for pol in geom:                     if thePoint.within(pol) == True:                         print "!!!!!!!!!!!!!!!!! Found a Point Within MultiPolygon !!!!!!!!!!!!!!"                         print str(row[1]) + ", " + str(row[2]) + ", " + str(row[5]) + " County, " + str(row[3])                         print records[shpIndex]                         openWriteFile.write((str(row[0]) + "|" + str(row[1]) + "|" + str(row[2]) + "|" + str(row[5]) + "|" + str(row[3]) + "|" + str(row[9]) + "|" + str(row[10]) + "|" + str(records[shpIndex][3]) + "|" + str(records[shpIndex][9]) + "|\n"))             shpIndex = shpIndex + 1         print "finished checking point"         openShape = None         layers = None               pointFile.close()     writeFile.close()     print "Done"


Create a Python script to merge broken polylines from a microstation CAD file in ArcGis

I have tried using the dissolve tool with unsplit_lines option but it does not merge the lines... maybe there is a step I am missing?


Why latitude/longitude and not the other way round?

When you google "latitude/longitude" you get 10 times more results than "longitude/latitude". This I find very confusing as "x/y" seems 20 times more common than "y/x". But on a map Latitude is on the Y axis and longitude on the X. Maybe I'm just venting, but maybe I'm missing a clue that makes all this madness logical. Any explanations?


IFeatureClassWrite and ITableWrite doubt

I'm looking at these specific interfaces ITableWrite and IFeatureClassWrite. I have a need to store some features (mostly a custom log) and I can't having them triggering my editor events (OnCreate, OnChange and OnDelete - but more specifically OnCreate). The document is clear that IFeatureClassWrite will NOT trigger these events (IRow.Store). ITableWrite just says: > " .WriteRow | Write a row to the database without polymorphic object update > behavior. " Do they mean the same thing? e.g. using WriteRow or WriteRows will not trigger the OnStore event (which BTW is not listed on IRowEvents) and using IFeatureClassWrite will not trigger OnStore events? Another question: do I need to bypass these events? I'm only listening to OnCreate, OnChange and OnDelete events of the editor. Also, is that the best tatic to capture these specific events? I'm afraid that programmatically, someone else might use IWorkspaceEdit, and my editor event handler won't listen to those (events). Sorry for the long question, but the setup to test this is kinda of big, and I'm open to advice. Thanks!


Rescale Raster Band With GDAL Python Bindings

I am trying to figure out how to rescale a raster band's pixel value using the GDAL python bindings. I am looking to emulate the -scale switch in gdal_translate.exe; rescaling the pixel values in my raster to 0-255. EDIT: Some goofing around today has produced this, seems to work thus far.               from osgeo import gdal     import numpy     import math          def singleBandToRGB(source,output):         src_ds = gdal.Open(source)         band = src_ds.GetRasterBand(1)         min = band.GetMinimum()         max = band.GetMaximum()         data = src_ds.ReadAsArray(0,0,src_ds.RasterXSize,src_ds.RasterYSize)         data = ((255-0)*((data-min)/(max-min)))+0         data = data.astype(numpy.uint8)         driver = gdal.GetDriverByName("GTiff")         dst_ds = driver.Create(output,src_ds.RasterXSize,src_ds.RasterYSize,3,gdal.GDT_Byte)         for i in range(1,4):             dst_ds.GetRasterBand(i).WriteArray(data)             dst_ds.GetRasterBand(i).ComputeStatistics(False)         dst_ds.SetProjection(src_ds.GetProjection())         dst_ds.SetGeoTransform(src_ds.GetGeoTransform())              # housekeeping         driver = None         dst_ds = None         src_ds = None


arcpy taking longer and longer in a loop

I am looping through an amount of point arrays, creating data on the fly. The features/arrays, are largely similar in size. One thing I have noticed, is that when I start the process, the time it takes to perform, rises from about 8 seconds, to around 1 minute. I can't see why this is happening, but you cna see the times slowly increase if you put a timer around the loop. Is there a way to increase this performance? Is there a flush method? I believe I am properly handling my objects and deleting them after use, but I cannot for the life of me see why it is happening? Any ideas? The code is refactored, so there may be some typos, etc.               def createGeom(geom,header,band,scratchDB,buffer, dist):          filetime = (str(time.time())).split(".")     outfile = "fc" + filetime[0]+filetime[1]     outpath =  scratchDB + "tmp.gdb/Polygon/"     print outpath     sCon = ["1", "16", "2.0"]      ts = header.split(" ")     ti = ts[6]     Current = ts[9]     LL = ts[2][2:5]     LU = ts[2][8:11]          outFeatureAggClass = outpath+outfile+"_agg"     outFeatureClass = outpath+outfile          arcpy.AggregatePoints_cartography(geom, outFeatureAggClass, dist)     arcpy.Buffer_analysis(outFeatureAggClass, outFeatureClass, buffer)                    arcpy.AddField_management(outFeatureClass, "Name", "Text")     arcpy.AddField_management(outFeatureClass, "ID", "SHORT")     arcpy.AddField_management(outFeatureClass, "LL", "SHORT")     arcpy.AddField_management(outFeatureClass, "LU", "SHORT")             arcpy.AddField_management(outFeatureClass, "Tim", "SHORT")      arcpy.AddField_management(outFeatureClass, "Band", "SHORT")     arcpy.AddField_management(outFeatureClass, "Lvl", "TEXT")      arcpy.AddField_management(outFeatureClass, "Cur", "SHORT")               rows = arcpy.UpdateCursor(outFeatureClass)     for row in rows:         row.name = outfile         row.ID = 1000         row.LL = int(LL)         row.LU = int(LU)         row.Tim = int(ti)            row.Band = int(band)         row.Lvl = sCon[int(band)]         row.Cur = Current         rows.updateRow(row)          del row     del rows          **UPDATE** I am now running this in ArcMap, and it's taking significantly less time, to a factor or about 3 or 4; what took 30 mins, now takes 7. What's that all about? **EDIT** ESRI have agreed to look at the issue. I'll park this for now, ready to update it with any progress.


Using ESRI.ArcGIS.Display.ITemplate to draw cutom lines?

I am using ESRI.ArcGIS.Display.ITemplate to draw custom lines such as dot/dash lines on a map control. Then, I used below codes               ESRI.ArcGIS.Display.ITemplate templateCls = new ESRI.ArcGIS.Display.TemplateClass();     templateCls.Interval = 1;     templateCls.AddPatternElement(1, 3);      The below image 1 will show the result for this. ![enter image description here](http://i.stack.imgur.com/4fxfV.png) But, I am want to the line include round elements (not rectangle) as the below image 2. ![enter image description here](http://i.stack.imgur.com/dZdy6.png) Are there anyone know how to do that ? Thank you very much !


How do I create a custom geostamp in the TerraGo toolbar

The blurb for the new 6.0 tool bar says it supports custom geostamps, but I can't find any info on how to create one. Can anyone point me to the method for creating a custom geostamp that the toolbar will recognize? Edit: So far, this is what I've figured out: The geostamp files on Windows are in C:\Program Files\Common Files\TerraGo\GeoStamps   1. Each collection of stamps in the Geostamps menu corresponds to a pdf file in that directory.   2. Each file begins with a sequential letter of the alphabet. The installation has A thru E.   3. The name of the collection corresponds to the document name (which in the default files is the file name minus the first letter).   4. If you copy one of the existing collection files, rename the document (in Acrobat), rename the file to start with the next letter of the alphabet (F), you will see a new collection in the GeoStamps menu in Acrobat Reader.   5. The pdf file consists of one 8.5x11 page (apparently blank), plus a series of pages each .65" square containing a single symbol, which is a glyph from a font whose name essentially matches the collection name.   6. If you delete one (or more) of these pages, the file still works, but the corresponding stamp is missing. And here's where it breaks down - 8. If you add a page to this file, it does NOT appear as a symbol available to the Geostamp function in the toolbar. Interestingly, the added page does not break the collection, even if placed before the original pages. If you add markup to a symbol from the original document (like an arrow, for example), the markup appears in the symbol preview, but no in the symbol "stamped" onto the document. I've checked all the document properties and can't find anything that seems out of the ordinary. But there must be something magic on the page to make it work.


Why is polygon used as range in GIS and maps?

I am enroute to create an app that finds nearest venues. I already have another SO question on this regard. I don't have any experience with such features, and some of the concepts are not being very obvious to me. So, I have been thinking that I am not taking things on right direction. I have seen in number of places with both GIS and in case of mobile towers, the range is calculated in polygons. I have also been reading a bit about Haversine Formula, and it appears it does not use Polygon, it is basically two-point distance (from my understanding). Why use Polygon for reference ? Why is circle not used for this ? How does Haversine formula integrate with this polygons concept ? #Copied : Original question in SO as refered by Nate


Retrieve road segment from Google or Bing Maps

Let me see if I would be able to explain this correctly... Both Bing and Google Map geocoders can return you and a point given an address. Is there any way to retrieve an 'address range' instead i.e. to get returned a LINE rather than a point? Its not necessarily address ranges I am after- the key word here is 'line' (along a road). Another example would be to get a road line given 2 points so I would want to get returned the road segment between these 2 points. I assume for this I would need to use the routing functions only? Another scenario (i guess even more difficult) is given 1 point (along a road) to ask for the road segments for x Km 'up or down' this same road Hope I am making sense...


How can I convert esriMeters to Lat/Lng?

I am pulling a JSON list of features into a web page. The points come as esriMeters and the rest of my app uses Lat/Lng. How can I do this conversion in the browser (javascript)?


Geoserver Problem

The following error message shows during an attempt to open geoserver url... "HTTP ERROR: 404 NOT_FOUND RequestURI=/geoserver" Note: I have restared the Start/Stop .bat files several times & also restarted the PC.