I'm writing a standalone PyQGIS application. In order to set the project CRS, I'm using the
QgsCoordinateReferenceSystem class. I tried all the possible methods to assign the crs I want (which is EPSG:32632, but I also tried with the standard EPSG:4326), and none is working (failure verified with
isValid method). When I use
QgsCoordinateReferenceSystem.createFromUserInput('EPSG:32632), I get the following error:
ERROR 4: ERROR 4: Unable to open EPSG support file gcs.csv. Try setting the GDAL_DATA environment variable to point to the directory containing EPSG csv files.
I therefore deduced that this could be the problem preventing every method I tried from working. However, the GDAL_DATA path is set in my batch file running the script by calling the
o4w_env.bat, and it is correctly set to the default for OSGeo4W64 installation, which is
gcs.csv is correctly located in the pointed directory. Within my script, I repeatedly verify the
GDAL_DATA variable, as well as
PROJ_LIB: they're all set to the default values for OSGeo4W64 installation, and are never changed within the script.
Since all the paths are correct, and the
gcs.csv is actually located in the pointed directory, I can't really get where the issue might be rising from.