reading CELL files

Joe Plesha root at
Sat Jun 3 08:00:00 EDT 1995

> Hi there!
>       I have some problems with reading and writing cell files in GRASS.
>       I want to program some 'interface' between GRASS and the other stuff
>       and I need to read and write binary raster files. I'm programing in
>       fortran and I cannot find how to achieve necessary size during
>       writing (bytes*rows*cols) because it always has 8 bytes more.
>       And the other way .. durin reading my program needs those 8 bytes
>       which are missing in raster files.
>       I suppose that the problem is in the files declaration. I use
>       open(unit,file, form='UNFORMATTED').
> Can anybody help me and solve my problem.
> Please answer on my e-mail address.
> Thanks
> --
>       KUBA
> ___________________________________________________________________________
> Jakub Loch                                    
> Inst. of Environmental Engineering Systems            tel. +48 22 250037
> Warsaw University of Technology                               fax. +48 2 6254
> Nowowiejska 20; 00-653 Warszawa               e-mail:  kubajl at
> ---------------------------------------------------------------------------
Fortran.... Let me think. Ah yes, I believe you need to open the file
unformated but also direct access. The problem stems from the way fortran
keeps track of its regular formatted files. There are extra bytes at the
begining and end which indicate the length of the file? There may only
be one indicator but I'm sure you get the idea. Most of our crew here
program in fortran so I've dealt with this problem before. Good luck and
have fun.


Joseph L. Plesha            /\
U.S. Geological Survey     /^^\/\     E-mail: jplesha at
Box 25046, Mail Stop 964  /^^^^^^\/\  Phone:  303-236-1398
Denver CO 80225-0046 USA /^COLORADO^\ Fax:    303-236-1425

More information about the grass-dev mailing list