Skip to contents

spa_exact_inside() checks whether a pgeometry object is completely inside of another pgeometry object.

Usage

spa_exact_inside(pgo1, pgo2)

Arguments

pgo1

A pgeometry object that is either a plateau point, plateau line, or plateau region object.

pgo2

A pgeometry object that is either a plateau point, plateau line, or plateau region object.

Value

A Boolean value that indicates if a pgeometry is completely and certainly inside pgo2.

Details

spa_exact_inside() is a Boolean function that checks fuzzy containment in the spatial plateau context. This Boolean function checks whether the components of pgo1 are contained in the components of pgo2 by considering their membership degrees and geographic positions. That is, it follows the classical definition of fuzzy containment of the fuzzy set theory.

In other words, this function checks if the (standard) intersection of pgo1 and pgo2 is exactly equal to pgo1. The other of operands affects the result.

Examples

pcp1 <- create_component("MULTIPOINT((2 2), (2 4), (2 0))", 0.5)
pcp2 <- create_component("MULTIPOINT((1 1), (3 1), (1 3), (3 3))", 0.9)
pcp3 <- create_component("POINT(2 2)", 0.2)
pcp4 <- create_component("MULTIPOINT((1 1), (3 3))", 0.7)

ppoint1 <- create_pgeometry(list(pcp1, pcp2), "PLATEAUPOINT")
ppoint2 <- create_pgeometry(list(pcp3, pcp4), "PLATEAUPOINT")

# is ppoint2 completely and certainly inside ppoint1?
spa_exact_inside(ppoint2, ppoint1)
#> [1] TRUE

# The order of operands after the result
# ppoint1 is not inside ppoint2 since it has different points
spa_exact_inside(ppoint1, ppoint2)
#> [1] FALSE