计算X和Y位置上的PNG地图的GPS坐标 [英] Calculate X and Y position on a PNG Map from GPS Coordinate

查看:451
本文介绍了计算X和Y位置上的PNG地图的GPS坐标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我实现自定义地图(图像尺寸地图宽度和地图高度)的iPhone应用程序,我试图表明在此显示当前用户的位置(current_long和current_lat)

I'm implementing a custom maps (image with size map_width and map_height) on an iPhone app and i try to show the current user position on this map (current_long and current_lat)

我有2个基准点,与已知的GPS坐标(ref1_long,ref1_lat,ref2_long和ref2_lat)和已知的X,以像素为单位Y位置(ref1_x,ref1_y,ref2_x和​​ref2_y)

I have 2 references points with a known GPS coordinates (ref1_long, ref1_lat, ref2_long and ref2_lat) and known X, Y positions in pixels (ref1_x, ref1_y, ref2_x and ref2_y)

我的问题是:如何根据这些信息计算current_x和current_y

My question is: how to calculate the current_x and current_y according to these informations ?

推荐答案

最有可能的映射使用mercantor投影。问题是,地球是一个球体,但你只有2地图上的尺寸。您需要的坐标的4个角的地图和地图的尺寸​​。的y地图值不会改变,但对于X映射值你所需要的mercantor投影。然后,它成为一个线性变换和宽度或地图的高度可以是从输入稍有不同:转换纬度/经度为像素坐标?

Most likely the map uses a mercantor projection. The problem is that the earth is a sphere but you have only 2 dimensions on a map. You need the co-ordinate of the 4 corners of the map and the map dimensions. The y-map value doesn't change but for the x-map value you need the mercantor projection. Then it become a linear transformation and either the width or the height of the map can be slightly different from the input:Convert lat/lon to pixel coordinate?.

这篇关于计算X和Y位置上的PNG地图的GPS坐标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆