Skip to contents

spa_get_type() returns the type of a spatial plateau object. It can be either "PLATEAUPOINT", "PLATEAULINE", "PLATEAUREGION", "PLATEAUCOMPOSITION", or "PLATEAUCOLLECTION".

Usage

spa_get_type(pgo)

Arguments

pgo

A pgeometry object of any type.

Value

The type of a spatial plateau object as a character object (i.e., a string).

Details

The spa_get_type() function yields the type of a spatial plateau object given as input. For instance, if the pgo is a object of the class ppoint (subclass of pgeometry), it returns "PLATEAUPOINT".

Examples

pcomp1 <- create_component("MULTIPOINT(1 2, 3 2)", 0.4)
pcomp2 <- create_component("POINT(2 1)", 0.3)
ppoint <- create_pgeometry(list(pcomp1, pcomp2), "PLATEAUPOINT")

spa_get_type(ppoint) 
#> [1] "PLATEAUPOINT"

lcomp1 <- create_component("LINESTRING(1 2, 3 3, 3 4)", 1)
lcomp2 <- create_component("LINESTRING(0 0, 5 5)", 0.5)
pline <- create_pgeometry(list(lcomp1, lcomp2), "PLATEAULINE")

spa_get_type(pline)
#> [1] "PLATEAULINE"

pcomposition <- create_pgeometry(list(ppoint, pline), "PLATEAUCOMPOSITION")

spa_get_type(pcomposition)
#> [1] "PLATEAUCOMPOSITION"