[GRASS-dev] adding units and vertical datum metadata to raster
maps
Hamish
hamish_nospam at yahoo.com
Wed May 9 08:29:39 EDT 2007
Hamish:
> > I have hacked together the attached code to add units and vertical
> > datum metadata to raster maps. It still needs some cleanup before
> > going into CVS, but right now I am interested in comments on the
> > approach taken. [it works]
Paul Kelly wrote:
> I remember Helena saying something about wanting a module to be able
> to check what units an input raster map was in, so it could warn the
> user if there was a subtle error. But if the units are totally
> free-form then this is likely to be unreliable. I'm wondering if
> there is some kind of standard for specifying units in an ASCII text
> string, and if we should investigate this and add wrapper functions
> to these new functions that try to ensure the units are in a
> prescribed format where possible. Of course people could still put
> anything in using your functions directly, if they had special
> requirements. But perhaps the modules Helena identified as having a
> serious need for storing and checking units should have some higher
> level functions to do that for them?
units must be free form, as the possibilities are endless.
(for example I have many µg/l raster maps)
$ units
2084 units, 71 prefixes, 32 nonlinear units
^D
modules like r.slope.aspect can set "units=degrees" if they want,
and modules like r.shaded.relief and NVIZ can check, e.g.,
strcmp(tolower(units), "meters")
for hinting about scaling (Lat/Lon). I don't think it is practical to be
seriously checked, but it can be useful for hinting when available and
also for rendering d.legend and ps.map scale bar labels automatically.
Hamish
More information about the grass-dev
mailing list