[Proj] quoting +nadgrids ?
Jack Bowling
jbinpg at shaw.ca
Thu Jul 29 21:23:11 PDT 2010
On Thu, 2010-07-29 at 18:46 -0700, Hamish wrote:
> Hamish:
> > > 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.
Maybe it is time to admit Windows inadequacies and install a unix
emulator. I would suggest the lightweight GOW rather than something like
Cygwin:
http://wiki.github.com/bmatzelle/gow/
Bash and many other useful apps are in there.
Jack
More information about the Proj
mailing list