Opened 9 years ago
Closed 9 years ago
#27573 closed Bug (fixed)
Distance function returns Distance object instead of raw value on MySQL
| Reported by: | Sergey Fedoseev | Owned by: | Sergey Fedoseev |
|---|---|---|---|
| Component: | GIS | Version: | 1.9 |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
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:
- made Distance function to return raw values on MySQL
- raise NotImplemented if Distance function is applied to geodetic field
Change History (4)
comment:1 by , 9 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:2 by , 9 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:3 by , 9 years ago
| Has patch: | set |
|---|
Note:
See TracTickets
for help on using tickets.
PR