Opened 17 years ago
Closed 17 years ago
#6414 closed (fixed)
Add support for geodetic coordinate systems in GeoDjango distance API.
Reported by: | jbronn | Owned by: | jbronn |
---|---|---|---|
Component: | GIS | Version: | gis |
Severity: | Keywords: | gis distance geodetic sphere | |
Cc: | jbronn@… | Triage Stage: | Accepted |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Currently the GeoDjango distance API will produce inaccurate results for calculating distances on geodetic coordinate systems. The PostGIS distance_sphere
provides such support, however, it only works on points (see PostGIS Reference - Measurement Functions).
Also discussed on the django-users mailing list.
Change History (2)
comment:1 by , 17 years ago
Status: | new → assigned |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
In ([7104]). gis: Fixed #6414, and applied DRY to spatial backend internals. Changes include:
(1) Support for distance calculations on geometry fields with geodetic coordinate systems (e.g., WGS84, the default).
(2) Theget_db_prep_save
andget_db_prep_lookup
have been moved from the spatial backends to common implementations inGeometryField
.
(3) Simplified SQL construction forGeoQuerySet
methods.
(4)SpatialBackend
now contains all spatial backend dependent settings.
The current implementation works for both PostGIS and Oracle spatial backends. The PostGIS
ST_distance_spheroid
routine is used for geodetic distance calculations, and is limited to point-to-point comparisons -- although it is slower thanST_distance_sphere
, it is more accurate. See PostGIS documentation at ch. 6.3.2.