mirror of
https://github.com/django/django.git
synced 2025-10-29 16:46:11 +00:00
[3.2.x] Fixed #32544 -- Confirmed support for GDAL 3.2 and GEOS 3.9.
Backport of e3cfba0029 from main.
This commit is contained in:
committed by
Mariusz Felisiak
parent
a3a4a0baa3
commit
5eb17d31c3
@@ -378,10 +378,10 @@ class OGRGeomTest(SimpleTestCase, TestDataMixin):
|
||||
b = OGRGeometry(self.geometries.topology_geoms[i].wkt_b)
|
||||
d1 = OGRGeometry(self.geometries.diff_geoms[i].wkt)
|
||||
d2 = a.difference(b)
|
||||
self.assertEqual(d1, d2)
|
||||
self.assertEqual(d1, a - b) # __sub__ is difference operator
|
||||
self.assertTrue(d1.geos.equals(d2.geos))
|
||||
self.assertTrue(d1.geos.equals((a - b).geos)) # __sub__ is difference operator
|
||||
a -= b # testing __isub__
|
||||
self.assertEqual(d1, a)
|
||||
self.assertTrue(d1.geos.equals(a.geos))
|
||||
|
||||
def test_intersection(self):
|
||||
"Testing intersects() and intersection()."
|
||||
@@ -391,10 +391,10 @@ class OGRGeomTest(SimpleTestCase, TestDataMixin):
|
||||
i1 = OGRGeometry(self.geometries.intersect_geoms[i].wkt)
|
||||
self.assertTrue(a.intersects(b))
|
||||
i2 = a.intersection(b)
|
||||
self.assertEqual(i1, i2)
|
||||
self.assertEqual(i1, a & b) # __and__ is intersection operator
|
||||
self.assertTrue(i1.geos.equals(i2.geos))
|
||||
self.assertTrue(i1.geos.equals((a & b).geos)) # __and__ is intersection operator
|
||||
a &= b # testing __iand__
|
||||
self.assertEqual(i1, a)
|
||||
self.assertTrue(i1.geos.equals(a.geos))
|
||||
|
||||
def test_symdifference(self):
|
||||
"Testing sym_difference()."
|
||||
@@ -403,10 +403,10 @@ class OGRGeomTest(SimpleTestCase, TestDataMixin):
|
||||
b = OGRGeometry(self.geometries.topology_geoms[i].wkt_b)
|
||||
d1 = OGRGeometry(self.geometries.sdiff_geoms[i].wkt)
|
||||
d2 = a.sym_difference(b)
|
||||
self.assertEqual(d1, d2)
|
||||
self.assertEqual(d1, a ^ b) # __xor__ is symmetric difference operator
|
||||
self.assertTrue(d1.geos.equals(d2.geos))
|
||||
self.assertTrue(d1.geos.equals((a ^ b).geos)) # __xor__ is symmetric difference operator
|
||||
a ^= b # testing __ixor__
|
||||
self.assertEqual(d1, a)
|
||||
self.assertTrue(d1.geos.equals(a.geos))
|
||||
|
||||
def test_union(self):
|
||||
"Testing union()."
|
||||
@@ -415,10 +415,10 @@ class OGRGeomTest(SimpleTestCase, TestDataMixin):
|
||||
b = OGRGeometry(self.geometries.topology_geoms[i].wkt_b)
|
||||
u1 = OGRGeometry(self.geometries.union_geoms[i].wkt)
|
||||
u2 = a.union(b)
|
||||
self.assertEqual(u1, u2)
|
||||
self.assertEqual(u1, a | b) # __or__ is union operator
|
||||
self.assertTrue(u1.geos.equals(u2.geos))
|
||||
self.assertTrue(u1.geos.equals((a | b).geos)) # __or__ is union operator
|
||||
a |= b # testing __ior__
|
||||
self.assertEqual(u1, a)
|
||||
self.assertTrue(u1.geos.equals(a.geos))
|
||||
|
||||
def test_add(self):
|
||||
"Testing GeometryCollection.add()."
|
||||
|
||||
Reference in New Issue
Block a user