r-spatial / RQGIS3

GNU Lesser General Public License v3.0
69 stars 19 forks source link

Cannot find proj.db #20

Open xtbgtraining opened 4 years ago

xtbgtraining commented 4 years ago

Dear all,

When I run the example codes from https://github.com/r-spatial/RQGIS3 I got several times "Cannot find proj.db".

Any one can give me clue how to fix this ??

Thank you so much !

Jingxin


R 3.6.2 RStudio 1.2.5033 installed the latest OSGeo4W64 Window 10


library("RQGIS3") set_env() open_app() _proj_create_from_database: Cannot find proj.db proj_create_fromdatabase: Cannot find proj.db

find_algorithms(search_term = "centroid", name_only = TRUE) get_usage(alg = "native:centroids") params = get_args_man(alg = "native:centroids") params params$INPUT = ger params$OUTPUT = file.path(tempdir(), "ger_coords.shp") out = run_qgis(alg = "native:centroids", params = params, load_output = TRUE) _ERROR 1: PROJ: proj_create_from_wkt: Cannot find proj.db ERROR 1: PROJ: proj_identify: Cannot find proj.db ERROR 1: PROJ: proj_as_wkt: Cannot find proj.db proj_create_from_wkt: Cannot find proj.db proj_identify: Cannot find proj.db proj_get_authorities_from_database: Cannot find proj.db proj_as_wkt: Cannot find proj.db ERROR 1: PROJ: proj_create_from_wkt: Cannot find proj.db ERROR 1: PROJ: proj_as_wkt: Cannot find proj.db proj_as_wkt: Cannot find proj.db ERROR 1: PROJ: proj_as_wkt: Cannot find proj.db ERROR 1: PROJ: proj_create_from_wkt: Cannot find proj.db ERROR 1: PROJ: projidentify: Cannot find proj.db $OUTPUT [1] "C:/Users/dell/AppData/Local/Temp/Rtmp6lEWK4/ger_coords.shp"

bkavlak commented 4 years ago

Same problem +1

adwiputra commented 4 years ago

Hi, same issue here. In my case, I would not rule out my suspicion on the fact that I also have Anaconda installed with its own gdal library.

ciupava commented 4 years ago

Also here. Using Qgis 3.10 and RStudio. Functions work fine from within R (for example gdal_rasterize) and from within Qgis (when I run for example Grass modules from there), but the same functions don't work when I try to run the same inside R using run_qgis().

pat-s commented 4 years ago

Hi guys, the package is in a non-robust state at the moment. Both me and @jannes-m do not have time to update/fix things currently.

Everyone is welcome to dive in and fix things - I am happy to look at a PR which tackles this.

adwiputra commented 4 years ago

Thanks for the response @pat-s ! I'll try to see if there's any 'quick and dirty' solution to this and maybe post some updates here if any.

bkavlak commented 4 years ago

I am not an expert but it seems the problem is derived from sth related to project environment.

This may hint to the solution: https://github.com/pyproj4/pyproj/issues/176

Also see: https://proj.org/faq.html#why-am-i-getting-the-error-cannot-find-proj-db "Why am I getting the error “Cannot find proj.db”?"

ciupava commented 4 years ago

By me the problem is solved. It looks like despite the error "cannot find proj.db" the algorithms run anyways, in fact native Qgis and gdal functions were working within RQGIS3. By me the problem was running Grass commands. Eventually inspired by @tylerbhampton in https://github.com/r-spatial/RQGIS3/issues/8#issuecomment-492469446_ I have checked again the OSGeo4W setup installation, and manually configured the packages (via the Advance Install) where I have noticed that the grass-plugin for the qgis-ltr were not installed by default. In my case I have selected qgis-ltr-grass-plugin7 under Libs (see picture attached) . This solved it by me. # RQgis3_grassplugin

Note: in RStudio I keep on getting messages like:

proj_create_from_wkt: Cannot find proj.db
proj_identify: Cannot find proj.db
proj_crs_create_bound_crs_to_WGS84: Cannot find proj.db
proj_as_proj_string: Cannot find proj.db
NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files

but they don't seem to affect the results

tylerbhampton commented 4 years ago

I am also finding that despite the error messages, I can get GRASS functions to run and produce the desired outputs.