Coverage for pyrdnap / rdnap2018.py: 93%

223 statements  

« prev     ^ index     » next       coverage.py v7.14.0, created at 2026-05-27 11:33 -0400

1 

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

3 

4u'''Main classes L{RDNAP2018v1} and L{RDNAP2018v2} follow C{variant 1} respectively C{variant 2} of 

5the U{RDNAPTRANS(tm)2018_v220627<https://formulieren.kadaster.nl/aanvragen_rdnaptrans>} specification. 

6Each provide a C{forward} method to convert geodetic lat-/longitudes and heights to C{RD} coodinates 

7and C{NAP} heights and a C{reverse} method for converting the other way. 

8 

9The L{RDNAP2018v1.forward} and C{.reverse} results are within the C{RDNAPTRANS(tm)2018_v220627} 

10self-validation requirements of C{0.000000010 degrees} respectively C{0.0010 meter} for points inside 

11the C{RD} region, see B{C{Note below}}. Class L{RDNAP2018v2} does not. 

12 

13@note: L{RDNAP2018v1}, C{PyRDNAP} and C{pyrdnap} have B{not been formally validated} and are 

14 B{not certified} to carry the trademark C{RDNAPTRANS(tm)}. 

15''' 

16# make sure int/int division yields float quotient, see .basics 

17from __future__ import division as _; del _ # noqa: E702 ; 

18 

19from pyrdnap.rd0 import _RD, _RD0 as A0, RDNAP7Tuple 

20from pyrdnap.v_grids import RDNAPError, _V_grid, _v_gridz_import 

21from pyrdnap.__pygeodesy import (_0_0, _0_5, _1_0, _2_0, 

22 _isNAN, _isNAN0, _earth_datum, 

23 _ALL_DOCS, _ALL_OTHER, _FOR_DOCS, 

24 _NamedBase, notOverloaded) 

25from pygeodesy import (map1, EPS0, EPS1, NAN, PI_2, PI, PI2, # "consterns" 

26 Datum, Datums, Ellipsoid, # datums, ellipsoids 

27 property_RO, property_ROnce, # props 

28 Lamd, Phid, # units 

29 sincos2, sincos2d) # utily 

30 

31from math import asin, atan, copysign, degrees, exp, \ 

32 fabs, floor, hypot, radians, sin, sqrt 

33 

34__all__ = () 

35__version__ = '26.05.23' 

36 

37_TOL_D = 1e-9 # degrees 2.3.3f+ 

38_TOL_M = 1e-6 # meter 

39_TOL_R = radians(_TOL_D) # 2e-11 

40_TRIPS = 16 # 5..6 sufficient 

41 

42 

43class _RDNAPbase(_NamedBase): 

44 '''(INTERNAL) L{RDNAP2018v1}C{/-v2} base class. 

45 ''' 

46 _datum = None # forward, v1 reverse Datum, lazily ("_DETRS") 

47 _EETRS = None # forward, v1 reverse Ellipsoid, lazily 

48 _raiser = False 

49 

50 def __init__(self, a_ellipsoid=None, f=None, raiser=False, **name): 

51 '''New C{RDNAP2018v1} or C{-v2} instance. 

52 

53 @kwarg a_ellipsoid: An ellipsoid (L{Ellipsoid}) or the ellipsoid's equatorial 

54 radius (C{scalar}, conventionally in C{meter}), see B{C{f}} 

55 or a datum (L{Datum}). Default C{Datums.GRS80}. 

56 @kwarg f: The flattening of the ellipsoid (C{scalar}) if B{C{a_ellipsoid}} is 

57 specified as C{scalar}, ignored otherwise. 

58 @kwarg raiser: If C{True} raise an L{RDNAPError} for lat-/longitudes outside 

59 the C{RD} region (C{bool}). 

60 @kwarg name: Optional name (C{str}). 

61 

62 @raise RDNAPError: Ellipsoid (or datum) is not oblate (i.e. is spherical or 

63 prolate) or the datum's C{transform} is not C{unity}. 

64 ''' 

65 if a_ellipsoid is f is None: 

66 self._datum = Datums.GRS80 

67 else: 

68 _earth_datum(a_ellipsoid, f, **name) # sets self._datum 

69 E = self._datum.ellipsoid 

70 if not E.isOblate: 

71 raise RDNAPError('not oblate: %r' % (E,)) 

72 self._EETRS = E 

73 if raiser: # PYCHOK no cover 

74 T = self._datum.transform 

75 if not T.isunity: 

76 raise RDNAPError('not unity: %r' % (T,)) 

77 self._raiser = True 

78 if name: 

79 self.name = name 

80 

81 def forward(self, lat, lon, height=0, raiser=None, name='forward'): 

82 '''Convert GRS80 (ETRS98) geodetic C{(B{lat}, B{lon})} and B{C{height}} 

83 to local C{(RDx, RDy)} coordinates and C{NAPh} quasi-geoid-height. 

84 

85 @arg lat: Latitude (C{degrees} geodetic). 

86 @arg lon: Longitude (C{degrees} geodetic). 

87 @kwarg height: Height, optional (C{meter} above geoid) or C{NAN} 

88 to ignore C{NAPh} interpolation. 

89 @kwarg raiser: If C{True} raise an L{RDNAPError} if B{C{lat}} or 

90 B{C{lon}} is outside the C{RD} region (C{bool}), 

91 if C{False} don't, overriding property C{raiser}. 

92 @kwarg name: Optional name (C{str}). 

93 

94 @return: An L{RDNAP7Tuple}C{(RDx, RDy, NAPh, lat, lon, height, datum)} 

95 with local C{RDx}, C{RDy} coordinates and C{NAPh} height. 

96 ''' 

97 lat0, lon0 = \ 

98 lat_, lon_ = self._forwardXform(lat, lon, raiser) 

99 for _ in range(_TRIPS): # 2.3.3a-f, 1..2 

100 latc, lonc = self._rdlatlon2(lat_, lon_, lat0, lon0) 

101 if fabs(latc - lat_) < _TOL_D and \ 

102 fabs(lonc - lon_) < _TOL_D: 

103 break 

104 lat_, lon_ = latc, lonc 

105 

106 phiClamC = _ellipsoidal2spherical(latc, lonc) 

107 RDx, RDy = _spherical2oblique(*phiClamC) 

108 NAPh = NAN if _isNAN(height) else (height - self.rdNAPh(lat, lon)) # 2.5.2 

109 return RDNAP7Tuple(RDx, RDy, NAPh, 

110 lat, lon, height, self.forwardDatum, name=name) 

111 

112 @property_RO 

113 def forwardDatum(self): 

114 '''Get the C{forward} datum (L{Datum}, default GRS80). 

115 ''' 

116 return self._datum 

117 

118 def _inside2(self, lat, lon, raiser): 

119 # default and variant 2: no datum Xform 

120 if (raiser or (raiser is None and self._raiser)) and \ 

121 not _RD.isinside(lat, lon): 

122 raise self._outsidError(lat, lon) 

123 return lat, lon 

124 

125 _forwardXform = _inside2 # no datum Xform 

126 

127 def isinside(self, lat, lon, eps=0): 

128 '''Is C{(B{lat}, B{lon})} inside the C{RD} region (C{bool})? 

129 

130 @kwarg eps: Over-/undersize the C{RD} region (C{degrees}). 

131 ''' 

132 return _RD.isinside(lat, lon, eps) 

133 

134 def _outsidError(self, *lat_lon): 

135 # format an RDNAPError for C{lat_lon} outside C{RD} region 

136 return RDNAPError('%r outside %s' % (lat_lon, self.region)) 

137 

138 @property_RO 

139 def _rdgrid(self): 

140 raise notOverloaded(self) 

141 

142 def _rdlatlon2(self, lat, lon, lat0=None, lon0=None): # 2.3.2 

143 # return the RD-corrected C{(lat, lon)} 

144 if _RD.isinside(lat, lon): 

145 c_f_N_f6 = _RD._c_f_N_f6(lat, lon) 

146 lat_corr = _bilinear(self._rdgrid._lat_corr, *c_f_N_f6) 

147 lon_corr = _bilinear(self._rdgrid._lon_corr, *c_f_N_f6) 

148 

149 if lat0 is lon0 is None: # reverse 

150 lat += lat_corr 

151 lon += lon_corr 

152 else: # forward 

153 lat = lat0 - lat_corr 

154 lon = lon0 - lon_corr 

155 return lat, lon # NAN, NAN? 

156 

157 def rdNAPh(self, lat, lon, raiser=False): # 2.5.1 and 3.5 

158 '''Interpolate the C{NAPh} quasi-geoid-height I{within} the C{RD} region. 

159 

160 @arg lat: Latitude (C{degrees} GRS80 (ETRS89), geodetic). 

161 @arg lon: Longitude (C{degrees} GRS80 (ETRS89), geodetic). 

162 @kwarg raiser: If C{True} raise an L{RDNAPError} if B{C{lat}} or 

163 B{C{lon}} is outside the C{RD} region (C{bool}), 

164 otherwise don't and return C{NAN}. 

165 

166 @return: C{NAPh} (C{meter}) or C{NAN} if C{B{raiser} is False} and 

167 B{C{lat}} or B{C{lon}} is outside the C{RD} region. 

168 ''' 

169 if _RD.isinside(lat, lon): 

170 c_f_N_f6 = _RD._c_f_N_f6(lat, lon) 

171 return _bilinear(self._rdgrid._NAP_h, *c_f_N_f6) 

172 elif raiser: 

173 raise self._outsidError(lat, lon) 

174 return NAN # c0 2.5.1e+ 

175 

176 @property_RO 

177 def region(self): 

178 '''Get the C{RD} region as L{Bounds4Tuple}C{(latS, lonW, latN, lonE)}, all C{GRS80 (ETRS89) degrees}. 

179 ''' 

180 return _RD.region 

181 

182 def _reverse(self, RDx, RDy, NAPh, raiser=None, name='reverse'): 

183 '''(INTERNAL) Convert local C{(B{RDx}, B{RDy})} coordinates and 

184 B{C{NAPh}} quasi-geoid-height to GRS80 (ETRS89) or Bessel1841 

185 (RD-Bessel) geodetic C{lat}, C{lon} and C{height}. 

186 ''' 

187 philCamC = _oblique2spherical(RDx, RDy) 

188 lat, lon = _spherical2ellipsoidal(*philCamC) 

189 

190 lat, lon = self._rdlatlon2(lat, lon) 

191 lat, lon = self._reverseXform(lat, lon, raiser) 

192 h = NAN if _isNAN(NAPh) else (NAPh + self.rdNAPh(lat, lon)) 

193 return RDNAP7Tuple(RDx, RDy, NAPh, 

194 lat, lon, h, self.reverseDatum, name=name) 

195 

196 @property_RO 

197 def reverseDatum(self): 

198 '''Get the C{reverse} datum (L{Datum}), GRS80 or Bessel1841. 

199 ''' 

200 return {1: self._datum, 

201 2: A0.D0}.get(self.variant) 

202 

203 _reverseXform = _inside2 # no datum Xform 

204 

205 def toStr(self, prec=9, **unused): # PYCHOK signature 

206 '''Return this C{RDNAP20181v1} or C{-v2} instance as a string. 

207 

208 @kwarg prec: Precision, number of decimal digits (0..9). 

209 

210 @return: This C{RDNAP2018v1} or C{-v2} (C{str}). 

211 ''' 

212 return self.attrs('name', 'variant', 'forwardDatum', prec=prec) # _ellipsoid_, _name__ 

213 

214 @property_RO 

215 def variant(self): 

216 raise None 

217 

218 

219class RDNAP2018v1(_RDNAPbase): 

220 '''Transformer implementing C{variant 1} of U{RD NAP 2018 v220627 

221 <https://formulieren.kadaster.nl/aanvragen_rdnaptrans>}. 

222 

223 @note: Method L{RDNAP2018v1.reverse} returns B{GRS80 (ETRS89)} 

224 geodetic lat- and longitudes. 

225 

226 @note: L{RDNAP2018v1} has B{not been formally validated} and is 

227 B{not certified} to carry the trademark C{RDNAPTRANS(tm)}. 

228 ''' 

229 if _FOR_DOCS: 

230 __init__ = _RDNAPbase.__init__ 

231 forward = _RDNAPbase.forward 

232 

233 def _forwardXform(self, lat, lon, raiser): 

234 # transform C{(lat, lon)} from GRS80 (ETRS89) to RD-Bessel datum 

235 x, y, z = _geodetic2cartesian(lat, lon, self._EETRS, A0.H0_ETRS) 

236 x, y, z = _RD._xETRS2RD.transform(x, y, z) 

237 lat, lon = _cartesian2geodetic(x, y, z, A0.E0) 

238 return self._inside2(lat, lon, raiser) 

239 

240 @property_ROnce 

241 def _rdgrid(self): 

242 try: 

243 from pyrdnap import v1grid 

244 except (AttributeError, ImportError, RDNAPError): 

245 v1grid = _v_gridz_import(self.variant) 

246 return v1grid 

247 

248 def reverse(self, RDx, RDy, NAPh=0, **raiser_name): # RDNAP to GRS80 (ETRS89) 

249 '''Convert a local C{(B{RDx}, B{RDy})} point and B{C{NAPh}} height to 

250 B{GRS80 (ETRS89)} geodetic C{(lat, lon, height)}. 

251 

252 @arg RDx: Local C{RD} X (C{meter}, conventionally). 

253 @arg RDy: Local C{RD} Y (C{meter}, conventionally). 

254 @kwarg NAPh: C{NAP} quasi-geoid-height (C{meter}, conventionally) 

255 or C{NAN} to ignore C{NAPh} interpolation. 

256 @kwarg raiser_name: Like the C{forward} method, C{B{raiser}=None} 

257 (C{bool}) and optional C{B{name}='reverse'} (C{str}). 

258 

259 @return: An L{RDNAP7Tuple}C{(RDx, RDy, NAPh, lat, lon, height, datum)} 

260 with geodetic C{lat} and C{lon}, C{height} and C{datum} 

261 B{GRS80 (ETRS89)}. 

262 ''' 

263 return self._reverse(RDx, RDy, NAPh, **raiser_name) 

264 

265 def _reverseXform(self, lat, lon, raiser): 

266 # transform C{(lat, lon)} from RD-Bessel to GRS80 (ETRS89) datum 

267 x, y, z = _geodetic2cartesian(lat, lon, A0.E0, A0.H0) 

268 x, y, z = _RD._xRD2ETRS.transform(x, y, z) 

269 lat, lon = _cartesian2geodetic(x, y, z, self._EETRS) 

270 return self._inside2(lat, lon, raiser) 

271 

272 def similarity(self, inverse=False): 

273 '''Get the similarity transform (C{Similarity}). 

274 

275 @kwarg inverse: Use C{True} for the C{reverse} or C{False} 

276 for the C{forward} transform (C{bool}). 

277 ''' 

278 return _RD._xRD2ETRS if inverse else _RD._xETRS2RD 

279 

280 @property_ROnce 

281 def variant(self): 

282 '''Get this C{RDNAP2018}'s variant (C{int}). 

283 ''' 

284 return 1 

285 

286 

287class RDNAP2018v2(_RDNAPbase): 

288 '''Transformer implementing C{variant 2} of U{RD NAP 2018 v220627 

289 <https://formulieren.kadaster.nl/aanvragen_rdnaptrans>}. 

290 

291 @note: Method L{RDNAP2018v2.reverse} returns B{Bessel1841 (RD-Bessel)} 

292 and B{not GRS80 (ETRS89)} geodetic lat- and longitudes. 

293 ''' 

294 if _FOR_DOCS: 

295 __init__ = _RDNAPbase.__init__ 

296 forward = _RDNAPbase.forward 

297 

298 @property_ROnce 

299 def _rdgrid(self): 

300 try: 

301 from pyrdnap import v2grid 

302 except (AttributeError, ImportError, RDNAPError): 

303 v2grid = _v_gridz_import(self.variant) 

304 return v2grid 

305 

306 def reverse(self, RDx, RDy, NAPh=0, **raiser_name): # RDNAP to RD-Bessel 

307 '''Convert a local C{(B{RDx}, B{RDy})} point and B{C{NAPh}} height 

308 to B{Bessel1841 (RD-Bessel)} geodetic C{(lat, lon, height)}. 

309 

310 @arg RDx: Local C{RD} X (C{meter}, conventionally). 

311 @arg RDy: Local C{RD} Y (C{meter}, conventionally). 

312 @kwarg NAPh: C{NAP} quasi-geoid-height (C{meter}, conventionally) 

313 or C{NAN} to ignore C{NAPh} interpolation. 

314 @kwarg raiser_name: Like the C{forward} method, C{B{raiser}=None} 

315 (C{bool}) and optional C{B{name}='reverse'} (C{str}). 

316 

317 @return: An L{RDNAP7Tuple}C{(RDx, RDy, NAPh, lat, lon, height, datum)} 

318 with geodetic C{lat} and C{lon}, C{height} and C{datum} 

319 B{Bessel1841 (RD-Bessel)}. 

320 ''' 

321 return self._reverse(RDx, RDy, NAPh, **raiser_name) 

322 

323 def similarity(self, *unused): # PYCHOK signature 

324 '''Get the similarity transform, always C{None}. 

325 ''' 

326 return None 

327 

328 @property_ROnce 

329 def variant(self): 

330 '''Get this C{RDNAP2018}'s variant (C{int}). 

331 ''' 

332 return 2 

333 

334 

335def _atan3(y, x, x0): # 2.2.3e and 3.1.1i 

336 # equiv to math.atan2 iff x0 is y 

337 if x > 0: 

338 r = atan(y / x) 

339 elif x < 0: 

340 r = atan(y / x) + copysign(PI, x0) 

341 else: 

342 r = copysign(PI_2, x0) if x0 else _0_0 

343 return r 

344 

345 

346def _atan_exp(w): # 2.4.1c 

347 return atan(exp(w)) * _2_0 - PI_2 

348 

349 

350def _bilinear(v_grid, c_latI, f_latI, latN_f, # 2.3.1f and g 

351 c_lonI, f_lonI, lonN_f): 

352 # interpolate a lat_corr_, lon_corr_ or NAP_... 

353 assert isinstance(v_grid, _V_grid), v_grid 

354 ne = v_grid(c_latI, c_lonI) 

355 nw = v_grid(c_latI, f_lonI) 

356 se = v_grid(f_latI, c_lonI) 

357 sw = v_grid(f_latI, f_lonI) 

358 lonN_f1 = _1_0 - lonN_f # == 1 - (lonN - f_lonN) 

359 return (ne * lonN_f + nw * lonN_f1) * latN_f + \ 

360 (se * lonN_f + sw * lonN_f1) * (_1_0 - latN_f) 

361 

362 

363def _cartesian2geodetic(x, y, z, E): # 2.2.3 == EcefUPC.reverse? 

364 # convert cartesian C{(x, y, z)} to C{E}-geodetic C{(lat, lon)} 

365 r = hypot(x, y) 

366 if r > _TOL_M: 

367 a = E.a * E.e2 

368 phi_ = atan(z / r) 

369 for _ in range(_TRIPS): # 4..6 

370 s = sin(phi_) 

371 s *= a / sqrt(_1_0 - s**2 * E.e2) 

372 phi = atan((z + s) / r) 

373 if fabs(phi - phi_) < _TOL_R: 

374 break 

375 phi_ = phi 

376 else: 

377 phi = copysign(PI_2, z) 

378 lam = _atan3(y, x, y) 

379 return degrees(phi), degrees(lam) 

380 

381 

382def _ellipsoidal2spherical(lat, lon): # 2.4.1 

383 # convert geodetic C{(lat, lon)} to spherical C{(𝛷, 𝛬)} 

384 phiC = phi = Phid(lat) 

385 if PI_2 > phi > -PI_2: # 2.4.1c 

386 q = A0.log_tan(phi) - A0.log_e_2(phi) 

387 w = A0.N0 * q + A0.M0 # 2.4.1b 

388 phiC = _atan_exp(w) 

389 lamC = (Lamd(lon) - A0.LAM0) * A0.N0 + A0.LAM0C # 2.4.1d 

390 return phiC, lamC # -Capital 

391 

392 

393def _eq0(r, r0=_0_0): 

394 return fabs(r - r0) < _TOL_R 

395 

396 

397# def _eq0d(d, d0=_0_0): 

398# return fabs(d - d0) < _TOL_D 

399 

400 

401def _geodetic2cartesian(lat, lon, E, h0=0): # 2.2.1 

402 # convert C{E}-geodetic C{(lat, lon)} to cartesian C{(x, y, z)} 

403 y, x = sincos2d(lon) 

404 z, c = sincos2d(lat) 

405 n = E.a / sqrt(_1_0 - z**2 * E.e2) 

406 H = _isNAN0(h0) 

407 c *= n + H 

408 x *= c 

409 y *= c 

410 z *= n * (_1_0 - E.e2) + H 

411 return x, y, z 

412 

413 

414def _ne0(r, r0=_0_0): 

415 return fabs(r - r0) > _TOL_R 

416 

417 

418# def _ne0d(d, d0=_0_0): 

419# return fabs(d - d0) > _TOL_D 

420 

421 

422def _oblique2spherical(x, y): # 3.1.1 

423 # inverse oblique stereographic conformal projection 

424 # from C{RD (x, y)} to spherical C{(𝛷, 𝛬)} 

425 x -= A0.X0 

426 y -= A0.Y0 

427 r = hypot(x, y) 

428 if r > _TOL_M: # x and y 

429 s0, c0 = A0.sincos2PHI0C 

430 sp, cp = sincos2(atan(r / A0.RK2) * _2_0) # psi 

431 ca = sp * y / r 

432 xN = cp * c0 - ca * s0 

433 yN = sp * x / r 

434 zN = cp * s0 + ca * c0 

435 phiC = asin(zN) 

436 else: 

437 _, xN = A0.sincos2PHI0C 

438 yN = _0_0 

439 phiC = A0.PHI0C # asin(sin(PHI0C)) 

440 lamC = _atan3(yN, xN, x) + A0.LAM0C 

441 return phiC, lamC # -Capital 

442 

443 

444def _spherical2ellipsoidal(phiC, lamC): # 3.1.2 

445 # inverse Gauss conformal projection from 

446 # spherical C{(𝛷, 𝛬)} to geodetic C{(lat, lon)} 

447 phi = phiC 

448 if PI_2 > phi > -PI_2: 

449 q = (A0.log_tan(phi) - A0.M0) / A0.N0 

450# w = A0.log_tan(phi) 

451 for _ in range(_TRIPS): # 3..6 

452 phi_ = phi 

453 phi = _atan_exp(A0.log_e_2(phi) + q) 

454 if fabs(phi - phi_) < _TOL_R: 

455 break 

456 lam = (lamC - A0.LAM0C) / A0.N0 + A0.LAM0 

457 lam = floor((PI - lam) / PI2) * PI2 + lam 

458 return map1(degrees, phi, lam) 

459 

460 

461def _spherical2oblique(phiC, lamC): # 2.4.2 

462 # oblique stereographic conformal projection 

463 # from spherical C{(𝛷, 𝛬)} to C{RD (x, y)} 

464 x = A0.X0 # 2.4.2g 

465 y = A0.Y0 # 2.4.2h 

466 a = phiC - A0.PHI0C # 𝛷 - 𝛷0 

467 b = lamC - A0.LAM0C # 𝛬 - 𝛬0 

468 if (_ne0(a) or _ne0(b)) and (_ne0(phiC, -A0.PHI0C) or 

469 _ne0(lamC, -A0.LAM0C + PI)): 

470 s0, c0 = A0.sincos2PHI0C # sin(𝛷0), cos(𝛷0) 

471 s, c = sincos2(phiC) # sin(𝛷), cos(𝛷) 

472 sp_22 = sin(a * _0_5)**2 + \ 

473 sin(b * _0_5)**2 * c * c0 # sin(𝜓/2)**2 

474 if EPS0 < sp_22 < EPS1: 

475 # r = 2kR * tan(𝜓/2) 

476 # q = r / (sin(𝜓/2) * cos(𝜓/2) * 2) 

477 # = 2kR * sin(𝜓/2) / (sin(𝜓/2) * cos(𝜓/2)**2 * 2) 

478 # = 2kR / (cos(𝜓/2)**2 * 2) 

479 # = 2kR / ((1 - sin(𝜓/2)**2) * 2) 

480 # = 2kR / (2 - sin(𝜓/2)**2 * 2) 

481 t = sp_22 * _2_0 # 0 < t < 2 

482 q = A0.RK2 / (_2_0 - t) 

483 x += q * (c * sin(b)) 

484 y += q * (s - s0 + s0 * t) / c0 

485 elif _eq0(a) and _eq0(b): 

486 pass 

487 else: # if _eq0(phiC, -A0.PHI0C) and _eq0(lamC, A0.LAM0C - PI): 

488 x = y = NAN 

489# else: 

490# raise RDNAPError(str((phiC, lamC))) 

491 return x, y 

492 

493 

494__all__ += _ALL_DOCS(_RDNAPbase) 

495__all__ += _ALL_OTHER(RDNAP2018v1, RDNAP2018v2, RDNAPError, 

496 Datum, Datums, Ellipsoid) # passed along from PyGeodesy 

497 

498# **) MIT License 

499# 

500# Copyright (C) 2026-2026 -- mrJean1 at Gmail -- All Rights Reserved. 

501# 

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

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

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

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

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

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

508# 

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

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

511# 

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

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

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

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

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

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

518# OTHER DEALINGS IN THE SOFTWARE.