[GRASS-SVN] r41304 - in grass/trunk: lib/gis misc/m.measure
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Mar 5 14:13:54 EST 2010
Author: martinl
Date: 2010-03-05 14:13:54 -0500 (Fri, 05 Mar 2010)
New Revision: 41304
Modified:
grass/trunk/lib/gis/units.c
grass/trunk/misc/m.measure/main.c
Log:
m.measure: length is measured in LL locations in meters by default
Modified: grass/trunk/lib/gis/units.c
===================================================================
--- grass/trunk/lib/gis/units.c 2010-03-05 19:04:46 UTC (rev 41303)
+++ grass/trunk/lib/gis/units.c 2010-03-05 19:13:54 UTC (rev 41304)
@@ -237,6 +237,9 @@
else if (strcasecmp(units_name, "foot") == 0 ||
strcasecmp(units_name, "feet") == 0)
return U_FEET;
+ else if (strcasecmp(units_name, "degree") == 0 ||
+ strcasecmp(units_name, "degrees") == 0)
+ return U_DEGREES;
return U_UNKNOWN;
}
Modified: grass/trunk/misc/m.measure/main.c
===================================================================
--- grass/trunk/misc/m.measure/main.c 2010-03-05 19:04:46 UTC (rev 41303)
+++ grass/trunk/misc/m.measure/main.c 2010-03-05 19:13:54 UTC (rev 41304)
@@ -79,9 +79,14 @@
}
/* determine units */
- units_name = G_get_units_name(G_units(units->answer), 1, 0);
- sq_units_name = G_get_units_name(G_units(units->answer), 1, 1);
-
+ if (G_projection() == PROJECTION_LL && !units->answer) {
+ units_name = G_get_units_name(U_METERS, 1, 0);
+ sq_units_name = G_get_units_name(U_METERS, 1, 1);
+ }
+ else {
+ units_name = G_get_units_name(G_units(units->answer), 1, 0);
+ sq_units_name = G_get_units_name(G_units(units->answer), 1, 1);
+ }
f = G_units_to_meters_factor(G_units(units->answer));
sq_f = G_units_to_meters_factor_sq(G_units(units->answer));
More information about the grass-commit
mailing list