From a885fbb2f1f285c2cdadacdaa4616bf60184f925 Mon Sep 17 00:00:00 2001 From: Thomas Knudsen Date: Tue, 19 Dec 2017 10:28:16 +0100 Subject: Some corrections in response to a review by Kristian Evers (#718) * Some corrections in response to a review by Kristian Evers --- examples/val_def.demo | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++ nad/val_def.demo | 83 ------------------------------------------------- src/gie.c | 1 - src/pj_init.c | 1 + test/gie/pip.gie | 41 ------------------------- 5 files changed, 86 insertions(+), 125 deletions(-) create mode 100644 examples/val_def.demo delete mode 100644 nad/val_def.demo delete mode 100644 test/gie/pip.gie diff --git a/examples/val_def.demo b/examples/val_def.demo new file mode 100644 index 00000000..315219fd --- /dev/null +++ b/examples/val_def.demo @@ -0,0 +1,85 @@ + +----------------------------------------------------------------------- + + INTEGRATING DEFINITION AND VALIDATION OF GEODETIC SYSTEMS + +----------------------------------------------------------------------- + Thomas Knudsen, thokn@sdfe.dk, 2017-12-06 +----------------------------------------------------------------------- + +This demo shows how to use the free format definition strings, +introduced in PROJ version 5.0.0, to integrate system definition +information with system validation data. + +The system definition parts are used when doing actual transformations, +e.g. using the cct 4D transformation program: + + echo 9 55 0 0 | cct +init=val_def.demo:DKTM1 + +The system validation parts are used when validating the systems +defined in the file. This is done using the gie test program: +Place val_def.demo in your PROJ_LIB directory +(or set PROJ_LIB=) and say: + + gie val_def.demo + +This will result in a report detailing how many tests succeeded, +resp. failed. + +The syntax of proj init files is orthogonal to the syntax of gie +integrity evaluation files. This makes it possible to interleave +init and gie blocks in the same file. + +#----------------------------------------------------------------------- + + + +#----------------------------------------------------------------------- +# Danish Transverse Mercator, zone 1 +#----------------------------------------------------------------------- + proj = etmerc + lat_0 = 0 lon_0 = 9 + x_0 = 200000 y_0 = -5000000 + + k = 0.99998 + + ellps = GRS80 + units = m + + no_defs +#----------------------------------------------------------------------- + +operation init = val_def.demo:DKTM1 +tolerance 100 um +accept 9 55 +expect 200000.0000 1097108.3684 +roundtrip 1000 1 nm + +#----------------------------------------------------------------------- + + + +#----------------------------------------------------------------------- +# Danish Transverse Mercator, zone 2 +#----------------------------------------------------------------------- + proj = etmerc + lat_0 = 0 lon_0 = 10 + x_0 = 400000 y_0 = -5000000 + + k = 0.99998 + + ellps = GRS80 + units = m + + no_defs +#----------------------------------------------------------------------- + +operation init = val_def.demo:DKTM2 +tolerance 100 um +accept 10 55 +expect 400000.0000 1097108.3684 +accept 10.5 55.5 +expect 431597.1668 1152884.9398 +roundtrip 1000 100 um + +#----------------------------------------------------------------------- diff --git a/nad/val_def.demo b/nad/val_def.demo deleted file mode 100644 index 87777b9d..00000000 --- a/nad/val_def.demo +++ /dev/null @@ -1,83 +0,0 @@ - ------------------------------------------------------------------------ - - INTEGRATING DEFINITION AND VALIDATION OF GEODETIC SYSTEMS - ------------------------------------------------------------------------ - Thomas Knudsen, thokn@sdfe.dk, 2017-12-06 ------------------------------------------------------------------------ - -This demo shows how to use the free format definition strings, -introduced in PROJ version 5.0.0, to integrate system definition -information with system validation data. - -The system definition parts are used when doing actual transformations, -e.g. using the cct 4D transformation program: - - echo 9 55 0 0 | cct +init=val_def.demo:DKTM1 - -The system validation parts are used when validating the systems -defined in the file. This is done using the gie test program: - - gie val_def.demo - -Which will respond with a report detailing how many tests succeeded, -resp. failed. - -The syntax of proj init files is orthogonal to the syntax of gie -integrity evaluation files. This makes it possible to interleave -init and gie blocks in the same file. - -#----------------------------------------------------------------------- - - - -#----------------------------------------------------------------------- -# Danish Transverse Mercator, zone 1 -#----------------------------------------------------------------------- - proj = etmerc - lat_0 = 0 lon_0 = 9 - x_0 = 200000 y_0 = -5000000 - - k = 0.99998 - - ellps = GRS80 - units = m - - no_defs -#----------------------------------------------------------------------- - -operation init = val_def.demo:DKTM1 -tolerance 100 um -accept 9 55 -expect 200000.0000 1097108.3684 -roundtrip 1000 1 nm - -#----------------------------------------------------------------------- - - - -#----------------------------------------------------------------------- -# Danish Transverse Mercator, zone 2 -#----------------------------------------------------------------------- - proj = etmerc - lat_0 = 0 lon_0 = 10 - x_0 = 400000 y_0 = -5000000 - - k = 0.99998 - - ellps = GRS80 - units = m - - no_defs -#----------------------------------------------------------------------- - -operation init = val_def.demo:DKTM2 -tolerance 100 um -accept 10 55 -expect 400000.0000 1097108.3684 -accept 10.5 55.5 -expect 431597.1668 1152884.9398 -roundtrip 1000 100 um - -#----------------------------------------------------------------------- diff --git a/src/gie.c b/src/gie.c index 2ae2ddee..8a1d356e 100644 --- a/src/gie.c +++ b/src/gie.c @@ -1888,7 +1888,6 @@ static int pj_unitconvert_selftest (void) { ret = test_time(args3, 1e-6, in3, in3); if (ret) return ret + 30; ret = test_time(args4, 1e-6, in4, exp4); if (ret) return ret + 40; ret = test_xyz (args5, 1e-10, in5, exp5); if (ret) return ret + 50; - ret = test_xyz (args6, 1e-10, in6, in6); if (ret) return ret + 50; ret = test_xyz (args6, 1e-10, in6, in6); if (ret) return ret + 60; ret = test_time(args7, 1e-6, in7, in7); if (ret) return ret + 70; diff --git a/src/pj_init.c b/src/pj_init.c index 7e885575..1b0f479f 100644 --- a/src/pj_init.c +++ b/src/pj_init.c @@ -344,6 +344,7 @@ where 'ellps=intl' precedes 'ellps=GRS80', and hence takes precedence, turning the expansion into an UTM projection on the Hayford ellipsoid. Note that 'init=foo:bar' stays in the list. It is ignored after expansion. + ******************************************************************************/ paralist *last; paralist *expn; diff --git a/test/gie/pip.gie b/test/gie/pip.gie deleted file mode 100644 index 0cb54614..00000000 --- a/test/gie/pip.gie +++ /dev/null @@ -1,41 +0,0 @@ -These two tests have occasionally been causing segfaults from gie, but -only at low PROJ_DEBUG levels. - - -------------------------------------------------------------------------------- -Finally test a pipeline with more than one init step -------------------------------------------------------------------------------- -operation proj=pipeline step - init=epsg:25832 inv step - init=epsg:25833 step - init=epsg:25833 inv step - init=epsg:25832 -------------------------------------------------------------------------------- -accept 691875.63214 6098907.82501 0 0 -expect 691875.63214 6098907.82501 0 0 -direction inverse -accept 12 55 0 0 -expect 12 55 0 0 -------------------------------------------------------------------------------- - - - -------------------------------------------------------------------------------- -This example is a coordinate from the geodetic observatory in Onsala, -Sweden transformed from ITRF2000 @ 2017.0 to ITRF93 @ 2017.0. - -The test coordinate was transformed using GNSStrans, using transformation -parameters published by ITRF: ftp://itrf.ensg.ign.fr/pub/itrf/ITRF.TP -------------------------------------------------------------------------------- -operation proj=helmert ellps=GRS80 transpose - x = 0.0127 dx = -0.0029 rx = -0.00039 drx = -0.00011 - y = 0.0065 dy = -0.0002 ry = 0.00080 dry = -0.00019 - z = -0.0209 dz = -0.0006 rz = -0.00114 drz = 0.00007 - - s = 0.00195 ds = 0.00001 t_epoch = 1988.0 -------------------------------------------------------------------------------- -tolerance 0.03 mm -accept 3370658.37800 711877.31400 5349787.08600 2017.0 # ITRF2000@2017.0 -expect 3370658.18890 711877.42370 5349787.12430 2017.0 # ITRF93@2017.0 -------------------------------------------------------------------------------- - -- cgit v1.2.3