I am trying to import a KML file into a PostgreSQL database using the ogr2ogr
tool, but I am encountering the following error:
ERROR 1: PROJ: proj_create_from_database: C:\Program Files\PostgreSQL\17\share\contrib\postgis-3.5\proj\proj.db contains DATABASE.LAYOUT.VERSION.MINOR = 2 whereas a number >= 4 is expected. It comes from another PROJ installation.
ERROR 1: Failed to process SRS definition: EPSG:4326
Command I used:
ogr2ogr -f "PostgreSQL" PG:"dbname=My_Maps01 user=postgres password=12341234" \
-nln "Test_KML" -append -t_srs "EPSG:4326" \
"D:\Atlas_MyMaps\4 Mesures - 2x E82 HH84.60m -TOTAL_.kml"
System Information:
- Operating System: Windows
- GDAL Version: 3.10.1 (released on 2025/01/08)
- PROJ Version: 9.5.1 (released on December 1st, 2024)
- PostgreSQL Version: 17
- PostGIS Version: 3.5
Checks and Attempts:
I found two different
proj.db
files on my system:C:\Program Files\PostgreSQL\17\share\contrib\postgis-3.5\proj\proj.db C:\Program Files\QGIS 3.34.15\share\proj\proj.db
I tried setting the
PROJ_DATA
environment variable to both directories, but the error persists:setx PROJ_DATA "C:\Program Files\PostgreSQL\17\share\contrib\postgis-3.5\proj" setx PROJ_DATA "C:\Program Files\QGIS 3.34.15\share\proj"
I also removed the
PROJ_LIB
environment variable and attempted to set it to different directories, but the issue remains unresolved.
Notes:
For others facing a similar issue, the following Stack Overflow discussions might be helpful:
- GDAL, ogr2ogr "Cannot find proj.db" Error
- GDAL in virtual environment vs PostgreSQL 11
I would appreciate any help in resolving this issue. Thanks in advance!