BufferTransformer#
- class BufferTransformer[source]#
Bases:
VectorTransformerBuffers geometries.
- __init__(geom_type: str, class_bufs: dict[int, float | None] | None = None, default_buf: float | None = None)[source]#
Constructor.
- Parameters
geom_type (str) – The geometry type to apply this transform to. E.g. “LineString”, “Point”, “Polygon”.
class_bufs (dict[int, float | None] | None) – Mapping from class IDs to buffer amounts (in pixels). If a class ID is not found in the mapping, the value specified by the
default_buffield will be used. If the buffer value for a class isNone, then no buffering will be applied to the geoms of that class. Defaults to{}.default_buf (float | None) – Default buffer to apply to classes not in
class_bufs. IfNone, no buffering will be applied to the geoms of those missing classes. Defaults toNone.
Methods
__init__(geom_type[, class_bufs, default_buf])Constructor.
transform(geojson[, crs_transformer])Transform a GeoJSON mapping of vector data.
- __init__(geom_type: str, class_bufs: dict[int, float | None] | None = None, default_buf: float | None = None)[source]#
Constructor.
- Parameters
geom_type (str) – The geometry type to apply this transform to. E.g. “LineString”, “Point”, “Polygon”.
class_bufs (dict[int, float | None] | None) – Mapping from class IDs to buffer amounts (in pixels). If a class ID is not found in the mapping, the value specified by the
default_buffield will be used. If the buffer value for a class isNone, then no buffering will be applied to the geoms of that class. Defaults to{}.default_buf (float | None) – Default buffer to apply to classes not in
class_bufs. IfNone, no buffering will be applied to the geoms of those missing classes. Defaults toNone.
- transform(geojson: dict, crs_transformer: CRSTransformer | None = None) dict[source]#
Transform a GeoJSON mapping of vector data.
- Parameters
geojson (dict) – A GeoJSON-like mapping of a FeatureCollection.
crs_transformer (CRSTransformer | None) –
- Returns
Transformed GeoJSON.
- Return type