fsr_numerical_operations {fsr}R Documentation

Compute fuzzy numerical operations

Description

Fuzzy numerical operations are implemented by spatial plateau numerical operations, which extract geometric measurements from spatial plateau objects, such as the area of a plateau region object and the length of a plateau line object.

Usage

spa_avg_degree(pgo)

spa_ncomp(pgo)

spa_area(pgo)

spa_perimeter(pgo)

spa_length(pgo)

Arguments

pgo

A pgeometry object of the type PLATEAULINE, PLATEAUCOMPOSITION, or PLATEAUCOLLECTION. It throws a warning if a different type is given.

Details

These functions calculate numerical properties from spatial plateau objects (i.e., pgeometry objects). Some of them are type-independent. This means that the parameter can be a pgeometry object of any type. The type-independent functions are:

The remaining functions are type-dependent. This means that the parameter have to be of a specific type. The type-dependent functions are:

For the aforementioned functions, if the input has the incorrect data type, it throws a warning message and returns 0.

Value

A numerical value.

References

Carniel, A. C.; VenĂ¢ncio, P. V. A. B; Schneider, M. fsr: An R package for fuzzy spatial data handling. Transactions in GIS, vol. 27, no. 3, pp. 900-927, 2023.

Underlying concepts and formal definitions of some spatial plateau numerical operations are introduced in:

Examples

# Point components
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)
# Line components
lcp1 <- create_component("LINESTRING(0 0, 1 1.5)", 0.2)
lcp2 <- create_component("LINESTRING(1 3, 1 2, 2 0.5)", 0.5)
lcp3 <- create_component("LINESTRING(2 1.2, 3 1.6, 4 4)", 0.7)
lcp4 <- create_component("LINESTRING(1 1.5, 2 1.2)", 1.0)
lcp5 <- create_component("LINESTRING(-1 1, 2 2)", 0.9)
# Polygon components
rcp1 <- create_component("POLYGON((0 0, 1 4, 2 2, 0 0))", 0.4)
rcp2 <- create_component("POLYGON((2 0.5, 4 1, 4 0, 2 0.5))", 0.8)

# Creating spatial plateau objects
ppoint <- create_pgeometry(list(pcp1, pcp2, pcp3, pcp4, pcp5), "PLATEAUPOINT")
pline <- create_pgeometry(list(lcp1, lcp2, lcp3), "PLATEAULINE")
pregion <- create_pgeometry(list(rcp1, rcp2), "PLATEAUREGION")
pcomp <- create_pgeometry(list(pcp6, pcp7, lcp4, lcp5), "PLATEAUCOMPOSITION")
pcol <- create_pgeometry(list(ppoint, pline, pregion, pcomp), "PLATEAUCOLLECTION")

spa_avg_degree(ppoint)
spa_avg_degree(pline)
spa_avg_degree(pregion)
spa_avg_degree(pcomp)
spa_avg_degree(pcol)

spa_ncomp(ppoint)
spa_ncomp(pline)
spa_ncomp(pregion)
spa_ncomp(pcomp)
spa_ncomp(pcol)

spa_area(pregion)
spa_area(pcomp)
spa_area(pcol)

spa_perimeter(pregion)
spa_perimeter(pcomp)
spa_perimeter(pcol)

spa_length(pline)
spa_length(pcomp)
spa_length(pcol)

[Package fsr version 2.0.1 Index]