Coverage for pygeodesy/deprecated/__init__.py: 95%

120 statements  

« prev     ^ index     » next       coverage.py v7.2.2, created at 2023-05-20 11:54 -0400

1 

2# -*- coding: utf-8 -*- 

3 

4u'''DEPRECATED constants, classes, functions, methods, etc. 

5 

6Kept and exported for backward compatibility, including deprecated modules 

7C{pygeodesy.bases}, C{pygeodesy.datum} and C{pygeodesy,nvector}, previously 

8inside the C{pygeodesy} package. 

9 

10Use either C{from pygeodesy import bases} or C{from pygeodesy.deprecated import 

11bases}. Likewise for C{datum} and C{nvector}. 

12''' 

13 

14from pygeodesy.constants import EPS, EPS_2, MANT_DIG, NAN, R_M, \ 

15 float0_, _float, _1_0 

16from pygeodesy.interns import NN, _azi12_, _COMMASPACE_, _convergence_, \ 

17 _DEPRECATED_, _down_, _east_, _easting_, _end_, \ 

18 _hemipole_, _lat_, _lat1_, _lat2_, _lon_, _lon1_, \ 

19 _lon2_, _negative_, _north_, _northing_, _s_, \ 

20 _s12_, _S12_, _scalar_, _scale_, _sep_, _SPACE_, \ 

21 _start_, _sx_, _sy_, _sz_, _tx_, _ty_, _tz_, \ 

22 _UNDER_, _value_, _zone_ 

23from pygeodesy.lazily import _ALL_LAZY, _ALL_MODS as _MODS, isLazy 

24from pygeodesy.named import _NamedTuple, _Pass 

25from pygeodesy.props import deprecated_class, deprecated_function, deprecated_method 

26from pygeodesy.units import Degrees, Easting, Float, Int, Lat, Lon, Meter, Northing, \ 

27 Number_, Scalar, Scalar_, Str 

28if isLazy: # XXX force import of all deprecated modules 

29 import pygeodesy.deprecated.bases as bases, \ 

30 pygeodesy.deprecated.datum as datum, \ 

31 pygeodesy.deprecated.nvector as nvector # PYCHOK unused 

32 # XXX instead, use module_property or enhance .lazily 

33 

34__all__ = _ALL_LAZY.deprecated 

35__version__ = '23.04.14' 

36 

37_WGS84 = _UTM = object() 

38 

39 

40class _Deprecated_Float(Float): 

41 '''DEPRECATED, don't use.''' 

42 pass 

43 

44EPS1_2 = _Deprecated_Float(EPS1_2=_1_0 - EPS_2) # PYCHOK floats 

45 

46 

47class _Deprecated_Int(Int): 

48 '''DEPRECATED, don't use.''' 

49 pass 

50 

51MANTIS = _Deprecated_Int(MANTIS=MANT_DIG) # PYCHOK ints 

52 

53 

54class _Deprecated_Str(Str): 

55 '''DEPRECATED, don't use.''' 

56 pass 

57 

58OK = _Deprecated_Str(OK='OK') # PYCHOK strs 

59 

60 

61class _DeprecatedNamedTuple(_NamedTuple): 

62 '''(INTERNAL) Base class for DEPRECATED C{_NamedTuple} classes. 

63 ''' 

64 def __new__(cls, *args, **kwds): 

65 deprecated_class(cls) 

66 return _NamedTuple.__new__(cls, *args, **kwds) 

67 

68 

69# DEPRECATED classes, for export and backward compatibility only 

70class ClipCS3Tuple(_DeprecatedNamedTuple): # PYCHOK no cover 

71 '''DEPRECATED, see function L{pygeodesy.clipCS3}.''' 

72 _Names_ = (_start_, _end_, 'index') 

73 _Units_ = (_Pass, _Pass, Number_) 

74 

75 

76def EcefCartesian(*args, **kwds): 

77 '''DEPRECATED, use class L{LocalCartesian}.''' 

78 LocalCartesian = _MODS.ltp.LocalCartesian 

79 

80 class EcefCartesian(LocalCartesian): 

81 '''DEPRECATED, use class L{LocalCartesian}. 

82 

83 @note: This class is named I{incorrectly}, since it provides conversion to 

84 and from I{local} cartesian coordinates in a I{local tangent plane} 

85 and I{not geocentric} (ECEF) ones, as the name suggests. 

86 ''' 

87 def __init__(self, latlonh0=0, lon0=0, height0=0, ecef=None, name=NN): 

88 deprecated_class(self.__class__) 

89 LocalCartesian.__init__(self, latlonh0=latlonh0, lon0=lon0, height0=height0, ecef=ecef, name=name) 

90 

91 @deprecated_method 

92 def forward(self, latlonh, lon=None, height=0, M=False, name=NN): 

93 '''DEPRECATED, use method L{LocalCartesian.forward}. 

94 

95 @return: I{Incorrectly}, an L{Ecef9Tuple}C{(x, y, z, lat, lon, height, C, 

96 M, datum)} with I{local} C{(x, y, z)} coordinates for the given 

97 I{geodetic} ones C{(lat, lon, height)}, case C{C=0} always, 

98 optionally I{concatenated} L{EcefMatrix} C{M} and C{datum}. 

99 ''' 

100 t = LocalCartesian.forward(self, latlonh, lon=lon, height=height, M=M, name=name) 

101 return _MODS.ecef.Ecef9Tuple(t.x, t.y, t.z, t.lat, t.lon, t.height, 

102 0, t.M, t.ecef.datum, 

103 name=t.name or self.name) 

104 

105 @deprecated_method 

106 def reverse(self, xyz, y=None, z=None, M=False, name=NN): 

107 '''DEPRECATED, use method L{LocalCartesian.reverse}. 

108 

109 @return: I{Incorrectly}, an L{Ecef9Tuple}C{(x, y, z, lat, lon, height, C, 

110 M, datum)} with I{geodetic} coordinates C{(lat, lon, height)} for 

111 the given I{local} ones C{(x, y, z)}, case C{C}, optionally 

112 I{concatenated} L{EcefMatrix} C{M} and C{datum}. 

113 ''' 

114 t = LocalCartesian.reverse(self, xyz, y=y, z=z, M=M, name=name) 

115 return _MODS.ecef.Ecef9Tuple(t.x, t.y, t.z, t.lat, t.lon, t.height, 

116 t.ecef.C, t.M, t.ecef.datum, 

117 name=t.name or self.name) 

118 

119 _MODS.deprecated.EcefCartesian = EcefCartesian 

120 return EcefCartesian(*args, **kwds) 

121 

122 

123class EasNorExact4Tuple(_DeprecatedNamedTuple): 

124 '''DEPRECATED, use class L{Forward4Tuple}.''' 

125 _Names_ = (_easting_, _northing_, _convergence_, _scale_) 

126 _Units_ = ( Easting, Northing, Degrees, Scalar) 

127 

128 

129def HeightIDW(knots, **kwds): # PYCHOK no cover 

130 '''DEPRECATED, use class L{HeightIDWeuclidean}.''' 

131 HeightIDWeuclidean = _MODS.heights.HeightIDWeuclidean 

132 

133 class HeightIDW(HeightIDWeuclidean): 

134 '''DEPRECATED, use class L{HeightIDWeuclidean}.''' 

135 def __init__(self, knots, adjust=True, beta=2, name=NN): 

136 deprecated_class(self.__class__) 

137 HeightIDWeuclidean.__init__(self, knots, adjust=adjust, beta=beta, name=name) 

138 

139 _MODS.deprecated.HeightIDW = HeightIDW 

140 return HeightIDW(knots, **kwds) 

141 

142 

143def HeightIDW2(knots, **kwds): # PYCHOK no cover 

144 '''DEPRECATED, use class L{HeightIDWequirectangular}.''' 

145 HeightIDWequirectangular = _MODS.heights.HeightIDWequirectangular 

146 

147 class HeightIDW2(HeightIDWequirectangular): 

148 '''DEPRECATED, use class L{HeightIDWequirectangular}.''' 

149 def __init__(self, knots, adjust=True, wrap=False, name=NN): 

150 deprecated_class(self.__class__) 

151 HeightIDWequirectangular.__init__(self, knots, adjust=adjust, wrap=wrap, name=name) 

152 

153 _MODS.deprecated.HeightIDW2 = HeightIDW2 

154 return HeightIDW2(knots, **kwds) 

155 

156 

157def HeightIDW3(knots, **kwds): # PYCHOK no cover 

158 '''DEPRECATED, use class L{HeightIDWhaversine}.''' 

159 HeightIDWhaversine = _MODS.heights.HeightIDWhaversine 

160 

161 class HeightIDW3(HeightIDWhaversine): 

162 '''DEPRECATED, use class L{HeightIDWhaversine}. 

163 ''' 

164 def __init__(self, knots, beta=2, wrap=False, name=NN): 

165 deprecated_class(self.__class__) 

166 HeightIDWhaversine.__init__(self, knots, beta=beta, wrap=wrap, name=name) 

167 

168 _MODS.deprecated.HeightIDW3 = HeightIDW3 

169 return HeightIDW3(knots, **kwds) 

170 

171 

172class LatLonExact4Tuple(_DeprecatedNamedTuple): 

173 '''DEPRECATED, used class L{Reverse4Tuple}.''' 

174 _Names_ = (_lat_, _lon_, _convergence_, _scale_) 

175 _Units_ = ( Lat, Lon, Degrees, Scalar) 

176 

177 

178class Ned3Tuple(_DeprecatedNamedTuple): # was in .ellipsoidalNvector 

179 '''DEPRECATED, use class L{pygeodesy.Ned4Tuple}.''' 

180 _Names_ = (_north_, _east_, _down_) 

181 _Units_ = ( Meter, Meter, Meter) 

182 

183 

184def RefFrameError(*args, **kwds): # PYCHOK no cover 

185 '''DEPRECATED, use class L{TRFError}.''' 

186 TRFError = _MODS.errors.TRFError 

187 

188 class RefFrameError(TRFError): 

189 '''DEPRECATED, use class L{TRFError}. 

190 ''' 

191 def __init__(self, *name_value, **txt_name_values): 

192 deprecated_class(self.__class__) 

193 TRFError.__init__(self, *name_value, **txt_name_values) 

194 

195 _MODS.deprecated.RefFrameError = RefFrameError 

196 return RefFrameError(*args, **kwds) 

197 

198 

199class Rhumb7Tuple(_DeprecatedNamedTuple): 

200 '''DEPRECATED, use class L{Rhumb8Tuple} ignoring item C{a12}.''' 

201 _Names_ = (_lat1_, _lon1_, _lat2_, _lon2_, _azi12_, _s12_, _S12_) 

202 _Units_ = (_Pass, _Pass, _Pass, _Pass, _Pass, _Pass, _Pass) 

203 

204 @deprecated_method 

205 def toDirect9Tuple(self, **kwds): 

206 return self.toRhumb8Tuple().toDirect9Tuple(self, **kwds) 

207 

208 @deprecated_method 

209 def toGDict(self, **kwds): 

210 return self.toRhumb8Tuple().toGDict(**kwds) 

211 

212 @deprecated_method 

213 def toInverse10Tuple(self, **kwds): 

214 return self.toRhumb8Tuple().toInverse10Tuple(self, **kwds) 

215 

216 @deprecated_method 

217 def toRhumb8Tuple(self, dflt=NAN): 

218 return _MODS.rhumbx.Rhumb8Tuple(self + (dflt,), name=self.name) 

219 

220 def _to7Tuple(self, **unused): 

221 '''(INTERNAL) see L{Rhumb8Tuple._to7Tuple}. 

222 ''' 

223 return self 

224 

225 

226class Transform7Tuple(_DeprecatedNamedTuple): # PYCHOK no cover 

227 '''DEPRECATED, use class L{Helmert7Tuple} without keyword arguments.''' 

228 _Names_ = (_tx_, _ty_, _tz_, _s_, _sx_, _sy_, _sz_) 

229 _Units_ = ( Float, Float, Float, Float, Float, Float, Float) 

230 

231 def __new__(cls, tx=0, ty=0, tz=0, s=0, 

232 sx=0, sy=0, sz=0, name=NN): 

233 t = map(_float, (tx, ty, tz, s, sx, sy, sz)) 

234 return _DeprecatedNamedTuple.__new__(cls, *t, name=name) 

235 

236 

237class UtmUps4Tuple(_DeprecatedNamedTuple): # PYCHOK no cover 

238 '''DEPRECATED and OBSOLETE, expect a L{UtmUps5Tuple} from method C{Mgrs.toUtm(utm=None)}. 

239 

240 4-Tuple C{(zone, hemipole, easting, northing)} as C{str}, 

241 C{str}, C{meter} and C{meter}. 

242 ''' 

243 _Names_ = (_zone_, _hemipole_, _easting_, _northing_) # band 

244 _Units_ = ( Str, Str, Easting, Northing) 

245 

246 

247@deprecated_function 

248def anStr(name, OKd='._-', sub=_UNDER_): # PYCHOK no cover 

249 '''DEPRECATED, use function L{pygeodesy.anstr}.''' 

250 return _MODS.streprs.anstr(name, OKd=OKd, sub=sub) 

251 

252 

253@deprecated_function 

254def areaof(points, adjust=True, radius=R_M, wrap=True): # PYCHOK no cover 

255 '''DEPRECATED, use function L{pygeodesy.areaOf}.''' 

256 return _MODS.points.areaOf(points, adjust=adjust, radius=radius, wrap=wrap) 

257 

258 

259@deprecated_function 

260def bounds(points, wrap=True, LatLon=None): # PYCHOK no cover 

261 '''DEPRECATED, use function L{pygeodesy.boundsOf}. 

262 

263 @return: 2-Tuple C{(latlonSW, latlonNE)} as B{C{LatLon}} 

264 or 4-Tuple C{(latS, lonW, latN, lonE)} if 

265 B{C{LatLon}} is C{None}. 

266 ''' 

267 return tuple(_MODS.points.boundsOf(points, wrap=wrap, LatLon=LatLon)) 

268 

269 

270@deprecated_function 

271def clipCS3(points, lowerleft, upperright, closed=False, inull=False): # PYCHOK no cover 

272 '''DEPRECATED, use function L{pygeodesy.clipCS4}. 

273 

274 @return: Yield a L{ClipCS3Tuple}C{(start, end, index)} for each 

275 edge of the I{clipped} path. 

276 ''' 

277 for p1, p2, _, j in _MODS.clipy.clipCS4(points, lowerleft, upperright, 

278 closed=closed, inull=inull): 

279 yield ClipCS3Tuple(p1, p2, j) 

280 

281 

282@deprecated_function 

283def clipDMS(deg, limit): # PYCHOK no cover 

284 '''DEPRECATED, use function L{pygeodesy.clipDegrees}.''' 

285 return _MODS.dms.clipDegrees(deg, limit) 

286 

287 

288@deprecated_function 

289def clipStr(bstr, limit=50, white=NN): # PYCHOK no cover 

290 '''DEPRECATED, use function L{pygeodesy.clips}.''' 

291 return _MODS.basics.clips(bstr, limit=limit, white=white) 

292 

293 

294@deprecated_function 

295def collins(pointA, pointB, pointC, alpha, beta, **useZ_Clas_and_kwds): 

296 '''DEPRECATED, use function L{pygeodesy.collins5}.''' 

297 return _MODS.resections.collins5(pointA, pointB, pointC, alpha, beta, 

298 **useZ_Clas_and_kwds) 

299 

300 

301@deprecated_function 

302def copysign(x, y): # PYCHOK no cover 

303 '''DEPRECATED, use function L{pygeodesy.copysign0}.''' 

304 return _MODS.basics.copysign0(x, y) 

305 

306 

307@deprecated_function 

308def decodeEPSG2(arg): # PYCHOK no cover 

309 '''DEPRECATED, use function L{epsg.decode2}. 

310 

311 @return: 2-Tuple C{(zone, hemipole)} 

312 ''' 

313 return tuple(_MODS.epsg.decode2(arg)) 

314 

315 

316@deprecated_function 

317def encodeEPSG(zone, hemipole=NN, band=NN): # PYCHOK no cover 

318 '''DEPRECATED, use function L{epsg.encode}. 

319 

320 @return: C{EPSG} code (C{int}). 

321 ''' 

322 return int(_MODS.epsg.encode(zone, hemipole=hemipole, band=band)) 

323 

324 

325@deprecated_function 

326def enStr2(easting, northing, prec, *extras): # PYCHOK no cover 

327 '''DEPRECATED, use function L{pygeodesy.enstr2}.''' 

328 return _MODS.streprs.enstr2(easting, northing, (int(prec) // 2 - 5), *extras) 

329 

330 

331@deprecated_function 

332def equirectangular3(lat1, lon1, lat2, lon2, **options): # PYCHOK no cover 

333 '''DEPRECATED, use function C{equirectangular_}. 

334 

335 @return: 3-Tuple C{(distance2, delta_lat, delta_lon)}. 

336 ''' 

337 return tuple(_MODS.formy.equirectangular_(lat1, lon1, lat2, lon2, **options)[:3]) 

338 

339 

340@deprecated_function 

341def excessAbc(A, b, c): 

342 '''DEPRECATED, use function L{excessAbc_}.''' 

343 return _MODS.formy.excessAbc_(A, b, c) 

344 

345 

346@deprecated_function 

347def excessGirard(A, B, C): 

348 '''DEPRECATED, use function L{excessGirard_}.''' 

349 return _MODS.formy.excessGirard_(A, B, C) 

350 

351 

352@deprecated_function 

353def excessLHuilier(a, b, c): 

354 '''DEPRECATED, use function L{excessLHuilier_}.''' 

355 return _MODS.formy.excessLHuilier_(a, b, c) 

356 

357 

358@deprecated_function 

359def false2f(value, name=_value_, false=True, Error=ValueError): # PYCHOK no cover 

360 '''DEPRECATED, use function L{falsed2f}.''' 

361 return falsed2f(falsed=false, Error=Error, **{name: value}) 

362 

363 

364@deprecated_function 

365def falsed2f(falsed=True, Error=ValueError, **name_value): # PYCHOK no cover 

366 '''DEPRECATED, use class L{Easting} or L{Northing}. 

367 

368 Convert a falsed east-/northing to non-negative C{float}. 

369 

370 @kwarg falsed: Value includes false origin (C{bool}). 

371 @kwarg Error: Optional, overriding error (C{Exception}). 

372 @kwarg name_value: One C{B{name}=value} pair. 

373 

374 @return: The value (C{float}). 

375 

376 @raise Error: Invalid or negative C{B{name}=value}. 

377 ''' 

378 t = NN 

379 if len(name_value) == 1: 

380 try: 

381 for f in name_value.values(): 

382 f = float(f) 

383 if falsed and f < 0: 

384 break 

385 return f 

386 t = _COMMASPACE_('falsed', _negative_) 

387 except (TypeError, ValueError) as x: 

388 t = str(x) 

389 raise _MODS.errors._InvalidError(Error=Error, txt=t, **name_value) 

390 

391 

392@deprecated_function 

393def float0(*xs): 

394 '''DEPRECATED, use function L{float0_}.''' 

395 return float0_(*xs) 

396 

397 

398@deprecated_function 

399def fStr(floats, prec=6, fmt=_MODS.streprs.Fmt.f, ints=False, sep=_COMMASPACE_): # PYCHOK no cover 

400 '''DEPRECATED, use function L{fstr}.''' 

401 return _MODS.streprs.fstr(floats, prec=prec, fmt=fmt, ints=ints, sep=sep) 

402 

403 

404@deprecated_function 

405def fStrzs(floatstr): # PYCHOK no cover 

406 '''DEPRECATED, use function L{pygeodesy.fstrzs}.''' 

407 return _MODS.streprs.fstrzs(floatstr) 

408 

409 

410@deprecated_function 

411def hypot3(x, y, z): # PYCHOK no cover 

412 '''DEPRECATED, use function L{pygeodesy.hypot_}.''' 

413 return _MODS.fmath.hypot_(x, y, z) 

414 

415 

416@deprecated_function 

417def inStr(inst, *args, **kwds): # PYCHOK no cover 

418 '''DEPRECATED, use function L{pygeodesy.instr}.''' 

419 return _MODS.streprs.instr(inst, *args, **kwds) 

420 

421 

422def isDEPRECATED(obj): 

423 '''Return C{True} if C{B{obj}} is a C{DEPRECATED} class, method 

424 or function, C{False} if not or C{None} if undetermined. 

425 ''' 

426 try: # XXX inspect.getdoc(obj) 

427 return bool(obj.__doc__.lstrip().startswith(_DEPRECATED_)) 

428 except AttributeError: 

429 return None 

430 

431 

432@deprecated_function 

433def isenclosedby(point, points, wrap=False): # PYCHOK no cover 

434 '''DEPRECATED, use function L{pygeodesy.isenclosedBy}.''' 

435 return _MODS.points.isenclosedBy(point, points, wrap=wrap) 

436 

437 

438@deprecated_function 

439def joined(*words, **sep): # PYCHOK no cover 

440 '''DEPRECATED, use C{NN(...)}, C{NN.join_} or C{B{sep}.join}.''' 

441 return sep.get(_sep_, NN).join(map(str, words)) 

442 

443 

444@deprecated_function 

445def istuplist(obj, minum=0): # PYCHOK no cover 

446 '''DEPRECATED, use function L{islistuple}.''' 

447 return _MODS.basics.islistuple(obj, minum=minum) 

448 

449 

450@deprecated_function 

451def joined_(*words, **sep): # PYCHOK no cover 

452 '''DEPRECATED, use C{_SPACE_(...)}, C{_SPACE_.join_} or C{B{sep}.join}, sep=" ".''' 

453 return sep.get(_sep_, _SPACE_).join(map(str, words)) 

454 

455 

456@deprecated_function 

457def nearestOn3(point, points, closed=False, wrap=False, **options): # PYCHOK no cover 

458 '''DEPRECATED, use function L{pygeodesy.nearestOn5}. 

459 

460 @return: 3-Tuple C{(lat, lon, distance)} 

461 ''' 

462 return tuple(_MODS.points.nearestOn5(point, points, closed=closed, wrap=wrap, **options)[:3]) 

463 

464 

465@deprecated_function 

466def nearestOn4(point, points, closed=False, wrap=False, **options): # PYCHOK no cover 

467 '''DEPRECATED, use function L{pygeodesy.nearestOn5}. 

468 

469 @return: 4-Tuple C{(lat, lon, distance, angle)} 

470 ''' 

471 return tuple(_MODS.points.nearestOn5(point, points, closed=closed, wrap=wrap, **options)[:4]) 

472 

473 

474@deprecated_function 

475def parseUTM(strUTM, datum=_WGS84, Utm=_UTM, name=NN): # PYCHOK no cover 

476 '''DEPRECATED, use function L{parseUTM5}. 

477 

478 @return: The UTM coordinate (B{L{Utm}}) or 4-tuple C{(zone, 

479 hemisphere, easting, northing)} if B{C{Utm}} is C{None}. 

480 ''' 

481 d = _MODS.datums.Datums.WGS84 if datum is _WGS84 else datum # PYCHOK shadows? 

482 U = _MODS.utm.Utm if Utm is _UTM else Utm 

483 r = _MODS.utm.parseUTM5(strUTM, datum=d, Utm=U, name=name) 

484 if isinstance(r, tuple): # UtmUps5Tuple 

485 r = r.zone, r.hemipole, r.easting, r.northing # no band 

486 return r 

487 

488 

489@deprecated_function 

490def perimeterof(points, closed=False, adjust=True, radius=R_M, wrap=True): # PYCHOK no cover 

491 '''DEPRECATED, use function L{perimeterOf}.''' 

492 return _MODS.points.perimeterOf(points, closed=closed, adjust=adjust, radius=radius, wrap=wrap) 

493 

494 

495@deprecated_function 

496def polygon(points, closed=True, base=None): # PYCHOK no cover 

497 '''DEPRECATED, use function L{points2}.''' 

498 return _MODS.deprecated.bases.points2(points, closed=closed, base=base) 

499 

500 

501@deprecated_function 

502def scalar(value, low=EPS, high=1.0, name=_scalar_, Error=ValueError): # PYCHOK no cover 

503 '''DEPRECATED, use class L{Number_} or L{Scalar_}. 

504 

505 @return: New value (C{float} or C{int} for C{int} B{C{low}}). 

506 

507 @raise Error: Invalid B{C{value}}. 

508 ''' 

509 C_ = Number_ if _MODS.basics.isint(low) else Scalar_ 

510 return C_(value, name=name, Error=Error, low=low, high=high) 

511 

512 

513@deprecated_function 

514def simplify2(points, pipe, radius=R_M, shortest=False, indices=False, **options): # PYCHOK no cover 

515 '''DEPRECATED, use function L{pygeodesy.simplifyRW}. 

516 ''' 

517 return _MODS.simplify.simplifyRW(points, pipe, radius=radius, shortest=shortest, 

518 indices=indices, **options) 

519 

520 

521@deprecated_function 

522def tienstra(pointA, pointB, pointC, alpha, **beta_gamma_useZ_Clas_and_kwds): 

523 '''DEPRECATED, use function L{pygeodesy.tienstra7}.''' 

524 return _MODS.resections.tienstra7(pointA, pointB, pointC, alpha, **beta_gamma_useZ_Clas_and_kwds) 

525 

526 

527@deprecated_function 

528def toUtm(latlon, lon=None, datum=None, Utm=_UTM, cmoff=True, name=NN): # PYCHOK no cover 

529 '''DEPRECATED, use function L{pygeodesy.toUtm8}. 

530 

531 @return: The UTM coordinate (B{C{Utm}}) or a 6-tuple C{(zone, 

532 easting, northing, band, convergence, scale)} if 

533 B{C{Utm}} is C{None} or B{C{cmoff}} is C{False}. 

534 ''' 

535 U = _MODS.utm.Utm if Utm is _UTM else Utm 

536 r = _MODS.utm.toUtm8(latlon, lon=lon, datum=datum, Utm=U, name=name, falsed=cmoff) 

537 if isinstance(r, tuple): # UtmUps8Tuple 

538 # no hemisphere/pole and datum 

539 r = r.zone, r.easting, r.northing, r.band, r.gamma, r.scale 

540 return r 

541 

542 

543@deprecated_function 

544def unsign0(x): # PYCHOK no cover 

545 '''DEPRECATED, use function L{pygeodesy.unsigned0}.''' 

546 return _MODS.basics.unsigned0(x) 

547 

548 

549@deprecated_function 

550def unStr(name, *args, **kwds): # PYCHOK no cover 

551 '''DEPRECATED, use function L{pygeodesy.unstr}.''' 

552 return _MODS.streprs.unstr(name, *args, **kwds) 

553 

554 

555@deprecated_function 

556def utmZoneBand2(lat, lon): # PYCHOK no cover 

557 '''DEPRECATED, use function L{pygeodesy.utmZoneBand5}. 

558 

559 @return: 2-Tuple C{(zone, band)}. 

560 ''' 

561 r = _MODS.utm.utmZoneBand5(lat, lon) # UtmUpsLatLon5Tuple 

562 return r.zone, r.band 

563 

564# **) MIT License 

565# 

566# Copyright (C) 2018-2023 -- mrJean1 at Gmail -- All Rights Reserved. 

567# 

568# Permission is hereby granted, free of charge, to any person obtaining a 

569# copy of this software and associated documentation files (the "Software"), 

570# to deal in the Software without restriction, including without limitation 

571# the rights to use, copy, modify, merge, publish, distribute, sublicense, 

572# and/or sell copies of the Software, and to permit persons to whom the 

573# Software is furnished to do so, subject to the following conditions: 

574# 

575# The above copyright notice and this permission notice shall be included 

576# in all copies or substantial portions of the Software. 

577# 

578# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 

579# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 

580# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 

581# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 

582# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 

583# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 

584# OTHER DEALINGS IN THE SOFTWARE.