[Proj] Failed to initialize PROJ.4 with "..."
Kristian Evers
kreve at sdfe.dk
Fri Oct 13 14:30:47 EST 2017
Chris,
It would be beneficial if you could try to reproduce this problem just using PROJ.4 and a few simple coordinates. Either on the command line with a call to cs2cs or by a small C program. I tried initialising the projection with a recent version of PROJ.4 without problems and I can't see any obvious problem in the proj string. It is likely that if this indeed is a bug in PROJ.4 that it has already been fixed.
/Kristian
________________________________
Fra: proj-bounces at lists.maptools.org [proj-bounces at lists.maptools.org] på vegne af Chris Marsh [chris.marsh at usask.ca]
Sendt: 13. oktober 2017 17:56
Til: proj at lists.maptools.org
Emne: [Proj] Failed to initialize PROJ.4 with "..."
Hi,
I'm using GDAL (and by extension proj.4) to reproject a set of WGS84 coordinates to North America Albers Conic Conformal.
I originally posted this to the GDAL list, however it seems like this may be entirely a Proj.4 problem.
On all but 1 computer I run my code on, this works as expected. However, when trying to run on one of Compute Canada's newest machines, I get the error
ERROR 6: Failed to initialize PROJ.4 with `+proj=aea +lat_1=20 +lat_2=60 +lat_0=40 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs'.
I have tried building and linking against various proj.4 versions, none of which solves this problem.
The code is straightfoward
OGRSpatialReference insrs;
insrs.SetWellKnownGeogCS("WGS84");
OGRSpatialReference outsrs;
outsrs.importFromProj4("+proj=aea +lat_1=20 +lat_2=60 +lat_0=40 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs");
OGRCoordinateTransformation* coordTrans = NULL;
coordTrans = OGRCreateCoordinateTransformation(&insrs, &outsrs);
coordTrans->Transform(1, &longitude, &latitude)
with the error appearing on the Transform call. The proj.4 string is from using the ExportToWkt of GDAL for the WKT of Albers Conic Conformal. (long story as to why i'm doing this). I have tried using the WKT string and that results in the same error -- seems like it is just converted to proj.4 behind the scenes.
I am using gdal 2.2.1 and proj4 4.8 (4.9 has other issues I'm running into)
$gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/cvmfs/soft.computecanada.ca/nix/store/lvjwgn6hpngyy6k4xqcqa9h2cxy3fl30-gfortran-5.4.0/libexec/gcc/x86_64-unknown-linux-gnu/5.4.0/lto-wrapper<http://soft.computecanada.ca/nix/store/lvjwgn6hpngyy6k4xqcqa9h2cxy3fl30-gfortran-5.4.0/libexec/gcc/x86_64-unknown-linux-gnu/5.4.0/lto-wrapper>
Target: x86_64-unknown-linux-gnu
Configured with:
Thread model: posix
gcc version 5.4.0 (GCC)
$uname -a
Linux gra-login4 3.10.0-514.21.1.el7.x86_64 #1 SMP Thu May 25 17:04:51 UTC 2017 x86_64 GNU/Linux
Cheers
Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/proj/attachments/20171013/a508f0a3/attachment.htm
More information about the Proj
mailing list