From edb068401822c0cb7047019ae7a1dac587778ce3 Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Thu, 3 Jan 2019 22:12:22 +0100 Subject: Replace PJ_IO_UNITS_WHATEVER with units from neighbour steps With this commit we make sure that proj_angular_input() and proj_angular_output return the correct result for any given pipeline. --- src/conversions/unitconvert.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/conversions/unitconvert.cpp') diff --git a/src/conversions/unitconvert.cpp b/src/conversions/unitconvert.cpp index cbd81a7d..1e3372d6 100644 --- a/src/conversions/unitconvert.cpp +++ b/src/conversions/unitconvert.cpp @@ -457,6 +457,8 @@ PJ *CONVERSION(unitconvert,0) { P->left = PJ_IO_UNITS_WHATEVER; P->right = PJ_IO_UNITS_WHATEVER; + P->skip_fwd_prepare = 1; + P->skip_inv_prepare = 1; /* if no time input/output unit is specified we can skip them */ Q->t_in_id = -1; @@ -476,6 +478,8 @@ PJ *CONVERSION(unitconvert,0) { } if (f != 0.0) Q->xy_factor *= f; + if (normalized_name != nullptr && strcmp(normalized_name, "Radian") == 0) + P->left = PJ_IO_UNITS_RADIANS; } if ((name = pj_param (P->ctx, P->params, "sxy_out").s) != nullptr) { @@ -489,6 +493,8 @@ PJ *CONVERSION(unitconvert,0) { } if (f != 0.0) Q->xy_factor /= f; + if (normalized_name != nullptr && strcmp(normalized_name, "Radian") == 0) + P->right= PJ_IO_UNITS_RADIANS; } if( xy_in_is_linear >= 0 && xy_out_is_linear >= 0 && -- cgit v1.2.3