pyufunc.get_osm_place#

pyufunc.get_osm_place(place, verbose=False)#

Geocode a place name to dictionary of its attributes and geometry from OpenStreetMap.

Parameters:
  • place (str) – The place of interest to geocode from OpenStreetMap.

  • verbose (bool, optional) – whether to print out processing details. Defaults to False.

Note

You can also manually get place of interest from OpenStreetMap https://www.openstreetmap.org/ by searching the place name in the search bar.

Returns:

dictionary of the place’s attributes and geometry from OpenStreetMap.

Return type:

dict

Example

>>> from pyufunc import get_osm_place
>>> get_osm_place("Arizona State University, AZ, USA")
{'bbox_north': '33.4329786',
'bbox_south': '33.4102062',
'bbox_east': '-111.9092447',
'bbox_west': '-111.9411651',
'place_id': 318528634,
'osm_type': 'relation',
'osm_id': 3444656,
'lat': '33.4213174',
'lon': '-111.93316305413154',
'class': 'amenity',
'type': 'university',
'place_rank': 30,
'importance': 0.5547365758311374,
'addresstype': 'amenity',
'name': 'Arizona State University',
'display_name': 'Arizona State University, 1151, South Forest Avenue, Tempe Junction,
    Tempe, Maricopa County, Arizona, 85281, United States',
'geometry': <MULTIPOLYGON (((-111.941 33.424, -111.941 33.424, -111.941 33.424, -111.941...>}