pyrosm.OSM.get_natural#
- OSM.get_natural(custom_filter=None, extra_attributes=None, timestamp=None, tags_to_keep=None)#
Parses natural from OSM.
- Parameters:
custom_filter (dict) –
What kind of natural to parse, see details below.
You can opt-in specific elements by using ‘custom_filter’. To keep only specific natural such as ‘wood’ and ‘tree’, you can apply a custom filter which is a Python dictionary with the following format:
custom_filter={'natural': ['wood', 'tree']}
extra_attributes (list (optional)) – Additional OSM tag keys that will be converted into columns in the resulting GeoDataFrame.
tags_to_keep (list (optional)) – When given, only these OSM tag keys are kept as columns, replacing the default set of tag columns (reduces memory). Structural columns and filtering are unaffected; extra_attributes still apply.
timestamp (str | datetime | int) –
If provided, the data from given moment of time will be returned. The time should be provided in UTC. Note: This functionality only works with OSH.PBF files that can be downloaded manually e.g. from Geofabrik (requires login with OSM account).
The logic: the closest version of each element up to given timestamp will be selected to the result. This means that elements can be older than the given timestamp (the most up-to-date version is selected), but not newer (records having exactly the selected timestamp will be kept). In case only a date is given, the time will represent midnight of the given day, such as “2021-01-01 00:00:00”.
See also
Take a look at OSM documentation for further details about the data: