From: kmishler <kmish...@arinc.com>
Date: Thu, 17 Jan 2008 11:18:41 -0800 (PST)
Local: Thurs, Jan 17 2008 2:18 pm
Subject: GeoDjango: distance calculation
We are starting to use geodjango (revision 7003) and are having
problems using the api to calculate distance. class Airport(models.Model):
The location field will eventually be populated using lat/longs from a
For now, I populated 3 records in the table:
Airport.objects.create(icao="KBWI",
When I try to use the api to get distance, I do not get the correct
point = Airport.objects.get(icao="KBWI").location
EGLL: 77.1935295397, 0.000727473678024
select icao, ST_distance(ST_GeomFromText('POINT(-76.668333333333337
select icao,
Using distance_sphere, I get the correct results. Is there any way to
I also tried using the SRID 32140:
class Airport(models.Model):
I used the same code to populate the records - it's nice that
When I try to use the api to get distance, I get closer results, but
point = Airport.objects.get(icao="KBWI").location
EGLL: 6258767.81814, 3379.46426466
Is there any way to use the django api to get the distance?
Versions:
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||