From 2d1ac1dce8a1c169def5af01fc871e33f93c27c3 Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 9 Apr 2025 21:40:55 -0400 Subject: [PATCH] Refs #36036 -- Removed unsupported 4D GEOS tests. --- tests/gis_tests/gdal_tests/test_geom.py | 19 +++++-------------- tests/gis_tests/geos_tests/test_geos.py | 22 ---------------------- 2 files changed, 5 insertions(+), 36 deletions(-) diff --git a/tests/gis_tests/gdal_tests/test_geom.py b/tests/gis_tests/gdal_tests/test_geom.py index a296af75f9..919e547511 100644 --- a/tests/gis_tests/gdal_tests/test_geom.py +++ b/tests/gis_tests/gdal_tests/test_geom.py @@ -1,6 +1,5 @@ import json import pickle -from unittest import mock, skipIf from django.contrib.gis.gdal import ( CoordTransform, @@ -11,7 +10,6 @@ from django.contrib.gis.gdal import ( ) from django.contrib.gis.gdal.geometries import CircularString, CurvePolygon from django.contrib.gis.geos import GEOSException -from django.contrib.gis.geos.libgeos import geos_version_tuple from django.template import Context from django.template.engine import Engine from django.test import SimpleTestCase @@ -873,19 +871,12 @@ class OGRGeomTest(SimpleTestCase, TestDataMixin): self.assertEqual(geom.geom_type.name, "PointM") self.assertEqual(geom.geom_type.num, 2001) - @skipIf(geos_version_tuple() < (3, 12), "GEOS >= 3.12.0 is required") def test_point_m_dimension_geos(self): - geo_zm = OGRGeometry("POINT ZM (1 2 3 4)") - self.assertEqual(geo_zm.geos.wkt, "POINT ZM (1 2 3 4)") - geo_m = OGRGeometry("POINT M (1 2 3)") - self.assertEqual(geo_m.geos.wkt, "POINT M (1 2 3)") - - @mock.patch("django.contrib.gis.geos.libgeos.geos_version", lambda: b"3.11.0") - def test_point_m_dimension_geos_version(self): - geo_zm = OGRGeometry("POINT ZM (1 2 3 4)") - self.assertEqual(geo_zm.geos.wkt, "POINT Z (1 2 3)") - geo_m = OGRGeometry("POINT M (1 2 3)") - self.assertEqual(geo_m.geos.wkt, "POINT (1 2)") + """GEOSGeometry does not yet support the M dimension.""" + geom = OGRGeometry("POINT ZM (1 2 3 4)") + self.assertEqual(geom.geos.wkt, "POINT Z (1 2 3)") + geom = OGRGeometry("POINT M (1 2 3)") + self.assertEqual(geom.geos.wkt, "POINT (1 2)") def test_centroid(self): point = OGRGeometry("POINT (1 2 3)") diff --git a/tests/gis_tests/geos_tests/test_geos.py b/tests/gis_tests/geos_tests/test_geos.py index 018eccae4a..724555560b 100644 --- a/tests/gis_tests/geos_tests/test_geos.py +++ b/tests/gis_tests/geos_tests/test_geos.py @@ -86,22 +86,6 @@ class GEOSTest(SimpleTestCase, TestDataMixin): # Redundant sanity check. self.assertEqual(4326, GEOSGeometry(hexewkb_2d).srid) - @skipIf(geos_version_tuple() < (3, 12), "GEOS >= 3.12.0 is required") - def test_4d_hexewkb(self): - ogc_hex_4d = ( - b"01010000C00000000000000000000000000000" - b"F03F00000000000000400000000000000000" - ) - hexewkb_4d = ( - b"01010000E0E61000000000000000000000000000000000" - b"F03F00000000000000400000000000000000" - ) - pnt_4d = Point(0, 1, 2, 0, srid=4326) - self.assertEqual(ogc_hex_4d, pnt_4d.hex) - self.assertEqual(hexewkb_4d, pnt_4d.hexewkb) - self.assertIs(GEOSGeometry(hexewkb_4d).hasm, True) - self.assertEqual(memoryview(a2b_hex(hexewkb_4d)), pnt_4d.ewkb) - def test_kml(self): "Testing KML output." for tg in self.geometries.wkt_out: @@ -1285,12 +1269,6 @@ class GEOSTest(SimpleTestCase, TestDataMixin): self.assertEqual(g2.hex, g2.ogr.hex) self.assertEqual("WGS 84", g2.srs.name) - @skipIf(geos_version_tuple() < (3, 12), "GEOS >= 3.12.0 is required") - def test_gdal_4d(self): - g1_4d = fromstr("POINT(5 23 8 0)") - self.assertIsInstance(g1_4d.ogr, gdal.OGRGeometry) - self.assertEqual(g1_4d.ogr.m, 0) - def test_copy(self): "Testing use with the Python `copy` module." import copy