diff options
| author | David Smith <smithdc@gmail.com> | 2024-01-17 06:48:45 +0000 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2024-01-18 10:48:40 +0100 |
| commit | cfacd69ab81c37564799a7b8a0a765e3c1f40941 (patch) | |
| tree | 2633d6af5f3690a7e5bd7ef98b18a136377b2d07 /tests/gis_tests | |
| parent | 12c71bff8300f5b1252dab099f4753dc86903fbd (diff) | |
Refs #35058 -- Added is_3d and set_3d() to OGRGeometry.
Diffstat (limited to 'tests/gis_tests')
| -rw-r--r-- | tests/gis_tests/gdal_tests/test_geom.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/gis_tests/gdal_tests/test_geom.py b/tests/gis_tests/gdal_tests/test_geom.py index 372a385443..eba90504b2 100644 --- a/tests/gis_tests/gdal_tests/test_geom.py +++ b/tests/gis_tests/gdal_tests/test_geom.py @@ -714,3 +714,16 @@ class OGRGeomTest(SimpleTestCase, TestDataMixin): msg = f"Unsupported geometry type: {type_}" with self.assertRaisesMessage(TypeError, msg): OGRGeometry(f"{geom_type} EMPTY") + + def test_is_3d_and_set_3d(self): + geom = OGRGeometry("POINT (1 2)") + self.assertIs(geom.is_3d, False) + geom.set_3d(True) + self.assertIs(geom.is_3d, True) + self.assertEqual(geom.wkt, "POINT (1 2 0)") + geom.set_3d(False) + self.assertIs(geom.is_3d, False) + self.assertEqual(geom.wkt, "POINT (1 2)") + msg = "Input to 'set_3d' must be a boolean, got 'None'" + with self.assertRaisesMessage(ValueError, msg): + geom.set_3d(None) |
