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.

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