ropensci / CoordinateCleaner

Automated flagging of common spatial and temporal errors in biological and palaeontological collection data, for the use in conservation, ecology and palaeontology.

Home Page:https://docs.ropensci.org/CoordinateCleaner/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

New bug with centroids and institutions in version 3.0

victorcazalis opened this issue · comments

Hi,

Thanks for the great work to remove rgdal and rgeos dependencies! I just installed version 3.0 and have noticed 2 problems that you can (hopefully) recreate with the data and script attached.

The first problem is that centroids don't work and return Error in p[, 2] : subscript out of bounds with the data attached (in Mexico), similarly to what is reported for capitals in Issue #89. There does not seem to be a matching problem with isocodes (my data have "MEX" which is indeed the code used for Mexico in countryref table) and I did not have this bug when using a species in Europe.

The second problem is that institution function took two minutes to compute for both species (while it used to be very quick). Do you know why?

Issue CoordinateCleaner.zip

Quick addition: also the function that flags points at sea within clean_coordinates() is sometimes very long (for one set of points I had it took more than one minute, while when I do a join manually with the same points and country files it's less than a second).

HI @victorcazalis, thanks for reporting the issue. It is now fixed on the GitHub version, and will soon be on CRAN.
About the computational time, I managed to reduce the time by making small changes inside the function when using geod = TRUE, you will find it much faster now.

Thanks @BrunoVilela for your work! It seems to work well now!