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) | |
object & | operator= (const object &other) |
object & | operator= (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 handle & | dec_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 handle & | inc_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 |
Area of a geodesic polygon
Definition at line 51 of file polygonarea.py.
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.
|
private |
Count crossings of prime meridian for AddPoint.
Definition at line 54 of file polygonarea.py.
|
private |
Count crossings of prime meridian for AddEdge.
Definition at line 67 of file polygonarea.py.
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.
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.
def geographiclib.polygonarea.PolygonArea.Clear | ( | self | ) |
Reset to empty polygon.
Definition at line 108 of file polygonarea.py.
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.
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.
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.
|
private |
Definition at line 98 of file polygonarea.py.
|
private |
Definition at line 111 of file polygonarea.py.
|
private |
Definition at line 114 of file polygonarea.py.
|
private |
Definition at line 114 of file polygonarea.py.
|
private |
Definition at line 94 of file polygonarea.py.
|
private |
Definition at line 99 of file polygonarea.py.
|
staticprivate |
Definition at line 65 of file polygonarea.py.
|
staticprivate |
Definition at line 76 of file polygonarea.py.
geographiclib.polygonarea.PolygonArea.area0 |
Definition at line 92 of file polygonarea.py.
geographiclib.polygonarea.PolygonArea.earth |
Definition at line 88 of file polygonarea.py.
geographiclib.polygonarea.PolygonArea.lat1 |
Definition at line 102 of file polygonarea.py.
geographiclib.polygonarea.PolygonArea.lon1 |
Definition at line 104 of file polygonarea.py.
geographiclib.polygonarea.PolygonArea.num |
Definition at line 100 of file polygonarea.py.
geographiclib.polygonarea.PolygonArea.polyline |
Definition at line 90 of file polygonarea.py.