[GRASSLIST:9452] Re: Rasters not displaying from old (Windows) Gr ass Projects

Glynn Clements glynn at gclements.plus.com
Tue Dec 13 18:53:28 EST 2005


Patton, Eric wrote:

> >Just a guess, but rasters may need converting from DOS format (CR+LF at
> >ends of lines)  to Unix (LF only).  Try using -a as a parameter to unzip
> >in Linux, or running dos2unix on the raster files.
> 
> >Chris
> 
> Chris, I tried the -a switch on gunzip, but that isn't supported on Ubuntu. 
> 
> Glynn, the filesizes look fine - all rasters are several MB (normal sized).

I meant to compare the exact file sizes. If the files have undergone
EOL conversion, the Linux versions will typically be a few bytes
smaller than the Windows versions.

> Do I run dos2unix on every single file in every directory in my location? Or
> could I tar the whole location and run that tarfile through dos2unix? I
> tried that for fun, but I get an'Error exit delayed from previous errors'
> when dos2unix runs on my tarfile. Does it make sense to run a dos -> unix
> ascii convertor on Grass rasters? Aren't they in binary format?

They are in binary format. You definitely shouldn't be running
dos2unix on them. My concern is that the process used to transfer them
from Windows to Linux may have performed the translation implicitly.

I'm not sure exactly how the data was transferred, but there are
several tools which may do EOL conversions:

1. The Cygwin DLL does EOL conversion by default, unless either:

a) The application specifically opens the file in "binary" mode (the
O_BINARY flag, which is a Cygwin extension; Unix programs won't use
this flag unless they have been specifically "ported" to Cygwin).

b) The CYWGIN environment variable contains the "binmode" option.

c) The "device" from which the file was read was mounted in binary
mode. Cygwin's "mount" command will tell you whether a device is in
text or binary mode.

2. FTP transfers may do EOL conversion. An FTP session normally starts
in "text" mode (EOL conversions are performed on all transfers). With
a traditional Unix command-line client, you need to use the "binary"
command to select binary transfers (without EOL conversions). 
Graphical clients usually have a a checkbox or radio buttons to choose
between text and binary transfers.

3. Archiving utilities (ZIP, RAR) may perform EOL conversions.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-user mailing list