[GRASSLIST:710] Re: d.measure units
David Finlayson
david.p.finlayson at gmail.com
Thu Apr 13 12:29:02 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. 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.
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?
On 4/13/06, Tom Russo <russo at bogodyn.org> wrote:
> On Fri, Apr 14, 2006 at 12:09:41AM +1200, we recorded a bogon-computron collision of the <hamish_nospam at yahoo.com> flavor, containing:
> > Tom Russo wrote:
> > > The manual for d.measure says that it outputs distances in the units
> > > of the current location, but as far as I can tell it only outputs in
> > > meters.
> [...]
> > > But each time I use d.measure, with or without the "-m" flag, it
> > > reports all distances in meters (and does so correctly, but requires
> > > that I reconvert back to US feet by hand).
> > >
> > > The man page says that d.measure's only supposed to report in meters
> > > with -m (or presumably if the location's units are meters). What's up
> > > here? Bug, incorrect documentation, or error between keyboard and
> > > chair?
> >
> [...]
> > Now in that code the main length calculation uses G_distance()
> > length += G_distance()
> >
> > http://freegis.org/cgi-bin/viewcvs.cgi/grass6/lib/gis/distance.c?rev=HEAD&content-type=text/vnd.viewcvs-markup
> >
> > ..which should return a value in meters.
> >
> [...]
> > the help page says:
> > "Line lengths are stated in the same units as those of the current
> > LOCATION. In a XY-LOCATION, where no units are available, d.measure
> > prints a warning and gives results without units."
> >
> > so the help page is wrong?
>
> Yes, after posting I dug through the code a bit and and as you mention, I saw
> that the library's G_distance function always converts to meters. So yes
> indeed, the help page is wrong.
>
> My location is clearly using feet (the coordinate system is a state plane
> coordinate system with coordinates in US feet, as it shows in the PROJ_UNITS
> file) and gis.m's measure tool produces measurements in feet.
> But G_distance() converts internally to meters, 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.
>
> --
> Tom Russo KM5VY SAR502 DM64ux http://www.swcp.com/~russo/
> Tijeras, NM QRPL#1592 K2#398 SOC#236 AHTB#1
> "And, isn't sanity really just a one-trick pony anyway? I mean all you get is
> one trick, rational thinking, but when you're good and crazy, oooh, oooh,
> oooh, the sky is the limit!" --- The Tick
>
>
--
David Finlayson
More information about the grass-user
mailing list