diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-11-25 14:56:31 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2019-11-25 15:07:25 +0100 |
| commit | d81ffc6fa8a32db72bdfd1ff034c705222d0cdb3 (patch) | |
| tree | 8a20b9d0b7dfbda3e13b089bfa17960f855e217c /test/gie/4D-API_cs2cs-style.gie | |
| parent | ddd8a1243a5eb43ad209e934526c5c87848343b7 (diff) | |
| download | PROJ-d81ffc6fa8a32db72bdfd1ff034c705222d0cdb3.tar.gz PROJ-d81ffc6fa8a32db72bdfd1ff034c705222d0cdb3.zip | |
Pipeline: support +omit_fwd and +omit_inv keywords
Inspired from syntax of https://github.com/OSGeo/PROJ/pull/453/files
but 'rebased' on top of previous commit that cleans up the pipeline implementation
Different situations:
- +omit_fwd:
the step when followed in the forward path will be omitted
the step when followed in the reverse path will be executed
- +omit_fwd +inv:
the step when followed in the forward path will be omitted
the step when followed in the reverse path will be executed (with the inv method)
- +omit_inv:
the step when followed in the forward path will be executed
the step when followed in the reverse path will be omitted
- +omit_inv +inv:
the step when followed in the forward path will be executed (with the inv method)
the step when followed in the reverse path will be omitted
This will be used in the next commit to optimize constructs like
+step +proj=hgridshift +grids=foo
+step +proj=vgridshift +grids=bar
+step +inv +proj=hgridshift +grids=foo
Such steps are used for CRS to CRS transformations where applying the vertical grid
requires to do a transformation to an interpolating CRS. One can notice that
in the last step will just restore the horizontal coordinates before the first step, so
doing an inverse hgridshift is overkill.
So that could be optimized as:
+step +proj=push +v_1 +v_2
+step +proj=hgridshift +grids=foo +omit_inv
+step +proj=vgridshift +grids=bar
+step +inv +proj=hgridshift +grids=foo +omit_fwd
+step +proj=pop +v_1 +v_2
In the forward path, this will be equivalent to:
+step +proj=push +v_1 +v_2
+step +proj=hgridshift +grids=foo
+step +proj=vgridshift +grids=bar
+step +prop=pop +v_1 +v_2
And similarly in the reverse path, this will be quivalent to:
+step +proj=push +v_1 +v_2
+step +proj=hgridshift +grids=foo
+step +inv +proj=vgridshift +grids=bar
+step +proj=pop +v_1 +v_2
Diffstat (limited to 'test/gie/4D-API_cs2cs-style.gie')
| -rw-r--r-- | test/gie/4D-API_cs2cs-style.gie | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/test/gie/4D-API_cs2cs-style.gie b/test/gie/4D-API_cs2cs-style.gie index 19b3ad96..e5722b5e 100644 --- a/test/gie/4D-API_cs2cs-style.gie +++ b/test/gie/4D-API_cs2cs-style.gie @@ -386,6 +386,55 @@ operation +proj=pop +v_3 accept 12 56 0 0 expect 12 56 0 0 +------------------------------------------------------------------------------- +Test Pipeline +omit_inv +------------------------------------------------------------------------------- + +operation +proj=pipeline + +step +proj=affine +xoff=1 +yoff=1 +omit_inv + +accept 2 49 0 0 +expect 3 50 0 0 + +direction inverse +accept 2 49 0 0 +expect 2 49 0 0 + + +operation +proj=pipeline + +step +inv +proj=affine +xoff=1 +yoff=1 +omit_inv + +accept 2 49 0 0 +expect 1 48 0 0 + +direction inverse +accept 2 49 0 0 +expect 2 49 0 0 + +------------------------------------------------------------------------------- +Test Pipeline +omit_fwd +------------------------------------------------------------------------------- + +operation +proj=pipeline + +step +proj=affine +xoff=1 +yoff=1 +omit_fwd + +accept 2 49 0 0 +expect 2 49 0 0 + +direction inverse +accept 2 49 0 0 +expect 1 48 0 0 + + +operation +proj=pipeline + +step +inv +proj=affine +xoff=1 +yoff=1 +omit_fwd + +accept 2 49 0 0 +expect 2 49 0 0 + +direction inverse +accept 2 49 0 0 +expect 3 50 0 0 ------------------------------------------------------------------------------- Test bugfix of https://github.com/OSGeo/proj.4/issues/1002 |
