[Proj] quoting +nadgrids ?

Hamish hamish_b at yahoo.com
Thu Jul 29 20:46:46 EST 2010

> > we've run into a problem whereas the nad/conus grid file has
> > been installed under C:\Program Files\ (which contains a
> > space), and the pj_get_def(pjinfo.pj, 0) string doesn't
> > quote the filename of the +nadgrids=/full/path/and/filename
> > parameter. 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.

Greg wrote:
> Perhaps the installation should just error out on paths
> with spaces.

that's no good for a few reasons:
1) it's not friendly to the user / not a good look. 2) some
users are stuck with a locked down system with no ability to
install to the C:\ of their choosing. and 3) that would be
admitting defeat :-)

> Are you having trouble with shell quoting or with argument
> parsing?

with some shell script magic from Glynn and a small bugfix from
Paul we've now got it sussed I think as far as cs2cs goes.
(trade spaces with '+'s after them for newlines, 'single quote'
all +proj terms, reassemble into a single line)

> If you put quotes around the whole def string, does it work?

yes for gdalwarp, no for cs2cs. so 'single quoting' all +proj
terms and sending them as individual argv's works for cs2cs,
but I don't see a solution for `gdalwarp -t_srs` which takes
all +proj terms within a single "quoted list".

that quoted list does not like individual terms quoted within
it. e.g. this fails with a proj term parsing error:

gdalwarp -t_srs "'+proj=longlat' '+datum=nad83' '+nadgrids=c:\Program Files\GRASS\etc\nad\conus'" input.tif output.tif

so no way to quote the +nadgrids pathname for gdalwarp AFAICT.



More information about the Proj mailing list