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

crs error #101

Closed joyceem closed 3 months ago

joyceem commented 4 months ago

Hi there,

I'm trying to get clean_coordinates to work, but there always seems to be an issue with the crs for the zeros test and countries test. I've been following the tutorial and also had a look at the scripts but can't seem to figure out what I'm doing wrong. I've also attached an example subset of my dataframe. Any help on what the issue might be would be greatly appreciated!

> flags <- clean_coordinates(x = dat, 
+                            lon = "decimalLongitude", 
+                            lat = "decimalLatitude",
+                            countries = "countryCode",
+                            species = "species",
+                            tests = c("capitals", "centroids",
+                                      "equal",  "countries"))
Testing coordinate validity
Flagged 0 records.
Testing equal lat/lon
Flagged 4 records.
Testing country capitals
Flagged 722 records.
Testing country centroids
Flagged 88 records.
Testing country identity
Error in p@ptr$setPointsDF(x, geom - 1, crs) : 
  Expecting a single string value: [type=list; extent=242].

Error from zeros test on same dataset:

Testing zero coordinates
Error: [buffer] crs not defined

Many thanks, Lizzy

Edit: I am using v3.0.1

example.csv

joyceem commented 3 months ago

Hi again,

It seems that CoordinateCleaner just wasn't happy with my version of R. When I switched versions this issue was resolved - so closing this issue.

Thanks for the great tool.

Lizzy