[GRASS-dev] G_units_to_meters_factor renamed to G_meters_to_units_factor?

Huidae Cho grass4u at gmail.com
Mon May 19 21:56:08 PDT 2014


Maybe, it's just me?

G_units_to_meters_factor returns a factor that converts meters to units by
multiplication as opposed to the name and description. For example,
G_units_to_meters_factor(U_KILOMETERS) returns 0.001, not 1000. Multiplying
1 km by 0.001 to get 0.001 meters?

G_database_units_to_meters_factor returns a correct factor that actually
converts to meters by multiplication. If a database unit is foot, it
returns 0.3048, not 3.28, which G_units_to_meters_factor returns.

v.to.db is one of the modules that calls G_units_to_meters_factor, and
multiplies meters by this units-to-meters factor to get a user specified
unit.

The name of this function is confusing and misleading. If I'm not wrong, I
suggest to rename this function to G_meters_to_units_factor.

Huidae
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20140520/f75fd6c8/attachment.html>


More information about the grass-dev mailing list