Opened 18 years ago
Closed 18 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 , 18 years ago
| Status: | new → assigned |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
comment:2 by , 18 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_saveandget_db_prep_lookuphave been moved from the spatial backends to common implementations inGeometryField.
(3) Simplified SQL construction forGeoQuerySetmethods.
(4)SpatialBackendnow contains all spatial backend dependent settings.
The current implementation works for both PostGIS and Oracle spatial backends. The PostGIS
ST_distance_spheroidroutine 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.