View source: R/tile_functions.R
get_las_bounds | R Documentation |
This function reads the bounding coordinates and projection information from
the header of either a LAS file on disk (either compressed or uncompressed)
or LAS object imported via prepare_tile
. The bounds are returned as
either: a named vector, an EWKT (Extended Well Known Text) string specifier,
an sf
package bounding box, an sf
package geometry list object
or a terra
package SpatExtent
object.
get_las_bounds(
x,
type = c("vec", "wkt", "sfc", "bbox", "terra"),
unzip.dir = NULL
)
x |
Either a character string specifying the path to a file, or a
|
type |
Either |
unzip.dir |
The directory in which to uncompress a compressed LAS file
(identified by a '.zip' extension). If |
The bounding polygon in the format specified by the type
argument.
## Not run:
# Read bounds from a zipped LAS file and return as a vector
bounds <- get_las_bounds("c:/somewhere/myfile.zip")
# Get bounds as an 'sf' bounding box
bounds <- get_las_bounds("c:/somewhere/myfile.zip", type = "sf")
print(bounds)
plot(bounds)
# Same thing for an imported LAS object
las <- prepare_tile("c:/somewhere/myfile.zip")
bounds <- get_las_bounds(las, type = "sf")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.