[Gdal-dev] DOS crlf in GDAL create() ?

Lucena, Ivan ivan.lucena at pmldnet.com
Wed Aug 8 11:38:17 EDT 2007


Hi Dave, Frank,

> Dave Favis-Mortlock wrote:
>> I ask because I'm writing Idrisi output on Linux (where end-of-lines 
>> are, of course, lf only). Idrisi (running under WINE) expects DOS crlf 
>> end-of-lines in its .rdc metadata files.

The RST driver uses the CPL/StringList functions to handle the Idrisi 
.rdc (Raster Documentation) file. What happens is that CPL uses the 
default OS end-of-line preference and Idrisi can't read the file 
termination properly if it is not DOS format.

>> OK, I can write my .fdc files then convert 'em using unix2dos, but it 
>> would be nice to avoid this step. I see that OGR uses a LINEFORMAT 
>> switch for .csv files. Anything similar for GDAL?

The .rdc file is not a GDAL supported Metadata. Therefore, the 
end-of-line in that case is not subjected to any command line option.

> There is no generic support for this, but it could potentially be addressed
> on a driver by driver basis - or if IDRISI doesn't exist on Linux, perhaps
> we should just always be writing these files with DOS text format?  I'd
> encourage you to file a bug on it, and we will see what Ivan says about it.

Frank is right. I need to either tell CPL to always save the .rdc file 
in DOS format or do my own code to reformat it.

So Dave, Please go ahead and file a bug so we can keep track of that issue.

Best regards,

Ivan



More information about the Gdal-dev mailing list