pycitydata.streetview.baidu

Module Contents

Classes

Data

API

pycitydata.streetview.baidu.__all__

[‘BaiduStreetView’]

class pycitydata.streetview.baidu.BaiduStreetView(sid: str, zoom: int = 4, headers: Optional[Dict[str, str]] = None, proxies: Optional[Dict[str, str]] = None)

Initialization

meta

‘_query_camera(…)’

设备信息,关键字段如下(用于调整取出照片时的方位): Camera Information, the useful fields are as follows (used to adjust the orientation of the taken photo):

  • “Heading”: 拍摄时的朝向(单位:度),全景相片的0度方向总是为拍摄时朝向的左侧,90度为正前方,180度为拍摄时朝向的右侧,270度为正后方。The direction of the photo taken (unit: degree), the 0-degree direction of the panorama photo is always to the left of the direction when the photo was taken, 90 degrees is the front, 180 degrees is to the right of the direction when the photo was taken, and 270 degrees is the back.

  • “Pitch”: 拍摄时的俯仰角(单位:度),范围为[-90, 90],0度为水平方向,90度为垂直向上,-90度为垂直向下。The pitch angle when the photo was taken (unit: degree), the range is [-90, 90], 0 degrees is the horizontal direction, 90 degrees is vertical up, and -90 degrees is vertical down.

  • “X”/”Y”/”Z”: 拍摄时的坐标(单位:米),BD09MC坐标系。The coordinates when the photo was taken (unit: meter), BD09MC coordinate system.

  • “Rname”: 拍摄时的道路名称。The road name when the photo was taken.

panorama

‘_query_img(…)’

全景图,采用Equirectangular转换为普通透视图后可用于显示。 Panorama, which can be used for display after being converted to a normal perspective view using Equirectangular.

property heading: float

获取拍摄时的朝向(单位:度) Get the direction when the photo was taken (unit: degree)

static search(x, y, headers: Optional[Dict[str, str]] = None, proxies: Optional[Dict[str, str]] = None, cache_dir: Union[str, pathlib.Path, None] = None) pycitydata.streetview.baidu.BaiduStreetView

街景图片信息查询 Street view image information query

Args:

  • x: x坐标(BD09MC)。x coordinate (BD09MC)

  • y: y坐标(BD09MC)。y coordinate (BD09MC)

  • cache_dir: 缓存目录,若为None则不缓存。Cache directory, if None, no cache.

Returns:

  • sv: 街景图片。Street view image.

_query_camera()
_query_img()