最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

postgis - "PROJ: proj_create_from_database" error when transferring a KML file to PostgreSQL using ogr2ogr - S

programmeradmin8浏览0评论

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:

  1. 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
    
  2. 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"
    
  3. 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!

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论