问题描述
根据这个答案,我使用GEOS API中的缓冲区方法创建一个基于GeoDjango中的一个点和一个半径的圆圈。
I'm using the "buffer" method from the GEOS API to create a circle based on a point and a radius in GeoDjango, according to this answer: GeoDjango: How to create a circle based on point and radius
正如一位评论者指出的那样,您必须将公里的半径转换为度数,但如何?我想这是一个快速的公式,但它是我的希望。我会感谢任何指针。
As one commenter noted, you'll have to convert the radius in km to degrees... but how? I guess it's a quick formula but it's greek to me. I'd be grateful for any pointers.
推荐答案
答案可能取决于地球上的位置。在赤道附近,1km距离纬度经度大致为0.008度(1公里/ 40,000公里* 360度),但在极点附近,1公里将大致相等于纬度0.008度,但可能有许多经度。 (如果距离杆1公里,1公里的西将带你大概57度的西经。)
The answer may depend upon location on earth. Near the equator, 1km is going to equal roughly 0.008 degrees (1 km / 40,000 km * 360 degrees) of latitude and longitude, but near the poles, 1km is going to equal roughly 0.008 degrees latitude, but could be many many degrees longitude. (If you're 1km away from the pole, 1km travel 'west' would bring you roughly 57 degrees of longitude west.)
但是,如果API只是想要度沿着一个伟大的圈子作为测量,也许足够使用(n km / 40,000公里* 360度)。至少40,000公里对我来说足够好:)更准确的数字。
But, if the API just wants degrees along a great circle as the measurement, perhaps it'd be sufficient to use (n km / 40,000 km * 360 degrees). At least, 40,000km is "good enough for me" :) more accurate numbers are available.
这篇关于如何在Geodjango / GEOS中将公里转化为度数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!