spatialtis_core.shape_ops#

Module Contents#

spatialtis_core.shape_ops.multipoints_bbox(points_collections: Sequence[spatialtis_core.types.Points]) Sequence[spatialtis_core.types.BoundingBox]#

A utility function to return minimum bounding box list of polygons

Parameters

points_collections – List of 2d points collections

Returns

A list of bounding box (minx, miny, maxx, maxy)

spatialtis_core.shape_ops.multipolygons_area(points_collections: Sequence[spatialtis_core.types.Points]) Sequence[float]#

Calculate the area of polygons using shoelace formula

Parameters

points_collections – List of 2d points collections, represents a list of polygons

Returns

The area of the polygons in list

spatialtis_core.shape_ops.points_bbox(points: spatialtis_core.types.Points) spatialtis_core.types.BoundingBox#

Return minimum bounding box of points

Parameters

points – A list of points

Returns

The bounding box (minx, miny, maxx, maxy) or (minx, miny, minz, maxx, maxy, maxz)

spatialtis_core.shape_ops.points_shapes(polygons: List[spatialtis_core.types.Points], method: str = 'convex', concavity: float = 1.5) spatialtis_core.types.Points#

Acquire multipoints (shapes) that describe the points

Parameters
  • polygons – A list of polygons

  • method – “convex” or “concave”

  • concavity – Determine the concavity in concave hull

Returns

A list of points

spatialtis_core.shape_ops.polygons_area(points: spatialtis_core.types.Points) float#

Calculate the area of polygons using shoelace formula

Parameters

points – A list of points represents a polygon

Returns

The area of the polygon