streetlevel.ja: Já 360
Finding panoramas
- find_panorama(lat, lon, radius=100, session=None)
Searches for a panorama within a radius around a point.
- Parameters:
lat (float) – Latitude of the center point.
lon (float) – Longitude of the center point.
radius (int) – (optional) Search radius in meters, max. 5000(?). Defaults to 100.
session (Session | None) – (optional) A requests session.
- Returns:
A JaPanorama if a panorama was found, or None.
- Return type:
JaPanorama | None
- async find_panorama_async(lat, lon, session, radius=100)
- Parameters:
lat (float) –
lon (float) –
session (ClientSession) –
radius (int) –
- Return type:
JaPanorama | None
- find_panorama_by_id(panoid, session=None)
Fetches metadata of a specific panorama.
- Parameters:
panoid (int) – The pano ID.
session (Session | None) – (optional) A requests session.
- Returns:
A JaPanorama object if a panorama with this ID was found, or None.
- Return type:
JaPanorama | None
- async find_panorama_by_id_async(panoid, session)
- Parameters:
panoid (int) –
session (ClientSession) –
- Return type:
JaPanorama | None
Downloading panoramas
- get_panorama(pano, zoom=0, stitching_method=CubemapStitchingMethod.ROW)
Downloads a panorama and returns it as PIL image.
- Parameters:
pano (JaPanorama) – The panorama.
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.- Returns:
A PIL image or a list of six PIL images depending on
stitching_method.- Return type:
List[Image] | Image
- async get_panorama_async(pano, session, zoom=0, stitching_method=CubemapStitchingMethod.ROW)
- Parameters:
pano (JaPanorama) –
session (ClientSession) –
zoom (int) –
stitching_method (CubemapStitchingMethod) –
- Return type:
List[Image] | Image
- download_panorama(pano, path, zoom=0, stitching_method=CubemapStitchingMethod.ROW, pil_args=None)
Downloads a panorama to a file.
- Parameters:
pano (JaPanorama) – The panorama.
path (str) – Output path.
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{}.- Return type:
None
- async download_panorama_async(pano, path, session, zoom=0, stitching_method=CubemapStitchingMethod.ROW, pil_args=None)
- Parameters:
pano (JaPanorama) –
path (str) –
session (ClientSession) –
zoom (int) –
stitching_method (CubemapStitchingMethod) –
pil_args (dict | None) –
- Return type:
None
Data classes
- class Address(street_name_and_house_number, postal_code, place)
Nearest address to a Já 360 panorama.
- Parameters:
street_name_and_house_number (str) –
postal_code (int) –
place (str) –
- place: str
- postal_code: int
- street_name_and_house_number: str
- class CaptureDate(year, month)
Capture date of a Já 360 panorama.
- Parameters:
year (int) –
month (int) –
- month: int
- year: int
- class JaPanorama(id, lat, lon, heading, neighbors=None, date=None, pano_url=None, blur_key=None, street_name=None, address=None)
Metadata of a Já 360 panorama.
ID, latitude, longitude and heading are always present. The availability of other metadata depends on which function was called and what was returned by the API.
- Parameters:
id (int) –
lat (float) –
lon (float) –
heading (float) –
neighbors (List[JaPanorama]) –
date (CaptureDate) –
pano_url (str) –
blur_key (int) –
street_name (str) –
address (Address) –
- blur_key: int = None
Part of the panorama tile URL.
- date: CaptureDate = None
The month and year the panorama was captured.
- heading: float
Heading in radians, where 0° is north, 90° is east, 180° is south and 270° is west.
- id: int
The pano ID.
- lat: float
Latitude of the panorama’s location.
- lon: float
Longitude of the panorama’s location.
- neighbors: List[JaPanorama] = None
A list of nearby panoramas.
- pano_url: str = None
Part of the panorama tile URL.
- permalink(heading=0.0, radians=False)
Creates a permalink to a panorama at this location. Directly linking to a specific panorama by its ID does not appear to be possible.
- Parameters:
heading (float) – (optional) Initial heading of the viewport. Defaults to 0°.
radians (bool) – (optional) Whether angles are in radians. Defaults to False.
self (JaPanorama) –
- Returns:
A Já.is Kort URL.
- Return type:
str
- street_name: str = None
Name of the street.