-
Notifications
You must be signed in to change notification settings - Fork 300
Closed
Description
Request
If an sfc object has XYZ(M) dimensions, can you add a zbox (mbox) attribute to the object?
Example
In this contrived example I'm setting the Z to range in [0,2].
library(sf)
l <- sf::st_linestring(matrix(c(0,0,0,1,1,1,2,2,1,3,3,2), ncol =2, byrow = T))
sfc <- sf::st_sfc( l )Can a zbox be calculated and added, so it would take the form
zbox <- c(0,2)
attr(sfc, "zbox") <- zbox
attributes(sfc)
# $class
# [1] "sfc_LINESTRING" "sfc"
#
# $precision
# [1] 0
#
# $bbox
# xmin ymin xmax ymax
# 0 0 3 3
#
# $crs
# Coordinate Reference System: NA
#
# $n_empty
# [1] 0
#
# $zbox
# minz maxz
# 0 2Use case
I'm starting to add a lot of elevation and time animations into madpeck, so it would be useful to have the ranges of these values easily accessible so they can be read directly, rather than calculated on-the-fly.
Metadata
Metadata
Assignees
Labels
No labels