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.
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.
A degree of longitude is about 111 kilometers (69 miles) at its widest. The widest areas of longitude are near the Equator, where Earth bulges out. Because of Earth's curvature, the actual distance of a degrees, minutes, and seconds of longitude depends on its distance from the Equator.
Since one degree (1°) near the equator is equivalent to about 111 km, either moving to south or north poles of both the longitude and the latitude, though slight difference of about 1km. Therefore, 0.25° by 0.25° gridded degree is equivalent to about 27.75 km, while 0.5° by 0.5° is about 55km.
1 deg lat is approx 110.567 km at the equator to 111.699 km at the poles.
This link
might be of interest to you. The conversion is based on the circumference of the earth divide by 360 degrees.
1 deg long is also approx 111km at the equator and -> 0 as you go to the poles.
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.)
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With