gemgis.utils.transform_location_coordinate#

gemgis.utils.transform_location_coordinate(coordinates, crs: Union[str, pyproj.crs.crs.CRS]) dict#

Transforming coordinates of GeoPy Location

Parameters
  • coordinates (geopy.location.Location) – GeoPy location object

  • crs (Union[str, pyproj.crs.crs.CRS]) – Name of the target crs, e.g. crs='EPSG:4647'

Returns

result_dict – Dict containing the location address and transformed coordinates

Return type

dict

New in version 1.0.x.

Changed in version 1.1.7.

Updated to use the latest pyproj transformer

Example

>>> # Loading Libraries and get location object
>>> import gemgis as gg
>>> location = gg.utils.get_location_coordinate(name='Aachen')
>>> location
Location(Aachen, Städteregion Aachen, Nordrhein-Westfalen, Deutschland, (50.776351, 6.083862, 0.0))
>>> # Transforming location coordinates
>>> result_dict = gg.utils.transform_location_coordinate(coordinates=location, crs='EPSG:4647')
>>> result_dict
{'Aachen, Städteregion Aachen, Nordrhein-Westfalen, Deutschland': (32294411.33488576, 5629009.357074926)}

See also

get_location_coordinate

Get GeoPy Location Object

create_polygon_from_location

Create Shapely Polygon from GeoPy Location Object bounds

get_locations

Get location information for a list of city names