here.platform.utils.geo module

here.platform.utils.geo module

Utilities to convert geometries from non-standard formats

here.platform.utils.geo.is_geojson_geometry(x) bool

Check if an object is a mapping that represents a GeoJSON geometry.

Parameters:
x – the object to test

Returns:
if the object is in a supported, non-standard format

here.platform.utils.geo.is_nonstandard_geometry(x) bool

Check if an object is a geometry in a non-standard, supported format.

Supported formats:

{“longitude”: 43.23, “latitude”: 10.5}

[
{“longitude”: 43.23, “latitude”: 10.5}, {“longitude”: 44.01, “latitude”: 11.57}

]

Parameters:
x – the object to test

Returns:
if the object is in a supported, non-standard format

here.platform.utils.geo.nonstandard_to_geometry(x) Geometry

Convert an object from a non-standard format to a GeoJSON geometry.

Parameters:
x – the object to convert

Returns:
the object converted to GeoJSON geometry

Raises:
ValueError – if the format of the object is not supported