Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
geographiclib.polygonarea.PolygonArea Class Reference
Inheritance diagram for geographiclib.polygonarea.PolygonArea:
Inheritance graph
[legend]

Public Member Functions

def __init__ (self, earth, polyline=False)
 
def AddEdge (self, azi, s)
 
def AddPoint (self, lat, lon)
 
def Clear (self)
 
def Compute (self, reverse=False, sign=True)
 
def TestEdge (self, azi, s, reverse=False, sign=True)
 
def TestPoint (self, lat, lon, reverse=False, sign=True)
 
- Public Member Functions inherited from object
template<typename T >
T cast () const &
 
template<typename T >
T cast () &&
 
template<typename T >
T cast () const &
 
template<typename T >
T cast () &&
 
template<>
void cast () const &
 
template<>
void cast () &&
 
 object ()=default
 
 object (const object &o)
 Copy constructor; always increases the reference count. More...
 
 object (object &&other) noexcept
 Move constructor; steals the object from other and preserves its reference count. More...
 
 object (handle h, borrowed_t)
 
 object (handle h, stolen_t)
 
objectoperator= (const object &other)
 
objectoperator= (object &&other) noexcept
 
 PYBIND11_DEPRECATED ("Use reinterpret_borrow<object>() or reinterpret_steal<object>()") object(handle h
 
handle release ()
 
 ~object ()
 Destructor; automatically calls handle::dec_ref() More...
 
- Public Member Functions inherited from handle
template<typename T >
T cast () const
 
template<>
void cast () const
 
bool check () const
 
const handledec_ref () const &
 
 handle ()=default
 The default constructor creates a handle with a nullptr-valued pointer. More...
 
template<typename T , detail::enable_if_t< detail::is_pyobj_ptr_or_nullptr_t< T >::value, int > = 0>
 handle (T ptr)
 
template<typename T , detail::enable_if_t< detail::all_of< detail::none_of< std::is_base_of< handle, T >, detail::is_pyobj_ptr_or_nullptr_t< T >>, std::is_convertible< T, PyObject *>>::value, int > = 0>
 handle (T &obj)
 Enable implicit conversion through T::operator PyObject *(). More...
 
const handleinc_ref () const &
 
 operator bool () const
 Return true when the handle wraps a valid Python object. More...
 
bool operator!= (const handle &h) const
 
bool operator== (const handle &h) const
 
PyObject * ptr () const
 Return the underlying PyObject * pointer. More...
 
PyObject *& ptr ()
 

Public Attributes

 area0
 
 earth
 
 lat1
 
 lon1
 
 num
 
 polyline
 
- Public Attributes inherited from object
bool is_borrowed: handle(h) { if (is_borrowed) { inc_ref()
 

Private Member Functions

def _transit (lon1, lon2)
 
def _transitdirect (lon1, lon2)
 

Private Attributes

 _areasum
 
 _crossings
 
 _lat0
 
 _lon0
 
 _mask
 
 _perimetersum
 

Static Private Attributes

 _transit = staticmethod(_transit)
 
 _transitdirect = staticmethod(_transitdirect)
 

Additional Inherited Members

- Static Public Member Functions inherited from handle
static std::size_t inc_ref_counter ()
 
- Protected Attributes inherited from handle
PyObject * m_ptr = nullptr
 

Detailed Description

Area of a geodesic polygon

Definition at line 51 of file polygonarea.py.

Constructor & Destructor Documentation

◆ __init__()

def geographiclib.polygonarea.PolygonArea.__init__ (   self,
  earth,
  polyline = False 
)
Construct a PolygonArea object

:param earth: a :class:`~geographiclib.geodesic.Geodesic` object
:param polyline: if true, treat object as a polyline instead of a polygon

Initially the polygon has no vertices.

Definition at line 78 of file polygonarea.py.

Member Function Documentation

◆ _transit()

def geographiclib.polygonarea.PolygonArea._transit (   lon1,
  lon2 
)
private
Count crossings of prime meridian for AddPoint.

Definition at line 54 of file polygonarea.py.

◆ _transitdirect()

def geographiclib.polygonarea.PolygonArea._transitdirect (   lon1,
  lon2 
)
private
Count crossings of prime meridian for AddEdge.

Definition at line 67 of file polygonarea.py.

◆ AddEdge()

def geographiclib.polygonarea.PolygonArea.AddEdge (   self,
  azi,
  s 
)
Add the next edge to the polygon

:param azi: the azimuth at the current the point in degrees
:param s: the length of the edge in meters

This specifies the new vertex in terms of the edge from the current
vertex.

Definition at line 139 of file polygonarea.py.

◆ AddPoint()

def geographiclib.polygonarea.PolygonArea.AddPoint (   self,
  lat,
  lon 
)
Add the next vertex to the polygon

:param lat: the latitude of the point in degrees
:param lon: the longitude of the point in degrees

This adds an edge from the current vertex to the new vertex.

Definition at line 116 of file polygonarea.py.

◆ Clear()

def geographiclib.polygonarea.PolygonArea.Clear (   self)
Reset to empty polygon.

Definition at line 108 of file polygonarea.py.

◆ Compute()

def geographiclib.polygonarea.PolygonArea.Compute (   self,
  reverse = False,
  sign = True 
)
Compute the properties of the polygon

:param reverse: if true then clockwise (instead of
  counter-clockwise) traversal counts as a positive area
:param sign: if true then 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
:return: a tuple of number, perimeter (meters), area (meters^2)

If the object is a polygon (and not a polygon), the perimeter
includes the length of a final edge connecting the current point to
the initial point.  If the object is a polyline, then area is nan.

More points can be added to the polygon after this call.

Definition at line 162 of file polygonarea.py.

◆ TestEdge()

def geographiclib.polygonarea.PolygonArea.TestEdge (   self,
  azi,
  s,
  reverse = False,
  sign = True 
)
Compute the properties for a tentative additional edge

:param azi: the azimuth at the current the point in degrees
:param s: the length of the edge in meters
:param reverse: if true then clockwise (instead of
  counter-clockwise) traversal counts as a positive area
:param sign: if true then 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
:return: a tuple of number, perimeter (meters), area (meters^2)

Definition at line 273 of file polygonarea.py.

◆ TestPoint()

def geographiclib.polygonarea.PolygonArea.TestPoint (   self,
  lat,
  lon,
  reverse = False,
  sign = True 
)
Compute the properties for a tentative additional vertex

:param lat: the latitude of the point in degrees
:param lon: the longitude of the point in degrees
:param reverse: if true then clockwise (instead of
  counter-clockwise) traversal counts as a positive area
:param sign: if true then 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
:return: a tuple of number, perimeter (meters), area (meters^2)

Definition at line 216 of file polygonarea.py.

Member Data Documentation

◆ _areasum

geographiclib.polygonarea.PolygonArea._areasum
private

Definition at line 98 of file polygonarea.py.

◆ _crossings

geographiclib.polygonarea.PolygonArea._crossings
private

Definition at line 111 of file polygonarea.py.

◆ _lat0

geographiclib.polygonarea.PolygonArea._lat0
private

Definition at line 114 of file polygonarea.py.

◆ _lon0

geographiclib.polygonarea.PolygonArea._lon0
private

Definition at line 114 of file polygonarea.py.

◆ _mask

geographiclib.polygonarea.PolygonArea._mask
private

Definition at line 94 of file polygonarea.py.

◆ _perimetersum

geographiclib.polygonarea.PolygonArea._perimetersum
private

Definition at line 99 of file polygonarea.py.

◆ _transit

geographiclib.polygonarea.PolygonArea._transit = staticmethod(_transit)
staticprivate

Definition at line 65 of file polygonarea.py.

◆ _transitdirect

geographiclib.polygonarea.PolygonArea._transitdirect = staticmethod(_transitdirect)
staticprivate

Definition at line 76 of file polygonarea.py.

◆ area0

geographiclib.polygonarea.PolygonArea.area0

Definition at line 92 of file polygonarea.py.

◆ earth

geographiclib.polygonarea.PolygonArea.earth

Definition at line 88 of file polygonarea.py.

◆ lat1

geographiclib.polygonarea.PolygonArea.lat1

Definition at line 102 of file polygonarea.py.

◆ lon1

geographiclib.polygonarea.PolygonArea.lon1

Definition at line 104 of file polygonarea.py.

◆ num

geographiclib.polygonarea.PolygonArea.num

Definition at line 100 of file polygonarea.py.

◆ polyline

geographiclib.polygonarea.PolygonArea.polyline

Definition at line 90 of file polygonarea.py.


The documentation for this class was generated from the following file:


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:46:12