spa_core()
yields a crisp spatial object (as an sfg
object) that corresponds to the core of a pgeometry
object given as input.
Value
An sfg
object that represents the core of pgo
. It can be an empty object, if pgo
does not have a component with membership degree 1.
Details
The spa_core()
function employs the classical definition of core from the fuzzy set theory in the context of Spatial Plateau Algebra.
The core only comprises the points with membership degree equal to 1.
Hence, this operation returns the sfg
object that represents the component labeled with
membership degree equal to 1 of the pgeometry
object given as input. If the pgeometry
object has no core, then an empty sfg
object is returned.
Examples
pcp1 <- create_component("POINT(0 0)", 0.3)
pcp2 <- create_component("MULTIPOINT((2 2), (2 4), (2 0))", 0.5)
pcp3 <- create_component("MULTIPOINT((1 1), (3 1), (1 3), (3 3))", 0.9)
pcp4 <- create_component("MULTIPOINT((1 2), (2 1), (3 2))", 1)
pcp5 <- create_component("MULTIPOINT((0 0.5), (2 3))", 0.7)
pcp6 <- create_component("MULTIPOINT((0 1), (3 3.5))", 0.85)
pcp7 <- create_component("MULTIPOINT((1 0), (4 2))", 0.4)
# Creating a plateau point object
ppoint <- create_pgeometry(list(pcp1, pcp2, pcp3, pcp4, pcp5), "PLATEAUPOINT")
ppoint
#> [1] "PLATEAUPOINT ((POINT (0 0), 0.3), (MULTIPOINT ((2 2), (2 4), (2 0)), 0.5), (MULTIPOINT ((0 0.5), (2 3)), 0.7), (MULTIPOINT ((1 1), (3 1), (1 3), (3 3)), 0.9), (MULTIPOINT ((1 2), (2 1), (3 2)), 1))"
# Getting its core
spa_core(ppoint)
#> MULTIPOINT ((1 2), (2 1), (3 2))
# Getting the core of an empty pgeometry
spa_core(create_empty_pgeometry("PLATEAUREGION"))
#> POLYGON EMPTY