here.inspector.keplergl.utils module#
Helper utilities for the Kepler-based inspector
- here.inspector.keplergl.utils.convert_to_2d_2(gdf: GeoSeries | GeoDataFrame | BaseGeometry | Iterable[BaseGeometry] | Iterable[Tuple[BaseGeometry, Dict[str, Any]]] | Dict[str, Any] | Iterable[Dict[str, Any]]) GeoSeries | GeoDataFrame | BaseGeometry | Iterable[BaseGeometry] | Iterable[Tuple[BaseGeometry, Dict[str, Any]]] | Dict[str, Any] | Iterable[Dict[str, Any]][source]#
- Convert the feature object from 3D to 2D
by removing the z coordinates from the geometry.
If a GeoDataFrame is passed, it will convert all the geometries of all the features in the dataframe. :param gdf: A Feature object or GeoDataFrame with geometry and coordinates in 3D. :return: A Feature object or GeoDataFrame with the same properties but in 2D by removing the z coordinates.
- here.inspector.keplergl.utils.fix_coordinates(geometry: Dict) Dict[source]#
fix_coordinates modifies any coordinate values of (180, 90) or (-180, -90) in a geometry dict to (179.999, 89.999) or (-179.999, -89.999) respectively.
The function takes in a single argument: :param geometry: A dictionary representing a geometry in GeoJSON format. It should contain a ‘coordinates’ key with list of coordinates.
- Returns:
modified geometry dictionary.
- here.inspector.keplergl.utils.process_dataframe(new_df_feature: GeoSeries | GeoDataFrame | BaseGeometry | Iterable[BaseGeometry] | Iterable[Tuple[BaseGeometry, Dict[str, Any]]] | Dict[str, Any] | Iterable[Dict[str, Any]])[source]#
Convert the Feature object from GeoJSON format to a Python dictionary. This function is useful when the add data method doesn’t accept FeatureCollection object. :param new_df_feature: a Feature object in GeoJSON format. :return: a Python dictionary containing the same information as the input Feature object.