<div dir="ltr"><div class="gmail_quote"><div>Even,</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
That one is a very odd beast. The <br>
PARAMETER["latitude_of_center",6.64456744726493] is completely <br>
inconsistant with the name "WGS_84_Pseudo_Mercator". I see GDAL 2.4 <br>
honoured this latitude of center, as gdalsrsinfo on it returns <br>
+proj=merc +lon_0=0 +lat_ts=6.64456744726493 +x_0=0 +y_0=0 +ellps=WGS84 <br>
+towgs84=0,0,0,0,0,0,0 +units=m +no_defs. Newer PROJ versions have a <br>
heustistics that only look at the name WGS_84_Pseudo_Mercator and ignore <br>
the projection parameters to decide to use the official EPSG:3857 "WGS <br>
84 / Pseudo-Mercator" definition. One could argue it is a bug to ignore <br>
the latitude_of_center parameter, but this definition is very confusing <br>
to start with. It is hard to know what the intention of the user was: <br>
use official EPSG:3857 "WGS 84 / Pseudo-Mercator", or use a modified <br>
version of it...<br></blockquote><div><br></div><div>I should say up front that I have nothing invested in any of these personally -- if they're wrong, that's an answer I can at least relay back. It'll be ugly in some cases because we'll have umpteen hundred maps using a questionable WKT that has to be remedied somehow, but at least I can say there's no code solution at my end.</div><div><br></div><div>That said, to play devil's advocate, what would the right way to specify a customized pseudo-mercator look like? It sounds like you're saying that the PROJCS name is the problem? I tried changing the name to 'Unknown' and it had no effect, so either you're talking about a PROJ version later than 8.1.1 or I'm misunderstanding what you mean.</div><div><br></div><div>Of the two cases, this is the one that I feel like there should be a way to make it work properly. The next map is sounding more & more like a lousy map to start with. This one is weird, but it should be feasible (if strange) to tweak a pseudo-mercator like this, shouldn't it?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
As far as I can see, GDAL 2.4 can't transform that to a PROJ.4 string at <br>
all (it doesn't understand the "Mercator" projection), so I'm not sure <br>
why you get a result at all with it. With recent PROJ,<br>
<br>
$ projinfo <br>
'PROJCS["Popular_Visualisation_CRS_Mercator_deprecated",GEOGCS["GCS_Popular <br>
Visualisation <br>
CRS",DATUM["D_Popular_Visualisation_Datum",SPHEROID["Popular_Visualisation_Sphere",6378137,0]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Mercator"],PARAMETER["central_meridian",0],PARAMETER["false_easting",0],PARAMETER["false_northing",0],PARAMETER["standard_parallel_1",0],UNIT["Meter",1]]'<br>
<br>
returns<br>
<br>
PROJ.4 string:<br>
+proj=merc +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +R=6378137 +units=m +no_defs <br>
+type=crs<br>
<br>
WKT2:2019 string:<br>
PROJCRS["Popular_Visualisation_CRS_Mercator_deprecated",<br>
BASEGEOGCRS["GCS_Popular Visualisation CRS",<br>
DATUM["Popular Visualisation Datum",<br>
ELLIPSOID["Popular_Visualisation_Sphere",6378137,0,<br>
LENGTHUNIT["metre",1]],<br>
ID["EPSG",6055]],<br>
PRIMEM["Greenwich",0,<br>
ANGLEUNIT["Degree",0.0174532925199433]]],<br>
CONVERSION["unnamed",<br>
METHOD["Mercator (variant B)",<br>
ID["EPSG",9805]],<br>
PARAMETER["Latitude of 1st standard parallel",0,<br>
ANGLEUNIT["Degree",0.0174532925199433],<br>
ID["EPSG",8823]],<br>
PARAMETER["Longitude of natural origin",0,<br>
ANGLEUNIT["Degree",0.0174532925199433],<br>
ID["EPSG",8802]],<br>
PARAMETER["False easting",0,<br>
LENGTHUNIT["metre",1],<br>
ID["EPSG",8806]],<br>
PARAMETER["False northing",0,<br>
LENGTHUNIT["metre",1],<br>
ID["EPSG",8807]]],<br>
CS[Cartesian,2],<br>
AXIS["(E)",east,<br>
ORDER[1],<br>
LENGTHUNIT["metre",1,<br>
ID["EPSG",9001]]],<br>
AXIS["(N)",north,<br>
ORDER[2],<br>
LENGTHUNIT["metre",1,<br>
ID["EPSG",9001]]]]<br>
<br>
Which is a reasonable enough interpretation of this WKT. It could have <br>
potentially been better recognized as the deprecated EPSG:3785 (which <br>
PROJ then interprets as EPSG;3857), but there's no heuristics for that <br>
particular formulation, so it is recognized as classic Mercator on a <br>
sphere. In practice, it should give identical results to official <br>
EPSG:3857 "WGS 84 / Pseudo-Mercator", except when a datum transformation <br>
is involved. So if you transform between WGS 84 and this, you should get <br>
correct results. But results off by 26 km are beyond an ignored datum <br>
shift (differences should be off by a few hundred of meters max), so I'm <br>
not sure why you observe this.<br></blockquote><div><br></div><div>That actually explains something one of our QA told me. He said there was an unnamed conversion in there but I wasn't seeing -- I guess he was using WKT2! Our QA was already converging on the consensus that this particular map was just bad, so it sounds like your reckoning backs that up. The strangest part is that it worked in PROJ 6.1 (though I'm told by a colleague that we were running it in legacy mode, so perhaps it was more akin to PROJ 4.x).</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Yes that one is the canonical WKT1:GDAL formulation<br></blockquote><div><br></div><div>I asked our QA to go through the working maps and so far they've all had the <span style="color:rgb(80,0,80)">AUTHORITY["EPSG","3</span><span style="color:rgb(80,0,80)">857"] </span>tag. I suspect all of the workings are just plain-jane vanilla pseudo-mercator. The problem ones all seem to be ones that wander off the beaten path. The unfortunate thing is that it seems to be somewhat common in our map store.</div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">I appreciate the attention. The bottom line here seems to be that there was some latitude (no pun intended) for these questionable versions of pseudo-mercator that is gone in later versions of PROJ. Ultimately better for everyone, but we'll have to figure out how to deal with t</span><span style="font-size:12.8px">hose problematic maps.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">..............................</span><br></div></div><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Andrew Patterson</div><div>Lead Software Architect</div><div>Avenza Systems Inc.</div><div><br></div><div>email: <a href="mailto:andrew@avenza.com" target="_blank">andrew@avenza.com</a></div><div>phone: 416.487.5116 </div></div></div></div>