Add support for Osmose unnecessary tag error type

This commit is contained in:
SilentSpike
2019-12-31 19:36:27 +00:00
parent c13eb15691
commit a53f1c0f67
5 changed files with 36 additions and 3 deletions
+4
View File
@@ -200,6 +200,10 @@
color: #3DE736;
}
.osmose.category-9010 {
color: #976432;
}
/* Custom Map Data (geojson, gpx, kml, vector tile) */
.layer-mapdata {
pointer-events: none;
+6
View File
@@ -933,6 +933,12 @@ en:
3: 'surveillance camera'
4: 'fire hydrant'
5: 'set of traffic signals'
9010-9010001:
title: 'Unnecessary Tag'
description: '{0} is redundantly tagged with "{1}".'
9010-9010003:
title: 'Descriptive Name'
description: '{0} appears to have a descriptive name: "{1}".'
improveOSM:
title: ImproveOSM Detection
geometry_types:
+8 -1
View File
@@ -53,7 +53,8 @@
"7090",
"5070",
"8300",
"8360"
"8360",
"9010"
],
"errorTypes": {
"0-1": {
@@ -250,6 +251,12 @@
},
"8360-5": {
"icon": "temaki-traffic_signals"
},
"9010-9010001": {
"icon": "make-waste-basket"
},
"9010-9010003": {
"icon": "temaki-plaque"
}
}
}
+8
View File
@@ -1169,6 +1169,14 @@
"7090-3": {
"title": "Disconnected Highway Feature",
"description": "{0} is highway feature or barrier with no connected highway."
},
"9010-9010001": {
"title": "Unnecessary Tag",
"description": "{0} is redundantly tagged with \"{1}\"."
},
"9010-9010003": {
"title": "Descriptive Name",
"description": "{0} appears to have a descriptive name: \"{1}\"."
}
}
},
+10 -2
View File
@@ -174,7 +174,7 @@ export default {
});
},
// todo: &item=1090%2C1110%2C1120%2C3010%2C3020%2C3032%2C3050%2C3060%2C3091%2C3092%2C3150%2C3180%2C3190%2C3200%2C3210%2C4010%2C4030%2C5010%2C5020%2C5030%2C5040%2C5050%2C5080%2C6030%2C9000%2C9001%2C9004%2C9005%2C9010
// todo: &item=1090%2C1110%2C1120%2C3010%2C3020%2C3032%2C3050%2C3060%2C3091%2C3092%2C3150%2C3180%2C3190%2C3200%2C3210%2C4010%2C4030%2C5010%2C5020%2C5030%2C5040%2C5050%2C5080%2C6030%2C9000%2C9001
loadErrorDetail(d, callback) {
// Error details only need to be fetched once
if (d.elems !== undefined) {
@@ -199,7 +199,8 @@ export default {
'3090-3090': /Incorrect date "(.+)"/i,
'5070-50703': /"(.+)"=".+" unexpected symbol char \(.+, (.+)\)/i,
'5070-50704': /Umbalanced (.+)/i,
'5070-50705': /Unexpected char (.+)/i
'5070-50705': /Unexpected char (.+)/i,
'9010-9010003': /(.+)/
};
if (d.error_type in special) {
let [, ...details] = special[d.error_type].exec(data.subtitle);
@@ -208,6 +209,13 @@ export default {
if (d.error_type === '5070-50703') {
d.replacements[2] = String.fromCharCode(details[1]);
}
} else if (d.error_type === '9010-9010001') {
// This error has a rare subtitle variant
let details = /(.+) is unnecessary/i.exec(data.subtitle);
if (details == null) {
details = /\. Remove (.+)/i.exec(data.subtitle);
}
d.replacements.push(details[1]);
}
this.replaceError(d);