Read icons from qa_errors.json when building data

Also adds support for the following error types:
- Objects mapped as both node/area or way/area
- Power lines that lead to nowhere
- Extra nodes in power lines (which should only go from support to
support to endpoint)
- Power line supports with no power lines
This commit is contained in:
SilentSpike
2019-12-29 19:18:30 +00:00
parent 5afdfc527b
commit d4723ec9e2
6 changed files with 83 additions and 6 deletions

View File

@@ -174,6 +174,14 @@
color: #2D9359;
}
.osmose.category-4080 {
color: #F2F230;
}
.osmose.category-7040 {
color: #9F16B4;
}
.osmose.category-8300,
.osmose.category-8360 {
color: #3DE736;

View File

@@ -869,6 +869,18 @@ en:
3250-32501:
title: 'Invalid Opening Hours'
description: '{0} has an invalid value for the "opening_hours" tag.'
4080:
title: 'Object Mapped Twice'
description: '{0} and {1} both appear to represent the same object.'
7040:
title: 'Unfinished Power Line'
description: 'A power line appears to be unfinished at {0}.'
7040-1:
title: 'Lone Power Support'
description: '{0} is a power tower or pole with no connected power lines.'
7040-4:
title: 'Extra Power Line Node'
description: 'Power lines only have nodes at connections and {0} is not tagged as a power line support.'
8300:
title: 'Traffic Sign Suggestion'
description: 'Traffic signs detected by Mapillary suggest there may be an unmapped {0} nearby.'

View File

@@ -34,7 +34,7 @@
}
},
"osmose": {
"items": ["0", "1040", "1050", "1070", "1150", "1280", "3161", "3250", "8300", "8360"],
"items": ["0", "1040", "1050", "1070", "1150", "1280", "3161", "3250", "4080", "7040", "8300", "8360"],
"errorTypes": {
"0-1": {
"icon": "maki-home"
@@ -87,6 +87,27 @@
"3250-32501": {
"icon": "maki-watch"
},
"4080-1": {
"icon": "far-dot-circle"
},
"4080-2": {
"icon": "far-dot-circle"
},
"4080-3": {
"icon": "far-dot-circle"
},
"7040-1": {
"icon": "temaki-power_tower"
},
"7040-2": {
"icon": "temaki-power"
},
"7040-4": {
"icon": "maki-marker"
},
"7040-6": {
"icon": "temaki-power"
},
"8300-20": {
"icon": "temaki-height_restrictor"
},

16
dist/locales/en.json vendored
View File

@@ -1050,6 +1050,14 @@
"title": "Missing Parking Access",
"description": "There is no highway leading to {0}."
},
"4080": {
"title": "Object Mapped Twice",
"description": "{0} and {1} both appear to represent the same object."
},
"7040": {
"title": "Unfinished Power Line",
"description": "A power line appears to be unfinished at {0}."
},
"8300": {
"title": "Traffic Sign Suggestion",
"description": "Traffic signs detected by Mapillary suggest there may be an unmapped {0} nearby.",
@@ -1107,6 +1115,14 @@
"3250-32501": {
"title": "Invalid Opening Hours",
"description": "{0} has an invalid value for the \"opening_hours\" tag."
},
"7040-1": {
"title": "Lone Power Support",
"description": "{0} is a power tower or pole with no connected power lines."
},
"7040-4": {
"title": "Extra Power Line Node",
"description": "Power lines only have nodes at connections and {0} is not tagged as a power line support."
}
}
},

View File

@@ -67,11 +67,8 @@ function buildData() {
let faIcons = {
'fas-i-cursor': {},
'fas-lock': {},
'fas-long-arrow-alt-right': {},
'fas-th-list': {},
'fas-user-cog': {},
'far-clone': {},
'fas-weight-hanging': {}
'fas-user-cog': {}
};
// The Noun Project icons used
@@ -92,7 +89,7 @@ function buildData() {
'dist/data/*',
'svg/fontawesome/*.svg',
]);
readQAErrorIcons(faIcons, tnpIcons);
let categories = generateCategories(tstrings, faIcons, tnpIcons);
let fields = generateFields(tstrings, faIcons, tnpIcons, searchableFieldIDs);
let presets = generatePresets(tstrings, faIcons, tnpIcons, searchableFieldIDs);
@@ -174,6 +171,28 @@ function validate(file, instance, schema) {
}
function readQAErrorIcons(faIcons, tnpIcons) {
const qa = read('data/qa_errors.json');
for (const service in qa.services) {
for (const error in qa.services[service].errorTypes) {
const icon = qa.services[service]
.errorTypes[error]
.icon;
// fontawesome icon, remember for later
if (/^fa[srb]-/.test(icon)) {
faIcons[icon] = {};
}
// noun project icon, remember for later
if (/^tnp-/.test(icon)) {
tnpIcons[icon] = {};
}
}
}
}
function generateCategories(tstrings, faIcons, tnpIcons) {
let categories = {};

View File

@@ -0,0 +1 @@
<svg aria-hidden="true" focusable="false" data-prefix="far" data-icon="dot-circle" class="svg-inline--fa fa-dot-circle fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M256 56c110.532 0 200 89.451 200 200 0 110.532-89.451 200-200 200-110.532 0-200-89.451-200-200 0-110.532 89.451-200 200-200m0-48C119.033 8 8 119.033 8 256s111.033 248 248 248 248-111.033 248-248S392.967 8 256 8zm0 168c-44.183 0-80 35.817-80 80s35.817 80 80 80 80-35.817 80-80-35.817-80-80-80z"></path></svg>

After

Width:  |  Height:  |  Size: 532 B