map2loop.project.SamplerSpacing#

class map2loop.project.SamplerSpacing(spacing: float = 50.0)#

Bases: Sampler

Spacing based sampler which decimates the geo data frame based on the distance between points along a line or in the case of a polygon along the boundary of that polygon ie. spacing = 500 means take a sample every 500 metres Note: This only works on data frames that contain MultiPolgon, Polygon, MultiLineString and LineString geometry

Initialiser for spacing sampler

Parameters:

spacing (float, optional) – The distance between samples. Defaults to 50.0.

__init__(spacing: float = 50.0)#

Initialiser for spacing sampler

Parameters:

spacing (float, optional) – The distance between samples. Defaults to 50.0.

Methods

__init__([spacing])

Initialiser for spacing sampler

sample(spatial_data[, map_data])

Execute sample method takes full point data, samples the data and returns the sampled points

type()

Getter for subclass type label

sample(spatial_data: GeoDataFrame, map_data: MapData | None = None) DataFrame#

Execute sample method takes full point data, samples the data and returns the sampled points

Parameters:

spatial_data (geopandas.GeoDataFrame) – the data frame to sample (must contain column [“ID”])

Returns:

pandas.DataFrame – the sampled data points

type()#

Getter for subclass type label

Returns:

str – Name of subclass