Skip to content

LAScatalog function (catalog_map) using filter_poi(), "Cannot write a file with 0 points" #742

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

You must be logged in to vote

You found a bug. It is a limit case. In chunk 2 when exiting your myfilt function it remains a single point. This point is in the buffer and is removed automatically by catalog_map that handles the buffer for you. So it remains 0 points inside the tile outside your function. You can handle that using the good old catalog_apply function but I fixed it in 4.1.1 available on github. Install the latest version or use:

myfilt<-function(las)
{
  if (is(las, "LAS"))
  {
    las <- segment_shapes(las, shp_plane(k = 25), "planar")
    las <- segment_shapes(las, shp_line(th = 8, k = 15), "linear")
    las<-filter_poi(las, planar==FALSE, linear==FALSE)
    return(las)
  }
  else if (is(las, "LAScluster

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
7 replies
@SteinarVatne
Comment options

@Jean-Romain
Comment options

@SteinarVatne
Comment options

@Jean-Romain
Comment options

Answer selected by SteinarVatne
Comment options

You must be logged in to vote
1 reply
@Jean-Romain
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants