<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 21, 2021 at 10:49 AM Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Andrew,<br>
<br>
Le 21/04/2021 à 16:31, Andrew Bell a écrit :<br>
> exportToPrettyWkt() takes an argument called simplify. If it's set, <br>
> the FORMAT option is set to WKT1_SIMPLE before a call is made to <br>
> exportToWkt(). But it seems that WKT1_SIMPLE is also the default <br>
> format value for exportToWkt(). Perhaps I'm misreading, but it seems <br>
> like the simplify argument is potentially a no-op, depending on the SRS.<br>
<br>
The default format value for exportToWkt() is "WKT1" (with axis and <br>
authority)<br></blockquote><div><br></div><div>Ah. This bit of code makes it seem that they are all synonyms:<br><br>     auto wktFormat = PJ_WKT1_GDAL;</div>    const char* pszFormat = CSLFetchNameValueDef(papszOptions, "FORMAT",<br>                                    CPLGetConfigOption("OSR_WKT_FORMAT", ""));<br>    if( EQUAL(pszFormat, "WKT1_ESRI" ) || d->m_bMorphToESRI )<br>    {<br>        wktFormat = PJ_WKT1_ESRI;<br>    }<br>    else if( EQUAL(pszFormat, "WKT1") ||<br>             EQUAL(pszFormat, "WKT1_GDAL") ||<br>             EQUAL(pszFormat, "WKT1_SIMPLE") ||<br>             EQUAL(pszFormat, "SFSQL") )<br>    {<br>        wktFormat = PJ_WKT1_GDAL;<br>    }</div><div class="gmail_quote"><br></div><div class="gmail_quote">But the code goes on to use both pszFormat and wktFormat. My mistake.</div><div class="gmail_quote"><br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Which GDAL and PROJ versions do you use ? and what is the reproducer for <br>
this issue ?<br>
<br>
I suspect you might ingest a SRS from a WKT that contains a DATUM[] node <br>
and try to export that as WKT1something with PROJ < 7.2 (if I remember <br>
well). PROJ 7.2 got changes to automatically turn a DatumEnsemble as a <br>
Datum when exporting to WKT1.<br></blockquote><div><br></div><div>I'm using PROJ 7.1, which I guess explains the behavior.</div><div><br></div><div>Still, it seems like there's no support to get WKT2 from the exportToPretty() function. Is this correct?</div></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature">Andrew Bell<br><a href="mailto:andrew.bell.ia@gmail.com" target="_blank">andrew.bell.ia@gmail.com</a></div></div>