### Get Coverage Tile (Async) Source: https://streetlevel.readthedocs.io/en/stable/streetlevel.streetview.html Asynchronous version for fetching coverage data for a map tile. Requires an aiohttp ClientSession. ```python from streetlevel import streetview from aiohttp import ClientSession async with ClientSession() as session: coverage = await streetview.get_coverage_tile_async(100, 200, session) ``` -------------------------------- ### Get Interior Panorama Metadata (Async) Source: https://streetlevel.readthedocs.io/en/stable/streetlevel.baidu.html Asynchronously fetches metadata for a set of interior panoramas using an 'inter' ID. Requires 'streetlevel' and 'aiohttp' libraries. Uses an aiohttp ClientSession. ```python from streetlevel import baidu from aiohttp import ClientSession async with ClientSession() as session: inter = await baidu.get_inter_metadata_async("b60ec15c48587562843304bc", session) print(inter.name) print(inter.lat, inter.lon) for floor in inter.floors: print(floor.number, [p.id for p in floor.panos]) ``` -------------------------------- ### Get Interior Metadata by ID (Async) Source: https://streetlevel.readthedocs.io/en/stable/_sources/streetlevel.baidu.rst.txt Asynchronously retrieve metadata for an interior location by its ID. Requires an aiohttp ClientSession. Returns name, coordinates, and floor-specific panorama information. ```python from streetlevel import baidu async with ClientSession() as session: inter = await baidu.get_inter_metadata_async("b60ec15c48587562843304bc", session) print(inter.name) print(inter.lat, inter.lon) for floor in inter.floors: print(floor.number, [p.id for p in floor.panos]) ``` -------------------------------- ### GET /get_coverage_tile_by_latlon_async Source: https://streetlevel.readthedocs.io/en/stable/streetlevel.streetview.html Retrieves a list of StreetViewPanoramas for a given latitude and longitude. ```APIDOC ## GET /get_coverage_tile_by_latlon_async ### Description Retrieves a list of StreetViewPanoramas for a specific location. If no coverage is found, returns an empty list. ### Parameters #### Query Parameters - **lat** (float) - Required - Latitude coordinate - **lon** (float) - Required - Longitude coordinate - **session** (ClientSession) - Required - The aiohttp session ### Response #### Success Response (200) - **List[StreetViewPanorama]** - A list of available panoramas. ``` -------------------------------- ### GET /get_panorama Source: https://streetlevel.readthedocs.io/en/stable/streetlevel.streetview.html Downloads a specific panorama and returns it as a PIL image object. ```APIDOC ## GET /get_panorama ### Description Downloads a panorama and returns it as a PIL image. ### Parameters #### Query Parameters - **pano** (StreetViewPanorama) - Required - The panorama object to download - **zoom** (int) - Optional - Image size (0-5). Defaults to 5. ``` -------------------------------- ### GET /build_permalink Source: https://streetlevel.readthedocs.io/en/stable/streetlevel.naver.html Generates a shareable Naver Map URL for a specific panorama ID with configurable viewport settings. ```APIDOC ## GET /build_permalink ### Description Creates a permalink to the given panorama with specified initial viewport parameters. ### Method GET ### Endpoint /build_permalink ### Parameters #### Query Parameters - **id** (str) - Required - The pano ID. - **heading** (float) - Optional - Initial heading of the viewport. Defaults to 0.0. - **pitch** (float) - Optional - Initial pitch of the viewport. Defaults to 10.0. - **fov** (float) - Optional - Initial FOV of the viewport. Defaults to 80.0. - **map_zoom** (float) - Optional - Initial zoom level of the map. Defaults to 17.0. - **radians** (bool) - Optional - Whether angles are in radians. Defaults to False. ### Response #### Success Response (200) - **url** (str) - A Naver Map URL which will open the given panorama. ``` -------------------------------- ### Get Coverage Tile by Coordinates Source: https://streetlevel.readthedocs.io/en/stable/streetlevel.lookaround.html Fetches Look Around panoramas on a specific map tile using XYZ coordinates. Coordinates are in Slippy Map aka XYZ format at zoom level 17. Requires importing the lookaround module. ```python from streetlevel import lookaround tile = lookaround.get_coverage_tile(109775, 56716) first = tile.panos[0] print(f" Got {len(tile.panos)} panoramas. Here's one of them: ID: {first.id} Build ID: {first.build_id} Latitude: {first.lat} Longitude: {first.lon} Capture date: {first.date} ") ``` -------------------------------- ### Get Coverage Tile by Latitude and Longitude Source: https://streetlevel.readthedocs.io/en/stable/streetlevel.lookaround.html Fetches the map tile containing a given latitude and longitude, then retrieves panoramas on that tile. The returned list of panoramas is not sorted. Requires importing the lookaround module. ```python from streetlevel import lookaround tile = lookaround.get_coverage_tile_by_latlon(23.53239040648735, 121.5068719584602) first = tile.panos[0] print(f" Got {len(tile.panos)} panoramas. Here's one of them: ID: {first.id} Build ID: {first.build_id} Latitude: {first.lat} Longitude: {first.lon} Capture date: {first.date} ") ``` -------------------------------- ### Download Baidu Panorama Image (Async) Source: https://streetlevel.readthedocs.io/en/stable/_sources/streetlevel.baidu.rst.txt Asynchronously download a panorama image to a specified file path. Requires an aiohttp ClientSession and a panorama object. ```python from streetlevel import baidu from aiohttp import ClientSession async with ClientSession() as session: pano = await baidu.find_panorama_by_id_async("09024200121707301421572809B", session) await baidu.download_panorama_async(pano, f"{pano.id}.jpg", session) ``` -------------------------------- ### Download Panorama (Async) Source: https://streetlevel.readthedocs.io/en/stable/_sources/streetlevel.naver.rst.txt Asynchronously download a panorama image to a specified file path. Requires an aiohttp ClientSession. ```python from streetlevel import naver from aiohttp import ClientSession async with ClientSession() as session: pano = await naver.find_panorama_by_id_async("hQ46n55JstD9C-tGdzZz2g", session) await naver.download_panorama_async(pano, f"{pano.id}.jpg", session) ``` -------------------------------- ### GET get_panorama_face Source: https://streetlevel.readthedocs.io/en/stable/streetlevel.lookaround.html Fetches a single face of a panorama in HEIC format. ```APIDOC ## GET get_panorama_face ### Description Fetches one face of a panorama. Images are in HEIC format. ### Parameters #### Query Parameters - **pano** (LookaroundPanorama | Tuple[int, int]) - Required - The panorama or its ID. - **face** (Face | int) - Required - Index of the face. - **zoom** (int) - Required - The zoom level (0 is highest, 7 is lowest). - **auth** (Authenticator) - Required - An Authenticator object. - **session** (Session) - Optional - A requests session. ### Response - **bytes** (binary) - The HEIC file containing the face. ``` -------------------------------- ### Get Coverage Tile Source: https://streetlevel.readthedocs.io/en/stable/streetlevel.streetview.html Fetches Street View coverage data for a specific map tile. ```APIDOC ## get_coverage_tile ### Description Fetches Street View coverage on a specific map tile. Coordinates are in Slippy Map aka XYZ format at zoom level 17. This function returns ID, position, elevation, orientation, and links within the tile of the most recent coverage. ### Method GET ### Endpoint /streetview/get_coverage_tile ### Parameters #### Query Parameters - **tile_x** (int) - Required - X coordinate of the tile. - **tile_y** (int) - Required - Y coordinate of the tile. - **session** (Session | None) - Optional - A requests session. ### Response #### Success Response (200) - **List[StreetViewPanorama]** (list) - A list of StreetViewPanoramas. If no coverage was returned by the API, the list is empty. ### Request Example ```python from streetlevel import streetview tile_coverage = streetview.get_coverage_tile(100, 200) print(tile_coverage) ``` ``` ```APIDOC ## get_coverage_tile_async ### Description Asynchronously fetches Street View coverage on a specific map tile. Coordinates are in Slippy Map aka XYZ format at zoom level 17. This function returns ID, position, elevation, orientation, and links within the tile of the most recent coverage. ### Method GET ### Endpoint /streetview/get_coverage_tile_async ### Parameters #### Query Parameters - **tile_x** (int) - Required - X coordinate of the tile. - **tile_y** (int) - Required - Y coordinate of the tile. - **session** (ClientSession) - Required - An aiohttp client session. ### Response #### Success Response (200) - **List[StreetViewPanorama]** (list) - A list of StreetViewPanoramas. If no coverage was returned by the API, the list is empty. ### Request Example ```python from streetlevel import streetview from aiohttp import ClientSession async with ClientSession() as session: tile_coverage = await streetview.get_coverage_tile_async(100, 200, session) print(tile_coverage) ``` ``` -------------------------------- ### Download Kakao panorama Source: https://streetlevel.readthedocs.io/en/stable/_sources/streetlevel.kakao.rst.txt Downloads a panorama image to the local filesystem. ```python from streetlevel import kakao pano = kakao.find_panorama_by_id(1168949345) kakao.download_panorama(pano, f"{pano.id}.jpg") ``` ```python from streetlevel import kakao from aiohttp import ClientSession async with ClientSession() as session: pano = await kakao.find_panorama_by_id_async(1168949345, session) await kakao.download_panorama(pano, f"{pano.id}.jpg") ``` -------------------------------- ### GET get_coverage_tile_by_latlon Source: https://streetlevel.readthedocs.io/en/stable/streetlevel.lookaround.html Fetches the coverage tile containing a specific geographic point defined by latitude and longitude. ```APIDOC ## GET get_coverage_tile_by_latlon ### Description Fetches the tile on which a specific point is located. ### Parameters #### Query Parameters - **lat** (float) - Required - Latitude of the point. - **lon** (float) - Required - Longitude of the point. - **session** (Session) - Optional - A requests session. ### Response - **CoverageTile** (object) - A CoverageTile object holding a list of panoramas. ``` -------------------------------- ### Download Panorama to File Source: https://streetlevel.readthedocs.io/en/stable/streetlevel.yandex.html Downloads a panorama to a specified file path. Includes Exif and XMP GPano metadata if saving as JPEG. Use this for synchronous file downloads. ```python from streetlevel import yandex pano = yandex.find_panorama_by_id("1532719828_788624743_23_1678861237") yandex.download_panorama(pano, f"{pano.id}.jpg") ``` -------------------------------- ### download_panorama Source: https://streetlevel.readthedocs.io/en/stable/streetlevel.streetside.html Downloads a panorama directly to a file on the local system. ```APIDOC ## download_panorama ### Description Downloads a panorama to a specified file path. ### Parameters - **pano** (StreetsidePanorama) - Required - The panorama object. - **path** (str) - Required - Output file path. - **zoom** (int) - Optional - Image size; 0 is lowest, 4 is highest. Defaults to 4. - **stitching_method** (CubemapStitchingMethod) - Optional - Whether and how the faces of the cubemap are stitched into one image. Defaults to ROW. - **pil_args** (dict | None) - Optional - Additional arguments for PIL’s Image.save method. ### Response - **Return Type** (None) ``` -------------------------------- ### GET /build_permalink Source: https://streetlevel.readthedocs.io/en/stable/streetlevel.yandex.html Generates a shareable Yandex Maps URL for a specific panorama based on ID or geographic coordinates. ```APIDOC ## GET /build_permalink ### Description Creates a permalink to the given panorama. All parameters are optional, but either a location (lat/lon), or a pano ID, or both must be passed. ### Method GET ### Endpoint /build_permalink ### Parameters #### Query Parameters - **id** (str) - Optional - The pano ID. - **lat** (float) - Optional - Latitude of the panorama’s location. - **lon** (float) - Optional - Longitude of the panorama’s location. - **heading** (float) - Optional - Initial heading of the viewport. Defaults to 0.0. - **pitch** (float) - Optional - Initial pitch of the viewport. Defaults to 0.0. - **map_zoom** (float) - Optional - Initial zoom level of the map. Defaults to 17.0. - **radians** (bool) - Optional - Whether angles are in radians. Defaults to True. ### Response #### Success Response (200) - **url** (str) - A Yandex Maps URL which will open the given panorama. ``` -------------------------------- ### Download Panorama (Sync) Source: https://streetlevel.readthedocs.io/en/stable/_sources/streetlevel.naver.rst.txt Download a panorama image to a specified file path. This is a synchronous operation. ```python from streetlevel import naver pano = naver.find_panorama_by_id("hQ46n55JstD9C-tGdzZz2g") naver.download_panorama(pano, f"{pano.id}.jpg") ``` -------------------------------- ### permalink Method Source: https://streetlevel.readthedocs.io/en/stable/streetlevel.mapy.html Creates a permalink to a Mapy.cz panorama with specified viewport and map settings. ```APIDOC ## permalink Method ### Description Creates a permalink to this panorama. ### Method (This is a method of the MapyPanorama class, not a standalone API endpoint) ### Parameters - **heading** (float) - Optional. Initial heading of the viewport. Defaults to 0°. - **pitch** (float) - Optional. Initial pitch of the viewport. Defaults to 0°. - **fov** (float) - Optional. Initial FOV of the viewport. Defaults to 72°. - **map_zoom** (float) - Optional. Initial zoom level of the map. Defaults to 17. - **radians** (bool) - Optional. Whether angles are in radians. Defaults to False. ### Returns A Mapy.cz URL which will open the given panorama. ### Return Type str ``` -------------------------------- ### download_panorama_async Source: https://streetlevel.readthedocs.io/en/stable/streetlevel.ja.html Asynchronously downloads a panorama to a specified file path. Requires an active aiohttp ClientSession and allows for additional PIL save arguments. ```APIDOC ## POST /api/panorama/download/file/async ### Description Asynchronously downloads a panorama to a file. ### Method POST ### Endpoint /api/panorama/download/file/async ### Parameters #### Query Parameters - **pano** (JaPanorama) - Required - The panorama object. - **path** (str) - Required - Output path for the downloaded file. - **session** (ClientSession) - Required - The aiohttp client session. - **zoom** (int) - Optional - Image size; 0 is high, 1 is low. Defaults to 0. - **stitching_method** (CubemapStitchingMethod) - Optional - Whether and how the faces of the cubemap are stitched into one image. Defaults to `ROW`. - **pil_args** (dict | None) - Optional - Additional arguments for PIL’s Image.save method, e.g. `{"quality":100}`. Defaults to `{}`. ### Request Example ```python from streetlevel import ja from aiohttp import ClientSession async with ClientSession() as session: pano = await ja.find_panorama_by_id_async(2962469, session) await ja.download_panorama_async(pano, f"{pano.id}.jpg", session) ``` ### Response #### Success Response (200) - **None** - This endpoint does not return any data upon successful execution. ``` -------------------------------- ### Get Coverage Tile by LatLon Source: https://streetlevel.readthedocs.io/en/stable/streetlevel.streetview.html Fetches Street View coverage data for the map tile containing a given latitude and longitude. ```APIDOC ## get_coverage_tile_by_latlon ### Description Same as `get_coverage_tile`, but for fetching the tile on which a point is located. ### Method GET ### Endpoint /streetview/get_coverage_tile_by_latlon ### Parameters #### Query Parameters - **lat** (float) - Required - Latitude of the point. - **lon** (float) - Required - Longitude of the point. - **session** (Session | None) - Optional - A requests session. ### Response #### Success Response (200) - **List[StreetViewPanorama]** (list) - A list of StreetViewPanoramas. If no coverage was returned by the API, the list is empty. ### Request Example ```python from streetlevel import streetview tile_coverage = streetview.get_coverage_tile_by_latlon(45.59395, 24.631609) print(tile_coverage) ``` ``` -------------------------------- ### Get Interior Metadata by ID Source: https://streetlevel.readthedocs.io/en/stable/_sources/streetlevel.baidu.rst.txt Retrieve metadata for an interior location using its ID. This includes the name, coordinates, and floor-specific panorama information. ```python from streetlevel import baidu inter = baidu.get_inter_metadata("b60ec15c48587562843304bc") print(inter.name) print(inter.lat, inter.lon) for floor in inter.floors: print(floor.number, [p.id for p in floor.panos]) ``` -------------------------------- ### Download Panorama Image (Asynchronous) Source: https://streetlevel.readthedocs.io/en/stable/_sources/streetlevel.ja.rst.txt Asynchronously download a panorama image to a specified file path. Requires aiohttp.ClientSession. ```python from streetlevel import ja from aiohttp import ClientSession async with ClientSession() as session: pano = await ja.find_panorama_by_id_async(2962469, session) await ja.download_panorama_async(pano, f"{pano.id}.jpg", session) ``` -------------------------------- ### GET get_coverage_tile Source: https://streetlevel.readthedocs.io/en/stable/streetlevel.lookaround.html Fetches Look Around panoramas on a specific map tile using Slippy Map (XYZ) coordinates at zoom level 17. ```APIDOC ## GET get_coverage_tile ### Description Fetches Look Around panoramas on a specific map tile. Coordinates are in Slippy Map aka XYZ format at zoom level 17. ### Parameters #### Query Parameters - **tile_x** (int) - Required - X coordinate of the tile. - **tile_y** (int) - Required - Y coordinate of the tile. - **session** (Session) - Optional - A requests session. ### Response - **CoverageTile** (object) - A CoverageTile object holding a list of panoramas and the last modification date of the tile. ``` -------------------------------- ### Download a panorama to a file Source: https://streetlevel.readthedocs.io/en/stable/streetlevel.kakao.html Saves a panorama to the specified path. JPEG files include Exif and XMP GPano metadata. ```python from streetlevel import kakao pano = kakao.find_panorama_by_id(1168949345) kakao.download_panorama(pano, f"{pano.id}.jpg") ``` -------------------------------- ### Download Panorama Image (Synchronous) Source: https://streetlevel.readthedocs.io/en/stable/_sources/streetlevel.ja.rst.txt Download a panorama image to a specified file path. First, find the panorama using `find_panorama_by_id`. ```python from streetlevel import ja pano = ja.find_panorama_by_id(2962469) ja.download_panorama(pano, f"{pano.id}.jpg") ``` -------------------------------- ### Get Coverage Tile by Latitude and Longitude Source: https://streetlevel.readthedocs.io/en/stable/_sources/streetlevel.lookaround.rst.txt Fetches a coverage tile using precise latitude and longitude. This is an alternative to using tile coordinates for finding panoramas. ```python from streetlevel import lookaround tile = lookaround.get_coverage_tile_by_latlon(23.53239040648735, 121.5068719584602) first = tile.panos[0] print(f" Got {len(tile.panos)} panoramas. Here's one of them: ID: {first.id}\t\tBuild ID: {first.build_id} Latitude: {first.lat}\tLongitude: {first.lon} Capture date: {first.date} ") ``` -------------------------------- ### Download Mapy.cz panorama asynchronously Source: https://streetlevel.readthedocs.io/en/stable/_sources/streetlevel.mapy.rst.txt Asynchronous version of downloading a panorama image, requiring an aiohttp ClientSession. ```python from streetlevel import mapy from aiohttp import ClientSession async with ClientSession() as session: pano = await mapy.find_panorama_by_id_async(82102772, session) await mapy.download_panorama_async(pano, f"{pano.id}.jpg", session) ``` -------------------------------- ### Get Coverage Tile by Coordinates Source: https://streetlevel.readthedocs.io/en/stable/_sources/streetlevel.lookaround.rst.txt Fetches a coverage tile based on integer tile coordinates. Useful for retrieving metadata about available panoramas in a specific area. ```python from streetlevel import lookaround tile = lookaround.get_coverage_tile(109775, 56716) first = tile.panos[0] print(f" Got {len(tile.panos)} panoramas. Here's one of them: ID: {first.id}\t\tBuild ID: {first.build_id} Latitude: {first.lat}\tLongitude: {first.lon} Capture date: {first.date} ") ``` -------------------------------- ### Find Panorama by Coordinates (Synchronous) Source: https://streetlevel.readthedocs.io/en/stable/_sources/streetlevel.streetview.rst.txt Use this function to find a panorama ID and its metadata based on latitude and longitude. Requires no special setup beyond importing the library. ```python from streetlevel import streetview pano = streetview.find_panorama(45.59395, 24.631609) print(pano.id) print(pano.lat, pano.lon) print(pano.date) ``` -------------------------------- ### Asynchronously Download Panorama to File Source: https://streetlevel.readthedocs.io/en/stable/streetlevel.yandex.html Asynchronously downloads a panorama to a specified file path using an aiohttp session. Suitable for concurrent operations in async applications. ```python from streetlevel import yandex from aiohttp import ClientSession async with ClientSession() as session: pano = await yandex.find_panorama_by_id_async("1532719828_788624743_23_1678861237", session) await yandex.download_panorama_async(pano, f"{pano.id}.jpg", session) ``` -------------------------------- ### Get Coverage Tile by LatLon Source: https://streetlevel.readthedocs.io/en/stable/streetlevel.streetview.html Fetches Street View coverage data for the map tile containing a given latitude and longitude. This is an alternative to using XYZ tile coordinates. ```python from streetlevel import streetview coverage = streetview.get_coverage_tile_by_latlon(45.59395, 24.631609) print(coverage) ``` -------------------------------- ### get_panorama_async Source: https://streetlevel.readthedocs.io/en/stable/streetlevel.ja.html Asynchronously downloads a panorama and returns it as a PIL image. Requires an active aiohttp ClientSession. ```APIDOC ## GET /api/panorama/download/async ### Description Asynchronously downloads a panorama and returns it as a PIL image. ### Method GET ### Endpoint /api/panorama/download/async ### Parameters #### Query Parameters - **pano** (JaPanorama) - Required - The panorama object. - **session** (ClientSession) - Required - The aiohttp client session. - **zoom** (int) - Optional - Image size; 0 is high, 1 is low. Defaults to 0. - **stitching_method** (CubemapStitchingMethod) - Optional - Whether and how the faces of the cubemap are stitched into one image. Defaults to `ROW`. ### Response #### Success Response (200) - **image** (Image | List[Image]) - A PIL image or a list of six PIL images depending on `stitching_method`. ``` -------------------------------- ### Asynchronously Download Panorama to File Source: https://streetlevel.readthedocs.io/en/stable/streetlevel.streetside.html Asynchronously downloads a panorama and saves it to a specified file path using an aiohttp session. Supports custom PIL arguments for saving. ```python from streetlevel import streetside from aiohttp import ClientSession async with ClientSession() as session: pano = await streetside.find_panorama_by_id_async(398611371, session) await streetside.download_panorama_async(pano, f"{pano.id}.jpg", session) ``` -------------------------------- ### Find Panorama by Coordinates (Async) Source: https://streetlevel.readthedocs.io/en/stable/_sources/streetlevel.naver.rst.txt Asynchronously find a panorama using latitude and longitude. Requires an aiohttp ClientSession. ```python from streetlevel import naver from aiohttp import ClientSession async with ClientSession() as session: pano = await naver.find_panorama_async(37.4481486, 126.4509719, session) print(pano.lat, pano.lon) print(pano.id) print(pano.date) ``` -------------------------------- ### Reprojecting Panoramas Source: https://streetlevel.readthedocs.io/en/stable/streetlevel.lookaround.html This section covers the `to_equirectangular` function, which reprojects faces of a Look Around panorama into a single equirectangular image. Note that this function requires PyTorch to be installed and can be computationally intensive. ```APIDOC ## POST /api/streetlevel/reproject ### Description Reprojects the faces of a Look Around panorama to a single equirectangular image. The center of the returned image is the inverse direction of travel (meaning you’re looking backwards). **Note:** This method is very slow. On a typical machine, a full-resolution image (zoom 0, 16384x8192) takes about 50 seconds to convert. **PyTorch must be installed** to call this function. ### Method POST ### Endpoint /api/streetlevel/reproject ### Parameters #### Request Body - **faces** (List[Image]) - Required - The faces of the panorama as PIL images. - **camera_metadata** (List[CameraMetadata]) - Required - The camera metadata of the faces. ### Request Example ```json { "faces": [ "", "", "", "", "", "" ], "camera_metadata": [ { "k2": 0.1, "k3": 0.0, "k4": 0.0, "cx": 1024.0, "cy": 1024.0, "lx": 0.0, "ly": 0.0, "x": 0.0, "y": 0.0, "z": 0.0, "yaw": 0.0, "pitch": 0.0, "roll": 0.0 } // ... metadata for other faces ] } ``` ### Response #### Success Response (200) - **equirectangular_image** (Image) - The reprojected panorama as a PIL image. #### Response Example ```json { "equirectangular_image": "" } ``` ``` -------------------------------- ### Build Baidu Panorama Permalink Source: https://streetlevel.readthedocs.io/en/stable/_sources/streetlevel.baidu.rst.txt Construct a permalink for a Baidu panorama given its ID. This is useful for sharing or referencing specific panoramas. ```python from streetlevel import baidu permalink = baidu.build_permalink("09024200121707301421572809B") print(permalink) ``` -------------------------------- ### Get Coverage Tile Source: https://streetlevel.readthedocs.io/en/stable/streetlevel.streetview.html Fetches Street View coverage data for a specific map tile using XYZ coordinates. Returns a list of panoramas within that tile, including their ID, position, and orientation. ```python from streetlevel import streetview coverage = streetview.get_coverage_tile(100, 200) print(coverage) ``` -------------------------------- ### Image and Panorama Utilities Source: https://streetlevel.readthedocs.io/en/stable/util.html Functions for fetching images and stitching tiled panoramas. ```APIDOC ## get_image(url, session=None) ### Description Fetches an image from a URL using requests. ### Parameters - **url** (str) - Required - The URL. - **session** (Session|None) - Optional - A requests session. ### Response - **Image** (PIL Image) - The image as PIL Image. ## get_equirectangular_panorama(width, height, tile_size, tile_list) ### Description Downloads and stitches a tiled equirectangular panorama. ### Parameters - **width** (int) - Required - Width of the panorama in pixels. - **height** (int) - Required - Height of the panorama in pixels. - **tile_size** (Size) - Required - Size of one tile. - **tile_list** (List[Tile]) - Required - The tiles this panorama is made of. ### Response - **Image** (PIL Image) - The stitched panorama as PIL image. ``` -------------------------------- ### Building Permalinks Source: https://streetlevel.readthedocs.io/en/stable/_sources/streetlevel.yandex.rst.txt Function to construct a permalink for a given panorama. ```APIDOC ## Building Permalinks ### `streetlevel.yandex.build_permalink(panorama)` Constructs a shareable permalink for a panorama. ### Method (N/A - Utility function) ### Endpoint (N/A - Utility function) ### Parameters #### Path Parameters - **panorama** (YandexPanorama) - Required - The panorama object for which to build the permalink. ### Request Example ```python from streetlevel import yandex pano = yandex.find_panorama_by_id("1532719828_788624743_23_1678861237") permalink = yandex.build_permalink(pano) print(permalink) ``` ### Response #### Success Response (200) - **permalink** (str) - The generated URL string for the panorama. ``` -------------------------------- ### Asynchronous Panorama Downloading Source: https://streetlevel.readthedocs.io/en/stable/streetlevel.yandex.html Asynchronous functions for downloading panoramas. `get_panorama_async` returns a PIL image, and `download_panorama_async` saves the panorama to a specified file path. ```APIDOC ## GET /api/panorama/download/async ### Description Downloads a panorama asynchronously and returns it as a PIL image. ### Method GET ### Endpoint /api/panorama/download/async ### Parameters #### Query Parameters - **pano** (YandexPanorama) - Required - The panorama to download. - **session** (ClientSession) - Required - The aiohttp client session. - **zoom** (int) - Optional - Image size; 0 is highest, 4 is lowest. Defaults to 0. ### Response #### Success Response (200) - **image** (PIL Image) - The downloaded panorama as a PIL image. ### Request Example ```python from streetlevel import yandex from aiohttp import ClientSession async with ClientSession() as session: pano = await yandex.find_panorama_by_id_async("1532719828_788624743_23_1678861237", session) image = await yandex.get_panorama_async(pano, session) ``` ## POST /api/panorama/download/file/async ### Description Downloads a panorama asynchronously to a file. If the chosen format is JPEG, Exif and XMP GPano metadata are included. ### Method POST ### Endpoint /api/panorama/download/file/async ### Parameters #### Path Parameters - **path** (str) - Required - Output path. #### Query Parameters - **pano** (YandexPanorama) - Required - The panorama to download. - **session** (ClientSession) - Required - The aiohttp client session. - **zoom** (int) - Optional - Image size; 0 is highest, 4 is lowest. Defaults to 0. - **pil_args** (dict | None) - Optional - Additional arguments for PIL’s Image.save method, e.g. `{"quality":100}`. Defaults to `{}`. ### Request Example ```python from streetlevel import yandex from aiohttp import ClientSession async with ClientSession() as session: pano = await yandex.find_panorama_by_id_async("1532719828_788624743_23_1678861237", session) await yandex.download_panorama_async(pano, f"{pano.id}.jpg", session) ``` ### Response #### Success Response (200) - **None** - The function does not return any value. ``` -------------------------------- ### Download Panorama Image (Synchronous) Source: https://streetlevel.readthedocs.io/en/stable/_sources/streetlevel.streetview.rst.txt Downloads the panorama image to a specified file path. First, find the panorama using `find_panorama`. ```python from streetlevel import streetview pano = streetview.find_panorama(46.883958, 12.169002) streetview.download_panorama(pano, f"{pano.id}.jpg") ``` -------------------------------- ### Download a panorama asynchronously Source: https://streetlevel.readthedocs.io/en/stable/streetlevel.kakao.html Saves a panorama to a file using an aiohttp session. ```python from streetlevel import kakao from aiohttp import ClientSession async with ClientSession() as session: pano = await kakao.find_panorama_by_id_async(1168949345, session) await kakao.download_panorama(pano, f"{pano.id}.jpg") ``` -------------------------------- ### POST /download_panorama Source: https://streetlevel.readthedocs.io/en/stable/streetlevel.streetview.html Downloads a panorama to a local file path with optional metadata inclusion. ```APIDOC ## POST /download_panorama ### Description Downloads a panorama to a file. If JPEG format is used, Exif and XMP GPano metadata are included. ### Parameters #### Request Body - **pano** (StreetViewPanorama) - Required - The panorama object - **path** (str) - Required - Output file path - **zoom** (int) - Optional - Image size (0-5). Defaults to 5. - **pil_args** (dict) - Optional - Additional arguments for PIL's Image.save method. ``` -------------------------------- ### Asynchronous Panorama Download Source: https://streetlevel.readthedocs.io/en/stable/streetlevel.mapy.html Functions for downloading panoramas asynchronously. ```APIDOC ## GET /api/panorama/async/download ### Description Asynchronously downloads a panorama and returns it as a PIL image. ### Method GET ### Endpoint /api/panorama/async/download ### Parameters #### Query Parameters - **pano** (MapyPanorama) - Required - The panorama object. - **session** (ClientSession) - Required - The aiohttp client session. - **zoom** (int) - Optional - Image size; 0 is lowest, 2 is highest. If 2 is not available, 1 will be downloaded. Defaults to 2. ### Response #### Success Response (200) - **image** (PIL Image) - The downloaded panorama as a PIL image. #### Response Example ```python # Example response structure (actual image data not shown) { "image": "" } ``` ``` ```APIDOC ## POST /api/panorama/async/download/file ### Description Asynchronously downloads a panorama to a file. If the chosen format is JPEG, Exif and XMP GPano metadata are included. ### Method POST ### Endpoint /api/panorama/async/download/file ### Parameters #### Path Parameters - **path** (str) - Required - Output path for the downloaded file. #### Query Parameters - **pano** (MapyPanorama) - Required - The panorama object. - **session** (ClientSession) - Required - The aiohttp client session. - **zoom** (int) - Optional - Image size; 0 is lowest, 2 is highest. If 2 is not available, 1 will be downloaded. Defaults to 2. - **pil_args** (dict | None) - Optional - Additional arguments for PIL’s Image.save method, e.g. `{"quality":100}`. Defaults to `{}`. ### Request Example ```json { "pano": "", "path": "/path/to/save/panorama.jpg", "session": "", "zoom": 2, "pil_args": {"quality": 90} } ``` ### Response #### Success Response (200) - **status** (str) - Indicates successful download. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### Build Permalink Source: https://streetlevel.readthedocs.io/en/stable/streetlevel.lookaround.html Creates a link that opens a panorama at a specified location in Apple Maps. If the location does not have a direct panorama, it links to the closest one. On non-Apple devices, the link redirects to Google Maps. ```APIDOC ## POST /api/streetlevel/build_permalink ### Description Creates a link which will open a panorama at the given location in Apple Maps. Linking to a specific panorama by its ID does not appear to be possible. On non-Apple devices, the link will redirect to Google Maps. ### Method POST ### Endpoint /api/streetlevel/build_permalink ### Parameters #### Request Body - **lat** (float) - Required - Latitude of the panorama’s location. - **lon** (float) - Required - Longitude of the panorama’s location. - **heading** (float) - Optional - Initial heading of the viewport. Defaults to 0. - **pitch** (float) - Optional - Initial pitch of the viewport. Defaults to 0. - **radians** (bool) - Optional - Whether angles are in radians. Defaults to False. ### Request Example ```json { "lat": 54.583244, "lon": 9.820249, "heading": 45.0, "pitch": -10.0, "radians": false } ``` ### Response #### Success Response (200) - **permalink** (str) - An Apple Maps URL which will open the closest panorama to the given location. #### Response Example ```json { "permalink": "https://maps.apple.com/?ll=54.583244,9.820249&q=54.583244,9.820249&t=m&z=17" } ``` ``` -------------------------------- ### Download Yandex Panorama Source: https://streetlevel.readthedocs.io/en/stable/_sources/streetlevel.yandex.rst.txt Downloads a panorama image to the local filesystem. ```python from streetlevel import yandex pano = yandex.find_panorama_by_id("1532719828_788624743_23_1678861237") yandex.download_panorama(pano, f"{pano.id}.jpg") ``` ```python from streetlevel import yandex from aiohttp import ClientSession async with ClientSession() as session: pano = await yandex.find_panorama_by_id_async("1532719828_788624743_23_1678861237", session) await yandex.download_panorama_async(pano, f"{pano.id}.jpg", session) ``` -------------------------------- ### Download Mapy.cz panorama Source: https://streetlevel.readthedocs.io/en/stable/_sources/streetlevel.mapy.rst.txt Downloads a panorama image to a local file path. ```python from streetlevel import mapy pano = mapy.find_panorama_by_id(82102772) mapy.download_panorama(pano, f"{pano.id}.jpg") ``` -------------------------------- ### Asynchronous Panorama Download Source: https://streetlevel.readthedocs.io/en/stable/streetlevel.baidu.html Asynchronous functions for downloading panoramas. `get_panorama_async` returns a PIL image, and `download_panorama_async` saves it to a file. ```APIDOC ## GET /api/panorama/download/async ### Description Asynchronously downloads a panorama and returns it as a PIL image or saves it to a file. ### Method GET (simulated for documentation purposes, actual implementation is async function call) ### Endpoint N/A (Python async function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### async get_panorama_async(_pano_, _session_, _zoom_ = 3_) #### Description Asynchronously downloads a panorama and returns it as a PIL image. #### Parameters - **pano** (BaiduPanorama) - Required - The panorama to download. - **session** (ClientSession) - Required - The aiohttp client session. - **zoom** (int) - Optional - Image size; 0 is lowest, 3 is highest. Defaults to 3. #### Returns A PIL image containing the panorama. #### Response Example ```python # Example of a PIL Image object (actual content varies) from PIL import Image img = Image.new('RGB', (60, 30), color = 'red') ``` ### async download_panorama_async(_pano_, _path_, _session_, _zoom_ = 3_, _pil_args_ = None_) #### Description Asynchronously downloads a panorama to a file. If the chosen format is JPEG, Exif and XMP GPano metadata are included. #### Parameters - **pano** (BaiduPanorama) - Required - The panorama to download. - **path** (str) - Required - Output path. - **session** (ClientSession) - Required - The aiohttp client session. - **zoom** (int) - Optional - Image size; 0 is lowest, 3 is highest. Defaults to 3. - **pil_args** (dict | None) - Optional - Additional arguments for PIL’s Image.save method. Defaults to {}. #### Returns None #### Usage Sample ```python from streetlevel import baidu from aiohttp import ClientSession async with ClientSession() as session: pano = await baidu.find_panorama_by_id_async("09024200121707301421572809B", session) await baidu.download_panorama_async(pano, f"{pano.id}.jpg", session) ``` ``` -------------------------------- ### Find Mapy.cz panorama by coordinates asynchronously Source: https://streetlevel.readthedocs.io/en/stable/_sources/streetlevel.mapy.rst.txt Asynchronous version of finding a panorama by coordinates, requiring an aiohttp ClientSession. ```python from streetlevel import mapy from aiohttp import ClientSession async with ClientSession() as session: pano = await mapy.find_panorama_async(50.704732, 14.404809, session) print(pano.lat, pano.lon) print(pano.id) print(pano.date) ``` -------------------------------- ### permalink() Source: https://streetlevel.readthedocs.io/en/stable/streetlevel.kakao.html Creates a permalink to a panorama at the current location. ```APIDOC ## permalink() ### Description Creates a KakaoMap URL permalink to a panorama at this location. The link works for the most recent coverage at a location. ### Parameters - **heading** (float) - Optional - Initial heading of the viewport. Defaults to 0°. - **pitch** (float) - Optional - Initial pitch of the viewport. Defaults to 0°. - **radians** (bool) - Optional - Whether angles are in radians. Defaults to False. ### Response - **url** (str) - A KakaoMap URL. ``` -------------------------------- ### Download Panorama Image (Asynchronous) Source: https://streetlevel.readthedocs.io/en/stable/_sources/streetlevel.streetview.rst.txt Asynchronous function to download a panorama image. Requires an aiohttp ClientSession. ```python from streetlevel import streetview from aiohttp import ClientSession async with ClientSession() as session: pano = await streetview.find_panorama_async(46.883958, 12.169002, session) await streetview.download_panorama_async(pano, f"{pano.id}.jpg", session) ``` -------------------------------- ### Find Panoramas by Coordinates (Async) Source: https://streetlevel.readthedocs.io/en/stable/streetlevel.kakao.html Asynchronously searches for panoramas within a specified radius around a given latitude and longitude. Requires an aiohttp ClientSession. ```python from streetlevel import kakao from aiohttp import ClientSession async with ClientSession() as session: panos = await kakao.find_panoramas_async(37.4481486, 126.4509719, session) print(panos[0].lat, panos[0].lon) print(panos[0].id) print(panos[0].date) ``` -------------------------------- ### Synchronous Panorama Downloading Source: https://streetlevel.readthedocs.io/en/stable/streetlevel.yandex.html Functions for downloading panoramas synchronously. `get_panorama` returns a PIL image, while `download_panorama` saves the panorama to a specified file path. ```APIDOC ## GET /api/panorama/download ### Description Downloads a panorama and returns it as a PIL image. ### Method GET ### Endpoint /api/panorama/download ### Parameters #### Query Parameters - **pano** (YandexPanorama) - Required - The panorama to download. - **zoom** (int) - Optional - Image size; 0 is highest, 4 is lowest. Defaults to 0. ### Response #### Success Response (200) - **image** (PIL Image) - The downloaded panorama as a PIL image. ### Request Example ```python from streetlevel import yandex pano = yandex.find_panorama_by_id("1532719828_788624743_23_1678861237") image = yandex.get_panorama(pano) ``` ## POST /api/panorama/download/file ### Description Downloads a panorama to a file. If the chosen format is JPEG, Exif and XMP GPano metadata are included. ### Method POST ### Endpoint /api/panorama/download/file ### Parameters #### Path Parameters - **path** (str) - Required - Output path. #### Query Parameters - **pano** (YandexPanorama) - Required - The panorama to download. - **zoom** (int) - Optional - Image size; 0 is highest, 4 is lowest. Defaults to 0. - **pil_args** (dict | None) - Optional - Additional arguments for PIL’s Image.save method, e.g. `{"quality":100}`. Defaults to `{}`. ### Request Example ```python from streetlevel import yandex pano = yandex.find_panorama_by_id("1532719828_788624743_23_1678861237") yandex.download_panorama(pano, f"{pano.id}.jpg") ``` ### Response #### Success Response (200) - **None** - The function does not return any value. ``` -------------------------------- ### Download Panorama to File Source: https://streetlevel.readthedocs.io/en/stable/streetlevel.streetside.html Downloads a panorama and saves it to a specified file path. Supports custom PIL arguments for saving. ```python from streetlevel import streetside pano = streetside.find_panorama_by_id(398611371) streetside.download_panorama(pano, f"{pano.id}.jpg") ``` -------------------------------- ### permalink Method Source: https://streetlevel.readthedocs.io/en/stable/streetlevel.naver.html Generates a permalink URL for a Naver Street View panorama with specified viewport and map settings. ```APIDOC ## permalink Method ### Description Creates a permalink to this panorama. ### Method GET (Implicitly, as it returns a URL) ### Endpoint (This is a method of the NaverPanorama object, not a direct API endpoint) ### Parameters #### Query Parameters - **heading** (float) - Optional - Initial heading of the viewport. Defaults to 0°. - **pitch** (float) - Optional - Initial pitch of the viewport. Defaults to 10°. - **fov** (float) - Optional - Initial FOV of the viewport. Defaults to 80°. - **map_zoom** (float) - Optional - Initial zoom level of the map. Defaults to 17. - **radians** (bool) - Optional - Whether angles are in radians. Defaults to False. ### Returns - **str** - A Naver Map URL which will open this panorama. ```