Bus_Shape: Retrieve the geometry of bus routes

View source: R/TDX.R

Bus_ShapeR Documentation

Retrieve the geometry of bus routes

Description

The function is used to download the geometry of bus routes. And it supports to download data of city buses and intercity buses.

Usage

Bus_Shape(access_token, county, dates=F, dtype="text", out=F)

Arguments

access_token

Your access token given by TDX platform. This can be derived from the function get_token().

county

Please fill in the English county name. Checking out the appropriate county name in dataframe TDX_County. If Intercity is used, the function retrieves the intercity bus data.

dates

If historical data would be retrieved, this argument should be set; otherwise the default value is FALSE. The date format should be YYYY-MM-DD.

dtype

The class of data, including text (data frame) and sf (simple feature). The default value is text.

out

If the result should be exported to the local, please fill in the directory. The default value is FALSE, which does not export the data. Note that the directory must contain ".shp" when exporting simple feature. And the directory must contain ".csv" or ".txt" when exporting text file.

Value

Some columns definition are listed below.

RouteUID It contains every subroutes and directions in a same RouteUID.
SubRouteUID If the direction or subroute is not the same, a different SubRouteUID must be recorded.

Codes of Direction are listed below.

0 outbound
1 inbound
2 loop
255 unknown

Author(s)

Maintainer: Chia Jung, Yeh chia-jung.yeh@sydney.edu.au

Examples

Bus_Shape(access_token, "Hsinchu")
Bus_Shape(access_token, "Taipei", dtype="sf", out="./Taipei_Stop.shp")

# historical data
Bus_Shape(access_token, "Keelung", "2022-01-01", dtype="sf")

ChiaJung-Yeh/NYCU_TDX documentation built on Aug. 28, 2024, 10:43 p.m.