#27464: SRID should be stored in DB on MySQL backend
------------------------------------------------+------------------------
Reporter: Sergey Fedoseev | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: GIS | Version: master
Severity: Normal | Keywords: mysql
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
MySQL does not support SRID constraints on columns and SRID is stored
together with the geometry itself.
Django always saves geometries with SRID 0 on MySQL backend.
This leads to the problem I encountered while working on #26967: AsGeoJSON
function never returns the coordinate system because SRID is always 0.
Probably such Django behavior will lead to more problems in the future
(e.g. if/when MySQL will get ST_Transform function).
Saving SRID will be breaking change because the old geometries in DB will
have SRID 0, Django will provide geometries with SRID and
[https://dev.mysql.com/doc/refman/5.7/en/spatial-function-argument-
handling.html MySQL 5.7+ raises error] if geometry arguments have
different SRIDs. To make it work MySQL users will have to set SRIDs for
geometries in DB (call save() for every object of every GIS model).
--
Ticket URL: <https://code.djangoproject.com/ticket/27464>
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.c50d94eeb581d9b005f12aef9ee42088%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.