diff options
Diffstat (limited to 'src/io.cpp')
| -rw-r--r-- | src/io.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -2829,7 +2829,7 @@ bool WKTParser::Private::hasWebMercPROJ4String( projCRSNode->countChildrenOfName("center_latitude") == 0) { // Hack to detect the hacky way of encodign webmerc in GDAL WKT1 - // with a EXTENSION["PROJ", "+proj=merc +a=6378137 +b=6378137 + // with a EXTENSION["PROJ4", "+proj=merc +a=6378137 +b=6378137 // +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m // +nadgrids=@null +wktext +no_defs"] node if (extensionNode && extensionNode->GP()->childrenSize() == 2 && @@ -3274,14 +3274,16 @@ WKTParser::Private::buildProjectedCRS(const WKTNodeNNPtr &node) { if (isNull(conversionNode) && isNull(projectionNode)) { ThrowMissing(WKTConstants::CONVERSION); } + + auto props = buildProperties(node); + if (isNull(conversionNode) && hasWebMercPROJ4String(node, projectionNode)) { auto conversion = Conversion::createPopularVisualisationPseudoMercator( PropertyMap().set(IdentifiedObject::NAME_KEY, "unnamed"), Angle(0), Angle(0), Length(0), Length(0)); + props.set(IdentifiedObject::NAME_KEY, "WGS 84 / Pseudo-Mercator"); return ProjectedCRS::create( - PropertyMap().set(IdentifiedObject::NAME_KEY, - "WGS 84 / Pseudo-Mercator"), - GeographicCRS::EPSG_4326, conversion, + props, GeographicCRS::EPSG_4326, conversion, CartesianCS::createEastingNorthing(UnitOfMeasure::METRE)); } @@ -3377,7 +3379,6 @@ WKTParser::Private::buildProjectedCRS(const WKTNodeNNPtr &node) { ThrowNotExpectedCSType("Cartesian"); } - auto props = buildProperties(node); if (esriStyle_ && dbContext_) { auto projCRSName = stripQuotes(nodeP->children()[0]); |
