AW: [gdal-dev] how to escape special charakter

Suhr, Ralf Ralf.Suhr at itc-halle.de
Tue Feb 9 11:10:10 EST 2010


Thanks Frank,

the --optfile switch makes it work.

Regards
Ralf

-----Ursprüngliche Nachricht-----
Von: Frank Warmerdam [mailto:warmerdam at pobox.com] 
Gesendet: Dienstag, 9. Februar 2010 16:40
An: Suhr, Ralf
Cc: gdal-dev at lists.osgeo.org
Betreff: Re: [gdal-dev] how to escape special charakter

Suhr, Ralf wrote:
> Hello list,
> 
>  
> 
> how can I write the commandline to work on a dos box. The dos box says: 
> program "name" is not found. On linux it run fine.
> 
>  
> 
> ogr2ogr -f "DGN" -sql "SELECT 'LABEL(f:\"Times New Roman\",s:12pt,t:\"' 
> || name || '\")' AS OGR_STYLE,  *  FROM mytable" export.dgn 
> "PG:dbname=..--.."

Ralf,

The problem, I believe, is that the DOS command parser does not understand
backslash escaping to protect the internal double quotes.  I don't really
know if the above can be processed properly by the DOS command parser.

One option might be to install Cygwin which provides a unix-like shell
interpreter (bash) that should follow normal unix rules.

Alternatively, you could possibly invoke os.execl() in python to invoke
a subproject with preparsed arguments.

I had wanted to suggest using the GDAL/OGR --optfile switch which allows
reading command options from a text file, but on review I think the
escaped quotes will also end up confusing it and you will be no better off.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the gdal-dev mailing list