[Django] #27464: SRID should be stored in DB on MySQL backend

20 views
Skip to first unread message

Django

unread,
Nov 9, 2016, 7:40:18 AM11/9/16
to django-...@googlegroups.com
#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.

Django

unread,
Nov 9, 2016, 7:40:36 AM11/9/16
to django-...@googlegroups.com
#27464: SRID should be stored in DB on MySQL backend
-------------------------------------+-------------------------------------
Reporter: Sergey Fedoseev | Owner: Sergey
Type: | Fedoseev
Cleanup/optimization | Status: assigned
Component: GIS | Version: master
Severity: Normal | Resolution:

Keywords: mysql | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sergey Fedoseev):

* owner: nobody => Sergey Fedoseev
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/27464#comment:1>

Django

unread,
Nov 9, 2016, 12:51:35 PM11/9/16
to django-...@googlegroups.com
#27464: SRID should be stored in DB on MySQL backend
-------------------------------------+-------------------------------------
Reporter: Sergey Fedoseev | Owner: Sergey
Type: | Fedoseev
Cleanup/optimization | Status: assigned
Component: GIS | Version: master
Severity: Normal | Resolution:
Keywords: mysql | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* stage: Unreviewed => Accepted


Comment:

I'm not a GIS user, but based on the description, it seems like it could
be a large backwards-incompatibility. It might be nice to raise it on the
[https://groups.google.com/forum/#!forum/geodjango geodjango mailing list]
to make sure there's consensus about it.

--
Ticket URL: <https://code.djangoproject.com/ticket/27464#comment:2>

Django

unread,
Nov 16, 2019, 12:01:51 PM11/16/19
to django-...@googlegroups.com
#27464: SRID should be stored in DB on MySQL backend
-------------------------------------+-------------------------------------
Reporter: Sergey Fedoseev | Owner: Sergey
Type: | Fedoseev
Cleanup/optimization | Status: assigned
Component: GIS | Version: master

Severity: Normal | Resolution:
Keywords: mysql | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Sergey Fedoseev):

MySQL 8 allows to create `GEOMETRY` columns with explicitly set SRID.:
https://dev.mysql.com/doc/refman/8.0/en/spatial-type-overview.html.

--
Ticket URL: <https://code.djangoproject.com/ticket/27464#comment:3>

Django

unread,
Jun 3, 2022, 7:53:36 AM6/3/22
to django-...@googlegroups.com
#27464: SRID should be stored in DB on MySQL backend
--------------------------------------+------------------------------------
Reporter: Sergey Fedoseev | Owner: (none)
Type: Cleanup/optimization | Status: new
Component: GIS | Version: dev

Severity: Normal | Resolution:
Keywords: mysql | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Sergey Fedoseev):

* owner: Sergey Fedoseev => (none)
* status: assigned => new


--
Ticket URL: <https://code.djangoproject.com/ticket/27464#comment:4>

Reply all
Reply to author
Forward
0 new messages