#18765 closed defect (fixed)
false positive warning about some direction values
Reported by: | Klumbumbus | Owned by: | Klumbumbus |
---|---|---|---|
Priority: | normal | Milestone: | 20.03 |
Component: | Core validator | Version: | |
Keywords: | direction | Cc: |
Description
from https://github.com/osm-fr/osmose-backend/issues/751
direction=90;270
The regexp needs to be improved, it doesn't support two single values. Also ranges combined with single values are not supported. These are right now explicit marked as assertMatch: "node direction=45-100;190-250;300";
because when I created that regexp I thought about an incomplete range. However thinking about it again as single values and ranges are supported also a combination of both should be supported.
current code:
/* #14989 */ *[direction][direction<0], *[direction][direction>=360], *[direction][direction !~ /^([0-9][0-9]?[0-9]?|north|east|south|west|N|E|S|W|NE|SE|SW|NW|NNE|ENE|ESE|SSE|SSW|WSW|WNW|NNW|forward|backward|both|clockwise|anti-clockwise|anticlockwise|up|down)(-([0-9][0-9]?[0-9]?|N|E|S|W|NE|SE|SW|NW|NNE|ENE|ESE|SSE|SSW|WSW|WNW|NNW))?(;([0-9][0-9]?[0-9]?|N|E|S|W|NE|SE|SW|NW|NNE|ENE|ESE|SSE|SSW|WSW|WNW|NNW)-([0-9][0-9]?[0-9]?|N|E|S|W|NE|SE|SW|NW|NNE|ENE|ESE|SSE|SSW|WSW|WNW|NNW))*$/] { throwWarning: tr("unusual value of {0}", "{0.key}"); assertMatch: "node direction=north-down"; assertMatch: "node direction=rome"; assertMatch: "node direction=C"; assertMatch: "node direction=NNNE"; assertMatch: "node direction=1360"; assertNoMatch: "node direction=NE-S"; /* ranges are used at tourism=viewpoint*/ assertMatch: "node direction=north-south"; /* ranges only in numbers or short NESW form */ assertMatch: "node direction=north-east"; /* if range use N-E, if single direcion use NE */ assertNoMatch: "node direction=0-360"; /* complete panorama view */ assertNoMatch: "node direction=45-100;190-250;300-360"; assertMatch: "node direction=45-100;190-250;300"; assertNoMatch: "node direction=up"; assertNoMatch: "node direction=down"; /* up/down are replaced by incline tag, has separate warning */ assertMatch: "node direction=-10"; assertNoMatch: "node direction=0"; assertNoMatch: "node direction=45"; assertMatch: "node direction=360"; assertNoMatch: "node direction=N"; assertNoMatch: "node direction=NNE"; assertNoMatch: "node direction=west"; assertNoMatch: "node direction=forward"; assertNoMatch: "node direction=anti-clockwise"; assertNoMatch: "node direction=anticlockwise"; /* both spellings are in use and even wiki uses both */ }
Attachments (0)
Change History (3)
comment:1 by , 5 years ago
Keywords: | direction added |
---|
comment:2 by , 5 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:3 by , 5 years ago
Milestone: | → 20.03 |
---|
In 15965/josm: