From 8cfc81380617ff4a17a06a97635f77c5e9ed7d5b Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sun, 19 Aug 2018 14:13:06 +0200 Subject: pj_inv(): fix inverse of +proj=longlat +geoc There is a regression in PROJ 5 regarding the handling of the +geoc flag, specific to the case of +proj=longlat, and the inverse transformation, which makes it a no-op: echo "12 55 0 " | src/cct +proj=pipeline +step +proj=longlat +ellps=GRS80 +geoc +inv 12.0000000000 55.0000000000 0.0000 inf With this fix, we now get: echo "12 55 0 " | src/cct +proj=pipeline +step +proj=longlat +ellps=GRS80 +geoc +inv 12.0000000000 54.8189733083 0.0000 inf The fix consists in making inv_prepare() do symetrically as fwd_finalize(), ie skip a number of transforms when left and right units are angular, and in inv_finalize() apply the (OUTPUT_UNITS==PJ_IO_UNITS_ANGULAR) processing even if INPUT_UNITS == PJ_IO_UNITS_ANGULAR --- test/gie/more_builtins.gie | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test') diff --git a/test/gie/more_builtins.gie b/test/gie/more_builtins.gie index 2908fd63..15964a37 100644 --- a/test/gie/more_builtins.gie +++ b/test/gie/more_builtins.gie @@ -356,6 +356,16 @@ accept 12 89.99999999999 0 0 expect 12 89.999999999989996 0 0 ------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +geocentric latitude using old +geoc flag +------------------------------------------------------------------------------- +operation proj=pipeline step proj=longlat ellps=GRS80 geoc inv +accept 12 55 0 0 +expect 12 54.818973308324573 0 0 +roundtrip 1 +------------------------------------------------------------------------------- + + ------------------------------------------------------------------------------- some less used options -- cgit v1.2.3