I would like to find out what projection is google map using is it EPSG:4326 or P900913 ? Also if you use the drawing tools what projection coordinates are generated?
EPSG3857 is the official designation.
Interactive web maps are using "Spherical Mercator" system which uses Mercator projection on
the sphere instead of WGS84 ellipsoid.
More information
Google Maps uses the Mercator projection for this purpose
https://developers.google.com/maps/documentation/javascript/maptypes#WorldCoordinates
Related
I'm building a web application using Angular and mapbox-gl-js as map library.
The map tiles are projected using EPSG:4326 Plate-Carrée and the dataset is GeoJson (WGS84).
Since mapbox supports only web mercator projection, the data is not displayed in the correct position on map.
Any suggestions how to reproject the dataset so mapbox is able to display the data in the correct location?
Thanks.
If I understand your question correctly, you have some raster tiles which are "projected" (well, not really) in EPSG:4326, and you would like to display them in Mapbox-GL-JS. You also have another dataset, in GeoJSON, also provided in EPSG:4326, which you would like to overlay.
As you note, Mapbox-GL-JS only supports the EPSG:3857 (Web Mercator) projection. It projects datasets (but not raster tiles) from EPSG:4326 to EPSG:3857 in order to display them.
Your good options are:
Find a different basemap in Web Mercator
Find a web service which can reproject the tiles you have on the fly
Maybe there's some way where you could let Mapbox-GL-JS think it's displaying your tiles in EPSG:3857, then somehow adjust the coordinates of your overlaid dataset so that when they're reprojected from EPSG:4326 to EPSG:3857 they end up in the right positions. But I can't think how to achieve that.
You could try asking at gis.stackexchange.com.
I use EPSG:3857 projection for View in Map. I can easily add OSM to my map.
When I use EPSG:3395 projection for View, I can easily add tile-layer with source in EPSG:3395(world mercator) projection.
But how to combaine on map tile-layers with different source projection(3857 and 3395) ? Is it possible in openlayers-3 ?
Thanx!
Not yet possible, should be possible around october when raster reprojection work has been finished.
https://github.com/openlayers/ol3/issues/3785
I have a simple Google Map. I've added a marker at a given lat, lng.
I want to use turf.js to calculate a 1km buffer which I can then display as a Google Maps polygon.
The path that turf.buffer() returns is an ellipse. The distance from the marker to the boundary is correct latitudinally. However it is short of 1km longitudinally. It looks like there is a problem with the projection, however both the Google Maps API and turf.js documents state WGS84 is the default projection.
The end game is using turf.js to buffer Points, Polylines and Polygons so I can't just draw a Google Maps circle as a workaround unfortunately. I would consider migrating to Leaflet, however we are already quite invested in developing for the Google Maps API
I've created an htm file here showing the problem
I'm not going nuts. The buffer isnt geodesic so at the equator you get a round buffer and as you move north or south your buffer becomes squashed longitudinally towards the poles. The turf.js team are aware. See https://github.com/Turfjs/turf/issues/110 for full details.
I'm looking at using clipper.js instead. This is a cartesian library (2d) so in the uk i can use osgb eastings and northings. I will also have to flip north and south as clipper assumes we are dealing with standard graphics i.e. The y axis is inverted like in css with 0,0 being the top left.
Im going to use geotools to transform between osgb and wgs.
I need to get an equirectangular projected map out of TileMill (http://en.wikipedia.org/wiki/Equirectangular_projection).
I found a tutorial online explaining how to get a different projection by altering the project's setting in the 'project.mml' file.
(http://blog.kartena.se/using-tilemill-without-spherical-mercator/)
And I found what I thought to be a description of the necessary srs code for an equirectangular projection:
"srs": "+proj=longlat +ellps=WGS84 +no_defs"
However, the map no just shows a long thin line of water, nothing else, so clearly that's not quire right.
I've been scouring for more detail about how to set this up but I'm totally stumped.
The Web Mercator projection is no good for my purposes.
Anyone know how to do this?
Thanks so much.
S
This won't be possible in TileMill itself: the software is designed to output Spherical Mercator tiles only. Your best option would be to export Mapnik XML from TileMill, modify it to support EPSG:4326, and then serve the tiles from something like TileStache.
I have a working system with Google map API v2. I need migrate it on v3. I use some projections and point, which stored in own projection. So i need convert this points to latlong. How i can do this? Or i need set some options in the map and use needed projection?
for example I have point with coordinates x: 332525.708620, y: 389976.561487 in 27700 projection.
Use these functions...
fromPointToLatLng()
fromLatLngToPoint()