[Proj] quoting +nadgrids ?
Glynn Clements
glynn at gclements.plus.com
Tue Aug 3 05:35:03 EST 2010
Eric Miller wrote:
> > This issue has nothing (directly) to do with the shell on any
> > platform. It's simply an issue of how to represent a list of strings
> > as a single string.
>
> I understood the OP was getting the "projection definition" so that
> it could be used by cs2cs at some later date.
> """
> So when this string is passed as a CRS to cs2cs it only reads as far
> as the "C:\Program" part for the grid file and all goes downhill
> fast from there.
> """
> He didn't say anything about the shell, but I assumed there'd be one
> if cs2cs was being used.
The issues apply even if no shell is used.
In GRASS, I've been systematically replacing calls to system(),
popen() etc with functions which don't use the shell. And in 7.0,
shell scripts have been replaced by Python scripts, which pass an
argument list (as a list) to subprocess.Popen().
The problems are:
1. pj_get_def() returns a PROJ argument list as a string, with
arguments separated by spaces. Fortunately, each argument starts with
a "+", so we can convert this back to a list (so long as no argument
contains a space followed by a plus).
2. gdalwarp's -t_srs and -s_srs options expect a PROJ argument list as
a string, which is split on spaces (regardless of the presence or
absence of a "+"). This precludes any argument containing spaces.
--
Glynn Clements <glynn at gclements.plus.com>
More information about the Proj
mailing list