Learn R Programming

fsr (version 1.0.0)

PWKT: The PWKT of a spatial plateau object

Description

This function gives the Plateau Well-Known Text (PWKT) representation of a pgeometry object.

Usage

spa_pwkt(pgo)

# S3 method for pgeometry format(x, ...)

# S4 method for pgeometry show(object)

# S4 method for pgeometry as.character(x, ...)

Arguments

pgo

A pgeometry object of any type.

x

A pgeometry object of any type.

...

<dynamic-dots> Unused.

object

A pgeometry object of any type.

Value

A character value with the textual representation of a given pgeometry object.

Details

It gives the textual representation for a pgeometry object, combining the Well-Known Text (WKT) representation for crisp vector geometry objects and the formal definitions of the tree spatial plateau data types. (i.e. PLATEAUPOINT, PLATEAULINE, PLATEAUREGION).

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(sf)

# For a `PLATEAUPOINT` object.
pts1 <- rbind(c(1, 2), c(3, 2))
comp1 <- component_from_sfg(st_multipoint(pts1), 0.2) 
comp2 <- component_from_sfg(st_point(c(1, 5)), 0.8)  

ppoint <- create_pgeometry(list(comp1, comp2), "PLATEAUPOINT")

spa_pwkt(ppoint)

# For a `PLATEAULINE` object.

lpts1 <- rbind(c(0, 0), c(1, 1))
lpts2 <- rbind(c(1, 1), c(1.2, 1.9), c(2, 1))
lpts3 <- rbind(c(2, 1), c(1.5, 0.5))

comp4 <- component_from_sfg(st_linestring(lpts1), 0.4)
comp5 <- component_from_sfg(st_linestring(lpts2), 1)
comp6 <- component_from_sfg(st_linestring(lpts3), 0.7)

pline <- create_pgeometry(list(comp4, comp5, comp6), "PLATEAULINE")

spa_pwkt(pline)

# For a `PLATEAUREGION` object.

p1 <- rbind(c(0,0), c(1,0), c(3,2), c(2,4), c(1,4), c(0,0))
p2 <- rbind(c(1,1), c(1,2), c(2,2), c(1,1))
pol1 <-st_polygon(list(p1,p2))

comp1 <- component_from_sfg(pol1, 0.2)

pregion <- create_pgeometry(list(comp1), "PLATEAUREGION")

spa_pwkt(pregion)


# }

Run the code above in your browser using DataLab