Learn R Programming

lawn (version 0.1.7)

lawn_along: Get a point at a distance along a line

Description

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

Usage

lawn_along(line, distance, units, lint = FALSE)

Arguments

line
distance
distance along the line
units
can be degrees, radians, miles (default), or kilometers
lint
(logical) Lint or not. Uses geojsonhint. Takes up increasing time as the object to get linted increases in size, so probably use by default for small objects, but not for large if you know they are good geojson objects. Default: FALSE

Value

data-Point distance units along the line

See Also

Other measurements: lawn_area, lawn_bbox_polygon, lawn_bearing, lawn_center, lawn_centroid, lawn_destination, lawn_distance, lawn_envelope, lawn_extent, lawn_line_distance, lawn_midpoint, lawn_point_on_surface, lawn_size, lawn_square

Examples

Run this code
pts <- '[
   [-21.964416, 64.148203],
   [-21.956176, 64.141316],
   [-21.93901, 64.135924],
   [-21.927337, 64.136673]
]'
lawn_along(lawn_linestring(pts), 1, 'miles')

Run the code above in your browser using DataLab