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

Reading problems are expected with raster-dependent functions if PROJ >= 6 #67

Closed
florisvdh opened this issue Apr 9, 2020 · 0 comments

Comments

@florisvdh
Copy link
Member

This will affect all three read_GRTSmh***() functions, and is directly connected to rspatial/raster#78.

Due to changes in PROJ, the usage of +init=epsg:XXXX should be avoided, as listed here.

Planning to make a fix in below lines, probably similar to Nowosad/raceland@423758c - i.e. code which exports the full proj4string.

./R/GRTSmh.R:338:        crs(result) <- "+init=epsg:31370"
./R/GRTSmh.R:435:        crs(r) <- "+init=epsg:31370"
./R/GRTSmh.R:610:            crs(r) <- "+init=epsg:31370"

Note that above code already was a (temporary) workaround in order to prevent a warning, see #61.

More ideally, the above crs<- statements can be skipped: the CRS is in the files. However, because the returned proj4string did not exactly match the one of st_crs(31370), it was overwritten to prevent warnings in later processing steps.

In the long run, this will not suffice as it can be expected that raster will undergo changes as well. Also its successor terra is a package to keep an eye on.

florisvdh added a commit that referenced this issue Sep 28, 2020
Further follow-up to #67.

By using sp::CRS(SRS_string = "EPSG:31370"), compatibility is
offered:
- both for raster from CRAN and raster from GitHub
- both for PROJ4/GDAL2 and PROJ6+/GDAL3

To be revisited once raster from CRAN accepts simple EPSG-code
as input for crs<- (as on GitHub), i.e. with raster>=3.3-16
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