Fix workaround for Proj versions 9.0.0 to 9.4.0
Hello,
This is a fix for a workaround for a bug in Proj versions between version 9.0.0 and 9.4.0 (inclusive), which is described in this issue:
#7019
The source of this problem was a workaround in mapserver for a bug in proj prior to version 9.4.1. The workaround checks for proj major versions between 6 and 9, and then applies a fix. However, versions 9.0.0 through 9.4.0 suffer from the original proj bug, and do not have the workaround applied.
I'm fairly confident of my change on line 1903, but on line 1909 I had not much idea what I was doing. I only tested requests in EPSG:4326 and EPSG:3857 which the workaround targets, I did not test with expanded projection strings.
I am happy to write some tests + test data for this change if required!
The source of this problem was a workaround in mapserver for a bug in proj prior to version 9.4.1. The workaround checks for proj major versions between 6 and 9, and then applies a fix. However, versions 9.0.0 through 9.4.0 suffer from the original proj bug, and do not have the workaround applied.
hum, it is not obvious to me which change between PROJ 9.4.0 and 9.4.1 would have an influence on this, and PROJ 9 did have a fix related to +over handling. This would require more careful analysis. Could you do a git bisect on PROJ between 9.4.0 and 9.4.1 to find out which revision of PROJ would have changed behavior?
Yes no problem, I will take a look!
Thanks for this @oshawa-connection. Please also include a test through msautotest, as part of your pull request (see steps at https://mapserver.org/development/tests/autotest.html ). Thanks again.
I made a mistake when installing proj from source - so mapserver's cmake picked up my system installed proj (version 8)... Sorry for this, I don't use cmake often, hopefully I haven't wasted much of your time on this.
However, the bug definitely still exists in proj 9 for some cases when +over is added- I am trying to hunt down more specific information on when/ why. If it's ok with you, I will leave this PR open until the problem is fixed in proj 9, and then the PROJ_VERSION_PATCH/ PROJ_VERSION_MINOR number could be changed to cover those cases.
In the meantime I will try to get some more specifics of the problem with proj.
@oshawa-connection Thanks for the thouroughful analysis. I believe a better fix would be https://github.com/MapServer/MapServer/pull/7121 . Can you give this a try?
No problem, glad I could help :+1: Yes I agree, this PR isn't needed now!