Wednesday, September 1, 2010

Re: GeoDjango: default 4326 SRID doesn't work for transform()

On 08/30/2010 04:14 PM, kyleduncan wrote:
> Hi,
>
> thanks for the tips! to answer your questions:
>
> 1. our model doesnt specify a coordinate system, it just saves the lat
> and lng that are returned from google maps.
> 2. i thought transforming had to be done to make a lat/lng point
> "spatial" before distance was calculated. have i got that wrong?
> 3. i'm not actually sure we even have a "geodatabase". all we have are
> pointfields in the model for users, which save the lat/lng points from
> google.

Those PointFields are what make it a geo database (well, that's how I
use the terminology anyway).

So your_object.your_point_field.distance(another.your_point_field) ought
to give you a distance alright.

I don't know from the top of my head which unit that distance is in.
I've only had to pick the closest one till now :-)

> i'm not really capable enough to know how to proceed on my own from
> your points, but for now i'll try removing the transform() (and also
> placing it after) and i'll also specify the transform SRID of 900973
> (is that the SRID for google or are you talking about something else
> with that number?)

Oopsie, that's 900913 instead of 900973 (google written in characters
that look a bit similar).


Reinout

--
Reinout van Rees - reinout@vanrees.org - http://reinout.vanrees.org
Collega's gezocht!
Django/python vacature in Utrecht: http://tinyurl.com/35v34f9

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

No comments:

Post a Comment