StreetViewPanorama#
- class rapidtools.data_sources.StreetViewPanorama(id: str, lat: float, lon: float, heading: float = 0.0, pitch: float = 90.0, roll: float = 0.0, elevation: float | None = None, date: tuple[int, int] | None=None, address: list[str] = <factory>, sizes: dict[int, tuple[int, int]]=<factory>, tile_size: int = 512, links: list[tuple[str, float, float, float]]=<factory>, depth_map_b64: str | None = None)[source]#
Bases:
objectMetadata describing one Google Street View panorama.
- Variables:
id (str) – Google panorama ID.
lat (float) – Camera latitude in degrees.
lon (float) – Camera longitude in degrees.
heading (float) – Compass heading of the panorama centre column (degrees, 0 = north, clockwise).
pitch (float) – Camera pitch in degrees (Google reports ~90 for level).
roll (float) – Camera roll in degrees.
elevation (float | None) – Camera elevation above sea level in metres, if known.
date (tuple[int, int] | None) –
(year, month)of capture, if known.address (list[str]) – Human-readable address strings reported by Google.
sizes (dict[int, tuple[int, int]]) –
{zoom: (width, height)}of the full panorama per zoom level.tile_size (int) – Edge length of the panorama tiles in pixels.
links (list[tuple[str, float, float, float]]) – Neighbouring panoramas as
(pano_id, lat, lon, heading).depth_map_b64 (str | None) – URL-safe Base64 depth-map string (see
decode_depth_map()), if the metadata included one.
Example
>>> pano = StreetViewPanorama(id='abc', lat=34.0, lon=-118.0, heading=90.0) >>> pano.size_at_zoom(0) (512, 256)
Methods
Return the full panorama
(width, height)atzoom.- size_at_zoom(zoom: int) tuple[int, int][source]#
Return the full panorama
(width, height)atzoom.Falls back to the canonical
512 * 2**zoomlayout when the metadata did not report explicit sizes.- Parameters:
zoom – Tile zoom level (0-5).
- Returns:
tuple[int, int] – Panorama width and height in pixels.