BufferTransformer#
- class BufferTransformer[source]#
Bases:
VectorTransformer
Buffers geometries.
- __init__(geom_type: str, class_bufs: Optional[Dict[int, Optional[float]]] = None, default_buf: Optional[float] = None)[source]#
Constructor.
- Parameters
geom_type (str) – The geometry type to apply this transform to. E.g. “LineString”, “Point”, “Polygon”.
class_bufs (Dict[int, Optional[float]], optional) – 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_buf field will be used. If the buffer value for a class is None, then no buffering will be applied to the geoms of that class. Defaults to {}.
default_buf (Optional[float], optional) – Default buffer to apply to classes not in class_bufs. If None, no buffering will be applied to the geoms of those missing classes. Defaults to None.
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: Optional[Dict[int, Optional[float]]] = None, default_buf: Optional[float] = None)[source]#
Constructor.
- Parameters
geom_type (str) – The geometry type to apply this transform to. E.g. “LineString”, “Point”, “Polygon”.
class_bufs (Dict[int, Optional[float]], optional) – 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_buf field will be used. If the buffer value for a class is None, then no buffering will be applied to the geoms of that class. Defaults to {}.
default_buf (Optional[float], optional) – Default buffer to apply to classes not in class_bufs. If None, no buffering will be applied to the geoms of those missing classes. Defaults to None.
- transform(geojson: dict, crs_transformer: Optional[CRSTransformer] = None) dict [source]#
Transform a GeoJSON mapping of vector data.
- Parameters
geojson (dict) – A GeoJSON-like mapping of a FeatureCollection.
crs_transformer (Optional[CRSTransformer]) –
- Returns
Transformed GeoJSON.
- Return type