Jean-Romain / lidRplugins

Extra functions and algorithms for lidR package
43 stars 15 forks source link

st_make_valid() function is provided through sf package #12

Closed mcoghill closed 3 years ago

mcoghill commented 3 years ago

This affects the delineate_lakes() function, where it is currently scripted as being provided through the lwgeom package. I'm not sure if that would affect any of your other functions in this package as I just discovered it today (thank you for the hard work!).

I'm unable to replicate the issue with the provided lidR package files, though it occurred when I was testing it out on files of my own. I'm fairly certain that a simple change from lwgeom::st_make_valid(spsf) to sf::st_make_valid(spsf) on line 724 of the delineate_lakes() file will solve the issue!

Jean-Romain commented 3 years ago

I changed the namespace but I did not tested. I'm sure you were right so it should work.

By-the-way the method exists and is indeed available in the package but was never published and I don't think anybody can actually use it without a document that explains and illustrate how it works. The documentation is very poor in the current state and there is no other written description at the time being. If you have difficulties to use it do not hesitate to ask. But to tell the truth I don't remember myself every steps. What I know is that I tested it on 3000 km² in north Canada (many many lakes) and it worked really well. However in south it did not work so good because the south is flat and has a lot of field that are mistaken for lakes leading to many false positive.

Capture du 2020-11-14 06-36-52

Capture du 2020-11-14 06-38-54