Closed AndrewAtAvenza closed 3 years ago
The solution for us is basically not to call AutoIdentifyEPSG()
but I feel like this is going to burn other people, and given the hoopla around axes, it has the potential to muddy the waters for people (like me!) who think they have a handle on the 3.x changes and then get thrown a loop like this.
Oh wow, you're fast. Many thanks!
I read the note at the top of the submission blurb and while this is somewhat axis-adjacent, but not really an axis issue even though the consequences present like an axis bug.
We made the switch to 3.3 but had the usual axis-related issues. Using
OAMS_TRADITIONAL_GIS_ORDER
solved most of them, but we had some odd outliers. After a great deal of digging, I managed to boil it down to a fairly simple code block that demonstrates the issue. I've included comments that indicate what's happening under the hood along the wayBasically, the axis-related code is fine, but there are two unrelated issues that work together to cause the ultimate problem.
AutoIdentifyEPSG()
adds an EPSG authority based on impliedAXIS
that aren't present, and when theGEOCS
is pulled out viaCloneGeogCS()
, it insertsAXIS
tags that contradict the EPSGAUTHORITY
tag that was added.AXIS
tags (see comment in code above).Also, not for nothing, but it's a bit strange that
AutoIdentifyEPSG()
returnsOGRERR_UNSUPPORTED_SRS
, implying that it didn't do anything, when in fact it did inject someAUTHORITY
tags.I don't know what the best solution to the two problems above are (though maybe my suggestion on using
SetDatAxisToSRSAxisMapping()
would solve point 2) -- I suspect this can only happen withCloneGeogCS()
and not other aspects of the WKT so maybe just check for contradictoryAUTHORITY
tags whenAXIS
tags are added as a conseuence of 'CloneGeogCS()`?