Opened 9 years ago
Closed 8 years ago
#27964 closed Cleanup/optimization (fixed)
Raise an error if a MySQL geometry with an unsupported SRID is saved to the database
| Reported by: | Sergey Fedoseev | Owned by: | Sergey Fedoseev |
|---|---|---|---|
| Component: | GIS | Version: | 1.8 |
| 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
models.py:
class City(models.Model):
point = models.PointField(srid=4326)
on PostGIS:
In [1]: from test_app.models import City In [2]: from django.contrib.gis.geos import Point In [3]: c = City.objects.create(point=Point(1, 1, srid=3857)) In [7]: c.refresh_from_db() In [9]: print(c.point) SRID=4326;POINT (8.983152841195214e-06 8.983152840993819e-06)
on MySQL:
In [1]: from test_app.models import City In [2]: from django.contrib.gis.geos import Point In [3]: c = City.objects.create(point=Point(1, 1, srid=3857)) In [4]: c.refresh_from_db() In [5]: print(c.point) SRID=4326;POINT (1 1)
I think that more appropriate behavior is to raise some error.
Change History (4)
comment:1 by , 9 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:2 by , 9 years ago
| Summary: | on MySQL geometry with other SRID is saved silently in DB → Raise an error if a MySQL geometry with an unsupported SRID is saved to the database |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
| Type: | Bug → Cleanup/optimization |
Note:
See TracTickets
for help on using tickets.
Probably a mention in the backwards incompatible changes section of the release notes would be a good idea.