[GRASS-CVS] hamish: grass6/vector/v.to.db units.c,1.3,1.3.4.1
grass at intevation.de
grass at intevation.de
Fri Nov 16 06:26:37 EST 2007
Author: hamish
Update of /grassrepository/grass6/vector/v.to.db
In directory doto:/tmp/cvs-serv1386
Modified Files:
Tag: releasebranch_6_2
units.c
Log Message:
more precise conversions for square miles, feet, and acres
(merge from HEAD)
Index: units.c
===================================================================
RCS file: /grassrepository/grass6/vector/v.to.db/units.c,v
retrieving revision 1.3
retrieving revision 1.3.4.1
diff -u -d -r1.3 -r1.3.4.1
--- units.c 4 Nov 2005 17:09:44 -0000 1.3
+++ units.c 16 Nov 2007 11:26:34 -0000 1.3.4.1
@@ -7,7 +7,7 @@
int i;
double f=1.0, sq_f=1.0;
- switch ( options.units)
+ switch (options.units)
{
case U_METERS:
f = 1.0;
@@ -20,7 +20,7 @@
break;
case U_ACRES:
- sq_f = 2.471e-4;
+ sq_f = 2.47105381467165e-4; /* 640 acres in a sq mile */
break;
case U_HECTARES:
@@ -28,13 +28,13 @@
break;
case U_MILES:
- f = 6.213e-4;
- sq_f = 3.861e-7;
+ f = 6.21371192237334e-4; /* 1 / (0.0254 * 12 * 5280) */
+ sq_f = 3.86102158542446e-7; /* 1 / (0.0254 * 12 * 5280)^2 */
break;
case U_FEET:
- f = 3.2808;
- sq_f = 10.7639;
+ f = 3.28083989501312; /* 1 / (0.0254 * 12) */
+ sq_f = 10.7639104167097; /* 1 / (0.0254 * 12)^2 */
break;
}
More information about the grass-commit
mailing list