Преглед изворни кода

libgis, r.surf.area, v.to.db, m.measure: Renamed G_units_to_meters_factor* to G_meters_to_units_factor*

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@60414 15284696-431f-4ddb-bdfa-cd5b030d7da7
Huidae Cho пре 11 година
родитељ
комит
b57946a4ec
5 измењених фајлова са 13 додато и 14 уклоњено
  1. 2 2
      include/defs/gis.h
  2. 6 7
      lib/gis/units.c
  3. 2 2
      misc/m.measure/main.c
  4. 1 1
      raster/r.surf.area/area.c
  5. 2 2
      vector/v.to.db/units.c

+ 2 - 2
include/defs/gis.h

@@ -666,8 +666,8 @@ void G_free_tokens(char **);
 void G_trim_decimal(char *);
 
 /* units.c */
-double G_units_to_meters_factor(int);
-double G_units_to_meters_factor_sq(int);
+double G_meters_to_units_factor(int);
+double G_meters_to_units_factor_sq(int);
 const char *G_get_units_name(int, int, int);
 int G_units(const char *);
 int G_is_units_type_spatial(int);

+ 6 - 7
lib/gis/units.c

@@ -19,7 +19,7 @@
 #include <grass/glocale.h>
 
 /*!
-  \brief Units conversion to meters
+  \brief Units conversion from meters to units
 
   Units codes (gis.h):
    - U_METERS
@@ -27,14 +27,13 @@
    - U_MILES
    - U_FEET
 
-  Returns a factor which converts the grid unit to meters (by
-  multiplication).
+  Returns a factor which converts meters to units (by multiplication).
  
   \param units units code
 
   \return factor
 */
-double G_units_to_meters_factor(int units)
+double G_meters_to_units_factor(int units)
 {
     switch (units) {
     case U_METERS:
@@ -62,7 +61,7 @@ double G_units_to_meters_factor(int units)
 }
 
 /*!
-  \brief Units conversion to square meters
+  \brief Units conversion from square meters to square units
 
   Units codes (gis.h):
    - U_METERS
@@ -72,14 +71,14 @@ double G_units_to_meters_factor(int units)
    - U_MILES
    - U_FEET
 
-  Returns a factor which converts the grid unit to square meters (by
+  Returns a factor which converts square meters to square units (by
   multiplication).
  
   \param units units code
 
   \return factor
 */
-double G_units_to_meters_factor_sq(int units)
+double G_meters_to_units_factor_sq(int units)
 {
     switch (units) {
     case U_METERS:

+ 2 - 2
misc/m.measure/main.c

@@ -82,8 +82,8 @@ int main(int argc, char **argv)
 	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));
+    f    = G_meters_to_units_factor(G_units(units->answer));
+    sq_f = G_meters_to_units_factor_sq(G_units(units->answer));
     
     G_debug(1, "using '%s (%f) %s (%f)'",
 	    units_name, f, sq_units_name, sq_f);

+ 1 - 1
raster/r.surf.area/area.c

@@ -120,5 +120,5 @@ double conv_value(double value, int units)
     if (units == U_UNDEFINED)
 	return value;
 
-    return value * G_units_to_meters_factor_sq(units);
+    return value * G_meters_to_units_factor_sq(units);
 }

+ 2 - 2
vector/v.to.db/units.c

@@ -7,8 +7,8 @@ int conv_units()
     double f, sq_f;
 
     rad  = 0;
-    f    = G_units_to_meters_factor(options.units);
-    sq_f = G_units_to_meters_factor_sq(options.units);
+    f    = G_meters_to_units_factor(options.units);
+    sq_f = G_meters_to_units_factor_sq(options.units);
 
     if (options.units == U_RADIANS)
 	rad = 1;