GeofabrikDownloader.search_for_subregions¶
-
GeofabrikDownloader.
search_for_subregions
(*subregion_name, deep=False)[source]¶ Retrieve names of all subregions (if any) of the given geographic region(s).
The is based on the region-subregion tier.
See also [RNS-1].
- Parameters
subregion_name (str or None) – name of a geographic region (case-insensitive) available on Geofabrik’s free download server
deep (bool) – whether to get subregion names of the subregions, defaults to
False
- Returns
list of subregions (if any); if
subregion_name=None
, all regions that do have subregions- Return type
list
Examples:
>>> from pydriosm.downloader import GeofabrikDownloader >>> geofabrik_downloader = GeofabrikDownloader() >>> sr_names = geofabrik_downloader.search_for_subregions() >>> print(sr_names[:5]) ['Antarctica', 'Algeria', 'Angola', 'Benin', 'Botswana'] >>> sr_names = geofabrik_downloader.search_for_subregions( ... 'england', 'asia', deep=False) >>> print(sr_names[:5]) ['Bedfordshire', 'Berkshire', 'Bristol', 'Buckinghamshire', 'Cambridgeshire'] >>> print(sr_names[-5:]) ['Thailand', 'Turkmenistan', 'Uzbekistan', 'Vietnam', 'Yemen'] >>> sr_names = geofabrik_downloader.search_for_subregions( ... 'britain', deep=True) >>> print(sr_names[:5]) ['Scotland', 'Wales', 'Bedfordshire', 'Berkshire', 'Bristol']