Closed cedricr closed 6 months ago
Thank you for the reproducible example. I'll investigate.
FWIW: I’ve tried to run catalog_apply on the tiles of several cities, without the "keep_first" filter, but it nearly always fail with the "heterogeneous objects" error anyway. I can provide other reproductible examples if you feel like you need them.
Fixed. With the default parameters of st_concave_hull
and the first return only you reached a limit case where the polygon produced was invalid on one point. lidR
handles invalid cases with sf::st_make_valid()
but in this specific case it produced 2 polygons in a MULTIPOLYGON
.
I fixed it by casting MULTIPOLYGON
into POLYGON
+ a warning because your are not supposed to get more than 1 polygons.
Now a better way to handle this case would be to change the parameters. Your polygons are overly complex and this brings nothing. Change the parameters to produce less detailed polygons e.g.:
cbounds <- catalog_boundaries(ctg, concavity = 4, length_threshold = 10)
Problem gone and simpler/better/faster result
Changing the parameters work perfectly indeed, thanks !
Hello,
on some of the french IGN tiles,
catalog_apply
is failing with the following error:Here's a minimal reproduction:
Analysing a bit further, if I run concave_hull on both tiles separately, one returns a Polygon, and the other a MultiPolygon