Coverage for pyrdnap / __init__.py: 100%
22 statements
« prev ^ index » next coverage.py v7.14.0, created at 2026-06-14 13:03 -0400
« prev ^ index » next coverage.py v7.14.0, created at 2026-06-14 13:03 -0400
2# -*- coding: utf-8 -*-
4u'''A pure Python implementation of the 2018 v220627 version of Netherlands' U{RD NAP<https://
5www.NSGI.NL/coordinatenstelsels-en-transformaties/coordinatentransformaties/rdnap-etrs89-rdnaptrans>}
6specification to convert between GRS80 (ETRS89) geodetic lat-, longitudes and height and local
7I{B{R}ijksB{D}riehoeksmeeting (B{RD})} coordinates and I{B{N}ormaal B{A}msterdams B{P}eil (B{NAP})
8quasi-geoid-height}.
10The results of both B{C{pyrdnap}} transformer classes L{RDNAP2018v1} and L{RDNAP2018v2} have been
11formally validated and B{C{PyRDNAP}} has been certified to carry the trademark B{C{RDNAPTRANS(tm)}}.
13See module L{pyrdnap.rdnap2018} for further information, usage and implementation details.
15See modules L{pyrdnap.v1grid} and L{pyrdnap.v2grid} for the C{RDNAPTRANS(tm)2018_v220627} grid
16files, each the original, unmodified ASCII C{.txt} but compressed as C{.txt.zip}.
18See function L{pyrdnap.validation3} for C{.../Z001_ETRSandRDNAP.txt} test set details.
20See files C{testresults/v1_..._round_trips.txt} for "round-trip" (forward plus reverse) test
21results of the L{RDNAP2018v1} transformer, especially the final, summary lines in each file.
22'''
23import os.path as os_path
24import sys
26# _isfrozen = getattr(_sys, 'frozen', False)
27pyrdnap_abspath = os_path.dirname(os_path.abspath(__file__)) # _sys._MEIPASS + '/pyrdnap'
28_pyrdnap_ = __package__ or os_path.basename(pyrdnap_abspath)
30# setting __path__ should ...
31__path__ = [pyrdnap_abspath]
32try: # ... make this import work, ...
33 import pyrdnap.__pygeodesy as _ # noqa: F401
34except ImportError: # ... if it doesn't, extend sys.path to include
35 # this very directory such that all public and private sub-modules
36 # can be imported (by epydoc, checked by PyChecker, etc.)
37 if pyrdnap_abspath not in sys.path:
38 sys.path.insert(0, pyrdnap_abspath) # XXX __path__[0]
40try: # PYCHOK once
41 from pyrdnap.__pygeodesy import machine, _SPACE_, _versions as _pygeodesy_versions # PYCHOK ...
42except (AttributeError, ImportError) as x:
43 raise AssertionError(str(x))
45from pyrdnap.rd0 import * # noqa: F403
46from pyrdnap.rdnap2018 import * # noqa: F403
47from pyrdnap.v_self import * # noqa: F403
49from pyrdnap.rd0 import __all__ as _rd0 # PYCHOK ?
50from pyrdnap.rdnap2018 import __all__ as _rdnap # PYCHOK ?
51from pyrdnap.v_self import __all__ as _v_self # PYCHOK ?
53__all__ = tuple(sorted(('pyrdnap_abspath', machine.__name__) + _rd0 + _rdnap + _v_self))
54__version__ = '26.06.16'
57def _versions(): # in .__main__, .test/bases
58 # Get the pyrdnap, pygeodesy, Python ... versions (C{str}).
59 v = __version__.replace('.0', '.')
60 l_ = [_pyrdnap_, v] + _pygeodesy_versions(None)
61 return _SPACE_.join(l_)
64del _rd0, _rdnap, _v_self # os_path, sys
66# **) MIT License
67#
68# Copyright (C) 2026-2026 -- mrJean1 at Gmail -- All Rights Reserved.
69#
70# Permission is hereby granted, free of charge, to any person obtaining a
71# copy of this software and associated documentation files (the "Software"),
72# to deal in the Software without restriction, including without limitation
73# the rights to use, copy, modify, merge, publish, distribute, sublicense,
74# and/or sell copies of the Software, and to permit persons to whom the
75# Software is furnished to do so, subject to the following conditions:
76#
77# The above copyright notice and this permission notice shall be included
78# in all copies or substantial portions of the Software.
79#
80# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
81# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
82# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
83# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
84# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
85# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
86# OTHER DEALINGS IN THE SOFTWARE.