here.inspector.utils module#

HERE inspector utilities.

class here.inspector.utils.Options(default_colors: ~typing.List[~here.inspector.styles.Color] = <factory>, default_theme: ~here.inspector.styles.Theme = Theme.LIGHT_MAP, api_key: str | None = None, inspector_class: ~typing.Type | None = None)[source]#

Bases: object

Global options for any inspector.

api_key: str | None = None#

API key for the HERE platform to use HERE-provided background maps

default_colors: List[Color]#

styles are assigned automatically picked from this list of colors, when not specified.

default_theme: Theme = 11#

the default inspector theme

inspector_class: Type | None = None#

Name of the backend class to use for visualisation

here.inspector.utils.bounds_gdf(gdf: GeoDataFrame) Tuple[Tuple[float, float], Tuple[float, float]][source]#

Calculate the bounds of one GeoDataFrame.

Parameters:

gdf – The GeoDataFrame.

Returns:

Bounds of the GeoDataFrame object in this format: ((south, west), (north, east)).

Raises:

ValueError – in case GeoDataFrame is empty

here.inspector.utils.bounds_obj(geojson_obj: dict) Tuple[Tuple[float, float], Tuple[float, float]][source]#

Calculate the bounds of given GeoJSON object.

Parameters:

geojson_obj – The GeoJSON object (dict).

Returns:

Bounds of the GeoJSON object in this format: ((south, west), (north, east)).

Raises:

ValueError – in case the GeoJSON object has no coordinates

here.inspector.utils.center_bounds(bounds: Tuple[Tuple[float, float], Tuple[float, float]]) Tuple[float, float][source]#

The center of the bound area, for map display, latitude and longitude

here.inspector.utils.is_geojson(d: dict) bool[source]#

Check if the dictionary contains a valid GeoJSON object

here.inspector.utils.merge_bounds(bounds: List[Tuple[Tuple[float, float], Tuple[float, float]]]) Tuple[Tuple[float, float], Tuple[float, float]][source]#

Merge multiple bounds together into a single one that covers them all.

Parameters:

bounds – the list of bounds to merge

Returns:

overall bounds, None if the input list is empty

here.inspector.utils.zoom_bounds(bounds: Tuple[Tuple[float, float], Tuple[float, float]], min_zoom: float) float[source]#

The approximate zoom level to visualize the bound area, for map display