Skip to content

polygon metrics does not work with LAScatalog #774

Answered by Jean-Romain
GregorDall asked this question in Q&A
Discussion options

You must be logged in to vote

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:

  1. Get the bbox of the chunk
  2. Keep only polygons with the centroid inside the bbox
  3. Compute polygon_metrics with these polygons

Process with a relatively large buffer to ensure that the polygon…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@GregorDall
Comment options

Answer selected by GregorDall
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
Question Not an issue, just a question
2 participants
Converted from issue

This discussion was converted from issue #773 on August 13, 2024 11:36.