MCPcopy
hub / github.com/django/django / test_union

Method test_union

tests/gis_tests/gdal_tests/test_geom.py:432–442  ·  view source on GitHub ↗

Testing union().

(self)

Source from the content-addressed store, hash-verified

430 self.assertTrue(d1.geos.equals(a.geos))
431
432 def test_union(self):
433 "Testing union()."
434 for i in range(len(self.geometries.topology_geoms)):
435 a = OGRGeometry(self.geometries.topology_geoms[i].wkt_a)
436 b = OGRGeometry(self.geometries.topology_geoms[i].wkt_b)
437 u1 = OGRGeometry(self.geometries.union_geoms[i].wkt)
438 u2 = a.union(b)
439 self.assertTrue(u1.geos.equals(u2.geos))
440 self.assertTrue(u1.geos.equals((a | b).geos)) # __or__ is union operator
441 a |= b # testing __ior__
442 self.assertTrue(u1.geos.equals(a.geos))
443
444 def test_add(self):
445 "Testing GeometryCollection.add()."

Callers

nothing calls this directly

Calls 3

unionMethod · 0.95
OGRGeometryClass · 0.90
equalsMethod · 0.45

Tested by

no test coverage detected