确定给定地图中的投影
我意识到这可能不是一个编程问题,但这是我作为程序员不断遇到的问题,所以我认为这里的其他人可能有有用的知识可以分享。
我有一张地球某个区域的地图(可以是任何区域,但这里是 示例)我应该如何确定地图中使用的投影,然后如何以编程方式将纬度和经度坐标转换为图像上的像素位置。
目前我有 matlab 代码来打开图像并绘制结果 (x,y) 坐标,但我不知道如何将纬度/经度转换为 x,y!
任何帮助将不胜感激。
I realise this is potentially not a programming question, however its a problem I keep bumping into as a programmer, so I figure others here might have useful knowledge to share.
I have a map of a region of the earth (it could be any, but here's an example) how should I determine the projection used in the map and then how should I programatically transform latitude and longitude coordinates into pixel positions on the image.
At the moment I have matlab code to open the image and plot the resulting (x,y) coord, but I can't figure out how to convert lat/longs to x,y!
Any help at all would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
地理坐标是球坐标的变体。您可以将它们转换为正常坐标:
这并不准确,因为地球并不完全是一个球体。根据地图的类型,有多种方法可以从中获取 2D 坐标。图像可以从球体投影到圆柱体或两个平面。
这些链接可能会有所帮助:
Geographic coordinates are a variation of spherical coordinates. You can transform them to normal coordinates:
This is not really accurate because Earth is not exactly a sphere. Depending on the type of the map there are several ways to obtain 2D coordinates from these. The image may be projected from the sphere to a cylinder or two planes.
These links might help:
事实证明,以编程方式计算地图的投影是一项复杂的图像处理任务。我设法解决这个问题的方法是简单地使用具有明确定义的投影的地图 - 例如,谷歌地图使用墨卡托投影,英国的大多数地图也是如此(因为我们的英国参考网格基于通用横轴墨卡托投影)。
我希望这可以帮助别人!
It turns out that programatically calculating the projection of a map is a complex task of image processing. The way I managed to get around this problem is simply using maps that have well defined projections - for example Google maps use the Mercator projection, as do most maps of the UK (as our British Reference Grid is based on the Universal Transverse Mercator).
I hope this helps someone else out!