Open Rikuoja opened 2 years ago
Confirm this is still a problem with the latest LTR 3.22.8 as well.
Hi, Since it is still a problem in 3.22.8, how can I merge rasters in 3.22.8?
I have tried the method in #39801, which is
import os
os.environ["PROJ_LIB"]="/Applications/QGIS.app/Contents/Resources/proj"
But it doesn't work.
How can I merge rasters now?
Just figure out a temporary solution for this: Option - System - Environment and set the PROJ_LIB. Restart!
Same issue on QGIS version 3.32.2-Lima running on MacOS 10.13.6.
I looked around the code for PROJ_LIB
, and found _patch_proj_lib.py, which adds the variable if missing. If this file is still in use, then I might have found a possible cause of the bug.
The only place where _patch_proj_lib
is mentioned in the repository is in python_pyproj/recipe.sh
: https://github.com/qgis/QGIS-Mac-Packager/blob/1597c0499a968141670ace3f347262bc6d604fb7/qgis_bundle/recipes/python_pyproj/recipe.sh#L38-L40
The sed
command in line 40 adds _patch_proj_lib
to a line matching from pyproj import _datadir
inside pyproj/__init__.py
. Locally, this file is in
/Applications/QGIS.app/Contents/Resources/python/site-packages/pyproj-3.2.0-py3.9-macosx-10.13.0-x86_64.egg/pyproj/__init__.py
.
However, the line from pyproj import _datadir
is nowhere to be found as it seems it was removed from pyproj a while back. Therefore, sed
does nothing and the patch is not imported.
Could it be that_patch_proj_lib.py
was added to QGIS-Mac-Packager before the updated pyproj was added to QGIS?
Since the corresponding issue(s) in QGIS have been closed, I should report this here:
https://github.com/qgis/QGIS/issues/39801 https://github.com/qgis/QGIS/issues/48574
I have the same problem in all QGIS 3.22 versions on MacOS, including LTR. Trying to run etc. gdalwarp results in
I suspect this is because the PROJ_LIB env variable is not set in QGIS python environment. All the other GDAL variables are set correctly:
There is a merged commit https://github.com/qgis/QGIS-Mac-Packager/commit/18f8180db42b343cc425ba0aabef7b4a29af997b that should have fixed this issue. The commit seems to set env variables, including PROJ_LIB.
However, in 3.22 PROJ_LIB is still not set.