Package pyrdnap
[frames] | no frames]

Package pyrdnap

A pure Python implementation of the 2018 v220627 version of Netherlands' RD NAP specification to convert between GRS80 (ETRS89) geodetic lat-, longitudes and height and local RijksDriehoeksmeeting (RD) coordinates and Normaal Amsterdams Peil (NAP) quasi-geoid-height.

The results of both pyrdnap transformer classes RDNAP2018v1 and RDNAP2018v2 have been formally validated and PyRDNAP has been certified to carry the trademark RDNAPTRANS(tm).

See module pyrdnap.rdnap2018 for further information, usage and implementation details.

See modules pyrdnap.v1grid and pyrdnap.v2grid for the RDNAPTRANS(tm)2018_v220627 grid files, each the original, unmodified ASCII .txt but compressed as .txt.zip.

See function pyrdnap.validation3 for .../Z001_ETRSandRDNAP.txt test set details.

See files testresults/v1_..._round_trips.txt for "round-trip" (forward plus reverse) test results of the RDNAP2018v1 transformer, especially the final, summary lines in each file.


Version: 26.06.26

Submodules

Classes
  Bounds4Tuple
4-Tuple (latS, lonW, latN, lonE) with the bounds' lower-left (LatS, LowW) and upper-right (latN, lonE) corner lat- and longitudes.
  Datum
Ellipsoid and transform parameters for an earth model.
  Ellipsoid
Ellipsoid with equatorial and polar radii, flattening, inverse flattening and other, often used, cached attributes, supporting oblate and prolate ellipsoidal and spherical earth models.
  LatLon2Tuple
2-Tuple (lat, lon) in degrees90 and degrees180.
  LatLon3Tuple
3-Tuple (lat, lon, height) in degrees90, degrees180 and meter, conventionally.
  LatLon4Tuple
4-Tuple (lat, lon, height, datum) in degrees90, degrees180, meter and Datum.
  LqRD
Like pygeodesy.LqRD but with methods forward and reverse returning an RDNAP7Tuple with NAPh replaced by local z, the perpendicular distance to the local tangent plane (LTP).
  PhiLam2Tuple
2-Tuple (phi, lam) with latitude phi in radians[PI_2] and longitude lam in radians[PI].
  PhiLam3Tuple
3-Tuple (phi, lam, height) with latitude phi in radians[PI_2], longitude lam in radians[PI] and height in meter.
  PhiLam4Tuple
4-Tuple (phi, lam, height, datum) with latitude phi in radians[PI_2], longitude lam in radians[PI], height in meter and Datum.
  RDNAP2018v1
Transformer implementing variant 1 of the RDNAPTRANS(tm)2018_v220627 specification.
  RDNAP2018v2
Transformer implementing variant 2 of the RDNAPTRANS(tm)2018_v220627 specification.
  RDNAP7Tuple
7-Tuple (RDx, RDy, NAPh, lat, lon, height, datum) with local RDx, RDy and NAPh quasi-geoid_height, geodetic lat, lon, height and datum with lat and lon in degrees and with RDx, RDy, NAPh and height in meter, conventionally.
  RDNAPError
Error raised for RD, NAP, unzip and other issues.
  Similarity
Similarity transformation.
  Vector2Tuple
2-Tuple (x, y) of (geocentric) components, each in meter or the same units.
  Vector3Tuple
3-Tuple (x, y, z) of (geocentric) components, all in meter or the same units.
Functions
 
machine()
Return standard platform.machine, but distinguishing Intel native from Intel emulation on Apple Silicon (on macOS only).
 
validation3(self_txt, R, all_=False, in_out=True, _print=None, _printest=None)
Run the RDNAPTRANS(tm)2018_v220627 self-validation test set.
Variables
  pyrdnap_abspath = '..../PyRDNA...
  Datums = Datums.Sphere: Datum(name='Sphere', ellipsoid=Ellipso...
  Ellipsoids = Ellipsoids.Sphere: Ellipsoid(name='Sphere', a=637...
Function Details

machine()

 

Return standard platform.machine, but distinguishing Intel native from Intel emulation on Apple Silicon (on macOS only).

Returns:
Machine 'arm64' for Apple Silicon native, 'x86_64' for Intel native, "arm64_x86_64" for Intel emulation, etc. (str with commas replaced by underscores).

validation3 (self_txt, R, all_=False, in_out=True, _print=None, _printest=None)

 

Run the RDNAPTRANS(tm)2018_v220627 self-validation test set.

Arguments:
  • self_txt - Path of the file containing the self-validation test set (str, .../Z001_ETRS89andRDNAP.txt).
  • R - An RDNAP2018v# transformer (RDNAP2018v1 or RDNAP2018v2 instance).
  • all_ - If True print all tests and test results, otherwise print only failing tests (bool).
  • in_out - If True test only points inside the RD region, if False only points outside (bool).
  • _print - A Python 3+ print-like callable or None to not print the header and the final, summary lines.
  • _printest - A Python 3+ print-like callable or None to not print all_ in_out tests or only the failing ones.
Returns:
3-Tuple (failed, total, in_outside) with the number of FAILED tests, the total number of tests and the number of points in_out the RD region.

Variables Details

pyrdnap_abspath

Value:
'..../PyRDNAP/pyrdnap'

Datums

Value:
Datums.Sphere: Datum(name='Sphere', ellipsoid=Ellipsoids.Sphere, trans\
form=Transforms.WGS84),
Datums.NAD83: Datum(name='NAD83', ellipsoid=Ellipsoids.GRS80, transfor\
m=Transforms.NAD83),
Datums.OSGB36: Datum(name='OSGB36', ellipsoid=Ellipsoids.Airy1830, tra\
nsform=Transforms.OSGB36),
Datums.WGS84: Datum(name='WGS84', ellipsoid=Ellipsoids.WGS84, transfor\
m=Transforms.WGS84),
...

Ellipsoids

Value:
Ellipsoids.Sphere: Ellipsoid(name='Sphere', a=6371008.771415, f=0, f_=\
0, b=6371008.771415),
Ellipsoids.GRS80: Ellipsoid(name='GRS80', a=6378137, f=0.00335281, f_=\
298.2572221, b=6356752.31414035),
Ellipsoids.WGS84: Ellipsoid(name='WGS84', a=6378137, f=0.00335281, f_=\
298.25722356, b=6356752.31424518),
Ellipsoids.Airy1830: Ellipsoid(name='Airy1830', a=6377563.396, f=0.003\
34085, f_=299.3249646, b=6356256.90923729)