Skip to contents

These functions yield a crisp spatial object (as an sfg object) formed by the geometric parts of the components of the pgeometry given as input that satisfy a filter condition based on their membership degrees.

Usage

spa_range(pgo, lvalue, rvalue, lside_closed = TRUE, rside_closed = TRUE)

spa_alpha_cut(pgo, alpha)

spa_strict_alpha_cut(pgo, alpha)

Arguments

pgo

A pgeometry object of any type.

lvalue

A numeric value denoting the left side of an interval in [0, 1].

rvalue

A numeric value denoting the right side of an interval in [0, 1].

lside_closed

A Boolean value indicating whether the left side is closed or not. The default value is TRUE.

rside_closed

A Boolean value indicating whether the right side is closed or not. The default value is TRUE.

alpha

A numeric value. For spa_alpha_cut(), it must be in [0, 1]. For spa_strict_alpha_cut(), it must be in ]0, 1].

Value

An sfg object that represents the geometric union of the components extracted after applying the specific filter condition.

Details

Given a spatial plateau object as input, these functions return a crisp spatial object formed by the geometric parts of the components of the input that satisfy a filter condition based on their membership degrees. The filter condition of each function is detailed as follows:

  • spa_alpha_cut() selects all components that have membership degrees greater than or equal to a given value in [0, 1] indicated by the parameter alpha.

  • spa_strict_alpha_cut() picks a subset of components that have membership values greater than the parameter alpha (a value in ]0, 1]).

  • spa_range() generalizes these two operations and allows one to pick all components that have membership degrees belonging to a given open or closed interval. The parameters lside_closed and rside_closed, respectively, determine whether the left and right side (parameters lvalue and rvalue) of the interval is open (FALSE) or closed (TRUE). For example, to represent the right open interval [0.5, 0.8[, the following parameter values should be given: lvalue = 0.5, rvalue = 0.8, lside_closed = TRUE, rside_closed = FALSE.

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))"

# Processing the alpha-cut, strict alpha-cut, and range
spa_alpha_cut(ppoint, 0.7)
#> MULTIPOINT ((0 0.5), (1 1), (1 2), (1 3), (2 1), (2 3), (3 1), (3 2), (3 3))
spa_strict_alpha_cut(ppoint, 0.7)
#> MULTIPOINT ((1 1), (1 2), (1 3), (2 1), (3 1), (3 2), (3 3))
spa_range(ppoint, 0.4, 0.8)
#> MULTIPOINT ((0 0.5), (2 0), (2 2), (2 3), (2 4))