Coverage for pygeodesy/utmupsBase.py : 95%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# -*- coding: utf-8 -*-
for the UTM, UPS, Mgrs and Epsg classes/modules. '''
_NamedBase, nameof, _xattrs, _xnamed _TypeError, wrap90, wrap360
# _MAX_PSEUDO_ZONE = -1 # _MIN_PSEUDO_ZONE = -4 # _UTMUPS_ZONE_MATCH = -3 # _UTMUPS_ZONE_STANDARD = -1 # _UTM = -2
'''Return the hemisphere letter.
@param lat: Latitude (C{degrees} or C{radians}).
@return: C{'N'|'S'} for north-/southern hemisphere. '''
'''(INTERNAL) Return 4-tuple (C{lat, lon, datum, name}). ''' # if lon is not None: # raise AttributeError
'''Parse UTM/UPS zone, Band letter and hemisphere/pole letter.
@param zone: Zone with/-out Band (C{scalar} or C{str}). @keyword band: Optional (longitudinal/polar) Band letter (C{str}). @keyword hemipole: Optional hemisphere/pole letter (C{str}).
@return: 3-Tuple (C{zone, Band, hemisphere/pole}) as (C{int, str, 'N'|'S'}) where C{zone} is C{0} for UPS or C{1..60} for UTM and C{Band} is C{'A'..'Z'} I{NOT} checked for valid UTM/UPS bands.
@raise ValueError: Invalid B{C{zone}}, B{C{band}} or B{C{hemipole}}. ''' elif zone in 'AaBbYyZz': # single letter B = zone z = _UPS_ZONE
except (AttributeError, TypeError, ValueError): pass raise ValueError('%s, %s or %s invalid: %r' % ('zone', 'band', 'hemipole', (zone, B, hemipole)))
'''Wrap lat- and longitude and determine UTM zone.
@param lat: Latitude (C{degrees}). @param lon: Longitude (C{degrees}).
@return: 3-Tuple (C{zone, lat, lon}) as (C{int}, C{degrees90}, C{degrees180}) where C{zone} is C{1..60} for UTM. '''
'''Base class for L{Utm} and L{Ups} coordinates. ''' # _scale0 = _K0 #: (INTERNAL) Central scale factor (C{scalar}).
return self.toStr2(B=True)
def convergence(self): '''Get the meridian convergence (C{degrees}) or C{None}. '''
def datum(self): '''Get the datum (L{Datum}). '''
def easting(self): '''Get the easting (C{meter}). '''
'''Return easting and northing, falsed or unfalsed.
@keyword falsed: Return easting and northing falsed (C{bool}), otherwise unfalsed.
@return: An L{EasNor2Tuple}C{(easting, northing)}. ''' else:
def falsed(self): '''Get easting and northing falsed (C{bool}). '''
def falsed2(self): '''(INTERNAL) I{Must be overloaded}. ''' self._notOverloaded(self.falsed2.__name__)
def hemisphere(self): '''Get the hemisphere (C{str}, 'N'|'S'). '''
'''(INTERNAL) Convert cached LatLon ''' ll.convergence, ll.scale) ll, '_convergence', '_scale') else: raise _IsNotError(_LLEB.__name__, LatLon=LatLon)
def northing(self): '''Get the northing (C{meter}). '''
def scale(self): '''Get the grid scale (C{float}) or C{None}. '''
def scale0(self): '''Get the central scale factor (C{float}). '''
'''Determine the B{EPSG (European Petroleum Survey Group)} code.
@return: C{EPSG} code (C{int}).
@raise EPSGError: See L{Epsg}. '''
'''(INTERNAL) Return a string representation of this UTM/UPS coordinate. ''' fStr(self.northing, prec=prec)) degDMS(self.convergence, prec=8, pos='+'), 'n/a' if self.scale is None else fStr(self.scale, prec=8))
'''(INTERNAL) Return a string representation of this UTM/UPS coordinate. '''
# **) MIT License # # Copyright (C) 2016-2020 -- mrJean1 at Gmail -- All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy, modify, merge, publish, distribute, sublicense, # and/or sell copies of the Software, and to permit persons to whom the # Software is furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. |