[PROJ] proj_create reports errors itself

Roger Bivand Roger.Bivand at nhh.no
Fri Apr 10 03:58:14 PDT 2020


Hi,

A small example:

$ echo "0 0" | cs2cs +proj=longlat +proj=sch
proj_create: Error -37: failed to find projection to be rotated
Rel. 7.0.0, March 1st, 2020
<cs2cs>:
cannot instantiate target coordinate system
program abnormally terminated

>From the cs2cs code, I can see the error message "cannot ... " being 
generated, but proj_create seems to write to stderr itself:

$ echo "0 0" | cs2cs +proj=longlat +proj=sch 2> xy
$ cat xy
proj_create: Error -37: failed to find projection to be rotated
Rel. 7.0.0, March 1st, 2020
<cs2cs>:
cannot instantiate target coordinate system
program abnormally terminated

How can proj_create() (and maybe other functions) be instructed not to do 
this? Testing the returned value for equality to 0 works, as cs2cs also 
shows, but proj_create() writes on stderr anyway, which should be 
avoidable.

In the R rgdal package, I still have not moved to one context for the 
whole PROJ session - is this connected? From the cs2cs example, I don't 
think so, but ask for hints.

Best wishes,

Roger

-- 
Roger Bivand
Department of Economics, Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; e-mail: Roger.Bivand at nhh.no
https://orcid.org/0000-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en


More information about the PROJ mailing list