rsbivand / rgrass

Interpreted interface between the GRASS geographical information system and R
https://rsbivand.github.io/rgrass/
26 stars 8 forks source link

Change terra intermediate file format? #51

Closed rsbivand closed 2 years ago

rsbivand commented 2 years ago

42 : I have noticed that the RRASTER format only supports Proj.4 old-style strings for representing coordinate reference systems (https://github.com/AgrDataSci/gdistance/issues/11): https://rspatial.org/terra/pkg/7-writing.html, https://rspatial.org/raster/pkg/appendix2.html, @rhijmans. Even if terra and raster were updated to add wkt=, and the GDAL RRASTER driver updated to use both projection= and wkt= in reading and writing, those with pre-update GDAL would still be stranded with Proj.4 string CRS only. I think updating the R packages makes sense anyway, but am unsure how to proceed. GRASS rasters use the location projection information, PROJ_* which may include SRID, EPSG and WKT in addition to INFO.

Could I ask for a quick poll to see whether we should change from RRASTER to another uncompressed format (shortest response - check if agree to change)?

Any other comments or suggestions very welcome!

rsbivand commented 2 years ago

Prototype in raster at https://github.com/rspatial/raster/pull/257.

rsbivand commented 2 years ago

@rhijmans : does terra use the GDAL RRASTER driver rather than using special case read/write methods as in raster?

rhijmans commented 2 years ago

terra uses GDAL to read RRASTER format. I used the format in the raster package to allow for richer metadata writing than what I was able to achieve with GDAL.

rsbivand commented 2 years ago

I'll report back on progress with the GDAL RRASTER driver PR later. For now there is a curious error in trying to specify that WKT2_2019 should be written to the .grd header file.

rsbivand commented 2 years ago

@DevElliett Cease spamming this issue immediately. If you wish to contribute, provide a verifiable affiliation, but your profile suggests that you are not a potential contributor. Next spam will lead to blocking.

veroandreo commented 2 years ago

Dear Roger, I'm following the changes and progress of this issue. With your changes in terra and raster merged plus the proposal in GDAL repo (and the work together with Even), will the problem be solved or still other format suggestions are welcome? I do not know much about formats, but we may ask @neteler if he has some other idea :smiley_cat:

rsbivand commented 2 years ago

Dear Vero, thanks for responding! First I thought we'd need to change to GTiff without compression, but after reviewing the code, realised that patching raster, terra and the GDAL RRASTER driver would be difficult but feasible. @rouault has been helping with the driver and has just proposed https://github.com/rsbivand/gdal/pull/1 which modernises the driver; I'm checking it now. With those changes in place, we don't need to change. @rhijmans has merged my PRs for raster and terra; I'll need to check that raster and RRASTER read and write each other's files, and that released raster reads and writes revised raster and released and revised RRASTER files. So not quite done yet.

rsbivand commented 2 years ago

RRASTER PR merged in GDAL.