luukvdmeer / sfnetworks

Tidy Geospatial Networks in R
https://luukvdmeer.github.io/sfnetworks/
Other
338 stars 20 forks source link

Test fails on Solaris #190

Closed loreabad6 closed 2 years ago

loreabad6 commented 2 years ago

Tests that have to do with projections and transformations fail for older versions of GDAL and PROJ. This is the case for Solaris. The reason is that our roxel data object was created with newer versions of these software and hence older version do not recognize the associated CRS.

See related CRAN-ERROR outputs here

The solution seems to be to reassign the CRS as explained here.

luukvdmeer commented 2 years ago

@loreabad6 How should we proceed now it seems CRAN does not check for Solaris anymore?

loreabad6 commented 2 years ago

I see two options here:

  1. We can either include the line that reassigns the CRS on every test and example, assuming that although not on Solaris, people might still have older versions of GDAL and PROJ
  2. We take no action but do include in the ?sfnetworks::roxel page a note that the CRS should be reassigned for older PROJ versions, as proposed here.

I am happier with the second option.

agila5 commented 2 years ago

I also vote for the second option since it's much simpler than changing all tests. Moreover, when I faced similar problems in osmextract, I added an if clause into .onAttach printing a message in case PROJ/GDAL versions were too old: https://github.com/ropensci/osmextract/blob/7b29afcbe08a47b69e07f49944d6bdd9b05bcffb/R/zzz.R#L13-L23 If you like the idea, I can add a PR also here (something like, It seems that you are using an old version of PROJ. If you use the roxel dataset, please remember to reassign its CRS, i.e. sf::st_crs(roxel) = sf::st_crs("EPSG:4326"), before running any example.

loreabad6 commented 2 years ago

This is actually great @agila5 and sounds like the best solution! A PR here with those lines would be great!

loreabad6 commented 2 years ago

Thank you @agila5 for the startup message. Closing this issue for now.