Transformer

class pydriosm.reader.Transformer[source]

Transform / reformat data.

Examples:

>>> from pydriosm.reader import Transformer

>>> geometry = {'type': 'Point', 'coordinates': [-0.5134241, 52.6555853]}
>>> geometry_ = Transformer.transform_unitary_geometry(geometry)
>>> type(geometry_)
shapely.geometry.point.Point
>>> geometry_.wkt
'POINT (-0.5134241 52.6555853)'

Methods

point_as_polygon(multi_poly_coords)

Make the coordinates of a single 'Point' (in a 'MultiPolygon') be reformatted to a 'Polygon'-like coordinates.

transform_geometry(layer_data, layer_name)

Reformat the field of 'geometry' into shapely.geometry object.

transform_geometry_collection(geometry[, ...])

Transform a collection of geometry from dict into a shapely.geometry object.

transform_other_tags(other_tags)

Reformat a 'other_tags' from string into dictionary type.

transform_unitary_geometry(geometry[, mode, ...])

Transform a unitary geometry from dict into a shapely.geometry object.

update_other_tags(prop_or_feat[, mode])

Update the original data of 'other_tags' with parsed data.