fishtank.utils.tile_polygons

Contents

fishtank.utils.tile_polygons#

fishtank.utils.tile_polygons(polygons, tile_shape=(500, 500), buffer=25, cell='cell')#

Split polygons into tiles.

Parameters:
  • polygons (GeoDataFrame) – a GeoDataFrame of cell outlines.

  • tile_shape (tuple (default: (500, 500))) – the shape of the tiles to divide the polygons into.

  • buffer (int (default: 25)) – Add a buffer around the tiles to include polygons that overlap the edges.

  • cell (str (default: 'cell')) – the name of the cell column in the GeoDataFrame.

Return type:

tuple[list[GeoDataFrame], list]

Returns:

tiles

a list of GeoDataFrames of cell outlines for each tile.

bounds

The bounds for each tile.