nearest_osm: Generate nearest point on the route network of a point from...

Description Usage Arguments Details Examples

View source: R/osrmfunctions.R

Description

Generate nearest point on the route network of a point from OSRM locate service

Usage

1
2
3
nearest_osm(lat, lng, number = 1, api = 5, profile = "driving",
  protocol = "v1", osrmurl = "http://router.project-osrm.org",
  return_sf = FALSE)

Arguments

lat

Numeric vector containing latitude coordinate for each coordinate to map. Also accepts dataframe with latitude in the first column and longitude in the second column.

lng

Numeric vector containing longitude coordinate for each coordinate to map.

number

Number of locations to return (API v5 only)

api

An integer value containing the OSRM API version (either 4 or 5). Default is 5.

profile

OSRM profile to use (for API v5), defaults to "driving".

protocol

The protocol to use for the API (for v5), defaults to "v1".

osrmurl

Base URL of the OSRM service

return_sf

Boolean value if this function should return an sf object, if FALSE returns sp object (default FALSE).

Details

Retrieve coordinates of the node(s) on the network mapped from coordinates passed to functions.

Examples

1
2
3
4
5
6
7
## Not run: 
 nearest_osm(
   lat = 50.3,
   lng = 13.2
 )

## End(Not run)

stplanr documentation built on June 3, 2018, 1:04 a.m.