[GRASSLIST:715] Re: d.measure units

Hamish hamish_nospam at yahoo.com
Fri Apr 14 07:04:09 EDT 2006


> I am sure that when the GRASS code was being developed mainly by
> Americans, it made assumptions about feet being the default unit
> throughout the code. Now that Europeans are mainly developing GRASS,
> there are several places where meters are assumed to be the default
> unit.

I do not think that is a just assumption. e.g. UTM long predates GRASS
by a long long time.

You can ask over on the PROJ4 mailing list about unit history if you
want, I'm sure the learned elders of cartography there can provide you
with a much more satisfactory answer to this than I could.


> Either way, implicit conversion are ALWAYS bad. Either way,
> there is a bit of arrogance built in to the assumptions about the
> "right" way to do things.

Anyway we shouldn't start changing 20 yr old library functions and the
lib fns are doing explicit conversions (PROJ_UNITS to meters, always).
G_distance() reports meters, it's well documented as such, no problem.
If the module programmer wants something else displayed there's an easy
way to convert to the local units. So this is an issue at the module
level, not the library level. (thank goodness)

> Units of the Location should be the default units of all operations.
> The units of the Locations should be flexible and convertible. Meters
> and Feet are the two most common, but I can imagine medical
> applications of GRASS where smaller default units would be convenient
> (mm or microns for example). How convenient would it be to get the
> area of a blood cell in square meters?

"PROJ_UNITS" takes care of any math problems in the GIS engine.
If a module is unit centric, and there's a need to make it more general,
I'm sure that isn't a big problem.

> > and now that I check it, d.barscale is also deciding to display
> > distances in meters, too. I think both tools should probably be set
> > to use the units of the location, not force to meters.

It wouldn't be hard to change d.barscale to force the -f flag if the
units are found to be feet, but do you then need a -u flag to force
meters?



Hamish




More information about the grass-user mailing list