Django

Code

Ticket #6414 (closed: fixed)

Opened 11 months ago

Last modified 10 months ago

Add support for geodetic coordinate systems in GeoDjango distance API.

Reported by: jbronn Assigned to: jbronn
Milestone: Component: GIS
Version: gis Keywords: gis distance geodetic sphere
Cc: jbronn@gmail.com Triage Stage: Accepted
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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.

Attachments

Change History

02/10/08 19:33:00 changed by jbronn

  • status changed from new to assigned.
  • needs_better_patch changed.
  • stage changed from Unreviewed to Accepted.
  • needs_tests changed.
  • needs_docs changed.

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 than ST_distance_sphere, it is more accurate. See PostGIS documentation at ch. 6.3.2.

02/10/08 20:33:36 changed by jbronn

  • status changed from assigned to closed.
  • resolution set to fixed.

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) The get_db_prep_save and get_db_prep_lookup have been moved from the spatial backends to common implementations in GeometryField. (3) Simplified SQL construction for GeoQuerySet methods. (4) SpatialBackend now contains all spatial backend dependent settings.


Add/Change #6414 (Add support for geodetic coordinate systems in GeoDjango distance API.)




Change Properties
Action