openlayers – OSM: convert ties from projected coordinates in spherical mercator ‘EPSG:900913’ to ‘EPSG:4326’ coordinates – StackOverflow

Why not just get OpenLayers to project it back for you? So if you want the centre point as WGS84 then just do: I think you'll find that will do what you want anyway, at least if I've understood the question right... By the way, EPSG:4326 is the natural WGS84 lat/lon values that you seem to be looking for - the large numbers are the projected coordinates in spherical mercator, which is EPSG:900913. var lonLat = new OpenLayers.LonLat(40.4088576, -86.8576718) .transform( new OpenLayers.Projection('EPSG:4326'), // transform from WGS 1984 map.getProjectionObject() // to Spherical Mercator Projection ), public PointF TileToWorldPos(double tile_x, double tile_y, int zoom) { PointF p = new Point(), double n = Math.PI - ((2.0 * Math.PI * tile_y) / Math.Pow(2.0, zoom)), p.X = (float)((tile_x / Math.Pow(2.0, zoom) * 360.0) - 180.0), p.Y = (float)(180.0 / Math.PI * Math.Atan(Math.Sinh(n))), return p, } By the way, EPSG:4326 is the natural WGS84 lat/lon values that you seem to be looking for - the large numbers are the projected coordinates in spherical mercator, which is EPSG:900913. Source.


Яндекс.Метрика Рейтинг@Mail.ru Free Web Counter
page counter
Last Modified: April 18, 2016 @ 11:12 pm