geo_along: Takes a LineString and returns a Point at a specified...

View source: R/along.R

geo_alongR Documentation

Takes a LineString and returns a Point at a specified distance along the line.

Description

Takes a LineString and returns a Point at a specified distance along the line.

Usage

geo_along(line, distance, units)

Arguments

line

(character) a Feature<LineString>

distance

(numeric) distance along the line

units

(character) can be degrees, radians, miles, or kilometers (default)

Value

Feature<Point> distance (at X units) along the line

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')

ropenscilabs/geoops documentation built on Nov. 8, 2024, 4:01 a.m.