Opened 4 years ago

Closed 4 years ago

#4766 closed defect (fixed)

GDAL_DATA not found for windows with GDAL 3.0.4 and iconv failures and missing curl

Reported by: robe Owned by: robe
Priority: high Milestone: PostGIS Packaging
Component: build Version: 3.0.x
Keywords: windows Cc:

Description

As noted on https://lists.osgeo.org/pipermail/postgis-devel/2020-October/028652.html

PostgreSQL 13 PostGIS 3.0.2 installer (first ot have GDAL 3+ on it) is registering a

POSTGIS="3.0.2 3.0.2" [EXTENSION] PGSQL="130" GEOS="3.8.1-CAPI-1.13.3"
SFCGAL="1.3.8" PROJ="6.3.2" GDAL="GDAL 3.0.4, released 2020/01/28 *GDAL_DATA
not found*" LIBXML="2.9.9" LIBJSON="0.12" LIBPROTOBUF="1.2.1" WAGYU="0.4.3
(Internal)" TOPOLOGY RASTER

this is with having env variables set. Need to investigate what triggers this error, and remedy or make sure it's working properly on windows.

Change History (4)

comment:1 by robe, 4 years ago

Summary: GDAL_DATA not found for windows with GDAL 3.0.4GDAL_DATA not found for windows with GDAL 3.0.4 and iconv failures and missing curl

Adding to this the iconv error in ogrfdw and curl (which means wfs and other curl dependent drivers won't work)

https://github.com/pramsey/pgsql-ogr-fdw/issues/101

 DEBUG:  GDAL config option 'SHAPE_ENCODING' set to 'LATIN1'
  fid | name 
 -----+------
-   1 | PÃ ul
+   1 | Pul
 (1 row)
 
 SET client_min_messages = notice;

The iconv issue probably is because the gdal 3.0.4 distributed with windows is not compiled with iconv support as detailed here: https://lists.osgeo.org/pipermail/postgis-devel/2020-October/028655.html

also missing curl support

comment:2 by robe, 4 years ago

Okay just occurred to me why the GDAL_DATA is not found. The message is a bit erroneous. It's really proj data not found. I figured out on my regress scripts I have PROJ_LIB defined as an environment variable.

I'm going to change the installer to do this. The the message goes away when I have it defined. I wish there was an easy way to define this per install as it really makes having multiple versions of PostGIS not messing up each other harder.

Anyway for PostgreSQL 13 the Environment setting would be:

#if you are on 3.0, and change that to 3.1 if you are on 3.1

C:\Program Files\PostgreSQL\13\share\contrib\postgis-3.0\proj

I may change this to just be in root of 13 or in \share\proj so all versions of PostGIS share the same env.

comment:3 by robe, 4 years ago

Milestone: PostGIS 3.0.3PostGIS Packaging

Flipping this to a packaging problem. FWIW I will be shipping PostGIS 3.0.3 with GDAL 3.2.0 and Proj 7.1.1 and adding in an env to register the PROJ_LIB path.

comment:4 by robe, 4 years ago

Resolution: fixed
Status: assignedclosed

I just pushed out PostGIS 3.0.4 bundle (for 11,12,13 - still need to do for 10 and 9.6) with GDAL 3.2.0 and Proj 7.1.1 and conv fixed. I had to add an extra dialog which I plan to clean up later in 3.1.0 into a single screen, that offers to set the PROJ_LIB variable. Unfortunately for the new env to take effect requires a PostgreSQL service restart. At any rate it takes care of the GDAL DATA is not found error and prevents the crash I described in #4792.

I think the logic we had to find proj for windows must be broken - I haven't checked the code base to see where the setting is set -- as I recall it was hardcoded to look in <postgresql install>/contrib/postgis-<minor-version>/proj.

That in theory should have made the PROJ_LIB bit unnecessary but could be something in PROJ changed and GDAL to make it stop working. Compiling with Proj 5.2 never resulted in this error notice.

Note: See TracTickets for help on using tickets.