Opened 6 months ago

Closed 4 months ago

#30552 closed Bug (fixed)

GEOSGeometry.reverse() loses SRID.

Reported by: Yury Ryabov Owned by: nobody
Component: GIS Version: master
Severity: Normal Keywords: SRID, geometry, GIS
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Following code reproduces the bug. Haven't tested if it persists on Django 2.2.

from django.contrib.gis.geos import GEOSGeometry

linestring = GEOSGeometry('LINESTRING(0 1, 1 2)', srid=4326)
assert linestring.srid == 4326
assert linestring.srid == 4326, 'SRID data is lost!'

Attachments (1)

30552.diff (916 bytes) - added by felixxm 6 months ago.
Simple test.

Download all attachments as: .zip

Change History (4)

comment:1 Changed 6 months ago by felixxm

Summary: SRID data on GEOSGeometry is lost after calling `reverse()` methodGEOSGeometry.reverse() loses SRID.
Triage Stage: UnreviewedAccepted
Version: 2.1master

Thanks for this report.

Reproduced at c498f088c584ec3aff97409fdc11b39b28240de9.

Changed 6 months ago by felixxm

Attachment: 30552.diff added

Simple test.

comment:2 Changed 4 months ago by Claude Paroz

Has patch: set

comment:3 Changed 4 months ago by Mariusz Felisiak <felisiak.mariusz@…>

Resolution: fixed
Status: newclosed

In 3c6d32e:

Fixed #30552 -- Fixed loss of SRID when calling reverse() on LineString/Point.

Thanks Mariusz Felisiak for contributing the Point part.

Note: See TracTickets for help on using tickets.
Back to Top