calc_distance: Function to get distances between consecutive points:

Description Usage Arguments Examples

View source: R/trial_geom.R

Description

This goes through every point in sf_obj and sums the distances between each consecutive point. If parameter max is FALSE sf_obj should be a point feature. If max = TRUE, sf_obj should be a polygon and it will return the diagonal distance of the field.

Usage

1
calc_distance(sf_obj, max = FALSE)

Arguments

sf_obj

object of class 'sf'

max

conditional variable - default = FALSE

Examples

1
2
3
4
5
6
#Default
points =  sf::read_sf('./data/Points.gpkg')
DIFMR::calc_distance(points)
#max = TRUE
field = DIFMR::fields[4,]
DIFMR::calc_distance(field, max = TRUE)

RodrigoAgronomia/PAR documentation built on Jan. 19, 2020, 8:51 p.m.