This page features the most popular geometric operations, but far more are available. A full list of shapely operations can be found in the shapely user manual.

Common Shapely Operations

Boolean operations

These shapely operations can be used in conditionals.

Shape generators

These methods create a new shapely geometry based on the relationship between the passed geometries.

Shape modifiers

These methods return a modified version of object after a transformation.

Size and tolerance are both in meters.

Properties

These properties are defined on all shapely geometries.

Properties like length and area use units of meters and square meters when appropriate.

Methods

Calculate a result based on two geometries.

Distance is calculated in meters.

Invalid Geometries

Mundipy gracefully resolves invalid geometries during spatial operations with the shapely.make_valid method. This means datasets require no pre-processing for spatial operations.

Many real-world datasets encode geometries with invalid sets of points. This triggers errors like the following in LibGEOS:

GEOSException: TopologyException: Input geom 1 is invalid: Ring Self-intersection

Validating an entire dataset pre-emptively with .buffer(0) or shapely.make_valid is an expensive preprocessing step. Mundipy avoids this by catching GEOSException in spatial operations and automatically re-trying the operation with a valid geometry.