On 13 June 2010 06:24, Tyler Andersen <[email protected]> wrote:
> I'm trying to figure out how to take two Point objects and determine
> the distance between them.
>
> It seems that it is trivial to search the DB (well, provided that I'm
> not using mySQL, which I am) to filter by distance, however, that's
> not what I'm looking for at the moment.
>
> I have a set of Point objects, and I'd like to compute the distance in
> miles for each.
>
> For Point objects a, b, one can "a.distance(b)", however, a number is
> returned not a Distance object. I'm having trouble finding
> documentation on what this value represents (I could perhaps plug it
> into D(????=a.distance(b)).mi).

Try this query on the Geodjango list: http://groups.google.com/group/geodjango

But to try and answer your question:

Are you trying to get the distance of a set of objects from a point?

So for example, say you were looking for houses from a railway
station? Or are you looking at finding the distance between each of a
set of points that have an order? Like waypoints on a path?

As for what metric it returns, I'd say have a look at the documentation here:
http://docs.djangoproject.com/en/dev/ref/contrib/gis/db-api/#distance-lookups


Hope that helps,
Cheers,
Dan







>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>



-- 
Dan Hilton
============================
www.twitter.com/danhilton
www.DanHilton.co.uk
============================

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to