Modify

Opened 5 months ago

Closed 2 days ago

Last modified 2 days ago

#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)

josm_24456_24457.patch (11.3 KB ) - added by francois.lacombe 3 days ago.
Patch for this ticket. Fixing regexps in the last version

Download all attachments as: .zip

Change History (15)

comment:1 by francois.lacombe, 5 months ago

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

comment:2 by francois.lacombe, 4 months ago

Cc: stoecker Klumbumbus added

comment:3 by francois.lacombe, 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 stoecker, 4 months ago

Milestone: 25.09
Summary: Power circuits relations presets and validation[PATCH] Power circuits relations presets and validation

comment:5 by stoecker, 3 months ago

Milestone: 25.0925.10

Milestone renamed

comment:6 by gaben, 3 weeks ago

Cc: gaben added

comment:7 by anonymous, 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 francois.lacombe, 6 days ago

Hello, can you point me the exact lines in the proposed patch to analyse more in details please?

comment:9 by anonymous, 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.

comment:10 by stoecker, 4 days ago

Remember, that OSM allows to combine values like key=value1;value2.

by francois.lacombe, 3 days ago

Attachment: josm_24456_24457.patch added

Patch for this ticket. Fixing regexps in the last version

comment:11 by francois.lacombe, 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

Last edited 3 days ago by francois.lacombe (previous) (diff)

comment:12 by stoecker, 2 days ago

Resolution: fixed
Status: newclosed

In 19467/josm:

improve Power circuits relations presets and validation, fix #24456 - patch by francois.lacombe

comment:13 by stoecker, 2 days ago

In 19468/josm:

add missing bracket, see #24456

comment:14 by stoecker, 2 days ago

In 19469/josm:

fix tests, see #24456

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.