#24456 closed enhancement (fixed)
[PATCH] Power circuits relations presets and validation
| Reported by: | francois.lacombe | Owned by: | team |
|---|---|---|---|
| Priority: | normal | Milestone: | 25.10 |
| Component: | Core validator | Version: | |
| Keywords: | power, circuits, routing, route | Cc: | stoecker, Klumbumbus, gaben |
Description
Dear all,
Recently, and after several years of improvements, power=circuits has been reviewed and approved.
https://wiki.openstreetmap.org/wiki/Proposal:Power_circuits_routing
I encourage to use relations to map power circuits over physical level of power segments (line, cable, minor_line...).
It's a robust solution to avoid values lists in some keys like frequency as mentioned in #22633 and #22915.
Currently in JOSM, discouraged tagging with type=route + route=power is part of presets.
It should be move to a new category and replaced with type=power + power=circuits relations with same tagging completed with new topology{linear,branched} key.
https://wiki.openstreetmap.org/wiki/Tag:power%3Dcircuit
https://wiki.openstreetmap.org/wiki/Key:topology
wires=* key should not be used on power=circuit relations.
Roles are also changing. A power circuits expects substation and section as roles instead of substation and line.
It is possible to create relations involving discontinued lines as some segments may be missing at the moment at which the mapper intends to link two substations.
https://www.openstreetmap.org/relation/19536763
Finally, as per https://wiki.openstreetmap.org/wiki/Proposal:Power_circuits_routing#Less_tagging_redundancy_between_lines,_sections_and_circuits, a validation warning should be raised when both power=line and power=circuit relation it may be member of expose frequency=*. This information should be on relation only.
Best regards
Attachments (1)
Change History (15)
comment:1 by , 5 months ago
comment:2 by , 4 months ago
| Cc: | added |
|---|
comment:3 by , 4 months ago
I hope everything is fine with the provided patch, that's my first contribution to JOSM source.
Feel free to advise me for any required fix
comment:4 by , 4 months ago
| Milestone: | → 25.09 |
|---|---|
| Summary: | Power circuits relations presets and validation → [PATCH] Power circuits relations presets and validation |
comment:6 by , 3 weeks ago
| Cc: | added |
|---|
comment:7 by , 6 days ago
Shouldn't the regexes have ^( and )$ wrapping it such that the regex doesn't need to search through the full string, if it's full-word matching, but instead is already told that the match must start at the beginning and if the beginning doesn't match, it can already conclude there's no match?
comment:8 by , 6 days ago
Hello, can you point me the exact lines in the proposed patch to analyse more in details please?
comment:9 by , 4 days ago
Most of the regexes, for example:
relation[type=power][power][power!~/circuit|line_section/] {
which could become:
relation[type=power][power][power!~/^(circuit|line_section)$/] {
unless you purposefully want to match substrings (in which case I'd add a test).
This tells the matcher that if the match doesn't match from the first character, it doesn't need to look further.
by , 3 days ago
| Attachment: | josm_24456_24457.patch added |
|---|
Patch for this ticket. Fixing regexps in the last version
comment:11 by , 3 days ago
Hello
That's right all regexps in this patch cover unique values for the power or topology keys.
I've put ^(...)$ on two of them and converted one into a selectors list with = operator instead.
Thank you for warning



Code that covers most of this ticket is available here, I will investigate shortly about providing a diff to be integrated directly in josm
https://github.com/open-energy-transition/validate-my-grid/commit/965f472f64e94bde1e10db5b0521724fd7598417