simplify_footprint

simplify_footprint#

simplify_footprint(footprint: GeoDataFrame, resolution: float, max_nof_vertices: int = 50) GeoDataFrame[source]#

Simplify footprint.

Set a number of maximum vertices and this function will try to simplify the footprint to have less than this number of vertices. The tolerance will grow to try to respect this number of vertices.

This function will loop over a number of pixels of tolerence [1, 2, 4, 8, 16, 32, 64] (tolerance of gpd.simplify == resolution * tol_pix) If in the end, the number of vertices is still too high, a warning will be emitted.

Parameters:
  • footprint (gpd.GeoDataFrame) – Footprint to be simplified

  • resolution (float) – Corresponding resolution

  • max_nof_vertices (int) – Maximum number of vertices of the wanted footprint

Returns:

Simplified footprint

Return type:

gpd.GeoDataFrame

Examples

>>> # Open a raw footprint
>>> footprint_raw = vectors.read("footprint_raw.geojson")
>>> len(footprint_raw.get_coordinates())
64757
>>>
>>> # Get the simplified footprint
>>> simplified = simplify_footprint(footprint_raw, 20)
>>> len(simplified.get_coordinates())
29