Data Acquisition

getbusdata(city, keywords[, accurate, timeout])

Obtain the geographic information of the bus station and bus line from the map service (Only in China)

getadmin(keyword, ak[, jscode, ...])

Input the keyword and the Amap ak.

get_isochrone_amap(lon, lat, reachtime, ak)

Obtain the isochrone from Amap reachcricle

get_isochrone_mapbox(lon, lat, reachtime[, ...])

Obtain the isochrone from mapbox isochrone

transbigdata.getbusdata(city, keywords, accurate=True, timeout=20)

Obtain the geographic information of the bus station and bus line from the map service (Only in China)

Parameters:
  • city (str) – city name

  • keywords (list) – Keyword, the line name

  • accurate (bool) – Accurate matching

  • timeout (number) – Timeout of data fetching

Returns:

  • data (GeoDataFrame) – The generated bus line(WGS84)

  • stop (GeoDataFrame) – The generated bus station(WGS84)

transbigdata.getadmin(keyword, ak, jscode='', subdistricts=False, timeout=20)

Input the keyword and the Amap ak. The output is the GIS file of the administrative boundary (Only in China)

Parameters:
  • keywords (str) – The keyword. It might be the city name such as Shengzheng, or the administrative code such as 440500

  • ak (str) – Amap accesstoken

  • jscode (jscode) – Amap safty code

  • subdistricts (bool) – Whether to output the information of the administrative district boundary

  • timeout (number) – Timeout of data fetching

Returns:

  • admin (GeoDataFrame) – Administrative district(WGS84)

  • districts (DataFrame) – The information of subdistricts. This can be used to further get the boundary of lower level districts

transbigdata.get_isochrone_amap(lon, lat, reachtime, ak, jscode='', mode=2, timeout=20)

Obtain the isochrone from Amap reachcricle

Parameters:
  • lon (float) – Longitude of the start point(WGS84)

  • lat (float) – Latitude of the start point(WGS84)

  • reachtime (number) – Reachtime of the isochrone

  • ak (str) – Amap access token

  • jscode (jscode) – Amap safty code

  • mode (int or str) – Travel mode, should be 0(bus), 1(subway), 2(bus+subway)

  • timeout (number) – Timeout of data fetching

Returns:

isochrone – The isochrone GeoDataFrame(WGS84)

Return type:

GeoDataFrame

transbigdata.get_isochrone_mapbox(lon, lat, reachtime, access_token='auto', mode='driving', timeout=20)

Obtain the isochrone from mapbox isochrone

Parameters:
  • lon (float) – Longitude of the start point(WGS84)

  • lat (float) – Latitude of the start point(WGS84)

  • reachtime (number) – Reachtime of the isochrone

  • access_token (str) – Mapbox access token, if auto it will use the preset access token

  • mode (bool) – Travel mode, should be driving, walking or cycling

  • timeout (number) – Timeout of data fetching

Returns:

isochrone – The isochrone GeoDataFrame(WGS84)

Return type:

GeoDataFrame