Skip to content

Conversation

@nlehuby
Copy link
Contributor

@nlehuby nlehuby commented Oct 1, 2025

This PR add a mapcss ruleset about power grid & power generation, that is already packaged and available for JOSM.

source code: https://github.com/open-energy-transition/validate-my-grid
doc: https://wiki.openstreetmap.org/wiki/Power_networks/Quality_Assurance

The translations for the rules and the Osmose doc is intended to be in the validate-my-grid repo too, following the same models as Jungle Bus transport_mapcss ruleset (but it will come later, there are no translations in the repo for now)

#MapYourGrid

@nlehuby
Copy link
Contributor Author

nlehuby commented Oct 1, 2025

I had troubles with the rules that use the link selector, that is apparently not supported in Osmose mapcss:

even with the -osmoseItemClassLevel: none; flag, I got the following error at compilation:

line 315:30 no viable alternative at input '[role!~'
line 315:30 mismatched input '!~' expecting {',', '{'}

mapcss:

relation[power=circuit] >[role!~/^(section|substation)$/] way {  
   throwError: tr("Wrong role for way in power=circuit relations");
   suggestAlternative: "section/substation";
   -osmoseItemClassLevel: none; /* The rule involves multiple objects, which is not yet supported by Osmose */
}

source: https://github.com/open-energy-transition/validate-my-grid/blob/gh-pages/powerQA.validator.mapcss#L315

@nlehuby
Copy link
Contributor Author

nlehuby commented Oct 28, 2025

Can I get a review please 🙏 ?

@frodrigo
Copy link
Contributor

I had troubles with the rules that use the link selector, that is apparently not supported in Osmose mapcss:

even with the -osmoseItemClassLevel: none; flag, I got the following error at compilation:

line 315:30 no viable alternative at input '[role!~'
line 315:30 mismatched input '!~' expecting {',', '{'}

mapcss:

relation[power=circuit] >[role!~/^(section|substation)$/] way {  
   throwError: tr("Wrong role for way in power=circuit relations");
   suggestAlternative: "section/substation";
   -osmoseItemClassLevel: none; /* The rule involves multiple objects, which is not yet supported by Osmose */
}

source: https://github.com/open-energy-transition/validate-my-grid/blob/gh-pages/powerQA.validator.mapcss#L315

Should be here, but it is not https://github.com/osmose-qa/osmose-backend/blob/dev/mapcss/MapCSS.g4#L171

In any case, this will not be supported by the Osmose MapCSS implementation, as Osmose use Plugin as MapCSS backend that check only one object at the time.

@nlehuby
Copy link
Contributor Author

nlehuby commented Dec 18, 2025

🤔 hum, there is a bunch of unrelated commits in this PR (with conflicts on translations totally unrelated to my works), I'm note sure why ...
Should I close this one and create another one ?

@frodrigo
Copy link
Contributor

Try to rebase and remove unrelated commits from the branch.

@frodrigo
Copy link
Contributor

So big. Have you try to run it on Osmose, or just generated it ?

@nlehuby
Copy link
Contributor Author

nlehuby commented Dec 18, 2025

yes, I did test the generated plugin on france_ile_de_france_val_de_marne.

@frodrigo frodrigo merged commit e1dc32e into osmose-qa:dev Dec 18, 2025
2 of 3 checks passed
@nlehuby nlehuby deleted the power_qa branch December 18, 2025 14:23
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

Successfully merging this pull request may close these issues.

2 participants