将GPS坐标转换为坐标平面 [英] Convert GPS coordinates to coordinate plane
问题描述
这与我提出的另一个问题有些相关:翻译GPS坐标到PDF地图上的位置。这让我到现在为止,现在我被困在数学上了。
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.
假设我有一个建筑物的平面图,我已经从gps坐标读取建筑物的每个角落。还要假设平面图与纬度和经度对齐。
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.
如何将GPS坐标转换为此地图上的X,Y位置?我似乎无法获得数学权利。
How do I convert a GPS coordinate to a X,Y position on this map? I can't seem to get the math right.
推荐答案
让 delta_long
和 delta_lat
是建筑物角落的GPS坐标中的度数,以度为单位。让$ code> delta_x = 320 和 delta_y = 480
(脚,让我们说)然后:
Let delta_long
and delta_lat
be the differences, in degrees, in the GPS coordinates of the building's corners. Let delta_x = 320
and delta_y = 480
(feet, let's say). Then:
vertical_scale = delta_y / delta_lat
单位英尺/度纬度
horizontal_scale = delta_x /(cos(纬度)* delta_long)
,单位英尺/度经度。
horizontal_scale = delta_x/(cos(latitude)*delta_long)
with units feet/degree longitude.
cos(纬度)因素补偿了从赤道到极点的1度经度
的变化长度。我们可以为这个申请假设
它不会在建筑物的北端和南端之间明显变化。
The cos(latitude)
factor compensates for the varying length of 1 degree of longitude
as 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.
这篇关于将GPS坐标转换为坐标平面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!