|
NAMEPlanimeter -- compute the area of geodesic polygonsSYNOPSISPlanimeter [ -r ] [ -s ] [ -l ] [ -e a f ] [ -w ] [ -p prec ] [ -G | -E | -Q | -R ] [ --comment-delimiter commentdelim ] [ --version | -h | --help ] [ --input-file infile | --input-string instring ] [ --line-separator linesep ] [ --output-file outfile ]DESCRIPTIONMeasure 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 as GeoConvert(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).The edges of the polygon are given by the shortest geodesic between consecutive vertices. In certain cases, there may be two or many such shortest geodesics, and in that case, the polygon is not uniquely specified by its vertices. This only happens with very long edges (for the WGS84 ellipsoid, any edge shorter than 19970 km is uniquely specified by its end points). In such cases, insert an additional vertex near the middle of the long edge to define the boundary of the polygon. 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 -r option 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 by Planimeter is 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 -s option 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. Arbitrarily complex polygons are allowed. In the case of self-intersecting polygons the area is accumulated "algebraically", e.g., the areas of the 2 loops in a figure-8 polygon will partially cancel. Polygons may include one or both poles. There is no need to close the polygon. OPTIONS
EXAMPLESExample (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' ' ACCURACYUsing the -G option (the default), the accuracy was estimated by computing the error in the area for 10^7 approximately regular polygons on the WGS84 ellipsoid. The centers and the orientations of the polygons were uniformly distributed, the number of vertices was log-uniformly distributed in [3, 300], and the center to vertex distance log-uniformly distributed in [0.1 m, 9000 km].The maximum error in the perimeter was 200 nm, and the maximum error in the area was 0.0013 m^2 for perimeter < 10 km 0.0070 m^2 for perimeter < 100 km 0.070 m^2 for perimeter < 1000 km 0.11 m^2 for all perimeters SEE ALSOGeoConvert(1), GeodSolve(1).An online version of this utility is availbable at <https://geographiclib.sourceforge.io/cgi-bin/Planimeter>. The algorithm for the area of geodesic polygon is given in Section 6 of C. F. F. Karney, Algorithms for geodesics, J. Geodesy 87, 43-55 (2013); DOI <https://doi.org/10.1007/s00190-012-0578-z>; addenda: <https://geographiclib.sourceforge.io/geod-addenda.html>. AUTHORPlanimeter was written by Charles Karney.HISTORYPlanimeter was added to GeographicLib, <https://geographiclib.sourceforge.io>, in version 1.4.
Visit the GSP FreeBSD Man Page Interface. |