|
@@ -26,7 +26,7 @@ int what(int once, int txt, int terse, int width, int mwidth,
|
|
|
double east, north;
|
|
|
int button;
|
|
|
char east_buf[40], north_buf[40];
|
|
|
- double sq_meters;
|
|
|
+ double sq_meters, sqm_to_sqft, acres, hectares, sq_miles;
|
|
|
double x1, y1, x2, y2, z = 0, l = 0;
|
|
|
int notty;
|
|
|
double maxdist;
|
|
@@ -62,6 +62,12 @@ int what(int once, int txt, int terse, int width, int mwidth,
|
|
|
else
|
|
|
notty = 0;
|
|
|
|
|
|
+ /* always use plain feet not US survey ft */
|
|
|
+ /* if you really want USfeet, try G_database_units_to_meters_factor()
|
|
|
+ here, but then watch that sq_miles is not affected too */
|
|
|
+ sqm_to_sqft = 1 / ( 0.0254 * 0.0254 * 12 * 12 );
|
|
|
+
|
|
|
+
|
|
|
do {
|
|
|
if (!terse)
|
|
|
show_buttons(once);
|
|
@@ -321,6 +327,13 @@ int what(int once, int txt, int terse, int width, int mwidth,
|
|
|
}
|
|
|
|
|
|
sq_meters = Vect_get_area_area(&Map[i], area);
|
|
|
+ hectares = sq_meters / 10000.;
|
|
|
+ /* 1 acre = 1 chain(66') * 1 furlong(10 chains),
|
|
|
+ or if you prefer ( 5280 ft/mi ^2 / 640 acre/sq mi ) */
|
|
|
+ acres = (sq_meters * sqm_to_sqft) / (66 * 660);
|
|
|
+ sq_miles = acres / 640.;
|
|
|
+
|
|
|
+
|
|
|
if (topo) {
|
|
|
int nisles, isleidx, isle, isle_area;
|
|
|
|
|
@@ -347,21 +360,19 @@ int what(int once, int txt, int terse, int width, int mwidth,
|
|
|
else if (txt) {
|
|
|
fprintf(stdout,
|
|
|
_("Size - Sq Meters: %.3f\t\tHectares: %.3f\n"),
|
|
|
- sq_meters, (sq_meters / 10000.));
|
|
|
+ sq_meters, hectares);
|
|
|
|
|
|
fprintf(stdout,
|
|
|
_(" Acres: %.3f\t\tSq Miles: %.4f\n"),
|
|
|
- ((sq_meters * 10.763649) / 43560.),
|
|
|
- ((sq_meters * 10.763649) / 43560.) / 640.);
|
|
|
+ acres, sq_miles);
|
|
|
if (notty) {
|
|
|
fprintf(stderr,
|
|
|
_("Size - Sq Meters: %.3f\t\tHectares: %.3f\n"),
|
|
|
- sq_meters, (sq_meters / 10000.));
|
|
|
+ sq_meters, hectares);
|
|
|
|
|
|
fprintf(stderr,
|
|
|
_(" Acres: %.3f\t\tSq Miles: %.4f\n"),
|
|
|
- ((sq_meters * 10.763649) / 43560.),
|
|
|
- ((sq_meters * 10.763649) / 43560.) / 640.);
|
|
|
+ acres, sq_miles);
|
|
|
}
|
|
|
nlines += 3;
|
|
|
}
|