def _update(self, updated, *attrs):  # PYCHOK args
     '''(INTERNAL) Zap cached attributes if updated.
     '''
     if updated:
         LatLonNvectorBase._update(self, updated,
                                   _Nv=self._Nv)  # special case
         LatLonEllipsoidalBase._update(self, updated, '_r3', *attrs)
 def _update(self, updated, *attrs):
     '''(INTERNAL) Zap cached attributes if updated.
     '''
     if updated:
         if self._Nv:
             self._Nv._fromll = None
             self._Nv = None
         LatLonNvectorBase._update(self, updated, '_r3', *attrs)
         LatLonEllipsoidalBase._update(self, updated, *attrs)
 def _update(self, updated):
     '''(INTERNAL) Clear caches if updated.
     '''
     if updated:  # reset caches
         if self._Nv:
             self._Nv._fromll = None
             self._Nv = None
         self._r3 = None
         LatLonNvectorBase._update(self, updated)
         LatLonEllipsoidalBase._update(self, updated)
    def toCartesian(self, **kwds):  # PYCHOK Cartesian=Cartesian, datum=None
        '''Convert this point to an C{Nvector}-based geodetic point.

           @keyword kwds: Optional, additional B{C{LatLon}} keyword
                          arguments, ignored if C{B{LatLon}=None}.
                          Specify C{LatLon=...} to override this
                          L{LatLon} class or set C{B{LatLon}=None}.

           @return: The B{C{LatLon}} point (L{LatLon}) or when
                    C{B{LatLon}=None}, an L{Ecef9Tuple}C{(x, y, z,
                    lat, lon, height, C, M, datum)} with C{C} and
                    C{M} if available.

           @raise TypeError: Invalid B{C{LatLon}} or B{C{kwds}}.
        '''
        kwds = _2kwds(kwds, Cartesian=Cartesian, datum=self.datum)
        return LatLonEllipsoidalBase.toCartesian(self, **kwds)
    def toCartesian(self, **Cartesian_datum_kwds):  # PYCHOK Cartesian=Cartesian, datum=None
        '''Convert this point to an C{Nvector}-based geodetic point.

           @kwarg Cartesian_datum_kwds: Optional L{Cartesian}, B{C{datum}}
                                        and other keyword arguments, ignored
                                        if B{C{Cartesian=None}}.  Use
                                        B{C{Cartesian=...}} to override this
                                        L{Cartesian} class or specify
                                        B{C{Cartesian=None}}.

           @return: The geodetic point (L{LatLon}) or if B{C{LatLon}}
                    is C{None}, an L{Ecef9Tuple}C{(x, y, z, lat, lon,
                    height, C, M, datum)} with C{C} and C{M} if available.

           @raise TypeError: Invalid B{C{LatLon}} or other
                             B{C{Cartesian_datum_kwds}}.
        '''
        kwds = _xkwds(Cartesian_datum_kwds, Cartesian=Cartesian, datum=self.datum)
        return LatLonEllipsoidalBase.toCartesian(self, **kwds)
    def toCartesian(self, **kwds):  # PYCHOK Cartesian=Cartesian, datum=None
        '''Convert this point to C{Karney}-based cartesian (ECEF)
           coordinates.

           @keyword kwds: Optional, additional B{C{Cartesian}} keyword
                          arguments, ignored if C{B{Cartesian}=None}.
                          For example, use C{Cartesian=...} to override
                          the L{Cartesian} (sub-)class or specify
                          C{B{Cartesian}=None}.

           @return: The B{C{Cartesian}} point (L{Cartesian}) or if
                    C{B{Cartesian}=None}, an L{Ecef9Tuple}C{(x, y, z,
                    lat, lon, height, C, M, datum)} with C{C} and C{M}
                    if available.

           @raise TypeError: Invalid B{C{Cartesian}}, B{C{datum}}
                             or B{C{kwds}}.
        '''
        kwds = _2kwds(kwds, Cartesian=Cartesian, datum=self.datum)
        return LatLonEllipsoidalBase.toCartesian(self, **kwds)
    def isequalTo(self, other, eps=None):
        '''Compare this point with an other point.

           @param other: The other point (L{LatLon}).
           @keyword eps: Optional margin (C{float}).

           @return: C{True} if points are identical, including
                    datum, I{ignoring height}, C{False} otherwise.

           @raise TypeError: The B{C{other}} point is not L{LatLon}.

           @see: Use method L{isequalTo3} to include I{height}.

           @example:

           >>> p = LatLon(52.205, 0.119)
           >>> q = LatLon(52.205, 0.119)
           >>> e = p.isequalTo(q)  # True
        '''
        return LatLonEllipsoidalBase.isequalTo(self, other, eps=eps) \
               if self.datum == other.datum else False
 def _xcopy(self, *attrs):
     '''(INTERNAL) Make copy with add'l, subclass attributes.
     '''
     return LatLonEllipsoidalBase._xcopy(self, '_epsilon', '_iterations', *attrs)