将 GPS 坐标转换为坐标平面
这与我问的另一个问题有些相关: 将 GPS 坐标转换为位置PDF 地图。这让我走到了这一步,现在我被数学困住了。
假设我有一个建筑物的平面图,我从建筑物的每个角落获取了 GPS 坐标读数。还假设平面图与纬度和经度对齐。
如何将 GPS 坐标转换为地图上的 X,Y 位置?我似乎无法正确计算数学。
This is somewhat related to another question I asked: Translate GPS coordinates to location on PDF Map. That got me to this point, now I'm stuck on the math.
Let's say I have a floor plan of a building, I've taken gps coordinate readings from each corner of the building. Also assume that the floor plan is lined up with the latitude and longitude.
How do I convert a GPS coordinate to a X,Y position on this map? I can't seem to get the math right.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
令
delta_long
和delta_lat
为建筑物角落 GPS 坐标的差值(以度为单位)。令delta_x = 320
和delta_y = 480
(比如说英尺)。然后:vertical_scale = delta_y/delta_lat
,单位为英尺/度纬度horizontal_scale = delta_x/(cos(latitude)*delta_long)
,单位为英尺/度经度。cos(latitude)
因子补偿 1 度经度的长度变化当一个人从赤道移动到两极时。对于这个应用程序,我们可以假设
建筑物的北端和南端之间不会发生明显变化。
然后对于任何附近的(纬度,经度)点,减去西南坐标
建筑物的一角,并在明显的地方应用垂直和水平尺度
相对于建筑物布局定位该点的方法。
Let
delta_long
anddelta_lat
be the differences, in degrees, in the GPS coordinates of the building's corners. Letdelta_x = 320
anddelta_y = 480
(feet, let's say). Then:vertical_scale = delta_y/delta_lat
with units feet/degree latitudehorizontal_scale = delta_x/(cos(latitude)*delta_long)
with units feet/degree longitude.The
cos(latitude)
factor compensates for the varying length of 1 degree of longitudeas one moves from the equator to the poles. We can assume for this application that
it won't change appreciably between the north and south ends of the building.
Then for any nearby (lat,long) point, subtract off the coordinates of the southwest
corner of the building, and apply the vertical and horizontal scales in the obvious
way to locate that point with respect to the building layout.
您需要做的是计算纬度/经度点的 ECEF 坐标:
经纬度、GPS转换
What you need to do is calculate the ECEF coordinates of the lat/long point:
Latitude and Longitude, GPS Conversion