Skip to contents

Extend a geos_geometry linestring from, one or both ends, by a given distance (meters)

Usage

geos_extend_line(line, distance, dir = "both", with_crs = TRUE)

Arguments

line

sf linestring or geos_geometry linestring to extend

distance

numeric value in meters or a vector of length 2 if 'end = "both"' where

dir

character, determines whether to extend the linestring from the 'tail', 'head' or 'both' ends

with_crs

logical, whether a CRS should be prescribed to extended output geos_geometry linestring

Value

geos_geometry linestring extended by 'distance' from either the 'head', 'tail' or 'both' ends of the original linestring