spatial_join_tables: Spatial join of two layers

View source: R/fct_spatial_join_tables.R

spatial_join_tablesR Documentation

Spatial join of two layers

Description

Perform a spatial inner join or left join operation on two layers based on largest intersection between spatial features. Spatial joins are performed using sf's st_join.

Usage

spatial_join_tables(f_left, f_right, j_type)

Arguments

f_left

left table in spatial joins - a spatial (sf) data frame.

f_right

Right table in spatial joins - a spatial (sf) data frame.

j_type

A character specifying the type of join to perform. Options for spatial joins include inner and left joins.

Details

Geometries of both spatial tables are checked for validity (using sf's st_is_valid) and that they are not empty (using sf's st_is_empty). Invalid geometries are dropped before performing spatial joins.

Value

j_df A layer of class - a spatial (sf) data frame (i.e. spatial features and attribute columns) returned by the spatial join.


livelihoods-and-landscapes/maplandscape documentation built on March 20, 2023, 5:43 a.m.