diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2021-06-17 17:53:11 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2021-06-17 17:53:11 +0200 |
| commit | 5f6fac3afdb03aef5a26ce5f60c10ed612fa6fc2 (patch) | |
| tree | f26e1e183d1cd73e84eef01571d9596f76d1b5a3 /test | |
| parent | 987c8e9a4521c3e80fac73dbaa76ff77747d854b (diff) | |
| download | PROJ-5f6fac3afdb03aef5a26ce5f60c10ed612fa6fc2.tar.gz PROJ-5f6fac3afdb03aef5a26ce5f60c10ed612fa6fc2.zip | |
proj_trans/cs2cs: If two operations have the same accuracy, use the one that is contained within a larger one
Relates to https://github.com/OSGeo/gdal/issues/3998
Before that change, cs2cs on a NAD83(HARN) to WGS84 transformation would
use the "NAD83(HARN) to WGS 84 (1)" transformation (a null Helmert
shift) that is valid for whole US, including non-CONUS areas, even when
used on points located on CONUS that has a "NAD83(HARN) to WGS 84 (3)"
transformation (non-null Helmert shift) with same accuracy (1m).
But if doing EPSG:2874 "NAD83(HARN) / California zone 5 (ftUS)" to
WGS84, we would use this later "NAD83(HARN) to WGS 84 (3)"
transformation because the area of use of EPSG:2874 restricts to CONUS.
This isn't consistant.
With that change, we now have more consistent behavior, even if it can
be argued which of the 2 transformations is the best...
$ echo 34 -120 | src/cs2cs -d 8 EPSG:4326 "NAD83(HARN)" | src/cs2cs "NAD83(HARN)" EPSG:2874
5955507.74 1828410.98 0.00
$ echo 34 -120 | src/cs2cs EPSG:4326 EPSG:2874
5955507.74 1828410.98 0.00
Diffstat (limited to 'test')
| -rwxr-xr-x | test/cli/testvarious | 6 | ||||
| -rw-r--r-- | test/cli/tv_out.dist | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/test/cli/testvarious b/test/cli/testvarious index e88cf68b..6e9cd43c 100755 --- a/test/cli/testvarious +++ b/test/cli/testvarious @@ -1047,6 +1047,12 @@ $EXE -E EPSG:2636 "WGS 84" >> ${OUT} <<EOF 5540944.47 500000.001 EOF +echo "##############################################################" >> ${OUT} +echo "Check that we select the operation that has the smallest area of use, when 2 have the same accuracy" >> ${OUT} +$EXE -E EPSG:4326 "NAD83(HARN)" >> ${OUT} <<EOF +34 -120 +EOF + # Done! # do 'diff' with distribution results diff --git a/test/cli/tv_out.dist b/test/cli/tv_out.dist index 44926677..9bb85933 100644 --- a/test/cli/tv_out.dist +++ b/test/cli/tv_out.dist @@ -504,3 +504,6 @@ Check that we can use a transformation spanning the antimeridian (should use Pul Check that we can use a transformation spanning the antimeridian (should use Pulkovo 1942 to WGS 84 (20)) 5540944.47 499999.999 49d59'59.36"N 179d59'52.133"W 0.000 5540944.47 500000.001 49d59'59.36"N 179d59'52.133"W 0.000 +############################################################## +Check that we select the operation that has the smallest area of use, when 2 have the same accuracy +34 -120 33d59'59.983"N 119d59'59.955"W 0.000 |
