Closed GregorDall closed 3 months ago
This is correct there is no polygon_metrics
for LAScatalog
. The reason is that it is impossible to handle such algorithm in the general case with the LAScatalog
processing engine.
Assume you have a large and long polygon polygon that encompasses 3 tiles. This is impossible to handle with an processing engine that processes sequentially square regions.
If you are sure your polygons are relatively small and can fit in a chunk + its buffer, then, below are the steps of a custom function in catalog_apply
:
polygon_metrics
with these polygonsProcess with a relatively large buffer to ensure that the polygons with a centroid inside the chunk are not beyond the chunk + buffer.
Hi,
I am just adapting my workflow from using single LAS files to the LAScatalog processing workflow. Is it possible to use a LAScatalog with polygon_metrics or do I have to use catalog_apply?
temp <- polygon_metrics(las = mylas, func = ~list( minZ = min(Z), maxZ = max(Z), nZ = length(Z)), geometry = mygeometry)
Error in UseMethod("polygon_metrics", las): non-applicable method for 'polygon_metrics' applied to an object of class "LAScatalog"
Best Gregor