[GRASSLIST:708] Re: d.measure units

Tom Russo russo at bogodyn.org
Thu Apr 13 10:40:10 EDT 2006


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




More information about the grass-user mailing list