diff options
| author | David Smith <smithdc@gmail.com> | 2024-02-12 07:50:08 +0000 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2024-02-12 15:21:11 +0100 |
| commit | 222bf2932b55ebc964ffc5f9a6f47bad083e5ac2 (patch) | |
| tree | 3bbf5d1f3fa05e43eacc180a9aeae25800d92433 /tests/gis_tests | |
| parent | f8ff61c77e5739e24f0b86771747b38033b310ef (diff) | |
Refs #35058 -- Added support for measured geometries to GDAL GeometryCollection and subclasses.
Diffstat (limited to 'tests/gis_tests')
| -rw-r--r-- | tests/gis_tests/gdal_tests/test_geom.py | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/tests/gis_tests/gdal_tests/test_geom.py b/tests/gis_tests/gdal_tests/test_geom.py index 35b11b753a..3967b945a4 100644 --- a/tests/gis_tests/gdal_tests/test_geom.py +++ b/tests/gis_tests/gdal_tests/test_geom.py @@ -675,10 +675,10 @@ class OGRGeomTest(SimpleTestCase, TestDataMixin): ("Point M", 2001, True), ("LineString M", 2002, True), ("Polygon M", 2003, True), - ("MultiPoint M", 2004, False), - ("MultiLineString M", 2005, False), - ("MultiPolygon M", 2006, False), - ("GeometryCollection M", 2007, False), + ("MultiPoint M", 2004, True), + ("MultiLineString M", 2005, True), + ("MultiPolygon M", 2006, True), + ("GeometryCollection M", 2007, True), ("CircularString M", 2008, False), ("CompoundCurve M", 2009, False), ("CurvePolygon M", 2010, False), @@ -690,10 +690,10 @@ class OGRGeomTest(SimpleTestCase, TestDataMixin): ("Point ZM", 3001, True), ("LineString ZM", 3002, True), ("Polygon ZM", 3003, True), - ("MultiPoint ZM", 3004, False), - ("MultiLineString ZM", 3005, False), - ("MultiPolygon ZM", 3006, False), - ("GeometryCollection ZM", 3007, False), + ("MultiPoint ZM", 3004, True), + ("MultiLineString ZM", 3005, True), + ("MultiPolygon ZM", 3006, True), + ("GeometryCollection ZM", 3007, True), ("CircularString ZM", 3008, False), ("CompoundCurve ZM", 3009, False), ("CurvePolygon ZM", 3010, False), @@ -943,6 +943,30 @@ class OGRGeomTest(SimpleTestCase, TestDataMixin): geom.shell.wkt, "LINEARRING (0 0 0,10 0 0,10 10 0,0 10 0,0 0 0)" ) + def test_multi_geometries_m_dimension(self): + tests = [ + "MULTIPOINT M ((10 40 10), (40 30 10), (20 20 10))", + "MULTIPOINT ZM ((10 40 0 10), (40 30 1 10), (20 20 1 10))", + "MULTILINESTRING M ((10 10 1, 20 20 2),(40 40 1, 30 30 2))", + "MULTILINESTRING ZM ((10 10 0 1, 20 20 0 2),(40 40 1, 30 30 0 2))", + ( + "MULTIPOLYGON ZM (((30 20 1 0, 45 40 1 0, 30 20 1 0))," + "((15 5 0 0, 40 10 0 0, 15 5 0 0)))" + ), + ( + "GEOMETRYCOLLECTION M (POINT M (40 10 0)," + "LINESTRING M (10 10 0, 20 20 0, 10 40 0))" + ), + ( + "GEOMETRYCOLLECTION ZM (POINT ZM (40 10 0 1)," + "LINESTRING ZM (10 10 1 0, 20 20 1 0, 10 40 1 0))" + ), + ] + for geom_input in tests: + with self.subTest(geom_input=geom_input): + geom = OGRGeometry(geom_input) + self.assertIs(geom.is_measured, True) + class DeprecationTests(SimpleTestCase): def test_coord_setter_deprecation(self): |
