Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with cc_sea and seas_ref URL #69

Closed
jpstevenson2018 opened this issue Apr 12, 2022 · 1 comment
Closed

Issue with cc_sea and seas_ref URL #69

jpstevenson2018 opened this issue Apr 12, 2022 · 1 comment

Comments

@jpstevenson2018
Copy link

I'm running clean_coordinates on a set of data with default test settings and it seems to run the tests fine except for when testing sea coordinates. When it finishes the warning messages read:

> 1: In cc_sea(x, lon = lon, lat = lat, ref = seas_ref, scale = seas_scale,  :
   Gazetteer for land mass not found at
 http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/50m/physical/ne_50m_land.zip
> 2: In cc_sea(x, lon = lon, lat = lat, ref = seas_ref, scale = seas_scale,  :
   Skipping sea test

I went to the website and copied the download address (which only seems to differ by having "https" at the beginning) and tried the following:
clean_coordinates(x = data, lon = "Decimal_Long", lat = "Decimal_Lat", species = "Genus_species", seas_ref = "https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/50m/physical/ne_50m_land.zip")

This time it stops with the error:

> Error in (function (classes, fdef, mtable)  : 
  unable to find an inherited method for function ‘proj4string’ for signature ‘"character"’

If I try to run cc_sea on its own it comes up with the same warnings if run with default settings, and the same error if run with the given ref =.

I've looked around but I haven't found anything that can help with this error. Is there a way I can solve this issue and get it to run cc_sea alongside the other tests?

@jpstevenson2018
Copy link
Author

Resolved by downloading a local version of the zip file and reading it into R with:

sea <- st_read("ne_50m_land")
sea <- as_Spatial(sea) #convert to SpatialPolygonsDataFrame

and then using this in seas_ref = sea command as part of clean_coordinates().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant