gis.geos.MultiPolygon

class MultiPolygon(*args, **kwargs)

MultiPolygon objects may be instantiated by passing Polygon objects as arguments, or a single sequence of Polygon objects:

>>> p1 = Polygon( ((0, 0), (0, 1), (1, 1), (0, 0)) )
>>> p2 = Polygon( ((1, 1), (1, 2), (2, 2), (1, 1)) )
>>> mp = MultiPolygon(p1, p2)
>>> mp = MultiPolygon([p1, p2])
Changed in Django 1.10:

In previous versions, an empty MultiPolygon couldn’t be instantiated.

cascaded_union

Deprecated since version 1.10: Use the GEOSGeometry.unary_union property instead.

Returns a Polygon that is the union of all of the component polygons in this collection. The algorithm employed is significantly more efficient (faster) than trying to union the geometries together individually. [2]

doc_Django
2016-10-09 18:38:29
Comments
Leave a Comment

Please login to continue.