将距离转换为坐标
如何将给定距离(以米为单位)转换为地理坐标。
我需要的是在地图上绘制一个多边形(正多边形,如圆),但是,它的半径以米为单位,如何计算以度或弧度为单位的半径?
我可能会用 c 编码
How do i convert a given distance (in metres) into geographic coordinates.
What I need is to draw a polygon on the map (a regular polygon, like a circle), however, it's radius is given in meters, how do I calculate the radius in degrees or radians?
I'll probally code it in c
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
天哪,地理坐标可能会让人很头疼。首先,我假设地理坐标指的是大地坐标(纬度/经度)。
其次,你找不到以弧度或度为单位的“半径”。你问为什么?嗯,赤道的经度一度比靠近北极或南极的经度长得多。由于地球不是完美的球体,一纬度的弧度也会根据您在地球上的位置而变化。它通常被建模为椭球体。
话虽如此,这里有两种将多边形坐标映射到经纬度坐标的方法:
1) 如果你感觉自己是个十足的坏蛋,你可以用经纬度进行数学计算。很多三角函数,很容易犯错误……不要这样做。我在这里添加这个选项只是为了让您知道这是可能的。
2) 将您的大地坐标转换为UTM。然后,您可以以米为单位执行您需要执行的任何操作(即查找多边形的顶点),然后将生成的 UTM 转换回大地测量。就我个人而言,我认为这是要走的路。
Oh man, geographic coordinates can be a pain in the behind. First of all, I'm assuming that by geographic coordinates, you're talking about geodetic coordinates (lat/lon).
Second of all, you can't find a "radius" in radians or degrees. Why, you ask? Well, one degree of longitude at the equator is WAY longer than one degree of longitude close to the north or south pole. The arc of one degree latitude also changes based on your location on the earth since the earth is not a perfect sphere. It's usually modeled as an ellipsoid.
That being said, here are two ways to map the coordinates of a polygon onto lat-lon coordinates:
1) If you're feeling like a complete badass, you can do the math in lat-lon. Lots of trig, easy to make mistakes... DON'T DO IT. I'm just including this option here to let you know that it is possible.
2) Convert your geodetic coordinates to UTM. Then, you can do whatever you need to do in meters (i.e. find the vertices of a polygon), and then convert the resulting UTM back to geodetic. Personally, I think this is the way to go.
好吧,考虑一下在赤道(纬度 0 度),1 经度大约等于 60 海里。在任一极(纬度 90 度),单经度等于 0 海里。我记得纬度乘以 60 的余弦将为您提供单个经度的纬度处的近似距离(以海里为单位)。
但是,您的准确度必须考虑到您正在使用的地图投影。对于航空地图,他们使用兰伯特等角圆锥投影,这意味着只有沿圆锥体与地球球体相交的两个纬度上的距离才准确。但如果近似值足够好,您可能不需要精确度。
换算下来,一海里等于 1.852 公里。如果我计算正确(不能保证,我已经 70 多岁了),这意味着一米等于(除非你非常接近两极)0.0000009 度的纬度。它还等于赤道上的 0.0000009 度经度。如果您不在赤道,请将 0.0000009 除以纬度的余弦即可得到经度。
因此,纬度 45 度处半径为 1000 米的圆意味着纬度为 0.0009 度,经度为 0.0009/0.707 度的半径。当然是大约。
所有这些都来自记忆,所以请持保留态度。如果你真的想参与其中,谷歌地理方程或类似的东西。
Well, consider that at the equator (0 degrees latitude) one degree of longitude is equal to appximately 60 nautical miles. At either pole (90 degrees latitude) a single degree of longitude equals 0 nautical miles. As I remember the cosine of the latitude times 60 will give you the approximate distance in nautical miles at that latitude of a single degree of longitude.
However, how accurate you would be would have to account for the map projection you're using. For aeronautical maps, they use the Lambert Conformal Conic projection, which means distances are only exactly accurate along the two latitudes that the cone cuts the sphere of the earth. But if an approximation is good enough, you may not need the accuracy.
For conversion, one nautical mile equals 1.852 km. If I did the arithmetic properly (no guarantee, I'm in my 70s), that means that a meter equals (except as you get really close to the poles) 0.0000009 degrees latitude. It also equals 0.0000009 degrees longitude on the equator. If you're not at the equator, divide the 0.0000009 by the cosine of the latitude to get the degrees of longitude.
So, a 1000 meter radius circle at 45 degrees latitude would mean a radius of 0.0009 degrees latitude and 0.0009/0.707 degrees longitude. Approximately of course.
All this is from memory, so take it with a grain of salt. If you really want to get involved, Google geographic equations or some such.
查看http://trac.osgeo.org/proj/wiki/GeodesicCalculations。根据您需要的准确性,这可能会变得相当复杂,因此您最好从一些现有代码开始。
Check out http://trac.osgeo.org/proj/wiki/GeodesicCalculations. Depending on the accuracy you need, this can get pretty complicated, so you're probably best off starting from some existing code.