Takes a LineString and returns a Point at a specified distance along the line.
Source:R/along.R
geo_along.Rd
Takes a LineString and returns a Point at a specified distance along the line.
Arguments
- line
(character) a Feature<LineString>
- distance
(numeric) distance along the line
- units
(character) can be degrees, radians, miles, or kilometers (default)
Examples
line <- '{
"type": "Feature",
"properties": {},
"geometry": {
"type": "LineString",
"coordinates": [
[-77.031669, 38.878605],
[-77.029609, 38.881946],
[-77.020339, 38.884084],
[-77.025661, 38.885821],
[-77.021884, 38.889563],
[-77.019824, 38.892368]
]
}
}'
geo_along(line, 10, 'kilometers')
#> [1] "{\"geometry\":{\"coordinates\":[-77.019824,38.892368],\"type\":\"Point\"},\"properties\":{},\"type\":\"Feature\"}"