Package pygeodesy :: Module points :: Class LatLon2psxy
[frames] | no frames]

Class LatLon2psxy

       object --+            
                |            
    _abcoll.Sized --+        
                    |        
       object --+   |        
                |   |        
 _abcoll.Iterable --+        
                    |        
       object --+   |        
                |   |        
_abcoll.Container --+        
                    |        
     _abcoll.Sequence --+    
                        |    
              _Basequence --+
                            |
                           LatLon2psxy

Wrapper for LatLon points as "on-the-fly" pseudo-xy coordinates.

Nested Classes

Inherited from _abcoll.Sized: __metaclass__

Instance Methods
 
__init__(self, latlons, closed=False, radius=None, wrap=True)
Handle LatLon points as pseudo-xy coordinates.
 
__contains__(self, xy)
Check for a matching point.
 
__getitem__(self, index)
Return the pseudo-xy or return a LatLon2psxy slice.
 
__iter__(self)
Yield all pseudo-xy's.
 
__len__(self)
Return the number of pseudo-xy's.
 
__repr__(self)
Return a string representation.
 
__reversed__(self)
Yield all pseudo-xy's in reverse order.
 
__str__(self)
Return a string representation.
integer
count(self, xy)
Count the number of matching points.
 
find(self, xy, *start_end)
Find the first matching point.
 
findall(self, xy, *start_end)
Yield indices of all matching points.
integer
index(self, xy, *start_end)
Find the first matching point.
 
point(self, ll)
Create a pseudo-xy.
 
rfind(self, xy, *start_end)
Find the last matching point.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__

Class Methods

Inherited from _abcoll.Sized: __subclasshook__

Class Variables
  __abstractmethods__ = frozenset([])
Properties
  epsilon
Get the tolerance for equality tests (float).
  isPoints2
Is this a Points2 wrapper/converter?

Inherited from object: __class__

Method Details

__init__(self, latlons, closed=False, radius=None, wrap=True)
(Constructor)

 

Handle LatLon points as pseudo-xy coordinates.

Parameters:
  • latlons - Points list, sequence, set, tuple, etc. (LatLon[]).
  • closed - Points form a closed polygon (bool).
  • radius - Optional, mean earth radius (meter).
  • wrap - Optionally, wrap90(lat) and wrap180(lon) (bool).
Raises:
  • TypeError - Some points are not LatLon.
  • ValueError - Too few points.
Overrides: object.__init__

Note: The LatLon's latitude is considered the pseudo-y and longitude the pseudo-x coordinate. Similarly, 2-tuples (x, y) are (longitude, latitude).

__contains__(self, xy)
(In operator)

 

Check for a matching point.

Parameters:
  • xy - Point (LatLon) or 2-tuple (x, y) in (degrees).
Returns:
True if present, False otherwise.
Raises:
  • TypeError - Invalid xy.
Overrides: _abcoll.Container.__contains__

__getitem__(self, index)
(Indexing operator)

 

Return the pseudo-xy or return a LatLon2psxy slice.

Overrides: _abcoll.Sequence.__getitem__

__iter__(self)

 

Yield all pseudo-xy's.

Overrides: _abcoll.Iterable.__iter__

__len__(self)
(Length operator)

 

Return the number of pseudo-xy's.

Overrides: _abcoll.Sized.__len__

__repr__(self)
(Representation operator)

 

Return a string representation.

Overrides: object.__repr__

__reversed__(self)

 

Yield all pseudo-xy's in reverse order.

Overrides: _abcoll.Sequence.__reversed__

__str__(self)
(Informal representation operator)

 

Return a string representation.

Overrides: object.__str__

count(self, xy)

 

Count the number of matching points.

Parameters:
  • xy - Point (LatLon) or 2-tuple (x, y) in (degrees).
Returns: integer
Count (integer).
Raises:
  • TypeError - Invalid xy.
Overrides: _abcoll.Sequence.count

find(self, xy, *start_end)

 

Find the first matching point.

Parameters:
  • xy - Point (LatLon) or 2-tuple (x, y) in (degrees).
  • start_end - Optional [start [, end]] index (integers).
Returns:
Index or -1 if not found (integer).
Raises:
  • TypeError - Invalid xy.

findall(self, xy, *start_end)

 

Yield indices of all matching points.

Parameters:
  • xy - Point (LatLon) or 2-tuple (x, y) in (degrees).
  • start_end - Optional [start [, end]] index (integers).
Returns:
Indices (iterator).
Raises:
  • TypeError - Invalid xy.

index(self, xy, *start_end)

 

Find the first matching point.

Parameters:
  • xy - Point (LatLon) or 2-tuple (x, y) in (degrees).
  • start_end - Optional [start [, end]] index (integers).
Returns: integer
Index (integer).
Raises:
  • TypeError - Invalid xy.
  • ValueError - Point not found.
Overrides: _abcoll.Sequence.index

point(self, ll)

 

Create a pseudo-xy.

Parameters:
  • ll - Point (LatLon).
Returns:
3-Tuple (x, y, ll) of (float, float, ll).
Overrides: _Basequence.point

rfind(self, xy, *start_end)

 

Find the last matching point.

Parameters:
  • xy - Point (LatLon) or 2-tuple (x, y) in (degrees).
  • start_end - Optional [start [, end]] index (integers).
Returns:
Index or -1 if not found (integer).
Raises:
  • TypeError - Invalid xy.

Property Details

epsilon

Get the tolerance for equality tests (float).

Get Method:
epsilon(self) - Get the tolerance for equality tests (float).
Set Method:
epsilon(self, eps) - Set the tolerance for equality tests.

isPoints2

Is this a Points2 wrapper/converter?

Get Method:
isPoints2(self) - Is this a Points2 wrapper/converter?