5

I have a PostgreSQL/PostGIS database that I have been working on and it's generated in a docker container. I access it via PGAdmin to the docker DB or sometimes I create a backup and restore locally to build from for testing etc.

I have previously been able to run my batch scripts to generate a bunch of geopackages exports using ogr2ogr from the db whether its from my local or docker container everything worked fine. The last time I ran ogr2ogr to create exports was probably 2 months ago.

Previously I had these software versions installed on my computer:

  • QGIS 3.16 I use the ogr2ogr from qgis to generate exports
  • PostgreSQL 13.x
  • Postgis 3.1

About a month ago I had time to upgrade to the newer versions

  • QGIS 3.22
  • PostgreSQL 14.x, I also installed the older 13.x version as well
  • Postgis 3.2 on 14, postgis 3.1 on 13

Yesterday I had the run the exports again and notice a slew of errors that popped up that I have never seen before. Figuring it could be a difference in the PostgreSQL/PostGIS I reinstalled the previous versions as well and the error remains.

While there are errors, the geopackage is still created and everything appears to be correct (ie in the same coordinates as the original epsg 4326)

Aside from reverting back to qgis 3.16 and testing which I don't think is the issue, I'm stumped, and not sure where the error could be coming from.

All my geometries are stored in EPSG 4326 so not sure why the error would mention 5482,5936,3978,2193

I also tested a clean install on a ec2 of PostgreSQL 13.6/PostGIS 3.1/QGIS 3.22 and still getting the same issues.

ERROR 1: PROJ: proj_create: no database context specified

ERROR 1: Cannot parse CRS http://www.opengis.net/def/crs/EPSG/0/5482

ERROR 1: PROJ: proj_create: no database context specified

ERROR 1: Cannot parse CRS http://www.opengis.net/def/crs/EPSG/0/5936

ERROR 1: PROJ: proj_create: no database context specified

ERROR 1: Cannot parse CRS http://www.opengis.net/def/crs/EPSG/0/3978

ERROR 1: PROJ: proj_create: no database context specified

ERROR 1: Cannot parse CRS http://www.opengis.net/def/crs/EPSG/0/2193

ERROR 1: PROJ: proj_create_from_database: D:\Program Files\PostgreSQL\13\share\contrib\postgis-3.1\proj\proj.db 
lacks DATABASE.LAYOUT.VERSION.MAJOR / DATABASE.LAYOUT.VERSION.MINOR metadata. It comes from another PROJ installation.

1 Answer 1

0

I had the same problem with more-or-less the same data setup as you. However, I received the same set of errors when trying to run ogr2ogr, which is presumably what QGIS uses under the hood. I received the error when using ogr2ogr installed with Postgres. What solved the problem for me was to use a version of ogr2ogr in an Anaconda environment that contained an updated version of gdal. This doesn't really answer your question but might for others with the same problem and maybe provides a hint.

1
  • 1
    Late reply, but I did manage (at that time) to figure out what the issue was. It was definitely some ogr2ogr version issues between the Postgres / QGIS version. Commented Dec 2, 2022 at 18:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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