From 60d1d51aaa75cfef6c3c99535be7dfa9ecd026a0 Mon Sep 17 00:00:00 2001 From: edzer Date: Wed, 6 Dec 2023 19:05:28 +0100 Subject: [PATCH] update docs --- NAMESPACE | 1 + man/geos_measures.Rd | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index ef0b8392f..3657355a5 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -475,6 +475,7 @@ export(st_nearest_points) export(st_node) export(st_normalize) export(st_overlaps) +export(st_perimeter) export(st_point) export(st_point_on_surface) export(st_polygon) diff --git a/man/geos_measures.Rd b/man/geos_measures.Rd index 88f2eb76a..4f0b88c19 100644 --- a/man/geos_measures.Rd +++ b/man/geos_measures.Rd @@ -5,6 +5,7 @@ \alias{st_area} \alias{st_area.sfc} \alias{st_length} +\alias{st_perimeter} \alias{st_distance} \title{Compute geometric measurements} \usage{ @@ -14,6 +15,8 @@ st_area(x, ...) st_length(x, ...) +st_perimeter(x, ...) + st_distance( x, y, @@ -28,7 +31,7 @@ st_distance( \arguments{ \item{x}{object of class \code{sf}, \code{sfc} or \code{sfg}} -\item{...}{passed on to \link[s2]{s2_distance} or \link[s2]{s2_distance_matrix}} +\item{...}{passed on to \link[s2]{s2_distance}, \link[s2]{s2_distance_matrix}, or \link[s2]{s2_perimeter}} \item{y}{object of class \code{sf}, \code{sfc} or \code{sfg}, defaults to \code{x}} @@ -52,7 +55,7 @@ st_length returns the length of a \code{LINESTRING} or \code{MULTILINESTRING} ge If \code{by_element} is \code{FALSE} \code{st_distance} returns a dense numeric matrix of dimension length(x) by length(y); otherwise it returns a numeric vector the same length as \code{x} and \code{y} with an error raised if the lengths of \code{x} and \code{y} are unequal. Distances involving empty geometries are \code{NA}. } \description{ -Compute Euclidian or great circle distance between pairs of geometries; compute, the area or the length of a set of geometries. +Compute Euclidean or great circle distance between pairs of geometries; compute, the area or the length of a set of geometries. } \details{ great circle distance calculations use by default spherical distances (\link[s2]{s2_distance} or \link[s2]{s2_distance_matrix}); if \code{sf_use_s2()} is \code{FALSE}, ellipsoidal distances are computed using \link[lwgeom]{st_geod_distance} which uses function \code{geod_inverse} from GeographicLib (part of PROJ); see Karney, Charles FF, 2013, Algorithms for geodesics, Journal of Geodesy 87(1), 43--55 @@ -77,6 +80,8 @@ mpoly = st_multipolygon(list( )) st_length(st_sfc(poly, mpoly)) +st_perimeter(poly) +st_perimeter(mpoly) p = st_sfc(st_point(c(0,0)), st_point(c(0,1)), st_point(c(0,2))) st_distance(p, p) st_distance(p, p, by_element = TRUE)