[GRASS5] raster map titles

Hamish hamish_nospam at yahoo.com
Sun May 2 04:26:27 EDT 2004


Can anyone provide some insight or correct me if I'm wrong here; I'm
trying to dig myself out of some confusion regarding raster map titles.


AFAICT:
For each raster map are two different map titles, one is set by the
second line in the cats/ file, the other by the second line of the hist/
file. r.info reports these as "Title: cats_title ( hist_title )".

The cats/ version is the main one. It is read by:
 {G_get_cell_title() or G_get_cats_title() or G_get_raster_cats_title}

and set with:

 {G_put_cell_title() or G_set_cats_title() or G_set_raster_cats_title()}


G_*_cats_title() is just an alias to G_*_raster_cats_title() and
works on a cats structure (which still needs to be written out).
Usage is limited to 1024 characters by buff[] in libes/gis/cats.c

G_*_cell_title() is its own implementation which works on a map name.
Usage is limited to 300 characters by buf[] in libes/gis/put_title.c


According to the 5.0 Programmers' Manual, the hist/ one will generally
be the map's file name, and isn't really used for anything. It seems to
have a limit of RECORD_LEN (ie 80) characters in gis.h's History->title.


The 40 character limit I've imposed on r.in.mat is probably wrong, that
was for the (old?) vector map format's meta-info. BUT r.info will likely
start to give ugly output if the title is much longer than 40 chars..


I hope to add a title="" option to 5.3's r.support to change a map's
title from the command line. All the r.support yes/no questions could be
made into flags too, but I think r.support needs a major rewrite before
going into 5.7. For now I'm not planning on doing anything more than
adding the title="" option though. Hopefully this will be so useful it
will provide the motivation for someone to do a 5.7 version.. :)


My plan is to bump the limits in put_title.c and r.in.mat to 1024 so
that even if it is still a bit confusing, at least it is a little more
consistent. I'd also add a doxygen comment to gis.h explaining that
History->title should be reserved for the map's filename or parent's
filename.

Do any operating systems put limits on line lengths 300<1024 for
fgetl() or the like?



??

thanks,
Hamish




More information about the grass-dev mailing list