I am using lidR to create a DEM of a very large area (over 1 million hectares). I have already processed a portion of this area.

I would like to be able to read the entire LAScatalog so that the tiles I still need to process can access bordering tiles and use them as buffers, but don't know how to avoid processing the rest of the catalog.

I have been looking at the partial processing option as well as the catalog_intersect() function. I can make a raster of the area that I have already processed and get the extent and use catalog_intersect() to eliminate the tiles I have already processed, but that would also remove the tiles that would be needed as buffers.

Is there a way to use the ctg$processed option to select only the area not covered by a particular extent or spatial object for processing? Or is there a way to access the numbers assigned to each chunk of the catalog so that I can export the spatial object, intersect it with the processed area, and then use the ctg$processed option to select the unprocessed area?


You can either use catalog_select(..., method = "flag_unprocessed") to interactively click on tiles you don't want to process (those that will be used as buffer only) or you can convert your LAScatalog into a pure SpatialPolygonsDataFrame to apply geometry operations. Below an example removing 10 km to the bounding box of the collection.

ctg <- readLAScatalog("folder/")

bbox <- extent(ctg) - 10000
bbox <- as(bbox, 'SpatialPolygons')  
spctg <- as.spatial(ctg)
ctg$processed <- rgeos::gIntersects(bbox, spctg, byid = TRUE)

Created on 2020-04-15 by the reprex package (v0.3.0)

| improve this answer | |
  • Fantastic, thank you! This worked perfectly. – KLH Apr 16 at 6:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.