cartagen.labelgrid_selection

cartagen.labelgrid_selection#

labelgrid_selection(points, width, height, column, shape='square', grid=False)#

Reduce a set of points by selection using the Label Grid method.

For each cell of the given shape, the point with the largest value is selected.

This algorithm was proposed by Gröbe & Burghardt. [1] It assigns each point to a grid cell of a given height, width and shape before reducing the points for each cell.

Parameters:
  • points (GeoDataFrame of Point) – The points to reduce.

  • width (float) – Width of the grid cells.

  • height (float) – Height of the grid cells.

  • column (str) – Name of the column to use.

  • shape (str, optional) – Shape of the grid cells, can be ‘square’, ‘diamond’, ‘hexagonal’.

  • grid (bool, optional) – If set to True, returns a tuple with the points and the grid cell.

Returns:

  • points (GeoDataFrame of Point) – The provided set of points with two new attributes:

    • ’selected_labelgrid’: Set to True if the point has been selected.

    • ’cell_count’: The number of points in the cell represented by this point.

  • grid (GeoDataFrame of Polygon, optional)

See also

labelgrid_simplification

Reduce a set of points by simplification using the Label Grid method.

labelgrid_aggregation

Reduce a set of points by aggregation using the Label Grid method.

References

(Source code)

../_images/labelgrid_selection.png