pyguymer3.geo.extract_points

pyguymer3.geo.extract_points(shape, /, *, onlyValid=False)[source]

Extract the Points from the shape

This function accepts any Shapely geometry and returns a flat list of all of the Points contained within.

Parameters:
  • shape (list, shapely.geometry.point.Point, shapely.geometry.multipoint.MultiPoint, shapely.geometry.polygon.LinearRing, shapely.geometry.linestring.LineString, shapely.geometry.multilinestring.MultiLineString, shapely.geometry.polygon.Polygon, shapely.geometry.multipolygon.MultiPolygon, shapely.geometry.collection.GeometryCollection) – the Shapely geometry

  • onlyValid (bool, optional) – only return valid Points (checks for validity can take a while, if being called often)

Returns:

points – a flat list of all of the Points

Return type:

list of shapely.geometry.point.Point

Notes

To pass GeoJSON objects you must first convert them to Shapely objects by doing something like shape = shapely.geometry.shape(shape).

Copyright 2017 Thomas Guymer [1]

References