Learn R Programming

fsr (version 1.0.0)

spa_add_component: Adding components to a pgeometry object

Description

This function adds components to a spatial plateau object (i.e., pgeometry object). The crisp spatial object of the component must be compatible with the type of the plateau spatial object. For instance, a pgeometry object of the type PLATEAUREGION accepts only components containing polygons (e.g., POLYGON or MULTIPOLYGON).

Usage

spa_add_component(pgo, components)

Arguments

pgo

A pgeometry object of any type.

components

A component object or a list of component objects.

Value

A pgeometry object containing the component objects.

Details

This function implements the \(\odot\) operator defined by Spatial Plateau Algebra. The goal of this function is to insert a component or a list of components into a pgeometry object. This insertion is based on the membership degree of the component (e.g., created by component_from_sfg). Thus, it preserves the properties of a spatial plateau object. However, this function assumes that a component is compatible with the pgeometry object and its geometric format is valid (i.e., it does not overlap with existing components).

References

Carniel, A. C.; Schneider, M. Spatial Plateau Algebra: An Executable Type System for Fuzzy Spatial Data Types. In Proceedings of the 2018 IEEE International Conference on Fuzzy Systems (FUZZ-IEEE 2018), pp. 1-8, 2018.

Examples

Run this code
# NOT RUN {
library(sf)

pts1 <- rbind(c(1, 2), c(3, 2))
comp1 <- component_from_sfg(st_multipoint(pts1), 0.2) 
comp2 <- component_from_sfg(st_point(c(1, 5)), 0.8)  

# appending these components into an empty pgeometry object

pp <- create_empty_pgeometry("PLATEAUPOINT")
pp <- spa_add_component(pp, list(comp1, comp2))
pp

# }

Run the code above in your browser using DataLab