Get rough centerline

Get an approximate centerline of sliver polygons.

get_rough_centerlines(gdf, max_segment_length)[source]

Get a cheaply calculated centerline of a polygon.

The line is not guaraneteed to be completely within the polygon. The line should start and end at the polygons’ “endpoints”.

The function is meant for getting centerlines from slivers in coverage_clean and snap_polygons. It will give weird results and be extremely slow for complext polygons like (buffered) road networks.

Return type:

GeoDataFrame

Parameters:
  • gdf (GeoDataFrame)

  • max_segment_length (int)