read_transect: Read and prepare transects

Description Usage Arguments Details Value Examples

View source: R/read-transects.R

Description

Read transects from admitted file formats by sf::st_read function, and prepare the data for analysis workflows.

Usage

1
2
3
4
5
6
7
read_transect(x, ...)

## S3 method for class 'character'
read_transect(x, start_from = NULL, ...)

## S3 method for class 'sf'
read_transect(x, start_from = NULL, ...)

Arguments

x

object of class sf or path to geometries file. See details.

...

other arguments passed to sf::st_read.

start_from

character; 'E' assigns sequential id's to transects starting from East, 'N' from North, and so on.

Details

If x is a character string, it must be the path to an external data source (e.g. a file of line geometries). If x is an object of class sf, it must contains geometries of type LINESTRING or MULTILINESTRING.

A transect consists of one line comprised by two vertices, the first of which must be digitized landward. Currently, the function only accepts LINESTRING or MULTILINESTRING in projected coordinate systems (e.g. EPSG:32619).

Value

An object of class transect, which inherits both 'sf' and 'data.frame' classes, containing a coastr_id.

Examples

1
2
(file_path <- system.file('extdata', 'transects-long.geojson', package = 'coastr'))
(transect <- read_transect(file_path, start_from = 'N'))

geofis/coastr documentation built on July 3, 2020, 6:33 p.m.