getRoute: Get route from query Take in a original location and...

Description Usage Arguments Value Examples

Description

Get route from query Take in a original location and destination, return the direction

Usage

1

Arguments

origin

the original location

destination

the destination

mode

'driving'(default), 'walking', or 'transit'

region

the city of of original location and destination. If original and destination is not in the same city, set 'origin_region' and 'destination_region' seperately.

origin_region

the city of original location. If not set, use 'region' instead.

destination_region

the city of destination. If not set, use 'region' instead.

tactics

10(no expressway), 11(default, shortest time), 12(shortest path).

coord_type

'bd09ll'(default), 'gcj02'(which Google map and Soso map are using), 'wgs84' for GPS devices.

Value

a data frame contains longtitude and latitude of the route.

Examples

1
2
3
4
5
6
## Not run: 
bjMap = getBaiduMap('北京', color='bw')
df = getRoute('首都国际机场', '北京南苑机场', region = '北京')
ggmap(bjMap) + geom_path(data = df, aes(lon, lat), alpha = 0.5, col = 'red')

## End(Not run)

badbye/baidumap documentation built on May 11, 2019, 5:24 p.m.