#25498: PostGIS Distance lookups use ST_Distance_Sphere() and not ST_Distance()
-------------------------------+------------------------------------
     Reporter:  iambibhas      |                    Owner:  nobody
         Type:  Bug            |                   Status:  new
    Component:  Documentation  |                  Version:  master
     Severity:  Normal         |               Resolution:
     Keywords:                 |             Triage Stage:  Accepted
    Has patch:  1              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  1
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+------------------------------------
Changes (by claudep):

 * needs_better_patch:  0 => 1
 * stage:  Unreviewed => Accepted


Comment:

 You are right in that the documentation is not up-to-date. However, it's a
 bit more complicated than that. The real function used depends on the type
 of the geometry field in the database. You can see the logic here:
 
https://github.com/django/django/blob/master/django/contrib/gis/db/backends/postgis/operations.py#L39

 If the field is geodetic (latitude/longitude), `ST_Distance_Sphere` is
 used by default (with spheroid as an option). If the field has projected
 coordinates, `ST_Distance` is used by default.

--
Ticket URL: <https://code.djangoproject.com/ticket/25498#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.61d167956bc695d31e0608d5197e8950%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to