BingOrthomosaicExtractor#

class rapidtools.processing.BingOrthomosaicExtractor(zoom_level: int = 19, max_workers: int = 10, cancel_event: Event | None = None)[source]#

Bases: TileOrthomosaicExtractor

Component that extracts and synthesizes aerial imagery from Bing Maps Tiles.

Downloads Bing Maps aerial tiles for a given geographical region and stitches them into a single, continuous GeoTIFF. The resulting synthetic orthomosaic retains its coordinate metadata (EPSG:4326) and can be directly fed into region-wide feature extractors (like SAM3OrthoFeatureExtractor) just like a standard drone flight or satellite capture.

Parameters:
  • zoom_level (int, optional) – The detail level of the Bing Maps tiles to download, typically ranging from 1 (entire world) to 19 (0.3m/pixel). Defaults to 19.

  • max_workers (int, optional) – The number of concurrent threads to use for downloading tiles in parallel. Defaults to 10.

  • cancel_event (Event | None, optional) – Cooperative cancellation flag checked as tiles complete. When set, outstanding downloads are cancelled and OperationCancelled is raised. Defaults to None.

Example

>>> from rapidtools.core import BoundingBox
>>> from rapidtools.processing import BingOrthomosaicExtractor
>>>
>>> # Define the area of interest:
>>> region = BoundingBox(
...     min_x=-118.251, min_y=34.050, max_x=-118.245, max_y=34.055
... )
>>>
>>> # Initialize the extractor and stitch the region into a TIFF:
>>> extractor = BingOrthomosaicExtractor(zoom_level=19)
>>> tiff_path = extractor(region, output_path='downtown_la.tiff')
>>> tiff_path.suffix
'.tiff'

Methods

lat_lon_to_pixel

Convert latitude and longitude to global Web Mercator pixel coordinates.

tile_to_quadkey

Convert tile XY coordinates into a Bing Maps Quadkey string.

static tile_to_quadkey(tile_x: int, tile_y: int, zoom: int) → str[source]#

Convert tile XY coordinates into a Bing Maps Quadkey string.

Parameters:
  • tile_x (int) – Tile column index.

  • tile_y (int) – Tile row index.

  • zoom (int) – Zoom level (equals the length of the returned quadkey).

Returns:

str – The quadkey, a base-4 string such as '213'.

Example

>>> BingOrthomosaicExtractor.tile_to_quadkey(3, 5, zoom=3)
'213'