Given a GeoJSON in EPSG3857:  {   "type": "Feature",   "properties": {},   "geometry": {     "type": "LineString",     "coordinates": [       [         -13720479.997764934,         5688254.733325758       ],       [         -13720479.47473932,         5688241.794717406       ]     ]   } }   I am trying to convert the GeoJSON to EPSG 4326 for a Leaflet map. The user input in the map comes in EPSG 3857. I want to do the conversion with JavaScript after the user enters the GeoJSON. So I am looking for a JavaScript library that I can use. I am not looking for tools with whom I can convert the GeoJSON outside of my script (like GDAL/OGR)  .  I tried Proj4 but didn't get it to work. Is it possible to use Proj4 to convert line strings? If not, what other options should I consider?  var epsg4326 = new Proj4js.Proj('EPSG:4326'); var epsg3857 = new Proj4js.Proj('EPSG:3857');  var geoJSONOBJ4 = new Proj4js.Point(geoJSONOBJ3); Proj4js.transform(epsg4326,epsg3857,geoJSONOBJ4);
121769
I am using this  to convert a GeoJSON point from EPSG:3857 to EPSG:4326.   My command fails. What am I doing wrong?   $ echo '{"type":"Point","coordinates":[-13720479.997764934,5688254.733325758]}' | reproject --from=EPSG:3857 --to=EPSG:4326   /usr/local/lib/node_modules/reproject/cli.js:98             throw new Error("Could not find definition for CRS \"" + crsName + "\".");                   ^ Error: Could not find definition for CRS "EPSG:3857".     at lookupCrs (/usr/local/lib/node_modules/reproject/cli.js:98:10)     at Object.&lt;anonymous&gt; (/usr/local/lib/node_modules/reproject/cli.js:25:1)     at Module._compile (module.js:456:26)     at Object.Module._extensions..js (module.js:474:10)     at Module.load (module.js:356:32)     at Function.Module._load (module.js:312:12)     at Function.Module.runMain (module.js:497:10)     at startup (node.js:119:16)     at node.js:901:3
37637
I see that the Point type is made to store geometric coordinates, however I don't see what problem it is trying to solve, or what advantages it offers over simply using two numerical columns. It's 16 bytes, so is it just an abstraction for two 8 byte floats? Or is it a string containing some kind of geohash that optimizes the performance of certain queries?  Let's say I want to get all the points for a specific viewport on a Leaflet map... with numerical columns representing latitude and longitude, I'd just filter for all the rows that have a latitude number between the N/S bounds and a longitude number between the E/W bounds, easy. I looked into using Point here, but the syntax is cumbersome and it seems to me like unnecessary overhead for development and for database performance... is it?
105986
IMPORTS:  var geometry = /* color: #d63000 */ee.Geometry.Polygon(     [[[-67.76435852050781, -22.213792811479802],       [-67.76641845703125, -22.220785143658368],       [-67.75646209716797, -22.228412744835992],       [-67.74410247802734, -22.230319580297703],       [-67.7420425415039, -22.221420792936158],       [-67.74341583251953, -22.212203596469955],       [-67.74787902832031, -22.207753698686023],       [-67.75543212890625, -22.213474969917876]]]);   CODE I have tried :  var fg_points = ee.Feature(geometry);   I thought if we give geometry as a feature it will select all points in that polygon but it isn't.
115300
Suppose I have a set of coordinates in latitude and longitude.  What would be the easiest way to export those to an SVG file?  I'd rather do this programatically (any language or library will do) rather than manually, but can revert to that if necessary.
6180
I have a GeoTIFF published by Geoserver 2.2 and being used by Leaflet via WMS. How can I get Geoserver to return the raster value at a lat/long point?   I'm guessing it has to do with using WCS, but no examples seem to exist for doing this!  This will be similar to querying PostGIS with ST_Value(raster, ST_SetSRID(ST_Point(lon,lat),4326)). I dont really want to import the same raster into PostGIS just to find the raster value at a point. Or is this the recommended solution?
86795
I would like to get a geojson feature with properties from PostGIS. I have found  to have a feature collection but I can't make it works for just a feature.  SELECT row_to_json(fc)  FROM ( SELECT 'FeatureCollection' As type, array_to_json(array_agg(f)) As features  FROM (SELECT 'Feature' As type     , ST_AsGeoJSON(lg.geog)::json As geometry     , row_to_json(lp) As properties    FROM locations As lg           INNER JOIN (SELECT loc_id, loc_name FROM locations) As lp         ON lg.loc_id = lp.loc_id  ) As f )  As fc;   so far I tryed to modify the feature collection query of the example. but the output is not valid.
52050
I am trying to incorporate a wms feed in the British national grid projection (EPSG:27700) into a openlayers 3 project. I initially had used this wms layer in an openlayers 2 application using the following syntax:  new OpenLayers.Layer.WMS(         "ukimage",         "http://www.linktowms",         {             "LAYERS": 'ukimage',             "STYLES": '',             format: state.image_format         }, {     buffer: 0,     displayOutsideMaxExtent: true,     isBaseLayer: true } );   But I am having trouble converting this over to openlayers 3. I first tried setting the map projection to British national grid (view: new ol.View({ projection: 'EPSG:27700'}) as I had in the openlayers 2 app, but this produced the error  TypeError: h.B is not a function    and a white map.   When I try and use proj4 to convert the projection to EPSG:3857 as described here:  I get the same error:   TypeError: h.B is not a function    and again a white map.   my wms request is generally a varient of:  new ol.layer.Image({       source: new ol.source.TileWMS({         url: 'http://www.linktowms',         params: {'LAYERS': 'ukimage'},       })     }),   (I tried adding projection but that didn't help)  I am trying to work out if the image is even getting loaded from the WMS feed, but the syntax seems to have changed significantly from openlayers 2, instead of the properties and functions that have rather descriptive names, there are a now lots of short functions with names like Ua and Ig, which leaves me a bit in the dark as to what's actually going on when I try and inspect the layer with firebug.  I don't mind what projection the application is in, as I can re-project my other layers to match the basemap, so basically any way of using this EPSG 27700 WMS layer in openlayers 3 would be great.
53831
I'm working with  that has X Y coordinates. They are akin to '3672187.92698000, 534175.72095400'.  I would like to convert them to longitude latitude so they are more like '-90.097017, 29.963176'.  I've seen this  however I don't have that software. I was able to download and install  but I am unfortunately perplexed by its complicated interface. Would like to do the conversion with it, if possible.
20953
I have an old map over a part of Laos and wondering how do I georeference the map with the help of the Grid lines and other Longitude and Latitude information on the scanned map? I have searched for information on the internet and tried many times. My scanned map wont overly correctly on the base map. Any base map would be fine. As long as I can check the result.  Do I add X/East and Y/North values from the grid line crossings as marked and written in some parts of the map? How do I begin georeferencing this map? Do I have to add zeros after the two digits? For example if the Easting is 24 (its in KM right? Do I add like three/four zeros to convert it to meters?  I georeferenced the map with the option "From Map Canvas" in the georeferencer tool and I succeeded but I want to know the coordinate of a point on my old scanned map and write them as X/East and Y/North to georeference the map.   I hope I am not babbling and someone understands what I mean!  We can set the CRS to WGS84, EPSG:4326.
19838
I've got a project where I'm reading in geometry objects from text files to put them in ArcSDE. These geometry objects have an associated EPSG code, and I'm looking for a way to ensure they're in the right projection when I've finished with them.  Having taken a look at the factory codes that I'm interested in, (GCS GDA94; EPSG:4283, and VicGrid 94; EPSG:3111) for a project I'm working on it appears that the EPSG codes correspond directly to the ESRI factory codes for the spatial reference ( and ). This is great, as it means I don't have to worry about navigating to projection files to create  objects, for example in the code below:  import arcpy  # Create a spatial reference object using a factory code # sr = arcpy.SpatialReference() sr.factoryCode = int(epsg_code.lstrip("EPSG:")) sr.create()   Unfortunately I can't find any reference in the ESRI documentation to say whether this holds true all the time or not - I'm guess it does, but I'd rather know for sure. Does anyone know where I'd be able to find out?
106055
I am trying to make a script which selects every .png file in a folder beginning with the letters "LG". I then want the scipt create a shapefile, replacing the "LG" with "SH", and then i want the script to buffer that shapefile and rename the buffer with the first 2 letters being "SB".  I keep getting an error 99999 error message at line 37! ( gp.RasterToPolygon_conversion(INPUT_RASTER, Output_polygon_features, "SIMPLIFY", "VALUE") )  I have posted this on stackoverflow.com but probably here is a better place as scripting for arcmap is probably quite specialised!  Can anyone offer me any advice to why this script doesnt work? I am running ArcMap 9.3.1. and (attempting) to run the script from pyscripter!  # --------------------------------------------------------------------------- # RASTER2POLYGON.py # Created on: Wed Dec 01 2010 12:20:48 PM #   (generated by ArcGIS/ModelBuilder) # Usage: RASTER2POLYGON &lt;INPUT_RASTER&gt; &lt;Output_polygon_features&gt; &lt;Raster_Buffer_shp&gt; # ---------------------------------------------------------------------------  # Import system modules import sys, string, os, arcgisscripting  # Create the Geoprocessor object gp = arcgisscripting.create()  # Load required toolboxes... gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Conversion Tools.tbx") gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Analysis Tools.tbx")  # Script arguments...  folder = "D:\\J04-0083\\IMAGEFILES" for root, dirs, filenames in os.walk(folder): # returms root, dirs, and files     for filename in filenames:         filename_split = os.path.splitext(filename) # filename and extensionname (extension in [1])         filename_zero = filename_split[0]     try:         first_2_letters = filename_zero[0] + filename_zero[1]     except:         first_2_letters = "XX"      if first_2_letters == "LG":         Output_polygon_features = "D:\\J04-0083\\ShapeFiles.gdb\\" + "SH_" + filename + ".shp"          # Process: Raster to Polygon...          INPUT_RASTER = os.path.join(root + "\\" + filename_zero + ".png")         gp.RasterToPolygon_conversion(INPUT_RASTER, Output_polygon_features, "SIMPLIFY", "VALUE")           Distance__value_or_field_ = "5 Meters"         Raster_Buffer_shp = "SB_" + filename + ".shp"          # Process: Buffer...         gp.Buffer_analysis(Output_polygon_features, Raster_Buffer_shp, Distance__value_or_field_, "FULL", "ROUND", "NONE", "")
23388
I am trying to create raster file in the Mbtiles format. I tried , $ gdal_rasterize -ot Byte  -burn 255 -burn 0 -burn 0 -ts 4950 4090 -of MBTiles station.geojson station.mbtiles   I'm using,  $gdalinfo --version : GDAL 2.1.3, released 2017/20/01  Error:  &gt; ERROR 1: Cannot find min and max zoom_level &gt;  &gt; ERROR 6: Could not find an appropriate zoom level that matches raster &gt; pixel size &gt;  &gt; ERROR 6: Only EPSG:3857 supported on MBTiles dataset &gt; 0...10...20...30...40...50...60...70...80...90...100 - done. &gt;  &gt; ERROR 6: IWriteBlock() not supported if georeferencing not set &gt;  &gt; ERROR 6: IWriteBlock() not supported if georeferencing not set &gt;  &gt; ERROR 6: IWriteBlock() not supported if georeferencing not set   EDIT:  $ ogrinfo station.geojson -so -al  INFO: Open of 'stations.geojson' using driver 'GeoJSON' successful. Layer name: OGRGeoJSON Geometry: Point Feature Count: 86 Extent: (-77.272622, 38.766522) - (-76.842038, 39.119927) Layer SRS WKT: GEOGCS[&quot;WGS 84&quot;, DATUM[&quot;WGS_1984&quot;,    SPHEROID[&quot;WGS 84&quot;,6378137,298.257223563,         AUTHORITY[&quot;EPSG&quot;,&quot;7030&quot;]],     AUTHORITY[&quot;EPSG&quot;,&quot;6326&quot;]],  PRIMEM[&quot;Greenwich&quot;,0,    AUTHORITY[&quot;EPSG&quot;,&quot;8901&quot;]],  UNIT[&quot;degree&quot;,0.0174532925199433,    AUTHORITY[&quot;EPSG&quot;,&quot;9122&quot;]],  AUTHORITY[&quot;EPSG&quot;,&quot;4326&quot;]] name: String (0.0) marker-color: String (0.0) marker-symbol: String (0.0) line: String (0.0)`
103719
I have an image with known boundary and projection EPSG:4326 and want to overlay it to openstreetmap using Leaflet.js.   I have tried using function imageoverlay, but the image is not aligned with the basemap.   L.imageOverlay(imgUrl, [[-15, 75], [45, 145]], {opacity: 0.6, autoZIndex: true});   So, I use gdalwarp to transform the image projection to EPSG:3857.  gdal_translate -of Gtiff -a_ullr -15 145 45 75 -a_srs EPSG:4326 test.png out_4326.tiff gdalwarp -s_srs EPSG:4326 -t_srs EPSG:3857 -ts 850 728 out_4326.tiff out_3857.tiff gdal_translate -of png out_3857.tiff final.png   However, the final image looks like distorted. Here is the original image.    Here is the final image
115029
I'm very new to GIS concepts. Is there a way or procedure of finding out whether the co-ordinate system is in UTM, latitude/longitude or in stateplane using .prj file?   My .prj file contains the following text:      GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS   84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]
66903
I'm coding an app with Phonegap, which requests user's current position. As an overlay I have loaded a geojson layer. I want the app to automatically extract a value of said layer at the exact location, where the user currently is (without the user manually clicking on the layer).  I've tried Leaflet PIP extension, but couldn't get it to work with leaflet 1.0.3. I've also tried simulating a touch/mouseclick event at screen coordinates, but that didn't work either.  I've found the extension Leaflet.PointInPolygon, which can check, if a point is lying within a polygon. Therefore a transformation from geojson to an array with coords is required.  I wrote the following code to parse my geojson and write it into arrays to add polygon layers to my map (in order to check later, if map.getCenter() coords are within any of these):  var coord = []; for (var i = 0; i &lt; data.features.length; i++) {   feat = data.features[i];    for (var j = 0; j &lt; feat.geometry.coordinates.length; j++) {     coord = feat.geometry.coordinates[j];      var polygon = L.polygon(coord, { color: "red" }).addTo(map);   } }   I'm facing the prolem now  that lat and lon are in the wrong order:  [[10.77932197941255,52.03584196145097],[10.77932197941255,52.03575906909681],[10.779636389761993,52.03575906909681],[10.779636389761993,52.03584196145097],[10.77932197941255,52.03584196145097]]   How can I fix this?  Is there maybe a leaflet extension or javascript framework, which can directly check, if given coordinates are within a geojson object?
91665
How can I show features (from an example file)? I tried many, many ways. This is a different route using a standard GML example file from OpenLayers. Problem : With the shown code example, I don't see any features. There are no error messages. In an Angular / typescript environment I tried also:   let polygonStyle = new Style({   fill: new Fill({     color: &quot;rgba(255, 0, 0, 0.8)&quot;   }),   stroke: new Stroke({     color: &quot;#ffcc33&quot;,     width: 10   }) }); let vectorSource = new VectorSource({   format: new WFS({gmlFormat: new GML3() }),   url: 'http://osgis.terragis.net/openlayers/examples/gml/polygon.xml', }); this.vectorLayer = new Vector({   source: vectorSource,   style: [polygonStyle] });  this.map = new Map({   layers: [     new TileLayer({       source: new XYZ({         url: &quot;https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png&quot;       })     }),     this.vectorLayer   ],   view: new View({     center: transform([0.532597, 47.428810], 'EPSG:4326', 'EPSG:3857'),     zoom: 12   }),   target: &quot;map&quot; });
23703
I have a GeoJson file that I want to convert to ESRI Shapefile using ogr2ogr in FWTools.  I tried using   ogr2ogr -F "ESRI Shapefile" filename.shp geojsonfile.json OGRGeoJSON   I got output      ERROR 6: Can't create fields of type StringList on shapefile layers. ERROR 1: Attempt to write non-polygon (POINT)   geometry to  type shapefile. ERROR 1: Terminating translation   prematurely after failed translation of layer OGRGeoJSON   GeoJSON input we are giving is in standard geojson format.  content of geojson are like  {to share I took only a part from features array }  {"id":1223, "properties":{"name":"3","level":2}, "map_version":11,"type":"FeatureCollection","x_id":1234,"obj_type":"LevelGeometry", "features":[  { "my_area":[131.40093253528894,33.58879853190332,6.515867411008615,3.490549810987222,-0.6237271428108215], "id":1984791, "location":{"type":"Point","coordinates":[131.4009325,33.5887985]}, "properties":{"display_name":"xyz"}, "type":"Feature", "geometry":{"type":"Polygon","coordinates":[[[131.4009508,33.5888314],[131.4008895,33.5887946],[131.4009148,33.5887653],[131.4009761,33.5888020],[131.4009508,33.5888314]]]}, "obj_type":"Geometry" }  ] }