[GRASS5] the floating raster file format

Glynn Clements glynn.clements at virgin.net
Thu Apr 15 15:17:43 EDT 2004


Andrea Antonello wrote:

> 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?

Yes.

> 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?

The official mechanism is to read the "type:" entry from the
cell_misc/<map_name>/f_format file (see G__check_fp_type()).

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

The GRASS_FP_DOUBLE variable is only used if the program calls
G_open_fp_cell_new() or G_open_fp_cell_new_uncompressed() directly,
without calling G_set_fp_type(). Most programs use
G_open_raster_new(), and thus specify the exact type of map to be
created.

-- 
Glynn Clements <glynn.clements at virgin.net>




More information about the grass-dev mailing list