Skip to content

ReferencingFormatTest failing with newer versions of PROJ (9.5.0+) #76

@WouterVisscher

Description

@WouterVisscher

I noticed that the ReferencingFormatTest is failing when a newer version of PROJ is used. (anything 9.5.0 or newer)
The test fails on the testParser() the expected warning is not return.

It seems to be related to a change in the PROJ code -> https://github.com/OSGeo/PROJ/pull/4108/files
This warning is now been treated as a grammar_error (which seems logical)

They also identified it as a potential issue.

(removing backport label. As it moves reports on the C++ API from WKTParser::warningList() to WKTParser::grammarErrorList(), it is not fully backwards compatible)

Issue (as far that I can see) is that fixing this might bring complication issue. Simply adding

diff --git a/src/main/cpp/bindings.cpp b/src/main/cpp/bindings.cpp
index 80c2d6b..f4669e5 100644
--- a/src/main/cpp/bindings.cpp
+++ b/src/main/cpp/bindings.cpp
@@ -1755,6 +1755,8 @@ JNIEXPORT jobject JNICALL Java_org_osgeo_proj_ReferencingFormat_parse
                     text_utf = nullptr;
                     const std::list<std::string>& warnings = parser.warningList();
                     send_warnings(env, format, std::vector<std::string>(warnings.begin(), warnings.end()));
+                    const std::list<std::string>& grammarError = parser.grammarErrorList();
+                    send_warnings(env, format, std::vector<std::string>(grammarError.begin(), grammarError.end()));                    
                 }
                 break;
             }

Would fix it, if newer versions of PROJ are used. But will break anything older than 9.5.0.

I tried making the ant build proces aware which version of PROJ is used and apply a patch, but that didn't feel right...
So I'm not sure if this can be fixed without breaking changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions