brails.scrapers.overture_maps_scraper.overture_maps_scraper module
This module define the base class for scraping OvertureMaps data.
A base class for accessing and processing data from Overture Maps. |
- class brails.scrapers.overture_maps_scraper.overture_maps_scraper.OvertureMapsScraper
Bases:
ABC
A base class for accessing and processing data from Overture Maps.
This is a base class and is not intended to be instantiated directly. To use it, either:
Import and instantiate a subclass (e.g.,
Importer().get_class('OvertureMapsFootprintScraper')
)Or subclass it yourself and implement additional logic.
Direct imports of this base class are typically only needed when creating new Overture Maps scrapers.
Provided static methods include:
Fetching release version names from the Overture Maps release index.
Normalizing bounding box coordinates to a consistent format.
- static fetch_release_names(print_releases=False)
Fetch the list of release names from the OvertureMaps releases YAML.
- Parameters:
print_releases (bool, optional) – If
True
, print the list of releases. Defaults toFalse
.- Returns:
A list of release version strings.
- Return type:
List[str]
Examples
Get a list of available releases:
>>> from brails.scrapers.overture_maps_scraper.overture_maps_scraper import OvertureMapsScraper >>> releases = OvertureMapsScraper.fetch_release_names() >>> print(releases[0]) 2025-08-20.1
Print all available releases:
>>> OvertureMapsScraper.fetch_release_names(print_releases=True) ['2025-08-20.1', '2025-08-20.0', '2025-07-23.0', '2025-06-25.0', '2025-05-21.0', '2025-04-23.0', '2025-03-19.1', '2025-03-19.0', '2025-02-19.0', '2025-01-22.0', '2024-12-18.0', '2024-11-13.0', '2024-10-23.0', '2024-09-18.0', '2024-08-20.0', '2024-07-22.0', '2024-06-13-beta.1', '2024-06-13-beta.0', '2024-05-16-beta.0', '2024-04-16-beta.0', '2024-03-12-alpha.0', '2024-02-15-alpha.0', '2024-01-17-alpha.0', '2023-12-14-alpha.0', '2023-11-14-alpha.0', '2023-10-19-alpha.0', '2023-07-26-alpha.0']
- static normalize_bbox_order(bbox)
Reorder bbox coordinates to (lonmin, latmin, lonmax, latmax) format.
- Parameters:
bbox (tuple or list) – A sequence of four numeric coordinates defining the corner coordinatesin of a bounding box in (lon1, lat1, lon2, lat2) format.
- Returns:
Bounding box coordinates reordered as (lonmin, latmin, lonmax, latmax).
- Return type:
Tuple[float, float, float, float]
Examples
Reorder coordinates where longitude and latitude pairs are reversed:
>>> from brails.scrapers.overture_maps_scraper.overture_maps_scraper import OvertureMapsScraper >>> OvertureMapsScraper.normalize_bbox_order( >>> (-73.5, 40.8, -74.2, 40.5) >>> ) (-74.2, 40.5, -73.5, 40.8)
Works the same with lists:
>>> OvertureMapsScraper.normalize_bbox_order( >>> [-122.5, 37.9, -123.1, 37.6] >>> ) (-123.1, 37.6, -122.5, 37.9)
Raises an error if the input does not contain exactly four values:
>>> OvertureMapsScraper.normalize_bbox_order((10.0, 20.0, 30.0)) ValueError: bbox must be a tuple or list of exactly four elements