Provided by: geographiclib-tools_1.21-1ubuntu1_amd64

**NAME**

Planimeter -- compute the area of geodesic polygons

**SYNOPSIS**

Planimeter[-r] [-s] [-l] [-eaf] [--comment-delimitercommentdelim] [--version|-h|--help] [--input-fileinfile|--input-stringinstring] [--line-separatorlinesep] [--output-fileoutfile]

**DESCRIPTION**

Measure the area of a geodesic polygon. Reads polygon vertices from standard input, one per line. Vertices may be given as latitude and longitude, UTM/UPS, or MGRS coordinates, interpreted in the same way asGeoConvert(1). (MGRS coordinates signify the center of the corresponding MGRS square.) The end of input, a blank line, or a line which can't be interpreted as a vertex signals the end of one polygon and the start of the next. For each polygon print a summary line with the number of points, the perimeter (in meters), and the area (in meters^2). By default, polygons traversed in a counter-clockwise direction return a positive area and those traversed in a clockwise direction return a negative area. This sign convention is reversed if the-roption is given. Of course, encircling an area in the clockwise direction is equivalent to encircling the rest of the ellipsoid in the counter-clockwise direction. The default interpretation used byPlanimeteris the one that results in a smaller magnitude of area; i.e., the magnitude of the area is less than or equal to one half the total area of the ellipsoid. If the-soption is given, then the interpretation used is the one that results in a positive area; i.e., the area is positive and less than the total area of the ellipsoid. Only simple polygons are supported for the area computation. Polygons may include one or both poles. There is no need to close the polygon.

**OPTIONS**

-rtoggle whether counter-clockwise traversal of the polygon returns a positive (the default) or negative result.-stoggle whether to return a signed result (the default) or not.-ltoggle whether the vertices represent a polygon (the default) or a polyline. For a polyline, the number of points and the length of the path joining them is returned; the path is not closed and the area is not reported.-especify the ellipsoid viaaf; the equatorial radius isaand the flattening isf. Settingf= 0 results in a sphere. Specifyf< 0 for a prolate ellipsoid. A simple fraction, e.g., 1/297, is allowed forf. (Also, iff> 1, the flattening is set to 1/f.) By default, the WGS84 ellipsoid is used,a= 6378137 m,f= 1/298.257223563. If entering vertices as UTM/UPS or MGRS coordinates, use the default ellipsoid, since the conversion of these coordinates to latitude and longitude uses the WGS84 parameters.--comment-delimiterset the comment delimiter tocommentdelim(e.g., "#" or "//"). If set, the input lines will be scanned for this delimiter and, if found, the delimiter and the rest of the line will be removed prior to processing. For a given polygon, the last such string found will be appended to the output line (separated by a space).--versionprint version and exit.-hprint usage and exit.--helpprint full documentation and exit.--input-fileread input from the fileinfileinstead of from standard input; a file name of "-" stands for standard input.--input-stringread input from the stringinstringinstead of from standard input. All occurrences of the line separator character (default is a semicolon) ininstringare converted to newlines before the reading begins.--line-separatorset the line separator character tolinesep. By default this is a semicolon.--output-filewrite output to the fileoutfileinstead of to standard output; a file name of "-" stands for standard output.

**EXAMPLES**

Example (the area of the 100km MGRS square 18SWK) Planimeter <<EOF 18N 500000 4400000 18N 600000 4400000 18N 600000 4500000 18N 500000 4500000 EOF => 4 400139.53295860 10007388597.1913 The following code takes the output from gdalinfo and reports the area covered by the data (assuming the edges of the image are geodesics). #! /bin/sh egrep '^((Upper|Lower) (Left|Right)|Center) ' | sed -e 's/d /d/g' -e "s/' /'/g" | tr -s '(),\r\t' ' ' | awk '{ if ($1 $2 == "UpperLeft") ul = $6 " " $5; else if ($1 $2 == "LowerLeft") ll = $6 " " $5; else if ($1 $2 == "UpperRight") ur = $6 " " $5; else if ($1 $2 == "LowerRight") lr = $6 " " $5; else if ($1 == "Center") { printf "%s\n%s\n%s\n%s\n\n", ul, ll, lr, ur; ul = ll = ur = lr = ""; } } ' | Planimeter | cut -f3 -d' '

**SEE** **ALSO**

GeoConvert(1). The algorithm for the area of geodesic polygon is given in Section 15 of C. F. F. Karney,Geodesicsonanellipsoidofrevolution, Feb. 2011; preprint <http://arxiv.org/abs/1102.1215>. See also Section 6 of C. F. F. Karney,Algorithmsforgeodesics, Sept. 2011; preprint <http://arxiv.org/abs/1109.4448>.

**AUTHOR**

Planimeterwas written by Charles Karney.

**HISTORY**

Planimeterwas added to GeographicLib, <http://geographiclib.sf.net>, in version 1.4.