From 6e95d484cd653e32b3a51e6fd7e811c77ba26117 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Sat, 24 Feb 2018 11:20:29 +0100 Subject: [PATCH] Added support for OGC:CRS84 CRS to WMTS maps --- src/map/wmts.cpp | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/src/map/wmts.cpp b/src/map/wmts.cpp index 8aa8106f..d65f03d9 100644 --- a/src/map/wmts.cpp +++ b/src/map/wmts.cpp @@ -34,19 +34,26 @@ bool WMTS::createProjection(const QString &crs) return false; } - if (authority != "EPSG") - return false; - epsg = code.toInt(&res); - if (!res) - return false; + if (authority == "EPSG") { + epsg = code.toInt(&res); + if (!res) + return false; - if ((pcs = PCS::pcs(epsg))) { - _projection = Projection(pcs->gcs(), pcs->method(), pcs->setup(), - pcs->units()); - return true; - } else if ((gcs = GCS::gcs(epsg))) { - _projection = Projection(gcs); - return true; + if ((pcs = PCS::pcs(epsg))) { + _projection = Projection(pcs->gcs(), pcs->method(), pcs->setup(), + pcs->units()); + return true; + } else if ((gcs = GCS::gcs(epsg))) { + _projection = Projection(gcs); + return true; + } else + return false; + } else if (authority == "OGC") { + if (code == "CRS84") { + _projection = Projection(GCS::gcs(4326)); + return true; + } else + return false; } else return false; }