2
votes
0answers
75 views

GeoDjango order_by('distance') not working as expected?

Using GeoDjango, I am trying to sort a list of users based on the distance from a point. It does generate a list, but its not ordered by distance, though I specify that in my query. This is the query ...
2
votes
1answer
141 views

GeoDjango: read geometry column in geography field

I have a Django application that needs to work with an existent PostGIS database, apart from its own database. I've configured multidatabase support, created a database router, created models for the ...
1
vote
0answers
334 views

Get the distance between 2 WGS84 GEOSGeometries

I currently want to check if 2 given GEOSGeometry objects of type Point are within 100m of each other. (length flexible) Looking at previous asked questions on this topic, most of the answers were ...
1
vote
2answers
635 views

GeoDjango Order by distance for Model that is linked to User who has a location on their user profile

I need to order my query model by distance, however the point field in question is not on the model class but on the user profile and the i am getting an error when attempting the following. g = ...
4
votes
4answers
2k views

Geodjango- get the distance between 2 points

Sorry to be asking yet another geodjango newbie question. What I want to do is quite simple, I have 2 locations defined by gps coords, lat / long like returned by google maps: ...
2
votes
1answer
1k views

Using a geodjango PointField with geography=True, my distance calculations are wrong

Here's my model: class ExchangeArea(models.Model): """ An Exchange Service Area, calculated from a phone exchange and surrounding census tracts. """ coordinates = ...
2
votes
1answer
531 views

How do I query for all polygons within a distance from a point?

Call me stupid, but somehow I couldn't figure out how to do the following. I've got a testing shapefile with 18 features, which I successfully imported into GeoDjango (1.3, running on Spatialite). As ...
5
votes
5answers
720 views

Getting a square mile bounding box anchored by coordinates?

Let's say I have a lat/lng coordinate pair. I want to determine the coordinates that would create a square mile box. The existing coordintae pair would be the top left of the box, and the coordinate ...