| spa_is_empty {fsr} | R Documentation |
Check if a pgeometry object is empty
Description
spa_is_empty() checks whether a given pgeometry object is empty (i.e., if it does not contain components).
Usage
spa_is_empty(pgo)
Arguments
pgo |
A |
Details
The spa_is_empty() function checks if a pgeometry object has any component or not. If the number of components of a pgeometry object is equal to 0, then
it returns TRUE. Otherwise, it returns FALSE.
Value
A Boolean value that indicates if a pgeometry is empty.
Examples
# Creating an empty plateau line object
pgo1 <- create_empty_pgeometry("PLATEAULINE")
# Checking if it is empty
spa_is_empty(pgo1)
# Adding a component to it and checking if it still empty
comp <- create_component("LINESTRING(1 1, 2 2, 2 3)", 0.5)
pgo1 <- spa_add_component(pgo1, comp)
spa_is_empty(pgo1)
[Package fsr version 2.0.1 Index]