gemgis.utils.convert_location_dict_to_gdf#

gemgis.utils.convert_location_dict_to_gdf(location_dict: dict) geopandas.geodataframe.GeoDataFrame#

Converting a location dict to a GeoDataFrame

Parameters

location_dict (dict) – Dict containing the name of the location and the coordinates

Returns

gdf – GeoDataFrame containing the location name and the coordinates of the location

Return type

gpd.geodataframe.GeoDataFrame

New in version 1.0.x.

Example

>>> # Loading Libraries
>>> import gemgis as gg
>>> # Creating a dict with coordinates
>>> coordinates_dict = gg.utils.get_locations(names = ['Aachen', 'Berlin', 'München', 'Hamburg', 'Köln'], crs='EPSG:4647')
>>> # Converting dict to GeoDataFrame
>>> gdf = gg.utils.convert_location_dict_to_gdf(location_dict=coordinates_dict)
>>> gdf
    City    X           Y           geometry
0       Aachen  32294411.33 5629009.36  POINT (32294411.335 5629009.357)
1       Berlin  32797738.56 5827603.74  POINT (32797738.561 5827603.740)
2       München 32691595.36 5334747.27  POINT (32691595.356 5334747.274)
3       Hamburg 32566296.25 5933959.96  POINT (32566296.251 5933959.965)
4       Köln    32356668.82 5644952.10  POINT (32356668.818 5644952.100)