From 10a30bb539be1afb25952b19af8bbe72e1b13b56 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Mon, 26 Aug 2019 21:44:21 +0200 Subject: Fix 6.0 regression regarding +init=epsg:4326 +over +to +init=epsg:3857 +over with longitudes outside of [-180,180] --- src/iso19111/io.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/iso19111/io.cpp') diff --git a/src/iso19111/io.cpp b/src/iso19111/io.cpp index 3b630a10..20a90946 100644 --- a/src/iso19111/io.cpp +++ b/src/iso19111/io.cpp @@ -8255,6 +8255,7 @@ CRSNNPtr PROJStringParser::Private::buildProjectedCRS( } auto axisType = AxisType::REGULAR; + bool bWebMercator = false; if (step.name == "tmerc" && ((getParamValue(step, "axis") == "wsu" && iAxisSwap < 0) || @@ -8337,8 +8338,7 @@ CRSNNPtr PROJStringParser::Private::buildProjectedCRS( } } if (getNumericValue(getParamValue(step, "a")) == 6378137) { - return createPseudoMercator(PropertyMap().set( - IdentifiedObject::NAME_KEY, "WGS 84 / Pseudo-Mercator")); + bWebMercator = true; } } else if (hasParamValue(step, "lat_ts")) { mapping = getMapping(EPSG_CODE_METHOD_MERCATOR_VARIANT_B); @@ -8599,7 +8599,11 @@ CRSNNPtr PROJStringParser::Private::buildProjectedCRS( props.set("IMPLICIT_CS", true); - CRSNNPtr crs = ProjectedCRS::create(props, geogCRS, NN_NO_CHECK(conv), cs); + CRSNNPtr crs = + bWebMercator + ? createPseudoMercator(props.set(IdentifiedObject::NAME_KEY, + "WGS 84 / Pseudo-Mercator")) + : ProjectedCRS::create(props, geogCRS, NN_NO_CHECK(conv), cs); if (!hasParamValue(step, "geoidgrids") && (hasParamValue(step, "vunits") || hasParamValue(step, "vto_meter"))) { -- cgit v1.2.3