4

Updated to QGIS 3.16 recently, when I try to reproject from the datafiles CRS EPSG:4326 - WG 84 to EPSG:32718 - WG84/UTM zone 18S I get this error

ERROR 1: PROJ: proj_create_from_database: Cannot find proj.db

ERROR 1: Translating source or target SRS failed:

EPSG:32718  

I am using macOS and I updated to by downloading software from the website https://qgis.org/en/site/forusers/download.html - the latest release

I have located the proj.db in my computer C:/Users/anaconda3/envs/gsa_sm2019/share/proj/proj.db and tried to change the setting environment.

I tried

import os os.environ['PROJ_LIB'] = 'C:/Users/anaconda3/envs/gsa_sm2019/share/proj' os.environ['GDAL_DATA'] = 'C:/Users/anaconda3/envs/gsa_sm2019/share' import gdal

Reprojected again, this is the new error received:

ERROR 1: PROJ: proj_create_from_database: cannot build geodeticCRS 4326: SQLite error on SELECT name, ellipsoid_auth_name, ellipsoid_code, prime_meridian_auth_name, prime_meridian_code, area_of_use_auth_name, area_of_use_code, publication_date, deprecated FROM geodetic_datum WHERE auth_name = ? AND code = ?: no such column: publication_date ERROR 1: Translating source or target SRS failed: EPSG:4326

6
  • Welcome to Geographic Information Systems! Welcome to GIS SE! We're a little different from other sites; this isn't a discussion forum but a Q&A site. Your questions should as much as possible describe not just what you want to do, but precisely what you have tried and where you are stuck trying that. Please check out our short tour for more about how the site works.
    – Ian Turton
    Nov 5, 2020 at 16:04
  • What operating system are you using? how did you update to 3.16?
    – Ian Turton
    Nov 5, 2020 at 16:05
  • I am using macOS and I updated to by downloading software from the website qgis.org/en/site/forusers/download.html - the latest release Nov 5, 2020 at 16:14
  • please use the edit link to update your question with this information
    – Ian Turton
    Nov 5, 2020 at 16:15
  • I've updated the question with the info now - thanks Nov 5, 2020 at 16:16

2 Answers 2

5

I believe PROJ_LIB should be set to the directory where proj.db lives, not the file itself.

4
  • Thanks for the help - I did this and it got a different error (see above) Nov 6, 2020 at 15:26
  • Is your proj.db from the same version as your library? see, e.g.: osgeo-org.1560.x6.nabble.com/… Nov 6, 2020 at 15:46
  • not sure - I have a few proj.db in anaconda3. The other paths are /Users/heatherneedham/anaconda3/pkgs/proj4-6.1.0-h2cc77ee_2/share/proj/proj.db, /Users/anaconda3/pkgs/proj4-6.1.0-h2cc77ee_2/share/proj/proj.db - which I think are different versions to the proj.db in the gsa_sm2019 environment Nov 6, 2020 at 17:22
  • do you have a GDAL install folder? Mine is 'C:\Program Files\GDAL\projlib'. In my script is: os.environ['PROJ_LIB'] = r'C:\Program Files\GDAL\projlib'
    – Theo F
    Apr 5, 2021 at 15:23
3

I had a similar issue when trying to use ogr2ogr on a shapefile, whilst setting -a_srs "EPSG:27700". The error you mention was very similar to mine, and I realised that my install of PostgreSQL/PostGIS had created its own gdal folder and set my system environment variables to look in the PostgreSQL gdal install folder, not my seperate standalone GDAL installation folder.

To fix, I removed all references to C:\Program Files\PostgreSQL\11\gdal-data & the postgres proj_lib folder etc from my system environment variables, making sure that ONLY the standalone GDAL paths were set instead. ie. C:\Program Files\GDAL\gdal-data etc.

3
  • 2
    Worked for me! gis.stackexchange.com/questions/413943/… My 'Path' System Variable included C:\Program Files\PostgreSQL\13\bin. I just removed it and I can run ogr2ogr -t_srs with no error. Thanks!
    – BallpenMan
    Oct 15, 2021 at 12:56
  • @LeeGoddard I don't think it should be empty. It needs to point to the GDAL directory.
    – Theo F
    Jul 20 at 21:46
  • 1
    @TheoF Yes, indeed! Jul 21 at 6:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.