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 _Basequence: copy, dup

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
  isPoints2

Inherited from _Basequence: epsilon, isNumpy2, isTuple2

Inherited from object: __class__

Method Details

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

 

Handle LatLon points as pseudo-xy coordinates.

Arguments:
  • latlons - Points list, sequence, set, tuple, etc. (LatLon[]).
  • closed - Optionally, close the polygon (bool).
  • radius - Mean earth radius (meter).
  • wrap - If True, wrap or normalize and unroll the latlons points (bool).
Raises:
  • PointsError - Insufficient number of latlons.
  • TypeError - Some points are not base.
Overrides: object.__init__

Note: The LatLon latitude is considered the pseudo-y and longitude the pseudo-x coordinate, likewise for LatLon2Tuple. However, 2-tuples (x, y) are considered as (longitude, latitude).

__contains__ (self, xy)
(In operator)

 

Check for a matching point.

Arguments:
  • xy - Point (LatLon, LatLon2Tuple or 2-tuple (x, y)) in (degrees.
Returns:
True if xy is 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.

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

find (self, xy, *start_end)

 

Find the first matching point.

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

findall (self, xy, *start_end)

 

Yield indices of all matching points.

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

index (self, xy, *start_end)

 

Find the first matching point.

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

point (self, ll)

 

Create a pseudo-xy.

Arguments:
  • ll - Point (LatLon).
Returns:
An Point3Tuple(x, y, ll).
Overrides: _Basequence.point

rfind (self, xy, *start_end)

 

Find the last matching point.

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

Property Details

isPoints2

Get method:
isPoints2(self) - Is this a LatLon2 wrapper/converter?
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.