Unitless measures

st_ul_area(x, ...)

st_ul_length(x)

st_ul_distance(
  x,
  y,
  ...,
  dist_fun,
  by_element = FALSE,
  which = ifelse(isTRUE(sf::st_is_longlat(x)), "Great Circle", "Euclidean"),
  par = 0,
  tolerance = 0
)

Arguments

x

object of class sf, sfc or sfg

...

ignored

y

object of class sf, sfc or sfg, defaults to x

dist_fun

deprecated

by_element

logical; if TRUE, return a vector with distance between the first elements of x and y, the second, etc. if FALSE, return the dense matrix with all pairwise distances.

which

character; for Cartesian coordinates only: one of Euclidean, Hausdorff or Frechet; for geodetic coordinates, great circle distances are computed; see details

par

for which equal to Hausdorff or Frechet, optionally use a value between 0 and 1 to densify the geometry

tolerance

ignored if st_is_longlat(x) is FALSE; otherwise, if set to a positive value, the first distance smaller than tolerance will be returned, and true distance may be smaller; this may speed up computation. In meters, or a units object convertible to meters.

Examples

suppressPackageStartupMessages(library(dplyr)) data(states_map) states_map %>% filter(sfx::st_ul_area(states_map) > 250e9)
#> Simple feature collection with 8 features and 2 fields #> geometry type: MULTIPOLYGON #> dimension: XY #> bbox: xmin: -124.3834 ymin: 25.9378 xmax: -93.53536 ymax: 49.00508 #> CRS: EPSG:4326 #> # A tibble: 8 x 3 #> group region geometry #> * <dbl> <chr> <MULTIPOLYGON [°]> #> 1 2 arizona (((-114.6374 35.01918, -114.6431 35.10512, -114.603 35.12231,~ #> 2 4 californ~ (((-120.006 42.00927, -120.006 41.20139, -120.006 39.70024, -~ #> 3 5 colorado (((-102.0552 40.00964, -102.061 40.00391, -102.0552 39.57993,~ #> 4 28 montana (((-104.0491 48.99935, -104.0491 48.63266, -104.0491 48.38629~ #> 5 30 nevada (((-114.0415 36.99588, -114.0472 36.84119, -114.053 36.21093,~ #> 6 33 new mexi~ (((-103.0063 37.00161, -103.0006 36.48022, -103.0465 36.48022~ #> 7 50 texas (((-94.49792 33.667, -94.48074 33.65554, -94.47501 33.63262, ~ #> 8 63 wyoming (((-109.0511 40.99513, -110.0079 41.00086, -110.0537 41.00086~