djangosnippets.org: Latest snippets tagged with 'distance'https://djangosnippets.org/tags/distance/2007-04-18T19:21:58.620102-05:00Find nearby objects
2007-04-18T19:21:58.620102-05:00paulsmithhttps://djangosnippets.org/snippets/190/<p>This code assumes a) that you are using PostgreSQL with PostGIS and b) that the geometry column in your model's table is populated with points, no other type of geometry.</p>
<p>It also returns a list instead of a QuerySet, because it was simpler to sort by distance from the given …</p>
Freely redistributable