On Tue, Jun 27, 2023 at 04:24:08AM -0500, Dan Jacobson wrote:
> I am just saying that some commands,
> like
> 
> set 42.1527288 -87.8284360 42.1817060 -87.8275970
> geod +ellps=GRS80 -a -p -f %.6f -F %.4f -I +units=us-ft <<EOF
> $@
> EOF
> 42.152729 -87.828436 42.181706 -87.827597 1.233661 181.234224 10562.4246
> 
> never give the units,
> and some like units, always give the units...
> OK I guess both need postprocessing.

I don't really understand what you're saying here.  The command you
show is requesting output in feet, so the units have been specified.

You do that in units by converting to the desired units, that is

units --terse 1mi feet

This seems to function precisely the same as geod.  When you don't
supply a "you want" conversion factor, units instead prints the
definition reduced to primitive units.  Without the attached units,
this output is *not* meaningful. Suppose you wrote a script that
invoked units under the assumption that "m" was the primitive unit but
the user has done

export UNITS_SYSTEM=gauss

Then the output of definitions is in cm instead of meters, so your
proposed unitless definition output would give a mile as "160934.4".
But I guess that's better (?) than a user who defaulted to planck
units, where you'd get 9.9e37 back as the definition of the mile.

There is no fixed default for what the primitive units are, so you
can't make assumptions.

Reply via email to