#27573: Distance function returns Distance object instead of raw value on MySQL
-------------------------------------------+------------------------
Reporter: Sergey Fedoseev | Owner: nobody
Type: Bug | Status: new
Component: GIS | Version: 1.9
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------------+------------------------
https://docs.djangoproject.com/en/1.9/ref/contrib/gis/functions/#django.contrib.gis.db.models.functions.Distance
> On MySQL, a raw float value is returned, as it’s not possible to
automatically determine the unit of the field.
but
{{{
In [3]: City.objects.annotate(d=Distance('point', Point(0, 0,
srid=4326))).first().d
Out[3]: Distance(m=1.41421356237)
}}}
I see two ways how to fix it:
1. made Distance function to return raw values on MySQL
2. raise NotImplemented if Distance function is applied to geodetic field
--
Ticket URL: <https://code.djangoproject.com/ticket/27573>
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/053.03f58c6a5669866d718ec35fdc77ea86%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.