ropensci / CoordinateCleaner

Automated flagging of common spatial and temporal errors in biological and palaeontological collection data, for the use in conservation, ecology and palaeontology.
https://docs.ropensci.org/CoordinateCleaner/
79 stars 21 forks source link

ERROR in p[, 2] - CoordinateCleaner::clean_coordinates() #89

Closed mgaynor1 closed 11 months ago

mgaynor1 commented 1 year ago

https://github.com/ropensci/CoordinateCleaner/blob/db6ee9b0f961178c25d3973d8d533ab21e8f2363/R/cc_cap.R#L99

This line needs to say if(is.null(ref) | ncol(ref) = 0)

If the cropped region doesn't contain any capitals, an error will print (see photo). This can be fixed by modifying the if statement in cc_cap. Probably an issue throughout this code, sinceis.null(SpatVector)doesn't tell you if the vector is empty.

Screenshot 2023-09-27 at 4 36 28 PM

I

mgaynor1 commented 11 months ago

Hi, this is still an issue and we would love to update our package which uses CoordinateCleaner so that we remove our spatial dependency (which is only due to CoordinateCleaner <v3). However, with the updated version, this error => failed tests. Please fix!

BrunoVilela commented 11 months ago

HI @mgaynor1, thanks for reporting the issue. It is now fixed on the GitHub version, and will soon be on CRAN.

mgaynor1 commented 11 months ago

Thanks so much!