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

Description Usage Arguments Value Examples

View source: R/getRoute.R

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('<e5><8c><97><e4><ba><ac>', color='bw')
df = getRoute('<e9><a6><96><e9><83><bd><e5><9b><bd><e9><99><85><e6><9c><ba><e5><9c><ba>', '<e5><8c><97><e4><ba><ac><e5><8d><97><e8><8b><91><e6><9c><ba><e5><9c><ba>', region = '<e5><8c><97><e4><ba><ac>')
ggmap(bjMap) + geom_path(data = df, aes(lon, lat), alpha = 0.5, col = 'red')

## End(Not run)

badbye/baidumap documentation built on June 4, 2017, 12:12 a.m.