[proj-rdnap] 08/09: Reimplement required tests in Perl, tests pass if output is not identical but within the allowed margin.

Bas Couwenberg sebastic at xs4all.nl
Tue Nov 25 21:53:26 UTC 2014


This is an automated email from the git hooks/post-receive script.

sebastic-guest pushed a commit to branch master
in repository proj-rdnap.

commit 8bfff20c30e7b96b1ef83715c1019cdca7ba6bd5
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Sat Nov 22 01:44:06 2014 +0100

    Reimplement required tests in Perl, tests pass if output is not identical but within the allowed margin.
---
 debian/README.Debian          |    5 +-
 debian/control                |    7 +-
 debian/patches/add-test.patch | 1136 ++++++++++++++++++++---------------------
 debian/rules                  |    2 +-
 4 files changed, 561 insertions(+), 589 deletions(-)

diff --git a/debian/README.Debian b/debian/README.Debian
index e1c0fc1..4efae01 100644
--- a/debian/README.Debian
+++ b/debian/README.Debian
@@ -158,6 +158,5 @@ The package build includes the mandatory tests documented in Appendix 2 of
 transformations by cs2cs to those computed with RDNAPTRANS™2008.
 
 The transformations by cs2cs produce different results, not identical to
-RDNAPTRANS™2008. Failing the test to be identical to RDNAPTRANS™2008 does
-not prevent the package build from continuing.
-
+RDNAPTRANS™2008. The tests only fail if the difference is greater than
+the margin.
diff --git a/debian/control b/debian/control
index bb3d5b3..fb63124 100644
--- a/debian/control
+++ b/debian/control
@@ -5,7 +5,12 @@ Maintainer: Debian GIS Project <pkg-grass-devel at lists.alioth.debian.org>
 Uploaders: Bas Couwenberg <sebastic at xs4all.nl>
 Build-Depends: debhelper (>= 9),
                proj-bin (>= 4.8.0),
-               proj-data
+               proj-data,
+               perl,
+               libfile-slurp-perl,
+               libipc-run-perl,
+               libjson-perl,
+               libjson-xs-perl
 Standards-Version: 3.9.6
 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-grass/proj-rdnap.git
 Vcs-Git: git://anonscm.debian.org/pkg-grass/proj-rdnap.git
diff --git a/debian/patches/add-test.patch b/debian/patches/add-test.patch
index eded639..ed8b0a6 100644
--- a/debian/patches/add-test.patch
+++ b/debian/patches/add-test.patch
@@ -1,601 +1,569 @@
+Description: Add script implementing the required tests.
+ . 
+ The RDNAP license requires the correct implementation of the grid
+ corrections to be tested, as documented in the file:
+ "Use of RDTRANS2008 and NAPTRANS2008.pdf"
+ .
+ There are 10 tests which need to be run in both directions,
+ from ETS89 to RD/NAP and vice versa.
+ .
+ The tests are defined in testrdtrans2008.json, and the test script
+ testrdtrans2008.pl runs them for both directions.
+ .
+ Verbose output can be enabled by using the -v option, or setting the
+ VERBOSE environment variable.
+ .
+ The points in tests 07 - 10 fall outside the grid, the output for
+ these tests is not the expected floating point value, but a '*'.
+ .
+ These tests pass when the cs2cs output matches the overrides defined in
+ testrdtrans2008.json.
+ .
+ Regarding tests 07 - 10, the "Use of RDTRANS2008 and NAPTRANS2008.pdf"
+ file documents the following:
+ .
+   Points 07 - 10 are outside the region where interpolation between
+   either the NLGEO2004 geoid or the RD correction grid points is
+   possible. RD is defined only within the region enclosed by the
+   following points (in RD), outside this region RD coordinates can
+   be computed, but the output should be handled with care.
+ .
+   Corners of the validity region for RD:
+   +--------+--------+
+   |  x (m) |  y (m) |
+   +--------+--------+
+   | 140000 | 630000 |
+   | 100000 | 600000 |
+   |  80000 | 500000 |
+   |  -8000 | 390000 |
+   |  -8000 | 335000 |
+   | 100000 | 335000 |
+   | 160000 | 288000 |
+   | 220000 | 288000 |
+   | 301000 | 450000 |
+   | 301000 | 615000 |
+   | 260000 | 630000 |
+   +--------+--------+
+ .
+Author: Bas Couwenberg <sebastic at xs4all.nl>
+
 --- /dev/null
-+++ b/testrdtrans2008
-@@ -0,0 +1,383 @@
-+:
++++ b/epsg
+@@ -0,0 +1,2 @@
++# ETRS89
++<4258> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
+--- /dev/null
++++ b/rdnap
+@@ -0,0 +1,5 @@
++# RDNAP with NTv2 and VDatum
++<rdnap> +proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +nadgrids=rdtrans2008.gsb +geoidgrids=naptrans2008.gtx +units=m +no_defs <>
++
++# RD with NTv2 only
++<rd> +proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +nadgrids=rdtrans2008.gsb +units=m +no_defs <>
+--- /dev/null
++++ b/testrdtrans2008.json
+@@ -0,0 +1,178 @@
++[
++  {
++    "number"  : "01",
++    "name"    : "Texel",
++    "etrs89"  : {
++                  "latitude"  : "53.160753042",
++                  "longitude" : "4.824761912",
++                  "height"    : "42.8614"
++                },
++    "rdnap"   : {
++                  "x"   : "117380.1200",
++                  "y"   : "575040.3400",
++                  "nap" : "1.0000"
++                }
++  },
++  {
++    "number"  : "02",
++    "name"    : "Noord-Groningen",
++    "etrs89"  : {
++                  "latitude"  : "53.419482050",
++                  "longitude" : "6.776726674",
++                  "height"    : "42.3586"
++                },
++    "rdnap"   : {
++                  "x"   : "247380.5600",
++                  "y"   : "604580.7800",
++                  "nap" : "2.0000"
++                }
++  },
++  {
++    "number"  : "03",
++    "name"    : "Amersfoort",
++    "etrs89"  : {
++                  "latitude"  : "52.155172897",
++                  "longitude" : "5.387203657",
++                  "height"    : "43.2551"
++                },
++    "rdnap"   : {
++                  "x"   : "155000.0000",
++                  "y"   : "463000.0000",
++                  "nap" : "0.0000"
++                }
++  },
++  {
++    "number"  : "04",
++    "name"    : "Zeeuws-Vlaanderen",
++    "etrs89"  : {
++                  "latitude"  : "51.368607152",
++                  "longitude" : "3.397588595",
++                  "height"    : "47.4024"
++                },
++    "rdnap"   : {
++                  "x"   : "16460.9100",
++                  "y"   : "377380.2300",
++                  "nap" : "3.0000"
++                }
++  },
++  {
++    "number"  : "05",
++    "name"    : "Zuid-Limburg",
++    "etrs89"  : {
++                  "latitude"  : "50.792584908",
++                  "longitude" : "5.773795547",
++                  "height"    : "174.9478"
++                },
++    "rdnap"   : {
++                  "x"   : "182260.4500",
++                  "y"   : "311480.6700",
++                  "nap" : "129.000"
++                }
++  },
++  {
++    "number"  : "06",
++    "name"    : "Maasvlakte",
++    "etrs89"  : {
++                  "latitude"  : "51.947393898",
++                  "longitude" : "4.072887101",
++                  "height"    : "47.5968"
++                },
++    "rdnap"   : {
++                  "x"   : "64640.8900",
++                  "y"   : "440700.0101",
++                  "nap" : "4.0000"
++                }
++  },
++  {
++    "number"  : "07",
++    "name"    : "No_rd&geoid",
++    "etrs89"  : {
++                  "latitude"  : "50.687420405",
++                  "longitude" : "4.608971812",
++                  "height"    : ""
++                },
++    "rdnap"   : {
++                  "x"   : "100000.6700",
++                  "y"   : "300000.8900",
++                  "nap" : ""
++                },
++    "note"    : "point not within available datum shift grids",
++    "override": {
++                  "latitude"  : "*",
++                  "longitude" : "*",
++                  "height"    : "^-?\\d+\\.\\d+$",
++                  "x"         : "*",
++                  "y"         : "*",
++                  "nap"       : "^-?\\d+\\.\\d+$"
++                }
++  },
++  {
++    "number"  : "08",
++    "name"    : "No_geoid",
++    "etrs89"  : {
++                  "latitude"  : "51.136825197",
++                  "longitude" : "4.601375361",
++                  "height"    : ""
++                },
++    "rdnap"   : {
++                  "x"   : "100000.6700",
++                  "y"   : "350000.8900",
++                  "nap" : ""
++                },
++    "note"    : "point not within available datum shift grids",
++    "override": {
++                  "latitude"  : "*",
++                  "longitude" : "*",
++                  "height"    : "^-?\\d+\\.\\d+$",
++                  "x"         : "*",
++                  "y"         : "*",
++                  "nap"       : "^-?\\d+\\.\\d+$"
++                }
++  },
++  {
++    "number"  : "09",
++    "name"    : "No_rd",
++    "etrs89"  : {
++                  "latitude"  : "52.482440839",
++                  "longitude" : "4.268403889",
++                  "height"    : ""
++                },
++    "rdnap"   : {
++                  "x"   : "79000.0100",
++                  "y"   : "500000.2300",
++                  "nap" : ""
++                },
++    "note"    : "point not within available datum shift grids",
++    "override": {
++                  "latitude"  : "*",
++                  "longitude" : "*",
++                  "height"    : "^-?\\d+\\.\\d+$",
++                  "x"         : "*",
++                  "y"         : "*",
++                  "nap"       : "^-?\\d+\\.\\d+$"
++                }
++  },
++  {
++    "number"  : "10",
++    "name"    : "edge_rd",
++    "etrs89"  : {
++                  "latitude"  : "51.003976532",
++                  "longitude" : "3.891247830",
++                  "height"    : ""
++                },
++    "rdnap"   : {
++                  "x"   : "50000.4500",
++                  "y"   : "335999.6700",
++                  "nap" : ""
++                },
++    "note"    : "point not within available datum shift grids",
++    "override": {
++                  "latitude"  : "*",
++                  "longitude" : "*",
++                  "height"    : "^-?\\d+\\.\\d+$",
++                  "x"         : "*",
++                  "y"         : "*",
++                  "nap"       : "^-?\\d+\\.\\d+$"
++                }
++  }
++]
+--- /dev/null
++++ b/testrdtrans2008.pl
+@@ -0,0 +1,323 @@
++#!/usr/bin/perl -w
++#
 +# Script to do some testing of various transformations
 +# required by the RDNAPTRANS™2008 license.
 +#
 +# For the license and test sheet refer to the file:
 +# "Use of RDTRANS2008 and NAPTRANS2008.pdf"
 +
-+EXE=$1
-+
-+usage()
-+{
-+    echo "Usage: ${0} <path to 'cs2cs' program>"
-+    echo
-+    exit 1
-+}
-+
-+if test -z "${EXE}"; then
-+    EXE=../src/cs2cs
-+fi
-+
-+if test ! -x ${EXE}; then
-+    echo "*** ERROR: Can not find '${EXE}' program!"
-+    exit 1
-+fi
-+
-+echo "==============================================="
-+echo "Running ${0} using ${EXE}:"
-+echo "==============================================="
-+
-+OUT=testrdtrans2008_out
-+
-+ETRS89="epsg:4258"
-+RDNAP="rdnap:rdnap"
-+
-+echo "doing tests into file ${OUT}, please wait"
-+
-+rm -f ${OUT}
-+
-+
-+# From ETRS89 to RD/NAP
-+
-+cat >>${OUT} <<EOF
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# | No. | Name              | ETRS89       |               |          | RD/NAP      |             |         |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# |     |                   | latitude (°) | longitude (°) |    h (m) |       x (m) |       y (m) | NAP (m) |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# | 01  | Texel             | 53.160753042 |   4.824761912 |  42.8614 | 117380.1200 | 575040.3400 |  1.0000 |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+
-+EOF
-+
-+$EXE -r +init=$ETRS89 +to +init=$RDNAP -E -f '%.4f' >>${OUT} <<EOF
-+53.160753042 4.824761912 42.8614
-+EOF
-+
-+cat >>${OUT} <<EOF
-+
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# | No. | Name              | ETRS89       |               |          | RD/NAP      |             |         |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# |     |                   | latitude (°) | longitude (°) |    h (m) |       x (m) |       y (m) | NAP (m) |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# | 02  | Noord-Groningen   | 53.419482050 |   6.776726674 |  42.3586 | 247380.5600 | 604580.7800 |  2.0000 |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+
-+EOF
-+
-+$EXE -r +init=$ETRS89 +to +init=$RDNAP -E -f '%.4f' >>${OUT} <<EOF
-+53.419482050 6.776726674 42.3586
-+EOF
-+
-+cat >>${OUT} <<EOF
-+
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# | No. | Name              | ETRS89       |               |          | RD/NAP      |             |         |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# |     |                   | latitude (°) | longitude (°) |    h (m) |       x (m) |       y (m) | NAP (m) |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# | 03  | Amersfoort        | 52.155172897 |   5.387203657 |  43.2551 | 155000.0000 | 463000.0000 |  0.0000 |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+
-+EOF
-+
-+$EXE -r +init=$ETRS89 +to +init=$RDNAP -E -f '%.4f' >>${OUT} <<EOF
-+52.155172897 5.387203657 43.2551
-+EOF
-+
-+cat >>${OUT} <<EOF
-+
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# | No. | Name              | ETRS89       |               |          | RD/NAP      |             |         |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# |     |                   | latitude (°) | longitude (°) |    h (m) |       x (m) |       y (m) | NAP (m) |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# | 04  | Zeeuws-Vlaanderen | 51.368607152 |   3.397588595 |  47.4024 |  16460.9100 | 377380.2300 |  3.0000 |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+
-+EOF
-+
-+$EXE -r +init=$ETRS89 +to +init=$RDNAP -E -f '%.4f' >>${OUT} <<EOF
-+51.368607152 3.397588595 47.4024
-+EOF
-+
-+cat >>${OUT} <<EOF
-+
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# | No. | Name              | ETRS89       |               |          | RD/NAP      |             |         |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# |     |                   | latitude (°) | longitude (°) |    h (m) |       x (m) |       y (m) | NAP (m) |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# | 05  | Zuid-Limburg      | 50.792584908 |   5.773795547 | 174.9478 | 182260.4500 | 311480.6700 | 129.000 |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+
-+EOF
-+
-+$EXE -r +init=$ETRS89 +to +init=$RDNAP -E -f '%.4f' >>${OUT} <<EOF
-+50.792584908 5.773795547 174.9478
-+EOF
-+
-+cat >>${OUT} <<EOF
-+
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# | No. | Name              | ETRS89       |               |          | RD/NAP      |             |         |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# |     |                   | latitude (°) | longitude (°) |    h (m) |       x (m) |       y (m) | NAP (m) |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# | 06  | Maasvlakte        | 51.947393898 |   4.072887101 |  47.5968 |  64640.8900 | 440700.0101 |  4.0000 |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+
-+EOF
-+
-+$EXE -r +init=$ETRS89 +to +init=$RDNAP -E -f '%.4f' >>${OUT} <<EOF
-+51.947393898 4.072887101 47.5968
-+EOF
-+
-+cat >>${OUT} <<EOF
-+
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# | No. | Name              | ETRS89       |               |          | RD/NAP      |             |         |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# |     |                   | latitude (°) | longitude (°) |    h (m) |       x (m) |       y (m) | NAP (m) |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# | 07* | No_rd&geoid       | 50.687420405 |   4.608971812 |          | 100000.6700 | 300000.8900 |         |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
++use strict;
++use File::Basename;
++use File::Slurp;
++use Getopt::Long qw(:config bundling no_ignore_case);
++use IPC::Run qw(run);
++use JSON;
 +
-+EOF
++$|=1;
 +
-+$EXE -r +init=$ETRS89 +to +init=$RDNAP -E -f '%.4f' >>${OUT} <<EOF
-+50.687420405 4.608971812
-+EOF
++my %cfg = (
++	    tests   => 'testrdtrans2008.json',
++	    verbose => 0,
++	    help    => 0,
++	  );
 +
-+cat >>${OUT} <<EOF
++my $result = GetOptions(
++			 'v|verbose' => \$cfg{verbose},
++			 'h|help'    => \$cfg{help},
++		       );
 +
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# | No. | Name              | ETRS89       |               |          | RD/NAP      |             |         |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# |     |                   | latitude (°) | longitude (°) |    h (m) |       x (m) |       y (m) | NAP (m) |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# | 08* | No_geoid          | 51.136825197 |   4.601375361 |          | 100000.6700 | 350000.8900 |         |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
++if(!$result || $cfg{help}) {
++	print STDERR "\n" if(!$result);
 +
-+EOF
++	print "Usage: ". basename($0). " [OPTIONS]\n\n";
++	print "Options:\n";
++	print "-v, --verbose   Enable verbose output\n";
++	print "-h, --help      Display this usage information\n";
 +
-+$EXE -r +init=$ETRS89 +to +init=$RDNAP -E -f '%.4f' >>${OUT} <<EOF
-+51.136825197 4.601375361
-+EOF
-+
-+cat >>${OUT} <<EOF
-+
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# | No. | Name              | ETRS89       |               |          | RD/NAP      |             |         |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# |     |                   | latitude (°) | longitude (°) |    h (m) |       x (m) |       y (m) | NAP (m) |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# | 09* | No_rd             | 52.482440839 |   4.268403889 |          |  79000.0100 | 500000.2300 |         |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+
-+EOF
-+
-+$EXE -r +init=$ETRS89 +to +init=$RDNAP -E -f '%.4f' >>${OUT} <<EOF
-+52.482440839 4.268403889
-+EOF
-+
-+cat >>${OUT} <<EOF
-+
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# | No. | Name              | ETRS89       |               |          | RD/NAP      |             |         |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# |     |                   | latitude (°) | longitude (°) |    h (m) |       x (m) |       y (m) | NAP (m) |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# | 10* | edge_rd           | 51.003976532 |   3.891247830 |          |  50000.4500 | 335999.6700 |         |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+
-+EOF
-+
-+$EXE -r +init=$ETRS89 +to +init=$RDNAP -E -f '%.4f' >>${OUT} <<EOF
-+51.003976532 3.891247830
-+EOF
-+
-+
-+# From RD/NAP to ETRS89
-+
-+cat >>${OUT} <<EOF
-+
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+# | No. | Name              | RD/NAP      |             |         | ETRS89       |               |          |
-+# +-----+-------------------+-------------+---------------+---------+--------------+-------------+----------+
-+# |     |                   |       x (m) |       y (m) | NAP (m) | latitude (°) | longitude (°) |    h (m) |
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+# | 01  | Texel             | 117380.1200 | 575040.3400 |  1.0000 | 53.160753042 |   4.824761912 |  42.8614 |
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+
-+EOF
-+
-+$EXE -s +init=$RDNAP +to +init=$ETRS89 -E -f '%.9f' >>${OUT} <<EOF
-+117380.1200 575040.3400 1.0000
-+EOF
-+
-+cat >>${OUT} <<EOF
-+
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+# | No. | Name              | RD/NAP      |             |         | ETRS89       |               |          |
-+# +-----+-------------------+-------------+---------------+---------+--------------+-------------+----------+
-+# |     |                   |       x (m) |       y (m) | NAP (m) | latitude (°) | longitude (°) |    h (m) |
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+# | 02  | Noord-Groningen   | 247380.5600 | 604580.7800 |  2.0000 | 53.419482050 |   6.776726674 |  42.3586 |
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+
-+EOF
-+
-+$EXE -s +init=$RDNAP +to +init=$ETRS89 -E -f '%.9f' >>${OUT} <<EOF
-+247380.5600 604580.7800 2.0000
-+EOF
-+
-+cat >>${OUT} <<EOF
-+
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+# | No. | Name              | RD/NAP      |             |         | ETRS89       |               |          |
-+# +-----+-------------------+-------------+---------------+---------+--------------+-------------+----------+
-+# |     |                   |       x (m) |       y (m) | NAP (m) | latitude (°) | longitude (°) |    h (m) |
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+# | 03  | Amersfoort        | 155000.0000 | 463000.0000 |  0.0000 | 52.155172897 |   5.387203657 |  43.2551 |
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+
-+EOF
-+
-+$EXE -s +init=$RDNAP +to +init=$ETRS89 -E -f '%.9f' >>${OUT} <<EOF
-+155000.0000 463000.0000 0.0000
-+EOF
-+
-+cat >>${OUT} <<EOF
-+
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+# | No. | Name              | RD/NAP      |             |         | ETRS89       |               |          |
-+# +-----+-------------------+-------------+---------------+---------+--------------+-------------+----------+
-+# |     |                   |       x (m) |       y (m) | NAP (m) | latitude (°) | longitude (°) |    h (m) |
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+# | 04  | Zeeuws-Vlaanderen |  16460.9100 | 377380.2300 |  3.0000 | 51.368607152 |   3.397588595 |  47.4024 |
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+
-+EOF
-+
-+$EXE -s +init=$RDNAP +to +init=$ETRS89 -E -f '%.9f' >>${OUT} <<EOF
-+16460.9100 377380.2300 3.0000
-+EOF
-+
-+cat >>${OUT} <<EOF
-+
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+# | No. | Name              | RD/NAP      |             |         | ETRS89       |               |          |
-+# +-----+-------------------+-------------+---------------+---------+--------------+-------------+----------+
-+# |     |                   |       x (m) |       y (m) | NAP (m) | latitude (°) | longitude (°) |    h (m) |
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+# | 05  | Zuid-Limburg      | 182260.4500 | 311480.6700 | 129.000 | 50.792584908 |   5.773795547 | 174.9478 |
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+
-+EOF
-+
-+$EXE -s +init=$RDNAP +to +init=$ETRS89 -E -f '%.9f' >>${OUT} <<EOF
-+182260.4500 311480.6700 129.000
-+EOF
-+
-+cat >>${OUT} <<EOF
-+
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+# | No. | Name              | RD/NAP      |             |         | ETRS89       |               |          |
-+# +-----+-------------------+-------------+---------------+---------+--------------+-------------+----------+
-+# |     |                   |       x (m) |       y (m) | NAP (m) | latitude (°) | longitude (°) |    h (m) |
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+# | 06  | Maasvlakte        |  64640.8900 | 440700.0100 |  4.0000 | 51.947393898 |   4.072887101 |  47.5968 |
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+
-+EOF
-+
-+$EXE -s +init=$RDNAP +to +init=$ETRS89 -E -f '%.9f' >>${OUT} <<EOF
-+64640.8900 440700.0100 4.0000
-+EOF
-+
-+cat >>${OUT} <<EOF
++	exit 1;
++}
 +
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+# | No. | Name              | RD/NAP      |             |         | ETRS89       |               |          |
-+# +-----+-------------------+-------------+---------------+---------+--------------+-------------+----------+
-+# |     |                   |       x (m) |       y (m) | NAP (m) | latitude (°) | longitude (°) |    h (m) |
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+# | 07* | No_rd&geoid       | 100000.6700 | 300000.8900 |         | 50.687420405 |   4.608971812 |          |
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+
-+EOF
-+
-+$EXE -s +init=$RDNAP +to +init=$ETRS89 -E -f '%.9f' >>${OUT} <<EOF
-+100000.6700 300000.8900
-+EOF
-+
-+cat >>${OUT} <<EOF
-+
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+# | No. | Name              | RD/NAP      |             |         | ETRS89       |               |          |
-+# +-----+-------------------+-------------+---------------+---------+--------------+-------------+----------+
-+# |     |                   |       x (m) |       y (m) | NAP (m) | latitude (°) | longitude (°) |    h (m) |
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+# | 08* | No_geoid          | 100000.6700 | 350000.8900 |         | 51.136825197 |   4.601375361 |          |
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+
-+EOF
-+
-+$EXE -s +init=$RDNAP +to +init=$ETRS89 -E -f '%.9f' >>${OUT} <<EOF
-+100000.6700 350000.8900
-+EOF
-+
-+cat >>${OUT} <<EOF
-+
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+# | No. | Name              | RD/NAP      |             |         | ETRS89       |               |          |
-+# +-----+-------------------+-------------+---------------+---------+--------------+-------------+----------+
-+# |     |                   |       x (m) |       y (m) | NAP (m) | latitude (°) | longitude (°) |    h (m) |
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+# | 09* | No_rd             |  79000.0100 | 500000.2300 |         | 52.482440839 |   4.268403889 |          |
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+
-+EOF
-+
-+$EXE -s +init=$RDNAP +to +init=$ETRS89 -E -f '%.9f' >>${OUT} <<EOF
++$cfg{verbose} = 1 if($ENV{VERBOSE});
 +
-+EOF
-+
-+cat >>${OUT} <<EOF
-+
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+# | No. | Name              | RD/NAP      |             |         | ETRS89       |               |          |
-+# +-----+-------------------+-------------+---------------+---------+--------------+-------------+----------+
-+# |     |                   |       x (m) |       y (m) | NAP (m) | latitude (°) | longitude (°) |    h (m) |
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+# | 10* | edge_rd           |  50000.4500 | 335999.6700 |         | 51.003976532 |   3.891247830 |          |
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+
-+EOF
-+
-+$EXE -s +init=$RDNAP +to +init=$ETRS89 -E -f '%.9f' >>${OUT} <<EOF
-+50000.4500 335999.6700
-+EOF
-+
-+##############################################################################
-+# Done!
-+# do 'diff' with distribution results
-+
-+echo "diff ${OUT} with ${OUT}.dist"
-+diff -b ${OUT} ${OUT}.dist
-+if [ $? -ne 0 ] ; then
-+	echo  ""
-+	echo "PROBLEMS HAVE OCCURED"
-+	echo "test file ${OUT} saved"
-+	echo
-+	exit 100
-+else
-+	echo "TEST OK"
-+	echo "test file ${OUT} removed"
-+	echo
-+	/bin/rm -f ${OUT}
-+	exit 0
-+fi
++if(!-r $cfg{tests}) {
++	print "Error: Cannot read tests file: $cfg{tests}\n";
++	exit 1;
++}
 +
---- /dev/null
-+++ b/epsg
-@@ -0,0 +1,2 @@
-+# ETRS89
-+<4258> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
---- /dev/null
-+++ b/rdnap
-@@ -0,0 +1,5 @@
-+# RDNAP with NTv2 and VDatum
-+<rdnap> +proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +nadgrids=rdtrans2008.gsb +geoidgrids=naptrans2008.gtx +units=m +no_defs <>
++my $json  = read_file($cfg{tests});
++my $tests = from_json($json);
++
++my %proj = (
++	     etrs89 => {
++		         init   => 'epsg:4258',
++		         args   => '-r',
++		         format => '%.9f',
++		       },
++	     rdnap  => {
++		         init   => 'rdnap:rdnap',
++		         args   => '-s',
++		         format => '%.4f',
++		       },
++	   );
++
++my @directions = (
++		   {
++		     name => 'From ETRS89 to RD/NAP',
++		     src  => 'etrs89',
++		     dst  => 'rdnap',
++		   },
++		   {
++		     name => 'From RD/NAP to ETRS89',
++		     src  => 'rdnap',
++		     dst  => 'etrs89',
++		   },
++		 );
++
++my $errors = 0;
++
++foreach my $direction (@directions) {
++	print "Direction: $direction->{name}\n\n" if($cfg{verbose});
++
++	foreach my $test (@{$tests}) {
++		print "Test:   $test->{number} $test->{name}\n" if($cfg{verbose});
++
++		my @cmd = (
++			    'cs2cs',
++			    $proj{ $direction->{src} }->{args},
++			    '+init='.$proj{ $direction->{src} }->{init},
++			    '+to',
++			    '+init='.$proj{ $direction->{dst} }->{init},
++			    '-f', $proj{ $direction->{dst} }->{format},
++			  );
++
++		my ($in, $out, $err) = '';
++
++		if($direction->{src} eq 'etrs89') {
++			$in  = $test->{etrs89}->{latitude}." ".$test->{etrs89}->{longitude};
++			$in .= " ".$test->{etrs89}->{height} if($test->{etrs89}->{height});
++			$in .= "\n";
++		}
++		elsif($direction->{src} eq 'rdnap') {
++			$in  = $test->{rdnap}->{x}." ".$test->{rdnap}->{y};
++			$in .= " ".$test->{rdnap}->{nap} if($test->{rdnap}->{nap});
++			$in .= "\n";
++		}
++		else {
++			print "Warning: Unsupported source: $direction->{src}, skipping test\n";
++			next;
++		}
++
++		my $expect = '';
++
++		if($direction->{dst} eq 'etrs89') {
++			$expect  = $test->{etrs89}->{latitude}."\t".$test->{etrs89}->{longitude};
++			$expect .= " ".$test->{etrs89}->{height} if($test->{etrs89}->{height});
++			$expect .= "\n";
++		}
++		elsif($direction->{dst} eq 'rdnap') {
++			$expect  = $test->{rdnap}->{x}."\t".$test->{rdnap}->{y};
++			$expect .= " ".$test->{rdnap}->{nap} if($test->{rdnap}->{nap});
++			$expect .= "\n";
++		}
++		else {
++			print "Warning: Unsupported source: $direction->{src}, skipping test\n";
++			next;
++		}
++
++		if($cfg{verbose}) {
++			print "Exec:   @cmd\n";
++			print "Input:  $in";
++		}
++
++		run \@cmd, \$in, \$out, \$err || die "Error: Command failed: @cmd ($?)";
++
++		if($cfg{verbose}) {
++			print "STDERR: $err" if($err);
++			print "Output: $out";
++			print "Expect: $expect";
++		}
++
++		my $ok  = 1;
++		my $msg = '';
++
++		if($out ne $expect) {
++			chomp($out);
++			chomp($expect);
++
++			my @out_parts    = split /[\t ]/, $out;
++			my @expect_parts = split /[\t ]/, $expect;
++
++			if($direction->{dst} eq 'etrs89') {
++				if($out_parts[0] =~ /^\d+\.\d+$/) {
++					my $diff = 0;
++					my $max  = 0.00000001;
++
++					if($out_parts[0] > $expect_parts[0]) {
++						$diff = $out_parts[0] - $expect_parts[0];
++					}
++					elsif($out_parts[0] < $expect_parts[0]) {
++						$diff = $expect_parts[0] - $out_parts[0];
++					}
++
++					if($diff > $max) {
++						print "Latitude exceeds $max degrees: $diff\n" if($cfg{verbose});
++						$ok = 0;
++					}
++				}
++				elsif($test->{override} && $test->{override}->{latitude} && $out_parts[0] ne $test->{override}->{latitude}) {
++					print "Latitude not expected: $out_parts[0], expected: $test->{override}->{latitude}\n" if($cfg{verbose});
++					$ok = 0;
++				}
++
++				if($out_parts[1] =~ /^\d+\.\d+$/) {
++					my $diff = 0;
++					my $max  = 0.00000001;
++
++					if($out_parts[1] > $expect_parts[1]) {
++						$diff = $out_parts[1] - $expect_parts[1];
++					}
++					elsif($out_parts[1] < $expect_parts[1]) {
++						$diff = $expect_parts[1] - $out_parts[1];
++					}
++
++					if($diff > $max) {
++						print "Longitude exceeds $max degrees: $diff\n" if($cfg{verbose});
++						$ok = 0;
++					}
++				}
++				elsif($test->{override} && $test->{override}->{longitude} && $out_parts[1] ne $test->{override}->{longitude}) {
++					print "Longitude not expected: $out_parts[1], expected: $test->{override}->{longitude}\n" if($cfg{verbose});
++					$ok = 0;
++				}
++
++				if($out_parts[2]    && $out_parts[2]    =~ /^\d+\.\d+$/ &&
++				   $expect_parts[2] && $expect_parts[2] =~ /^\d+\.\d+$/
++			  	) {
++					my $diff = 0;
++					my $max  = 0.001;
++
++					if($out_parts[2] > $expect_parts[2]) {
++						$diff = $out_parts[2] - $expect_parts[2];
++					}
++					elsif($out_parts[2] < $expect_parts[2]) {
++						$diff = $expect_parts[2] - $out_parts[2];
++					}
++
++					if($diff > $max) {
++						print "Height exceeds $max meters: $diff\n" if($cfg{verbose});
++						$ok = 0;
++					}
++				}
++				elsif($test->{override} && $test->{override}->{height} && $out_parts[2] !~ /$test->{override}->{height}/) {
++					print "Height not expected: $out_parts[2], expected: $test->{override}->{height}\n" if($cfg{verbose});
++					$ok = 0;
++				}
++			}
++			elsif($direction->{dst} eq 'rdnap') {
++				if($out_parts[0] =~ /^\d+\.\d+$/) {
++					my $diff = 0;
++					my $max  = 0.001;
++
++					if($out_parts[0] > $expect_parts[0]) {
++						$diff = $out_parts[0] - $expect_parts[0];
++					}
++					elsif($out_parts[0] < $expect_parts[0]) {
++						$diff = $expect_parts[0] - $out_parts[0];
++					}
++
++					if($diff > $max) {
++						print "x coordinate exceeds $max meters: $diff\n" if($cfg{verbose});
++						$ok = 0;
++					}
++				}
++				elsif($test->{override} && $test->{override}->{x} && $out_parts[0] ne $test->{override}->{x}) {
++					print "x coordinate not expected: $out_parts[0], expected: $test->{override}->{x}\n" if($cfg{verbose});
++					$ok = 0;
++				}
++
++				if($out_parts[1] =~ /^\d+\.\d+$/) {
++					my $diff = 0;
++					my $max  = 0.001;
++
++					if($out_parts[1] > $expect_parts[1]) {
++						$diff = $out_parts[1] - $expect_parts[1];
++					}
++					elsif($out_parts[1] < $expect_parts[1]) {
++						$diff = $expect_parts[1] - $out_parts[1];
++					}
++
++					if($diff > $max) {
++						print "y coordinate exceeds $max meters: $diff\n" if($cfg{verbose});
++						$ok = 0;
++					}
++				}
++				elsif($test->{override} && $test->{override}->{y} && $out_parts[1] ne $test->{override}->{y}) {
++					print "y coordinate not expected: $out_parts[1], expected: $test->{override}->{y}\n" if($cfg{verbose});
++					$ok = 0;
++				}
++
++				if($out_parts[2]    && $out_parts[2]    =~ /^\d+\.\d+$/ &&
++				   $expect_parts[2] && $expect_parts[2] =~ /^\d+\.\d+$/
++			  	) {
++					my $diff = 0;
++					my $max  = 0.001;
++
++					if($out_parts[2] > $expect_parts[2]) {
++						$diff = $out_parts[2] - $expect_parts[2];
++					}
++					elsif($out_parts[2] < $expect_parts[2]) {
++						$diff = $expect_parts[2] - $out_parts[2];
++					}
++
++					if($diff > $max) {
++						print "NAP exceeds $max meters: $diff\n" if($cfg{verbose});
++						$ok = 0;
++					}
++				}
++				elsif($test->{override} && $test->{override}->{nap} && $out_parts[2] !~ /$test->{override}->{nap}/) {
++					print "NAP not expected: $out_parts[2], expected: $test->{override}->{nap}\n" if($cfg{verbose});
++					$ok = 0;
++				}
++			}
++
++			$msg = "Not identical, but within margin" if($ok);
++
++			if($test->{override}) {
++				$msg = "Expected output overriden";
++
++				if($direction->{dst} eq 'etrs89'  &&
++				   $test->{override}->{latitude}  &&
++				   $test->{override}->{longitude} &&
++				   $test->{override}->{height}
++				) {
++					$msg .= ": $test->{override}->{latitude}\t$test->{override}->{longitude} $test->{override}->{height}";
++				}
++
++				if($direction->{dst} eq 'rdnap' &&
++				   $test->{override}->{x}       &&
++				   $test->{override}->{y}       &&
++				   $test->{override}->{nap}
++				) {
++					$msg .= ": $test->{override}->{x}\t$test->{override}->{y} $test->{override}->{nap}";
++				}
++			}
++		}
++
++		if($ok) {
++			print "Test OK: $direction->{name} - $test->{number} $test->{name}";
++			print " ($msg)" if($msg);
++			print "\n";
++		}
++		else {
++			print "Test FAILED: $direction->{name} - $test->{number} $test->{name}";
++			print " ($msg)" if($msg);
++			print "\n";
++
++			$errors++;
++		}
++
++		print "\n" if($cfg{verbose});
++	}
++}
 +
-+# RD with NTv2 only
-+<rd> +proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +nadgrids=rdtrans2008.gsb +units=m +no_defs <>
---- /dev/null
-+++ b/testrdtrans2008_out.dist
-@@ -0,0 +1,199 @@
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# | No. | Name              | ETRS89       |               |          | RD/NAP      |             |         |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# |     |                   | latitude (°) | longitude (°) |    h (m) |       x (m) |       y (m) | NAP (m) |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# | 01  | Texel             | 53.160753042 |   4.824761912 |  42.8614 | 117380.1200 | 575040.3400 |  1.0000 |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+
-+53.160753042 4.824761912 42.8614	117380.1200	575040.3400 1.0000
-+
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# | No. | Name              | ETRS89       |               |          | RD/NAP      |             |         |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# |     |                   | latitude (°) | longitude (°) |    h (m) |       x (m) |       y (m) | NAP (m) |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# | 02  | Noord-Groningen   | 53.419482050 |   6.776726674 |  42.3586 | 247380.5600 | 604580.7800 |  2.0000 |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+
-+53.419482050 6.776726674 42.3586	247380.5600	604580.7800 2.0000
-+
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# | No. | Name              | ETRS89       |               |          | RD/NAP      |             |         |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# |     |                   | latitude (°) | longitude (°) |    h (m) |       x (m) |       y (m) | NAP (m) |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# | 03  | Amersfoort        | 52.155172897 |   5.387203657 |  43.2551 | 155000.0000 | 463000.0000 |  0.0000 |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+
-+52.155172897 5.387203657 43.2551	155000.0000	463000.0000 0.0000
-+
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# | No. | Name              | ETRS89       |               |          | RD/NAP      |             |         |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# |     |                   | latitude (°) | longitude (°) |    h (m) |       x (m) |       y (m) | NAP (m) |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# | 04  | Zeeuws-Vlaanderen | 51.368607152 |   3.397588595 |  47.4024 |  16460.9100 | 377380.2300 |  3.0000 |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+
-+51.368607152 3.397588595 47.4024	16460.9100	377380.2300 3.0000
-+
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# | No. | Name              | ETRS89       |               |          | RD/NAP      |             |         |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# |     |                   | latitude (°) | longitude (°) |    h (m) |       x (m) |       y (m) | NAP (m) |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# | 05  | Zuid-Limburg      | 50.792584908 |   5.773795547 | 174.9478 | 182260.4500 | 311480.6700 | 129.000 |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+
-+50.792584908 5.773795547 174.9478	182260.4500	311480.6700 129.0000
-+
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# | No. | Name              | ETRS89       |               |          | RD/NAP      |             |         |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# |     |                   | latitude (°) | longitude (°) |    h (m) |       x (m) |       y (m) | NAP (m) |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# | 06  | Maasvlakte        | 51.947393898 |   4.072887101 |  47.5968 |  64640.8900 | 440700.0101 |  4.0000 |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+
-+51.947393898 4.072887101 47.5968	64640.8900	440700.0101 4.0000
-+
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# | No. | Name              | ETRS89       |               |          | RD/NAP      |             |         |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# |     |                   | latitude (°) | longitude (°) |    h (m) |       x (m) |       y (m) | NAP (m) |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# | 07* | No_rd&geoid       | 50.687420405 |   4.608971812 |          | 100000.6700 | 300000.8900 |         |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+
-+50.687420405 4.608971812	100000.6700	300000.8900
-+
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# | No. | Name              | ETRS89       |               |          | RD/NAP      |             |         |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# |     |                   | latitude (°) | longitude (°) |    h (m) |       x (m) |       y (m) | NAP (m) |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# | 08* | No_geoid          | 51.136825197 |   4.601375361 |          | 100000.6700 | 350000.8900 |         |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+
-+51.136825197 4.601375361	100000.6700	350000.8900
-+
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# | No. | Name              | ETRS89       |               |          | RD/NAP      |             |         |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# |     |                   | latitude (°) | longitude (°) |    h (m) |       x (m) |       y (m) | NAP (m) |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# | 09* | No_rd             | 52.482440839 |   4.268403889 |          |  79000.0100 | 500000.2300 |         |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+
-+52.482440839 4.268403889	79000.0100	500000.2300
-+
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# | No. | Name              | ETRS89       |               |          | RD/NAP      |             |         |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# |     |                   | latitude (°) | longitude (°) |    h (m) |       x (m) |       y (m) | NAP (m) |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+# | 10* | edge_rd           | 51.003976532 |   3.891247830 |          |  50000.4500 | 335999.6700 |         |
-+# +-----+-------------------+--------------+---------------+----------+-------------+-------------+---------+
-+
-+51.003976532 3.891247830	50000.4500	335999.6700
-+
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+# | No. | Name              | RD/NAP      |             |         | ETRS89       |               |          |
-+# +-----+-------------------+-------------+---------------+---------+--------------+-------------+----------+
-+# |     |                   |       x (m) |       y (m) | NAP (m) | latitude (°) | longitude (°) |    h (m) |
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+# | 01  | Texel             | 117380.1200 | 575040.3400 |  1.0000 | 53.160753042 |   4.824761912 |  42.8614 |
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+
-+117380.1200 575040.3400 1.0000	53.160753042	4.824761912 42.8614
-+
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+# | No. | Name              | RD/NAP      |             |         | ETRS89       |               |          |
-+# +-----+-------------------+-------------+---------------+---------+--------------+-------------+----------+
-+# |     |                   |       x (m) |       y (m) | NAP (m) | latitude (°) | longitude (°) |    h (m) |
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+# | 02  | Noord-Groningen   | 247380.5600 | 604580.7800 |  2.0000 | 53.419482050 |   6.776726674 |  42.3586 |
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+
-+247380.5600 604580.7800 2.0000	53.419482050	6.776726674 42.3586
-+
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+# | No. | Name              | RD/NAP      |             |         | ETRS89       |               |          |
-+# +-----+-------------------+-------------+---------------+---------+--------------+-------------+----------+
-+# |     |                   |       x (m) |       y (m) | NAP (m) | latitude (°) | longitude (°) |    h (m) |
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+# | 03  | Amersfoort        | 155000.0000 | 463000.0000 |  0.0000 | 52.155172897 |   5.387203657 |  43.2551 |
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+
-+155000.0000 463000.0000 0.0000	52.155172897	5.387203657 43.2551
-+
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+# | No. | Name              | RD/NAP      |             |         | ETRS89       |               |          |
-+# +-----+-------------------+-------------+---------------+---------+--------------+-------------+----------+
-+# |     |                   |       x (m) |       y (m) | NAP (m) | latitude (°) | longitude (°) |    h (m) |
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+# | 04  | Zeeuws-Vlaanderen |  16460.9100 | 377380.2300 |  3.0000 | 51.368607152 |   3.397588595 |  47.4024 |
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+
-+16460.9100 377380.2300 3.0000	51.368607152	3.397588595 47.4024
-+
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+# | No. | Name              | RD/NAP      |             |         | ETRS89       |               |          |
-+# +-----+-------------------+-------------+---------------+---------+--------------+-------------+----------+
-+# |     |                   |       x (m) |       y (m) | NAP (m) | latitude (°) | longitude (°) |    h (m) |
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+# | 05  | Zuid-Limburg      | 182260.4500 | 311480.6700 | 129.000 | 50.792584908 |   5.773795547 | 174.9478 |
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+
-+182260.4500 311480.6700 129.000	50.792584908	5.773795547 174.9478
-+
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+# | No. | Name              | RD/NAP      |             |         | ETRS89       |               |          |
-+# +-----+-------------------+-------------+---------------+---------+--------------+-------------+----------+
-+# |     |                   |       x (m) |       y (m) | NAP (m) | latitude (°) | longitude (°) |    h (m) |
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+# | 06  | Maasvlakte        |  64640.8900 | 440700.0100 |  4.0000 | 51.947393898 |   4.072887101 |  47.5968 |
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+
-+64640.8900 440700.0100 4.0000	51.947393898	4.072887101 47.5968
-+
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+# | No. | Name              | RD/NAP      |             |         | ETRS89       |               |          |
-+# +-----+-------------------+-------------+---------------+---------+--------------+-------------+----------+
-+# |     |                   |       x (m) |       y (m) | NAP (m) | latitude (°) | longitude (°) |    h (m) |
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+# | 07* | No_rd&geoid       | 100000.6700 | 300000.8900 |         | 50.687420405 |   4.608971812 |          |
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+
-+100000.6700 300000.8900	50.687420405	4.608971812
-+
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+# | No. | Name              | RD/NAP      |             |         | ETRS89       |               |          |
-+# +-----+-------------------+-------------+---------------+---------+--------------+-------------+----------+
-+# |     |                   |       x (m) |       y (m) | NAP (m) | latitude (°) | longitude (°) |    h (m) |
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+# | 08* | No_geoid          | 100000.6700 | 350000.8900 |         | 51.136825197 |   4.601375361 |          |
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+
-+100000.6700 350000.8900	51.136825197	4.601375361
-+
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+# | No. | Name              | RD/NAP      |             |         | ETRS89       |               |          |
-+# +-----+-------------------+-------------+---------------+---------+--------------+-------------+----------+
-+# |     |                   |       x (m) |       y (m) | NAP (m) | latitude (°) | longitude (°) |    h (m) |
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+# | 09* | No_rd             |  79000.0100 | 500000.2300 |         | 52.482440839 |   4.268403889 |          |
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+
-+79000.0100 500000.2300	52.482440839	4.268403889
-+
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+# | No. | Name              | RD/NAP      |             |         | ETRS89       |               |          |
-+# +-----+-------------------+-------------+---------------+---------+--------------+-------------+----------+
-+# |     |                   |       x (m) |       y (m) | NAP (m) | latitude (°) | longitude (°) |    h (m) |
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+# | 10* | edge_rd           |  50000.4500 | 335999.6700 |         | 51.003976532 |   3.891247830 |          |
-+# +-----+-------------------+-------------+-------------+---------+--------------+---------------+----------+
-+
-+50000.4500 335999.6700	51.003976532	3.891247830
++exit $errors;
diff --git a/debian/rules b/debian/rules
index 9ece09b..fb20573 100755
--- a/debian/rules
+++ b/debian/rules
@@ -9,7 +9,7 @@ override_dh_clean:
 	dh_clean testrdtrans2008_out
 
 override_dh_auto_test:
-	PROJ_LIB=. /bin/sh ./testrdtrans2008 /usr/bin/cs2cs || echo "Ignoring test failure"
+	PROJ_LIB=. perl ./testrdtrans2008.pl
 
 get-orig-source:
 	. debian/get-orig-source

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/proj-rdnap.git



More information about the Pkg-grass-devel mailing list