jonclayden/mmand

components(): objects with same label across mat-borders

Closed this issue · 3 comments

Great package! I am about to use it as dependency for a package I am working on myself atm. However, I think I found a bug.
Consider the following code:

  mat <- raster::as.matrix(spObj)
  kernel <- shapeKernel(c(3, 3), type="diamond")
  mat_cc <- mmand::components(mat, kernel)

It seems (at least on my machine) that connected components at the bottom and at the top share the same label. I think this is not intentional, is it? Here is spObj

Many thanks for the report. This should be fixed in the master branch by commit 1c8b364. I've tried it on your test data and it now seems to behave correctly, but if you could confirm that it works for you that would be very helpful. All the best!

I can confirm that it works. That was quick, thanks!

Great! I'll get a v1.5.1 release cut and sent to CRAN today.