Skip to main content

GeometryCollection

This class represents a collection of geometry objects and provides functionality to manage them as a single geometric entity. It supports initialization from sequences of geometries, iteration over its members, and coordinate access via properties. The class also provides compatibility for list-like operations and KML representation of the entire collection.

Attributes

AttributeTypeDescription
coordstupleAlias that returns a tuple of all coordinates for every geometry contained within this collection.

Constructor

Signature

def GeometryCollection(
*args: any,
**kwargs: any
)

Parameters

NameTypeDescription
*argsanyA sequence of Geometry objects, or a single list/tuple containing Geometry objects.
**kwargsanyKeyword arguments passed to the GEOSGeometry parent constructor.

Methods


kml()

@classmethod
def kml() - > string

Return the KML for this Geometry Collection.

Returns

TypeDescription
stringA KML string representation of the collection wrapped in MultiGeometry tags

tuple()

@classmethod
def tuple() - > tuple

Return a tuple of all the coordinates in this Geometry Collection

Returns

TypeDescription
tupleA nested tuple containing the coordinate data for every geometry in the collection