Opened 5 months ago
Closed 4 months ago
#23781 closed task (fixed)
[patch] Convert existing MapCSS rules to use the new siunit_length() function
Reported by: | gaben | Owned by: | team |
---|---|---|---|
Priority: | minor | Milestone: | 24.07 |
Component: | Core validator | Version: | |
Keywords: | unit conversion SI | Cc: | Famlam |
Description
The function is available since r19089.
Requested by Famlam in ticket:23621#comment:24.
Attachments (1)
Change History (9)
comment:1 by , 5 months ago
comment:2 by , 5 months ago
The patch so far:
-
resources/data/validator/combinations.mapcss
diff --git a/resources/data/validator/combinations.mapcss b/resources/data/validator/combinations.mapcss
a b 756 756 } 757 757 758 758 /* #17391 */ 759 way[highway=pedestrian][width][ width<3] {759 way[highway=pedestrian][width][siunit_length(tag(width))<3] { 760 760 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}"); 761 761 suggestAlternative: "highway=footway"; 762 762 group: tr("suspicious tag combination"); -
resources/data/validator/numeric.mapcss
diff --git a/resources/data/validator/numeric.mapcss b/resources/data/validator/numeric.mapcss
a b 67 67 assertNoMatch: "node building:levels=0"; /* valid because there can be building:levels:underground > 0 or roof:levels > 0 */ 68 68 } 69 69 70 *[roof:height][ roof:height =~ /^0*(\.0*)?( (m|ft))?$/][roof:shape=flat] {70 *[roof:height][siunit_length(tag("roof:height")) == 0][roof:shape=flat] { 71 71 throwWarning: tr("{0} is unnecessary for {1}", "{0.tag}", "{2.tag}"); 72 72 group: tr("unnecessary tag"); 73 73 fixRemove: "{0.key}";
comment:3 by , 5 months ago
Summary: | Convert existing MapCSS rules to use the new siunit_length() function → [patch] Convert existing MapCSS rules to use the new siunit_length() function |
---|
comment:4 by , 5 months ago
I'd like to run through the files before assigning a milestone, so if anyone find a candidate, just ping me and I'll add it to the patch.
comment:5 by , 5 months ago
I'd like to run through the files before assigning a milestone, so if anyone find a candidate, just ping me and I'll add it to the patch.
Another candidate (at the bottom of combinations.mapcss)
area[/^(building|building:part)$/][height =~ /^[0-9]+(\.[0-9]+)?( m)?$/][min_height =~ /^[0-9]+(\.[0-9]+)?( m)?$/][get(split(" ", tag(height)), 0) <= get(split(" ", tag(min_height)), 0)],
Probably (untested) something like:
area[/^(building|building:part)$/][height][min_height][siunit_length(tag(height)) <= siunit_length(tag(min_height))],
by , 5 months ago
Attachment: | 23781.patch added |
---|
comment:6 by , 4 months ago
For what it's worth: I didn't find other ones so I think the patch is complete now
comment:7 by , 4 months ago
Milestone: | → 24.07 |
---|
I'm on vacation right now, but the patch should be okay.
Well, requested... suggested :)
The only two I saw so far are:
1) the one linked in the initial post of this ticket
2) the
way[highway=pedestrian][width][width<3]
check in combinations.mapcss