On 08/25/2010 02:57 AM, Sam Walters wrote:
Hi fellow Django developers
I have Lat/Lng points stored in my db:
class Airfield(models.Model):
point = models.PointField(srid=4326)
I noticed when i query on my development server with postgresql i DONT
have to have the EXACT number of decimal places to find that point.
(what i want)
However on the production server if i ask for a point then i have to
give the exact same number with the same number of decimal places.
(undesired)
Production server is postgresql-8.3 where as my development server is
postgresql-8.4
Obviously the db backend is behaving differently.
8.4:
-32.6666666667 == -32.66666667
8.3:
-32.6666666667 != -32.66666667
Obviously, this is a problem.
But: do you need to *have* the problem? I mean, why would you look up
the airfield in the DB, grab x/y and then try to grab the same one back
again with the exact coordinates?
Normally, searching by coordinates would mean clicking on a map which
results in a DB query with a location plus a margin around that location.
=> Can you work with a "search radius" in your query?
Reinout
--
Reinout van Rees - [email protected] - http://reinout.vanrees.org
Programmer at http://www.nelen-schuurmans.nl
"Military engineers build missiles. Civil engineers build targets"
--
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.