ptitle / rangeBuilder

Provides tools for filtering occurrence records, generating alpha-hull-derived range polygons and mapping species richness.
8 stars 2 forks source link

getDynamicAlphaHull: Error in FUN(X[[i]], ...) : polygons require at least 4 points #9

Closed zsherpa closed 7 months ago

zsherpa commented 7 months ago

Thank you for this very useful package!

I'm having issues with getDynamicAlphaHull() for some species only (28 out of 1440 species). When running these specific species, I get the following error:

> getDynamicAlphaHull(df, coordHeaders=c('lon','lat'), clipToCoast = 'terrestrial', partCount = 10, fraction = 0.95) 

Error in FUN(X[[i]], ...) : polygons require at least 4 points

I have checked the occurrence data and installed the package from Github. I'm thinking the error might be related to st_cast() in ah2sf() when the function converts LINESTRING to POLYGON objects. Is this a known issue ? Would it be possible to send a reproducible code for this error via e-mail ?

Thank you in advance, Zoé

ptitle commented 7 months ago

Hi Zoé, Sure, send me some reproducible code to pascal.title[at]stonybrook.edu and I can take a look. This is not currently a known issue.

-Pascal