简体   繁体   English

给定地图图像,将x和y坐标转换为纬度和经度

[英]Given an image of a map convert an x and y coordinate to Latitude and Longitude

I have an image of a Mercator map (4000px by 2828px). 我有一张墨卡托地图的图像(4000像素乘2828像素)。 I know that the longitude on the left is -170, the longitude on the right is 190, and the latitude on the bottom is 85. 我知道左边的经度是-170,右边的经度是190,底部的纬度是85。

I'm able to calculate the x and y given a latitude and longitude from the solution at Mercator longitude and latitude calculations to x and y on a cropped map (of the UK) . 我可以从Mercator经度和纬度计算的解到裁剪后的地图(英国)上的x和y来计算给定的纬度和经度的x和y However, I'm looking for the reverse. 但是,我正在寻找相反的方向。 There are a few comments describing the reverse, but you do not get the same points if you go back and forth between the two equations. 有一些注释描述了相反的含义,但是如果在两个方程之间来回移动,您将得不到相同的观点。

Given an x and y pixel coordinate how do I calculate the latitude and longitude on the map? 给定x和y像素坐标,如何计算地图上的纬度和经度?

Have a look at the Javascript implementation on this page . 此页面上查看Javascript实现。

You can use the Conv.m2ll() function: 您可以使用Conv.m2ll()函数:

var latlon=Conv.m2ll(pixel_x, pixel_y);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM