Package pygeodesy :: Package geodesicx :: Module gxarea :: Class GeodesicAreaExact |
[frames] | no frames]

# Class GeodesicAreaExact

      object --+
               |
    named._Named --+
                   |
    named._NamedBase --+
                       |
                      GeodesicAreaExact

Known Subclasses:
  - PolygonArea

Area and perimeter of a geodesic polygon, an enhanced version of Karney's Python class PolygonArea using the more accurate surface area.

Note: The name of this class `*Exact` is a misnomer, see Karney's comments at C++ attribute GeodesicExact._c2.

Instance Methods
__init__(self, geodesic, polyline=False, name='') New GeodesicAreaExact instance. |
AddEdge(self, azi, s) Add another polygon edge. |
AddPoint(self, lat, lon) Add another polygon point. |
Compute(self, reverse=False, sign=True) Compute the accumulated perimeter and area. |
Reset(self) Reset this polygon to empty. |
Clear(self) Reset this polygon to empty. |
TestEdge(self, azi, s, reverse=False, sign=True) Compute the properties for a tentative, additional edge |
TestPoint(self, lat, lon, reverse=False, sign=True) Compute the properties for a tentative, additional vertex |
toStr(self, prec=6, sep=', ', **unused) Return this `GeodesicExactArea` as string. |
Inherited from `named._NamedBase`: `__repr__`, `__str__`, `others`, `toRepr` Inherited from `named._Named`: `__imatmul__`, `__matmul__`, `__rmatmul__`, `attrs`, `classof`, `copy`, `dup`, `methodname`, `rename`, `toStr2` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Properties
| area0x Get the ellipsoid's surface area (`meter` squared), more accurate for very oblate ellipsoids.
| area0 Get the ellipsoid's surface area (`meter` squared), more accurate for very oblate ellipsoids.
| ellipsoid Get this area's ellipsoid (`Ellipsoid[2]`).
| geodesic Get this area's geodesic object (`Geodesic[Exact]`).
| earth Get this area's geodesic object (`Geodesic[Exact]`).
| lat0 Get the first point's latitude (`degrees`).
| lat1 Get the most recent point's latitude (`degrees`).
| lon0 Get the first point's longitude (`degrees`).
| lon1 Get the most recent point's longitude (`degrees`).
| num Get the current number of points (`int`).
| polyline Is this perimter only (`boo`), area NAN?
| verbose Get the `verbose` option (`bool`).
Inherited from `named._Named`: `classname`, `classnaming`, `iteration`, `name`, `named`, `named2`, `named3`, `named4` Inherited from `object`: `__class__`

Method Details

### __init__ (self, geodesic, polyline=False, name='') (Constructor) |
New GeodesicAreaExact instance. Arguments: `geodesic` - A geodesic (GeodesicExact, wrapped `Geodesic` or GeodesicSolve). `polyline` - If `True` compute perimeter only, otherwise area and perimeter (`bool`). `name` - Optional name (`str`). Raises: `GeodesicError` - Invalid `geodesic`. Overrides: object.__init__

### AddEdge (self, azi, s) |
Add another polygon edge. Arguments: `azi` - Azimuth at the current point (compass `degrees`). `s` - Length of the edge (`meter`).

### AddPoint (self, lat, lon) |
Add another polygon point. Arguments: `lat` - Latitude of the point (`degrees`). `lon` - Longitude of the point (`degrees`).

### Compute (self, reverse=False, sign=True) |
Compute the accumulated perimeter and area. Arguments: `reverse` - If `True`, clockwise traversal counts as a positive area instead of counter-clockwise (`bool`). `sign` - If `True`, return a signed result for the area if the polygon is traversed in the "wrong" direction instead of returning the area for the rest of the earth. Returns: Area3Tuple`(number, perimeter, area)` with the number of points, the perimeter in `meter` and the area in `meter**2`. The perimeter includes the length of a final edge, connecting the current to the initial point, if this polygon was initialized with `polyline=False`. For perimeter only, i.e. `polyline=True`, area is `NAN`. Notes: 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. More points and edges can be added after this call.

### TestEdge (self, azi, s, reverse=False, sign=True) |
Compute the properties for a tentative, additional edge Arguments: `azi` - Azimuth at the current the point (compass `degrees`). `s` - Length of the edge (`meter`). `reverse` - If `True`, clockwise traversal counts as a positive area instead of counter-clockwise (`bool`). `sign` - If `True`, return a signed result for the area if the polygon is traversed in the "wrong" direction instead of returning the area for the rest of the earth. Returns: Area3Tuple`(number, perimeter, area)`. Raises: `GeodesicError` - No points.

### TestPoint (self, lat, lon, reverse=False, sign=True) |
Compute the properties for a tentative, additional vertex Arguments: `lat` - Latitude of the point (`degrees`). `lon` - Longitude of the point (`degrees`). `reverse` - If `True`, clockwise traversal counts as a positive area instead of counter-clockwise (`bool`). `sign` - If `True`, return a signed result for the area if the polygon is traversed in the "wrong" direction instead of returning the area for the rest of the earth. Returns: Area3Tuple`(number, perimeter, area)`.

### toStr (self, prec=6, sep=', ', **unused) |
Return this `GeodesicExactArea` as string. Arguments: `prec` - The `float` precision, number of decimal digits (0..9). Trailing zero decimals are stripped for `prec` values of 1 and above, but kept for negative `prec` values. `sep` - Separator to join (`str`). Returns: Area items (`str`). Overrides: named._Named.toStr

Property Details

### area0x Get the ellipsoid's surface area (`meter` squared), more accurate for very oblate ellipsoids. Get method: area0x(self) - Get the ellipsoid's surface area (`meter` squared), more accurate for very oblate ellipsoids. Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### area0 Get the ellipsoid's surface area (`meter` squared), more accurate for very oblate ellipsoids. Get method: area0x(self) - Get the ellipsoid's surface area (`meter` squared), more accurate for very oblate ellipsoids. Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### ellipsoid Get this area's ellipsoid (`Ellipsoid[2]`). Get method: ellipsoid(self) - Get this area's ellipsoid (`Ellipsoid[2]`). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### geodesic Get this area's geodesic object (`Geodesic[Exact]`). Get method: geodesic(self) - Get this area's geodesic object (`Geodesic[Exact]`). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### earth Get this area's geodesic object (`Geodesic[Exact]`). Get method: geodesic(self) - Get this area's geodesic object (`Geodesic[Exact]`). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### lat0 Get the first point's latitude (`degrees`). Get method: lat0(self) - Get the first point's latitude (`degrees`). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### lat1 Get the most recent point's latitude (`degrees`). Get method: lat1(self) - Get the most recent point's latitude (`degrees`). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### lon0 Get the first point's longitude (`degrees`). Get method: lon0(self) - Get the first point's longitude (`degrees`). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### lon1 Get the most recent point's longitude (`degrees`). Get method: lon1(self) - Get the most recent point's longitude (`degrees`). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### num Get the current number of points (`int`). Get method: num(self) - Get the current number of points (`int`). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### polyline Is this perimter only (`boo`), area NAN? Get method: polyline(self) - Is this perimter only (`boo`), area NAN? Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### verbose Get the `verbose` option (`bool`). Get method: verbose(self) - Get the `verbose` option (`bool`). Set method: verbose(self, verbose) - Set the `verbose` option (`bool`) to print a message after each method invokation. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.