grass icon indicating copy to clipboard operation
grass copied to clipboard

[Feat] R-GRASS interface: add used proj.db info e.g. to g.version for a better error handling in case of proj.db-version mismatch

Open hellik opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe.

taken from initGrass Error : XML content does not seem to be XML

On Windows, the terra and GRASS binaries both install proj.db, and when terra is loaded, its version takes over PROJ_LIB.

This means in this case that g.proj in GRASS is wrongly using a proj.db shipped with an R package, rather than that shipped with WinGRASS or OSGEO4W GRASS.

Describe the solution you'd like

  1. Adding version of used proj.db in (win)GRASS for a better error handling in case of version mismatch, e.g. in g.version

see proj functions mentioned in

https://proj.org/en/9.2/development/reference/functions.html#c.proj_context_get_database_metadata and https://proj.org/en/9.2/development/reference/functions.html#c.proj_context_get_database_path should give you all what you need to know

or see

  1. I think all current R packages shipping proj.db do protect their reference to their version, so g.proj should only detect the one it itself shipped with.

hellik avatar Jun 03 '23 10:06 hellik