cartagen.tessellate#
- tessellate(extent, width, height=None, shape='square')#
Create a tessellation of cells of a given shape.
This function creates a tessellation on the provided extent with cells of the provided shape.
- Parameters:
extent (
listoffloat) – The extent of the area to tessellate. Must be of the form [ xmin, ymin, xmax, ymax ]width (
float) – Width of the grid.height (
float, optional) – Height of the grid. If set to None, the height equals the width.shape (
str, optional) – Shape of the grid cells, can be ‘square’, ‘diamond’, ‘hexagonal’.
- Returns:
See also
partition_gridPartition objects using a grid of a given shape.
Examples
>>> tessellate([0, 0, 2, 1], 1) [<POLYGON ((0 0, 1 0, 1 1, 0 1, 0 0))>, <POLYGON ((1 0, 2 0, 2 1, 1 1, 1 0))>]