开发者

How to create a polygon from a central point with GeoDjango

开发者 https://www.devze.com 2023-04-13 04:25 出处:网络
I want to create a polygon from a point and a radius. For example, I want to be able to give a point (latitude, longitude) with a given radius (ex. 10km) and calculate the circle and store it as poly

I want to create a polygon from a point and a radius.

For example, I want to be able to give a point (latitude, longitude) with a given radius (ex. 10km) and calculate the circle and store it as polygon.

The goal is to be able to query my application with points and ask it if the given point is within a given radius of another point.

Maybe I'm doing it wrong, if t开发者_如何学运维here is a simplier way to achieve this I'd be glad to ear about it.

Thanks


I do not see why you need a circle. given two points you can use geopy to calculate distances : http://code.google.com/p/geopy/wiki/GettingStarted#Calculating_distances

an almost identical question: Django model property geo distance

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号