pyufunc.get_osm_by_relation_id#
- pyufunc.get_osm_by_relation_id(relation_id, output_filepath='map.osm', url='www.overpass-api.de/api/interpreter')#
Downloads OpenStreetMap (OSM) data for a specified region using the Overpass API.
This function queries the Overpass API for a given OSM relation ID, retrieves the corresponding map data, and saves it to a local file.
- Parameters:
See also
SUMO Documentation: eclipse-sumo/sumo osm2gmns Documentation: jiawlu/OSM2GMNS
Example
>>> import pyufunc as pf >>> relation_id = 123456789 # Example relation ID (Get this from OSM) >>> pf.get_osm_by_relation_id(relation_id, output_filepath='my_map.osm')
- Returns:
- True if the data was successfully downloaded and saved, False otherwise.
Returns None if the data could not be downloaded.
- Return type:
bool | None