pygeotools icon indicating copy to clipboard operation
pygeotools copied to clipboard

failed to load datum shift file

Open andylai2 opened this issue 3 years ago • 1 comments

Hello, when I import the lib/geolib module, I get multiple errors of:

proj_create: Error -38: failed to load datum shift file

From looking at the code it seems like this is coming from all the osr.SpatialReference().ImportFromProj4() calls. I followed the commented out steps to add the various .gtx files to /usr/local/share/proj, but I still get the errors.

Specifically, the errors come from egm96, egm08, navd88_conus, navd88_alaska, nps_egm08, sps_egm08, and aea_navd88.

andylai2 avatar Aug 10 '21 17:08 andylai2

Hi @andylai2. Thanks for the report.

I am unable to reproduce this error with the latest version of pygeotools on Github and a clean conda environment (GDAL 3.2.1, PROJ Rel. 7.2.0 from conda-forge). Can you provide details on your environment and version of pygeotools (commit hash)? The PROJ grid handling has evolved considerably since the Proj4 strings were added to geolib.

You could probably go ahead and delete most of the problematic definitions and related one-line conversion functions, as they are not used elsewhere. I created for convenience when working on past interactive projects.

I should make an effort to clean this up, as most of this is not necessary for the larger geolib function library, except for a subset of the core definitions (like wgs_srs). The reality is that modern Python packages like pyproj and geopandas offer much better options for these operations, and I rely less and less on geolib for day to day work.

dshean avatar Aug 21 '21 00:08 dshean