r-spatial / link2GI

Simplify the linking of GIS/RS and CLI tools
https://r-spatial.github.io/link2GI
GNU General Public License v3.0
25 stars 7 forks source link

linkGRASS() by default overrides region and projection when linking an existing database #22

Closed florisvdh closed 5 years ago

florisvdh commented 5 years ago

With following code example, assuming valid values for gisdbase and location, the GRASS database is successfully linked; however the existing region and projection are overridden to standard settings (WGS84, globe):

library(link2GI)
linkGRASS7(gisdbase = gisdbase, location = location, gisdbase_exist = TRUE, 
                     use_home = TRUE)

I'll propose a fix for this. It seems that only the case with quiet = FALSE is handled correctly, while by default (quiet = TRUE) the function continues with setting the region and projection as if it were for a temporary database.

gisma commented 5 years ago

Thanks for reporting and for the pull request. Unfortunately I have run in a sequence of follow ups dealing with grass 7.8 so I was stalling in integrating your issue. As a first workaround it is perfect. However I have to rewrite my awful code to integrate some more settings before we leave the subroutine with a return() I am working on it so keep tuned. Up to a final solution I integrate your pull request.