[PROJ] PROJ 6.0.0 cs2cs: cannot instantiate source coordinate system - program abnormally terminated
Sebastiaan Couwenberg
sebastic at xs4all.nl
Fri Mar 8 07:28:07 PST 2019
The cs2cs tests in the proj-rdnap package [0] fail with PROJ 6.0.0:
Rel. 6.0.0, March 1st, 2019
<cs2cs>:
cannot initialize transformation
cause: (null)
program abnormally terminated
The problem seems to be the minimal epsg file in PROJ_LIB, removing is
works around the issue.
Should cs2cs really terminate abnormally when an problematic init file
is present in PROJ_LIB?
Details follow:
A command like the following works with PROJ <= 5.2:
$ echo "53.160753042 4.824761912 42.8614" | \
PROJ_LIB="$(pwd)" PROJ_DEBUG=3 \
cs2cs -r +init=epsg:4258 +to +init=rdnap:rdnap -f %.4f
The current working directory has the rdnap init file and its datum
grids, and a minimal epsg init file:
$ cat rdnap
# RDNAP with NTv2 and VDatum
<rdnap> +proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889
+k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel
+nadgrids=rdtrans2008.gsb +geoidgrids=naptrans2008.gtx +units=m +no_defs <>
# RD with NTv2 only
<rd> +proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889
+k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel
+nadgrids=rdtrans2008.gsb +units=m +no_defs <>
$ cat epsg
# ETRS89
<4258> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs <>
Debug output for the same command with PROJ 6.0.0 shows:
$ echo "53.160753042 4.824761912 42.8614" | \
PROJ_LIB="/usr/share/proj:$(pwd)" PROJ_DEBUG=3 \
cs2cs -r +init=epsg:4258 +to +init=rdnap:rdnap -f %.4f
pj_open_lib(proj.db): call fopen(/usr/share/proj/proj.db) - succeeded
pj_open_lib(epsg): call fopen(/tmp/buildd/proj-rdnap/epsg) - succeeded
get_init: searching cache for key: [epsg:4258]
pj_open_lib(epsg): call fopen(/tmp/buildd/proj-rdnap/epsg) - succeeded
get_init: searching on in init files for [epsg:4258]
get_init_string: searching for section [4258] in init file [epsg]
pj_open_lib(epsg): call fopen(/tmp/buildd/proj-rdnap/epsg) - succeeded
key=epsg:4258, value: [proj=longlat ellps=GRS80 towgs84=0,0,0,0,0,0,0
no_defs]
get_init: got [proj=longlat ellps=GRS80 towgs84=0,0,0,0,0,0,0 no_defs],
paralist[0,1]: [proj=longlat,ellps=GRS80]
get_init: searching cache for key: [rdnap:rdnap]
get_init: searching on in init files for [rdnap:rdnap]
get_init_string: searching for section [rdnap] in init file [rdnap]
pj_open_lib(rdnap): call fopen(/tmp/buildd/proj-rdnap/rdnap) - succeeded
key=rdnap:rdnap, value: [proj=sterea lat_0=52.15616055555555
lon_0=5.38763888888889 k=0.9999079 x_0=155000 y_0=463000 ellps=bessel
nadgrids=rdtrans2008.gsb geoidgrids=naptrans2008.gtx units=m no_defs]
get_init: got [proj=sterea lat_0=52.15616055555555
lon_0=5.38763888888889 k=0.9999079 x_0=155000 y_0=463000 ellps=bessel
nadgrids=rdtrans2008.gsb geoidgrids=naptrans2008.gtx units=m no_defs],
paralist[0,1]: [proj=sterea,lat_0=52.15616055555555]
pj_open_lib(epsg): call fopen(/tmp/buildd/proj-rdnap/epsg) - succeeded
get_init: searching cache for key: [epsg:4258]
get_init: searching cache for key: [rdnap:rdnap]
No operation found matching criteria
Rel. 6.0.0, March 1st, 2019
<cs2cs>:
cannot initialize transformation
cause: (null)
program abnormally terminated
$ echo $?
3
The minimal epsg file is not required any more, since multiple paths can
be used in PROJ_LIB since 6.0.0. Doing that seems to work around the issue:
$ echo "53.160753042 4.824761912 42.8614" | \
PROJ_LIB="/usr/share/proj:$(pwd)" PROJ_DEBUG=3 \
cs2cs -r +init=epsg:4258 +to +init=rdnap:rdnap -f %.4f
pj_open_lib(proj.db): call fopen(/usr/share/proj/proj.db) - succeeded
pj_open_lib(epsg): call fopen(/tmp/buildd/proj-rdnap/epsg) - failed
get_init: searching cache for key: [rdnap:rdnap]
get_init: searching on in init files for [rdnap:rdnap]
get_init_string: searching for section [rdnap] in init file [rdnap]
pj_open_lib(rdnap): call fopen(/tmp/buildd/proj-rdnap/rdnap) - succeeded
key=rdnap:rdnap, value: [proj=sterea lat_0=52.15616055555555
lon_0=5.38763888888889 k=0.9999079 x_0=155000 y_0=463000 ellps=bessel
nadgrids=rdtrans2008.gsb geoidgrids=naptrans2008.gtx units=m no_defs]
get_init: got [proj=sterea lat_0=52.15616055555555
lon_0=5.38763888888889 k=0.9999079 x_0=155000 y_0=463000 ellps=bessel
nadgrids=rdtrans2008.gsb geoidgrids=naptrans2008.gtx units=m no_defs],
paralist[0,1]: [proj=sterea,lat_0=52.15616055555555]
pj_open_lib(epsg): call fopen(/tmp/buildd/proj-rdnap/epsg) - failed
get_init: searching cache for key: [rdnap:rdnap]
pj_ellipsoid - final: a=6377397.155 f=1/299.153, errno=0
pj_ellipsoid - final: ellps=bessel
pj_ellipsoid - final: a=6377397.155 f=1/299.153, errno=0
pj_ellipsoid - final:
Pipeline: Building arg list for step no. 0
Pipeline: init - proj=unitconvert, 3
xy_in=deg
xy_out=rad
pj_ellipsoid - final: a=6378137.000 f=1/298.257, errno=0
pj_ellipsoid - final: ellps=GRS80
xy_in unit: Degree
xy_out unit: Radian
Pipeline: Step 0 (proj=unitconvert) at 0x55a438eb9170
Pipeline at [0x55a438eb8c20]: step at [0x55a438eb9170]
(proj=unitconvert) done
Pipeline: Building arg list for step no. 1
Pipeline: init - proj=sterea, 7
lat_0=52.1561605555556
lon_0=5.38763888888889
k=0.9999079
x_0=155000
y_0=463000
ellps=bessel
pj_ellipsoid - final: a=6377397.155 f=1/299.153, errno=0
pj_ellipsoid - final: ellps=bessel
Pipeline: Step 1 (proj=sterea) at 0x55a438ea6c60
Pipeline at [0x55a438eb8c20]: step at [0x55a438ea6c60] (proj=sterea)
done
Pipeline: 2 steps built. Determining i/o characteristics
117355.9718 574917.6038 42.8614
[0] https://tracker.debian.org/pkg/proj-rdnap
Kind Regards,
Bas
--
GPG Key ID: 4096R/6750F10AE88D4AF1
Fingerprint: 8182 DE41 7056 408D 6146 50D1 6750 F10A E88D 4AF1
More information about the PROJ
mailing list