> I'm calculating the distance between two plain PointFields in the GIS
> branch using the distance GeoQuerySet method [1] and I'm coming up
> with some confusing results.
>

I require more information before I can answer your inquiry:

(1) What geographic fields are in your model, what type are they
(e.g., PointField, etc.), and their SRID.
(2) The geometry type of the parameter you're passing to `distance`,
and its SRID.

> The distance between nearby things is often about right, maybe off by
> a mile or two. But the distance between farther locations is off by
> quite a bit. The distance between Salt Lake City and Chicago is
> reported as just over 10,000 miles, for example.

My guess is that you're trying to calculate distances from a projected
coordinate system to a geodetic point that is outside the valid range
of your projection.  For example, if I had a model in the projected
coordinate system of SRID=32140 (only valid for South Texas[1]), and I
attempted to calculate distances from my model to a WGS84 point
referencing Denver, CO (SRID=4326) then I would get garbage distances
returned because Denver is well outside the valid range for 32140.  If
I were to use a WGS84 point referencing San Antonio instead of Denver
valid results would be returned.

[1] http://spatialreference.org/ref/epsg/32140/
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to