Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest geostyler-cli doesn't parse point_rules.qml properly #419

Open
olsen232 opened this issue Jan 9, 2025 · 4 comments
Open

Latest geostyler-cli doesn't parse point_rules.qml properly #419

olsen232 opened this issue Jan 9, 2025 · 4 comments

Comments

@olsen232
Copy link
Contributor

olsen232 commented Jan 9, 2025

Steps to reproduce:
Download latest geostyler-cli from https://github.com/geostyler/geostyler-cli/releases/tag/v4.3.0
Download point_rules.qml from https://github.com/geostyler/geostyler-qgis-parser/blob/main/data/qmls_old/point_rules.qml
Run the first against the second to produce a GeoStyler object.
End result: resulting rules don't contain any filter attributes, ie filter: ['==', 'Bildpositi', 1], is missing.

Cloning geostyler/geostyler-qgis-parser and doing npm run test shows that all tests pass -
indicating that data/qmls_old/point_rules.qml is successfully converted to data/styles/point_rules.ts.
And point_rules.ts does have filter attributes: see https://github.com/geostyler/geostyler-qgis-parser/blob/main/data/styles/point_rules.ts#L7

So, the latest geostyler-cli is missing functionality that is present in the latest geostyler-qgis-parser.
This would seem to indicate the geostyler-qgis-parser (v3.0.0) or geostyler-cql-parser (v4.0.0) that are bundled with geostyler-cli (v4.3.0) are missing some necessary changes that are present in in geostyler-qgis-parser@HEAD, without which point_rules.qml cannot be parsed.

However, I can't see any relevant commits that are present at geostyler-qgis-parser@HEAD but not in geostyler-qgis-parser (v3.0.0) or geostyler-cql-parser (v4.0.0).
So, it's a bit of a mystery to me why this is not working.

@olsen232
Copy link
Contributor Author

The root cause of this issue is actually in geostyler-cql-parser - there is CQL parser object that is available at (window || global).cqlParser, but a bug in the code means we always attempt to find it at window.cqlParser, which works in browser or vitest environments but not in node environments.

@KaiVolland
Copy link
Contributor

I did some releases and also updated the geostyler-cli. I hope this helps a bit.

@olsen232
Copy link
Contributor Author

This is now fixed in latest geostyler-cql-parser 4.0.1
but not in latest geostyler-qgis-parser 4.0.0 (still depends on geostyler-cql-parser 4.0.0)
and therefore not in latest geostyler-cli 4.3.1 (still depends on geostyler-qgis-parser 4.0.0)

so, it still needs a release of geostyler-qgis-parser and then geostyler-cli to fix it.

graph LR
    A[geostyler-cli] --> B[geostyler-lyrx-parser]
    A[geostyler-cli] --> C[geostyler-mapbox-parser]
    A[geostyler-cli] --> D[geostyler-mapfile-parser]
    A[geostyler-cli] --> E[geostyler-qgis-parser]
    A[geostyler-cli] --> F[geostyler-sld-parser]
    E[geostyler-qgis-parser] --> G[geostyler-cql-parser]
Loading

@KaiVolland
Copy link
Contributor

Damn it. Sorry. I'll try to update these as needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants