summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2019-07-27 20:12:46 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2019-07-27 20:12:46 +0200
commit3c6d32e0b233bc44eb4533f81819353036ae35e4 (patch)
tree7b05e39856ef3fc62622beae918cc6428c94e2c8 /tests
parent4122d9d3f1983eea612f236e941d937bd8589a0d (diff)
Fixed #30552 -- Fixed loss of SRID when calling reverse() on LineString/Point.
Thanks Mariusz Felisiak for contributing the Point part.
Diffstat (limited to 'tests')
-rw-r--r--tests/gis_tests/geos_tests/test_geos.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/gis_tests/geos_tests/test_geos.py b/tests/gis_tests/geos_tests/test_geos.py
index e2facb879d..a74eabb314 100644
--- a/tests/gis_tests/geos_tests/test_geos.py
+++ b/tests/gis_tests/geos_tests/test_geos.py
@@ -280,6 +280,12 @@ class GEOSTest(SimpleTestCase, TestDataMixin):
prev = pnt # setting the previous geometry
+ def test_point_reverse(self):
+ point = GEOSGeometry('POINT(144.963 -37.8143)', 4326)
+ self.assertEqual(point.srid, 4326)
+ point.reverse()
+ self.assertEqual(point.ewkt, 'SRID=4326;POINT (-37.8143 144.963)')
+
def test_multipoints(self):
"Testing MultiPoint objects."
for mp in self.geometries.multipoints:
@@ -348,6 +354,12 @@ class GEOSTest(SimpleTestCase, TestDataMixin):
# Test __iter__().
self.assertEqual(list(LineString((0, 0), (1, 1), (2, 2))), [(0, 0), (1, 1), (2, 2)])
+ def test_linestring_reverse(self):
+ line = GEOSGeometry('LINESTRING(144.963 -37.8143,151.2607 -33.887)', 4326)
+ self.assertEqual(line.srid, 4326)
+ line.reverse()
+ self.assertEqual(line.ewkt, 'SRID=4326;LINESTRING (151.2607 -33.887, 144.963 -37.8143)')
+
def test_multilinestring(self):
"Testing MultiLineString objects."
prev = fromstr('POINT(0 0)')