GeofabrikDownloader.get_region_subregion_tiers¶
- GeofabrikDownloader.get_region_subregion_tiers(update=False, confirmation_required=True, verbose=False, raise_error=False)[source]¶
Get region-subregion tier and all (sub)regions that have no subregions.
This includes all geographic (sub)regions for which data of subregions is unavailable.
- Parameters:
update (bool) – whether to (check on and) update the prepacked data, defaults to
Falseconfirmation_required (bool) – whether asking for confirmation to proceed, defaults to
Trueverbose (bool | int) – whether to print relevant information in console, defaults to
Falseraise_error (bool) – Whether to raise the provided exception; if
raise_error=False(default), the error will be suppressed.
- Returns:
region-subregion tier and all (sub)regions that have no subregions
- Return type:
tuple[dict, list] | tuple[None, None]
Examples:
>>> from pydriosm.downloader import GeofabrikDownloader >>> gfd = GeofabrikDownloader() >>> # region-subregion tiers, and all regions that have no subregions >>> region_subregion_tiers, having_no_subregions = gfd.get_region_subregion_tiers() >>> type(region_subregion_tiers) dict >>> # Keys of the region-subregion tier >>> list(region_subregion_tiers) ['Africa', 'Antarctica', 'Asia', 'Australia and Oceania', 'Central America', 'Europe', 'North America', 'South America'] >>> type(having_no_subregions) list >>> len(having_no_subregions) 484 >>> # Example: five regions that have no subregions >>> having_no_subregions[0:5] ['Antarctica', 'Algeria', 'Angola', 'Benin', 'Botswana']