Package pygeodesy :: Module geodesici :: Class Intersector
[frames] | no frames]

Class Intersector

  object --+            
           |            
named._Named --+        
               |        
named._NamedBase --+    
                   |    
      _IntersectBase --+
                       |
                      Intersector

Finder of intersections between two goedesic lines, each an instance of GeodesicLineExact, wrapped GeodesicLine or GeodesicLineSolve.


See Also: Karney's C++ class Intersect for more details.

Instance Methods
 
__init__(self, geodesic, **name)
New Intersector.
 
All(self, glA, glB, X0=None, aMaX0=0, **sMaX0_C)
Yield all intersection of two geodesic lines up to a limit.
 
All5(self, glA, glB, X0=XDict(c=0, sA=0.0, sB=0.0, sX0=0.0), **aMaX0_sMaX0_C)
Yield all intersection of two geodesic lines up to a limit.
 
Closest(self, glA, glB, X0=XDict(c=0, sA=0.0, sB=0.0, sX0=0.0), **_C)
Find the closest intersection of two geodesic lines.
 
Closest5(self, glA, glB, X0=XDict(c=0, sA=0.0, sB=0.0, sX0=0.0))
Find the closest intersection of two geodesic lines.
 
Line(self, lat1, lon1, azi1_lat2, *lon2, **name)
Return a geodesic line from this Intersector's geodesic, specified by two (goedetic) points or a (goedetic) point and an (initial) azimuth.
 
Middle(self, glA, glB, raiser=True, **_C)
Get the mid-points on two geodesic line segments.
 
Middle5(self, glA, glB, raiser=True)
Get the mid-points of two geodesic line segments and distances.
 
Next(self, glA, glB, eps1=None, **_C)
Yield the next intersection of two intersecting geodesic lines.
 
Next5(self, glA, glB, **eps1)
Yield the next intersection of two intersecting geodesic lines.
 
Segment(self, glA, glB, proven=None, raiser=True, **_C)
Find the intersection between two geodesic line segments.
 
Segment5(self, glA, glB, **proven_raiser)
Find the intersection between two geodesic line segments.
 
toStr(self, **prec_sep_name)
Return this Intersector as string.

Inherited from _IntersectBase: Next5s, intersect7, k2kAkB

Inherited from named._NamedBase: __repr__, __str__, others, toRepr

Inherited from named._Named: __imatmul__, __matmul__, __rmatmul__, attrs, classof, copy, dup, methodname, rename, renamed, toStr2

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

Properties
  Delta

Inherited from _IntersectBase: R, a, datum, ellipsoid, equatoradius, f, flattening, geodesic

Inherited from named._Named: classname, classnaming, iteration, name, named, named2, named3, named4, sizeof

Inherited from object: __class__

Method Details

__init__ (self, geodesic, **name)
(Constructor)

 

New Intersector.

Arguments:
Raises:
  • GeodesicError - The eccentricity of the geodesic's ellipsoid is too large or no initial convergence.
Overrides: object.__init__

See Also: The Note at Karney's C++ Intersect.

All (self, glA, glB, X0=None, aMaX0=0, **sMaX0_C)

 

Yield all intersection of two geodesic lines up to a limit.

Arguments:
  • glA - A geodesic line (Line).
  • glB - An other geodesic line (Line).
  • X0 - Optional origin for L1-distances (XDict) or None for the Middle of both lines if both are a 4-args Line or InverseLine, otherwise XDiff_(0, 0).
  • aMaX0 - Upper limit for the angular L1-distance (degrees) or None or 0 for unlimited.
  • sMaX0_C - Optional, upper limit sMaX0=2*PI*R for the L1-distance to X0 (meter) and option _C=False to include the intersection lat-/ longitudes latA, lonA, latB, lonB and distances sAB and aSB.
Returns:
Yield an XDict for each intersection found.
Raises:
Overrides: _IntersectBase.All

All5 (self, glA, glB, X0=XDict(c=0, sA=0.0, sB=0.0, sX0=0.0), **aMaX0_sMaX0_C)

 

Yield all intersection of two geodesic lines up to a limit.

Returns:
Yield an Intersector5Tuple(A, B, sAB, aAB, c) for each intersection found.

See Also: Methods All for further details.

Closest (self, glA, glB, X0=XDict(c=0, sA=0.0, sB=0.0, sX0=0.0), **_C)

 

Find the closest intersection of two geodesic lines.

Arguments:
  • glA - A geodesic line (Line).
  • glB - An other geodesic line (Line).
  • X0 - Optional origin for L1-closeness (XDict).
  • _C - If True, include the lat-/longitudes latA, lonA, latB, lonB oon and distances sAB and aSB between the intersections.
Returns:
The intersection (XDict) or None if none found.
Raises:

Closest5 (self, glA, glB, X0=XDict(c=0, sA=0.0, sB=0.0, sX0=0.0))

 

Find the closest intersection of two geodesic lines.

Returns:
An Intersector5Tuple(A, B, sAB, aAB, c) or None if none found.

See Also: Method Closest for further details.

Line (self, lat1, lon1, azi1_lat2, *lon2, **name)

 

Return a geodesic line from this Intersector's geodesic, specified by two (goedetic) points or a (goedetic) point and an (initial) azimuth.

Arguments:
  • lat1 - Latitude of the first point (degrees).
  • lon1 - Longitude of the first point (degrees).
  • azi1_lat2 - Azimuth at the first point (compass degrees) if no lon2 argument is given, otherwise the latitude of the second point (degrees).
  • lon2 - If given, the longitude of the second point (degrees).
  • name - Optional name=NN (str).
Returns:
A line (from geodesic.Line or .InverseLine method) with LINE_CAPS.
Overrides: _IntersectBase.Line

Middle (self, glA, glB, raiser=True, **_C)

 

Get the mid-points on two geodesic line segments.

Arguments:
  • glA - A geodesic line (Line, 4-args).
  • glB - An other geodesic line (Line, 4-args).
  • raiser - If True, check that glA and glB are a 4-args Line or InverseLine (bool).
  • _C - If True, include the lat-/longitudes latA, lonA, latB, lonB of the mid-points and half-lengths sA and sB in meter of the respective line segments.
Returns:
The mid-point and half-length of each segment (XDict), _C above.
Raises:
  • GeodesicError - Geodesic line glA or glB invalid, incompatible, ill-configured or not a 4-args Line or other InverseLine.

Middle5 (self, glA, glB, raiser=True)

 

Get the mid-points of two geodesic line segments and distances.

Returns:
A Middle5Tuple(A, B, sMM, aMM, c).

See Also: Method Middle for further details.

Next (self, glA, glB, eps1=None, **_C)

 

Yield the next intersection of two intersecting geodesic lines.

Arguments:
  • glA - A geodesic line (Line).
  • glB - An other geodesic line (Line).
  • eps1 - Optional margin for the euclidean distance (degrees) between the (lat1, lon1) points of both lines or None for unchecked.
  • _C - If True, include the lat-/longitudes latA, lonA, latB, lonB of and distances sAB and aSB between the intersections.
Returns:
The intersection (XDict) or None if none found.
Raises:

Note: Offset X0 is implicit, zeros.

Next5 (self, glA, glB, **eps1)

 

Yield the next intersection of two intersecting geodesic lines.

Returns:
An Intersector5Tuple(A, B, sAB, aAB, c) or None if none found.

See Also: Method Next for further details.

Segment (self, glA, glB, proven=None, raiser=True, **_C)

 

Find the intersection between two geodesic line segments.

Arguments:
  • proven - Conjecture is that whenever two geodesic line segments intersect, the intersection is the one closest to the mid-points of segments. If so, use proven=True, otherwise find intersections on the segments and specify proven=None to return the first or proven=False the closest (bool).
  • raiser - If True, check that glA and glB are a 4-args Line or InverseLine (bool).
  • _C - If True, include the lat-/longitudes latA, lonA, latB, lonB of and distances sAB and aSB between the intersections.
Returns:
The intersection of the segments (XDict) with indicators kA, kB and k set or if no intersection is found, None.
Raises:
  • GeodesicError - Geodesic line glA or glB invalid, incompatible, ill-configured or not an InverseLine or 4-args Line.
  • IntersectionError - No convergence.

See Also: Method Middle for further details.

Segment5 (self, glA, glB, **proven_raiser)

 

Find the intersection between two geodesic line segments.

Returns:
An Intersector5Tuple(A, B, sAB, aAB, c) or None if none found.

See Also: Method Segment for further details.

toStr (self, **prec_sep_name)

 

Return this Intersector as string.

Returns:
Intersector (str).
Overrides: named._Named.toStr

See Also: Ellipsoid.toStr for further details.


Property Details

Delta

Get method:
_fget(inst) - Get and cache/memoize the property value.
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.