future_st_join: Parallel implementations of 'sf::st_join' and 'sf::st_filter'

View source: R/future_st_join.R

future_st_joinR Documentation

Parallel implementations of sf::st_join and sf::st_filter

Description

Where the first sf object object (x) is split into chunks and joined with / filtered by the second (y). This will work best when x is large and y is small. It won't be kind to your machine's memory.

Usage

future_st_join(x, y, join, ...)

## S3 method for class 'sf'
future_st_join(
  x,
  y,
  join = st_intersects,
  ...,
  suffix = c(".x", ".y"),
  largest = FALSE,
  left = TRUE,
  nchunks = 1,
  .progress = FALSE
)

future_st_filter(x, y, ...)

## S3 method for class 'sf'
future_st_filter(
  x,
  y,
  ...,
  .predicate = st_intersects,
  nchunks = 1,
  .progress = FALSE
)

Arguments

x

object of class sf

y

object of class sf

join

geometry predicate function with the same profile as st_intersects; see details

...

for st_join: arguments passed on to the join function or to st_intersection when largest is TRUE; for st_filter arguments passed on to the .predicate function, e.g. prepared, or a pattern for st_relate

suffix

length 2 character vector; see merge

largest

logical; if TRUE, return x features augmented with the fields of y that have the largest overlap with each of the features of x; see https://github.com/r-spatial/sf/issues/578

left

left logical; if TRUE return the left join, otherwise an inner join; see details. see also left_join

nchunks

The number of chunks to run on each core. Default is 1. Can improve or worsen performance depending on dataset size and number of cores

.progress

Show progress bar. Only useful when nchunks > 1. default is FALSE

.predicate

geometry predicate function with the same profile as st_intersects; see details

Details

See st_join for detais regarding join types.

Value

an object of class sf, joined based on geometry

Examples

#plan(multisession, workers = 2)

future_st_join(cycleways_england(), gb_counties())
#plan(multisession, workers = 2)
future_st_filter(cycleways_england(), gb_counties()[1:50,])


h-a-graham/sfurrr documentation built on June 3, 2023, 10:14 p.m.