Opened 9 years ago
Last modified 4 years ago
#27574 new New feature
support geodetic distance calculation on MySQL 5.7+
| Reported by: | Sergey Fedoseev | Owned by: | |
|---|---|---|---|
| Component: | GIS | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | yes |
| Easy pickings: | no | UI/UX: | no |
Description
ST_Distance_Sphere function that returns geodetic distance was added in MySQL 5.7.6.
Change History (7)
comment:1 by , 9 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:2 by , 9 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:4 by , 5 years ago
| Owner: | removed |
|---|---|
| Status: | assigned → new |
comment:5 by , 5 years ago
| Owner: | set to |
|---|---|
| Status: | new → assigned |
I created the patch PR.
Updated the Distance function and be able to use distance lookup on MySQL.
comment:6 by , 5 years ago
| Has patch: | set |
|---|---|
| Patch needs improvement: | set |
Please uncheck "patch needs improvement" after addressing the test failures and other review comments. If the tests are passing locally, perhaps it's a difference between the versions that Jenkins uses.
comment:7 by , 4 years ago
| Owner: | removed |
|---|---|
| Status: | assigned → new |
Note:
See TracTickets
for help on using tickets.
I would like to note, that
ST_Areaalso works with MySQL (https://dev.mysql.com/doc/refman/5.7/en/gis-polygon-property-functions.html#function_st-area), although Django denies its execution:Region.objects.order_by(RawSQL('ST_Area(polygon)', params=[])) <QuerySet [<Region: Region object (1)>, '...(remaining elements truncated)...']>in contrast that errors with contributed
Area:from django.contrib.gis.db.models.functions import Area Region.objects.order_by(Area('polygon')) ... django.db.utils.NotSupportedError: Area on geodetic coordinate systems not supported.