Learn R Programming

fsr (version 1.0.0)

fsr_topological_relationships: Fuzzy topological relationships

Description

Fuzzy topological relationships are given as a family of functions that implements spatial plateau topological relationships. A fuzzy topological relationship expresses a particular relative position of two spatial plateau objects. Since the spatial objects are fuzzy, their topological relationships are also fuzzy. Hence, a fuzzy topological relationship determines the degree to which a relation holds for any two spatial plateau objects by a real value in the interval [0, 1]. The key idea of these relationships is to consider point subsets resulting from the combination of spatial plateau set operations and spatial plateau metric operations on the spatial plateau objects for computing the resulting degree. The resulting degree can be also interpreted as a linguistic value.

Usage

spa_overlap(pgo1, pgo2, itype = "min", ret = "degree", ...)

spa_meet(pgo1, pgo2, itype = "min", ret = "degree", ...)

spa_disjoint(pgo1, pgo2, itype = "min", ret = "degree", ...)

spa_equal(pgo1, pgo2, utype = "max", ret = 'degree', ...)

spa_inside(pgo1, pgo2, utype = "max", ret = 'degree', ...)

spa_contains(pgo1, pgo2, utype = "max", ret = 'degree', ...)

Arguments

pgo1

A pgeometry object of the type PLATEAUREGION.

pgo2

A pgeometry object of the type PLATEAUREGION.

itype

A character value that indicates the name of a function implementing a t-norm. The default value is "min", which is the standard operator of the intersection.

ret

A character value that indicates the return type of the fuzzy topological relationship. The default value is "degree" and other possible values are "list" and "bool".

...

<dynamic-dots> If ret = "bool", two additional parameters have to be informed, as described below.

utype

A character value that indicates the name of a function implementing a t-conorm. The default value is "max", which is the standard operator of the union.

Value

The returning value is determined by the parameter ret, as described above.

Details

These functions implement topological relationships of the spatial plateau algebra. They receive two pgeometry objects of the type PLATEAUREGION together with some additional parameters (as detailed below). The family of fuzzy topological relationships consists of the following functions:

  • spa_overlap computes the overlapping degree of two plateau region objects. Since it uses the intersection operation, a t-norm operator can be given by the parameter itype. Currently, it can assume "min" (default) or "prod".

  • spa_meet computes the meeting degree of two plateau region objects. Similarly to spa_overlap, a t-norm operator can be given by the parameter itype.

  • spa_disjoint computes the disjointedness degree of two plateau region objects. Similarly to spa_overlap and spa_meet, a t-norm operator can be given by the parameter itype.

  • spa_equal - computes how equal are two plateau region objects. Since it uses the union operation, a t-conorm operator can be given by the parameter utype. Currently, it can assume "max" (default).

  • spa_inside - computes the containment degree of pgo1 in pgo2. Similarly to spa_equal, a t-conorm operator can be given by the parameter utype.

  • spa_contains - it is the same of spa_inside but changing the order of the operands pgo1 and pgo2.

The parameter ret determines the returning value of a fuzzy topological relationship. The default value is the following:

  • "degree" (default) - it indicates that the function will return a value in [0, 1] that represents the degree of truth of a given topological relationships.

For the remainder possible values, the functions make use of a set of linguistic values that characterize the different situations of topological relationships. Each linguistic value has an associated membership function defined in the domain [0, 1]. The fsr package has a default set of linguistic values. You can use the function spa_set_classification to change this set of linguistic values.

The remainder possible values for the parameter ret are:

  • "list" - it indicates that the function will return a named list containing how much the result of the predicate belongs to each linguistic value (i.e., it employs the membership functions of the linguistic values).

  • "bool" - it indicates that the function will return a Boolean value indicating whether the degree returned by the topological relationship matches a given linguistic value according to an evaluation mode. The evaluation mode and the linguistic values have to be informed by using the parameters eval_mode and lval, respectively. The possible values for eval_mode are: "soft_eval", "strict_eval", "alpha_eval", and "soft_alpha_eval". They have different behavior in how computing the Boolean value from the membership function of a linguistic value. See their documentations for more details. Note that the parameter lval only accept a character value belonging to the set of linguistic values that characterize the different situations of topological relationships.

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(tibble)
library(sf)
library(FuzzyR)

set.seed(456)

# some random points to create pgeometry objects by using the function spa_creator
tbl = tibble(x = runif(10, min= 0, max = 30), 
             y = runif(10, min = 0, max = 30), 
             z = runif(10, min = 0, max = 50))

#getting the convex hull on the points to clipping the construction of plateau region objects
pts <- st_as_sf(tbl, coords = c(1, 2))
ch <- st_convex_hull(do.call(c, st_geometry(pts)))

pregions <- spa_creator(tbl, base_poly = ch, fuzz_policy = "fcp", k = 2)

# Showing the different types of returning values
spa_overlap(pregions$pgeometry[[1]], pregions$pgeometry[[2]])
spa_overlap(pregions$pgeometry[[1]], pregions$pgeometry[[2]], ret = "list")
spa_overlap(pregions$pgeometry[[1]], pregions$pgeometry[[2]], ret = "bool", 
           eval_mode = "soft_eval", lval = "mostly")

## Examples for evaluating the other fuzzy topological relationships
# }
# NOT RUN {
spa_meet(pregions$pgeometry[[1]], pregions$pgeometry[[2]], ret = "list")
spa_disjoint(pregions$pgeometry[[1]], pregions$pgeometry[[2]], ret = "list")
spa_equal(pregions$pgeometry[[1]], pregions$pgeometry[[2]], ret = "list")
spa_inside(pregions$pgeometry[[1]], pregions$pgeometry[[2]], ret = "list")
spa_contains(pregions$pgeometry[[1]], pregions$pgeometry[[2]], ret = "list")
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab