[GRASS5] the floating raster file format

Andrea Antonello moovida at katamail.com
Thu Apr 15 03:10:48 EDT 2004


Two doubts:
1) Since the offsets in the header referr to the compressed data (and the 
binary file doesn't carry the information of the datatype), I won't be able 
to understand just from the binary file itself if I have floating point or 
double data. Is that right? The cellhd file just says -1, which is float or 
double. 
Is the only way that to uncompress a row and divide the number of bytes per 
number of cols? Any hint?

2) Shouldn't the default be float? My GRASS_FP_DOUBLE variable is not set, but 
the r.in.ascii creates double type maps. 

Ciao
Andrea


> > The above is incorrect.
> >
> > The header is a single byte, equal to sizeof(long) (typically 4 on a
> > 32-bit platform, 8 on a 64-bit platform). Then, NROWS+1 offsets are
> > written as longs (i.e. 4 or 8 bytes, depending upon platform) in
> > big-endian (Motorola) byte order.
> >
> > Thus, your example is actually interpreted as:
> >
> > 	4		sizeof(long)
> > 	0 0 0 17	offset of row 0
> > 	0 0 0 36	offset of row 1
> > 	0 0 0 55	offset of row 2
> > 	0 0 0 74	offset of end of data
> >
> > See G__write_row_ptrs() in src/libes/gis/format.c for the code which
> > writes this data. However, note that the row offsets are initially
> > zero; they get overwritten later (if you're writing compressed data,
> > you don't know how much space it will require until you've compressed
> > it).
> >
> > As for the format of the actual row data, see put_fp_data() in
> > src/libes/gis/put_row.c and RFC 1014 (the XDR specification).
>
> I have taken the liberty to write these
> comments into
>  src/libes/gis/format.c
>
> Please update there if needed.
>
> Note: The XDR RFC 1014 is found at:
>  http://www.faqs.org/rfcs/rfc1014.html
>
> Markus
>
> _______________________________________________
> grass5 mailing list
> grass5 at grass.itc.it
> http://grass.itc.it/mailman/listinfo/grass5

-- 
____________________________________________________________________________
"Let it be as much a great honour to take as to give learning,
if you want to be called wise."
Skuggsja' - The King's mirror - 1240 Reykjavik

University of Trento
Department of Civil and Environmental Engineering
Via Mesiano, 77 - Trento (ITALY)

Andrea Antonello
tel:  +393288497722
fax:  +390461882672
____________________________________________________________________________





More information about the grass-dev mailing list