Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Osmose Q/A layer #7095

Merged
merged 38 commits into from
Feb 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
e11d97b
Add Osmose QA layer and service
kymckay Dec 7, 2019
09e7b23
Add Osmose issues UI and filtering
kymckay Dec 7, 2019
af5b64a
Allow translation with numerical token replacement
kymckay Dec 7, 2019
947f965
Port minor QoL tweaks to other QA services
kymckay Dec 7, 2019
1fa8880
Fix resolution request for Osmose issues
kymckay Dec 7, 2019
d9ba63a
Fix leftover errors and unused definitions
kymckay Dec 7, 2019
680fdb6
Allow Osmose errors to use category for UI strings
kymckay Dec 23, 2019
ebd2065
Use Osmose tiles API endpoint instead of issues
kymckay Dec 28, 2019
b24b041
Add Osmose issue detail fetching for UI
kymckay Dec 28, 2019
5afdfc5
Add support for more Osmose error types
kymckay Dec 29, 2019
d4723ec
Read icons from qa_errors.json when building data
kymckay Dec 29, 2019
a068cdf
Tag changeset with Osmose issue closed counts
kymckay Dec 30, 2019
896ed76
Fix silent failure for some Osmose error types
kymckay Dec 30, 2019
12206c6
Convert Osmsoe service to ES6 syntax
kymckay Dec 30, 2019
cc30390
Support more subtypes of osmose error type 8300
kymckay Dec 30, 2019
c13eb15
Add support for more Osmose error types
kymckay Dec 31, 2019
a53f1c0
Add support for Osmose unnecessary tag error type
kymckay Dec 31, 2019
406264c
Simplify structure of QA error data
kymckay Dec 31, 2019
9fca611
Add support for even more Osmose error types
kymckay Dec 31, 2019
d2f9278
Port changeset tag improvement to ImproveOSM QA
kymckay Jan 1, 2020
6310349
Use latest Osmose API tiles endpoint
kymckay Jan 1, 2020
316aca0
Change icon for Osmose Unnecessary Tag issue
kymckay Jan 25, 2020
7d76950
Use Osmose translation strings for issue titles
kymckay Jan 25, 2020
5d93d3c
Prepare to use Osmose issue detail strings
kymckay Jan 25, 2020
7a00c0a
Use Osmose locale filter and detail strings
kymckay Feb 3, 2020
010ca30
Show more Osmose strings in the UI
kymckay Feb 3, 2020
e3c6f58
Format markdown in Osmose strings appropriately
kymckay Feb 3, 2020
06ac02f
Use Osmose dynamic subtitile string
kymckay Feb 3, 2020
2d2fa44
Use multiple specific Osmose string requests
kymckay Feb 3, 2020
cf878ca
Use Object.keys() not Python {}.keys() 🤦‍♂️
kymckay Feb 3, 2020
ecadafb
Use Osmose supplied hex colors
kymckay Feb 3, 2020
1dd65cb
Correct Osmose UI element spacing
kymckay Feb 3, 2020
377e992
Add Osmose translations link to details footer
kymckay Feb 3, 2020
e6cf53d
Fix use of test() method on color string
kymckay Feb 4, 2020
02f088e
Update some QA translation strings
kymckay Feb 4, 2020
087867d
Use Promises for Osmose issue detail requests
kymckay Feb 4, 2020
3745c06
Hide Osmose issue description if no string
kymckay Feb 4, 2020
03a097c
Move Osmose translation link below details box
kymckay Feb 4, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions css/65_data.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

.error-header-icon .qa_error-fill,
.layer-keepRight .qa_error .qa_error-fill,
.layer-improveOSM .qa_error .qa_error-fill {
.layer-improveOSM .qa_error .qa_error-fill,
.layer-osmose .qa_error .qa_error-fill {
stroke: #333;
stroke-width: 1.3px; /* NOTE: likely a better way to scale the icon stroke */
}
Expand Down Expand Up @@ -152,7 +153,6 @@
color: #EC1C24;
}


/* Custom Map Data (geojson, gpx, kml, vector tile) */
.layer-mapdata {
pointer-events: none;
Expand Down Expand Up @@ -211,4 +211,4 @@
stroke: #000;
stroke-width: 5px;
stroke-miterlimit: 1;
}
}
27 changes: 23 additions & 4 deletions css/80_app.css
Original file line number Diff line number Diff line change
Expand Up @@ -2734,25 +2734,44 @@ input.key-trap {
padding-top: 20px;
}

.error-details {
padding: 10px;
}
.error-details-container {
background: #ececec;
padding: 10px;
margin-top: 20px;
border-radius: 4px;
border: 1px solid #ccc;
display: flex;
flex-direction: column;
}
.error-details-description {
margin-bottom: 10px;
display: flex;
flex-direction: column;
}
.error-details-description-text::first-letter {
text-transform: capitalize;
}
[dir='rtl'] .error-details-description-text::first-letter {
text-transform: none; /* #5877 */
}
.error-details-subsection h4 {
padding-top: 10px;
padding-bottom: 0;
}
.error-details code {
padding: .2em .4em;
margin: 0;
font-size: 85%;
font-family: monospace;
background-color: rgba(27,31,35,.05);
border-radius: 3px;
}
.error-details + .translation-link {
margin-top: 5px;
display: flex;
flex-direction: row;
justify-content: flex-end;
}

.note-save .new-comment-input,
.error-save .new-comment-input {
Expand Down Expand Up @@ -5590,4 +5609,4 @@ li.hide + li.version .badge .tooltip .popover-arrow {
}
[dir='rtl'] .list-item-photos.list-item-mapillary-map-features .request-data-link {
float: left;
}
}
18 changes: 14 additions & 4 deletions data/core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -625,11 +625,14 @@ en:
tooltip: Note data from OpenStreetMap
title: OpenStreetMap notes
keepRight:
tooltip: Automatically detected map issues from keepright.at
tooltip: Data issues detected by keepright.at
title: KeepRight Issues
improveOSM:
tooltip: Missing data automatically detected by improveosm.org
tooltip: Missing data detected by improveosm.org
title: ImproveOSM Issues
osmose:
tooltip: Data issues detected by osmose.openstreetmap.fr
title: Osmose Issues
custom:
tooltip: "Drag and drop a data file onto the page, or click the button to setup"
title: Custom Map Data
Expand Down Expand Up @@ -824,6 +827,13 @@ en:
cannot_zoom: "Cannot zoom out further in current mode."
full_screen: Toggle Full Screen
QA:
osmose:
title: Osmose Issue
detail_title: Details
elems_title: Features
fix_title: Fix Guidelines
trap_title: Common Mistakes
translation: Translations provided by Osmose
improveOSM:
title: ImproveOSM Detection
geometry_types:
Expand Down Expand Up @@ -1343,7 +1353,7 @@ en:
title: Quality Assurance
intro: "*Quality Assurance* (Q/A) tools can find improper tags, disconnected roads, and other issues with OpenStreetMap, which mappers can then fix. To view existing Q/A issues, click the {data} **Map data** panel to enable a specific Q/A layer."
tools_h: "Tools"
tools: "The following tools are currently supported: [KeepRight](https://www.keepright.at/) and [ImproveOSM](https://improveosm.org/en/). Expect iD to support [Osmose](https://osmose.openstreetmap.fr/) and more Q/A tools in the future."
tools: "The following tools are currently supported: [KeepRight](https://www.keepright.at/), [ImproveOSM](https://improveosm.org/en/) and [Osmose](https://osmose.openstreetmap.fr/)."
issues_h: "Handling Issues"
issues: "Handling Q/A issues is similar to handling notes. Click on a marker to view the issue details in the sidebar. Each tool has its own capabilities, but generally you can comment and/or close an issue."
field:
Expand Down Expand Up @@ -2058,4 +2068,4 @@ en:
wikidata:
identifier: "Identifier"
label: "Label"
description: "Description"
description: "Description"
112 changes: 84 additions & 28 deletions data/qa_errors.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,92 @@
{
"services": {
"improveOSM": {
"errorTypes": {
"ow": {
"icon": "fas-long-arrow-alt-right",
"category": "routing"
},
"mr-both": {
"icon": "maki-car",
"category": "geometry"
},
"mr-parking": {
"icon": "maki-parking",
"category": "geometry"
},
"mr-path": {
"icon": "maki-shoe",
"category": "geometry"
},
"mr-road": {
"icon": "maki-car",
"category": "geometry"
},
"tr": {
"icon": "temaki-junction",
"category": "routing"
}
"errorIcons": {
"ow": "fas-long-arrow-alt-right",
"mr-both": "maki-car",
"mr-parking": "maki-parking",
"mr-path": "maki-shoe",
"mr-road": "maki-car",
"tr": "temaki-junction"
}
},
"keepRight": {
"errorTypes": {

"osmose": {
"errorIcons": {
"0-1": "maki-home",
"0-2": "maki-home",
"1040-1": "maki-square-stroked",
"1050-1": "maki-circle-stroked",
"1050-1050": "maki-circle-stroked",
"1070-1": "maki-home",
"1070-4": "maki-dam",
"1070-5": "maki-dam",
"1070-8": "maki-cross",
"1070-10": "maki-cross",
"1150-1": "far-clone",
"1150-2": "far-clone",
"1150-3": "far-clone",
"1190-10": "fas-share-alt",
"1190-20": "fas-share-alt",
"1190-30": "fas-share-alt",
"1280-1": "maki-attraction",
"2110-21101": "temaki-plaque",
"2110-21102": "fas-shapes",
"3040-3040": "far-times-circle",
"3090-3090": "fas-calendar-alt",
"3161-1": "maki-parking",
"3161-2": "maki-parking",
"3200-32001": "fas-vector-square",
"3200-32002": "fas-vector-square",
"3200-32003": "fas-vector-square",
"3220-32200": "maki-roadblock",
"3220-32201": "maki-roadblock",
"3250-32501": "maki-watch",
"4010-4010": "maki-waste-basket",
"4010-40102": "maki-waste-basket",
"4030-900": "fas-yin-yang",
"4080-1": "far-dot-circle",
"4080-2": "far-dot-circle",
"4080-3": "far-dot-circle",
"5010-803": "fas-sort-alpha-up",
"5010-903": "fas-rocket",
"5070-50703": "fas-tint-slash",
"5070-50704": "fas-code",
"5070-50705": "fas-question",
"7040-1": "temaki-power_tower",
"7040-2": "temaki-power",
"7040-4": "maki-marker",
"7040-6": "temaki-power",
"7090-1": "maki-rail",
"7090-3": "maki-circle",
"8300-1": "fas-tachometer-alt",
"8300-2": "fas-tachometer-alt",
"8300-3": "fas-tachometer-alt",
"8300-4": "fas-tachometer-alt",
"8300-5": "fas-tachometer-alt",
"8300-6": "fas-tachometer-alt",
"8300-7": "fas-tachometer-alt",
"8300-8": "fas-tachometer-alt",
"8300-9": "fas-tachometer-alt",
"8300-10": "fas-tachometer-alt",
"8300-11": "fas-tachometer-alt",
"8300-12": "fas-tachometer-alt",
"8300-13": "fas-tachometer-alt",
"8300-14": "fas-tachometer-alt",
"8300-15": "fas-tachometer-alt",
"8300-16": "fas-tachometer-alt",
"8300-17": "fas-tachometer-alt",
"8300-20": "temaki-height_restrictor",
"8300-21": "fas-weight-hanging",
"8300-32": "maki-circle-stroked",
"8300-34": "temaki-diamond",
"8300-39": "temaki-pedestrian",
"8360-1": "temaki-bench",
"8360-2": "maki-bicycle",
"8360-3": "temaki-security_camera",
"8360-4": "temaki-fire_hydrant",
"8360-5": "temaki-traffic_signals",
"9010-9010001": "fas-tags",
"9010-9010003": "temaki-plaque"
}
}
}
Expand Down
18 changes: 15 additions & 3 deletions dist/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -775,13 +775,17 @@
"title": "OpenStreetMap notes"
},
"keepRight": {
"tooltip": "Automatically detected map issues from keepright.at",
"tooltip": "Data issues detected by keepright.at",
"title": "KeepRight Issues"
},
"improveOSM": {
"tooltip": "Missing data automatically detected by improveosm.org",
"tooltip": "Missing data detected by improveosm.org",
"title": "ImproveOSM Issues"
},
"osmose": {
"tooltip": "Data issues detected by osmose.openstreetmap.fr",
"title": "Osmose Issues"
},
"custom": {
"tooltip": "Drag and drop a data file onto the page, or click the button to setup",
"title": "Custom Map Data",
Expand Down Expand Up @@ -1027,6 +1031,14 @@
"cannot_zoom": "Cannot zoom out further in current mode.",
"full_screen": "Toggle Full Screen",
"QA": {
"osmose": {
"title": "Osmose Issue",
"detail_title": "Details",
"elems_title": "Features",
"fix_title": "Fix Guidelines",
"trap_title": "Common Mistakes",
"translation": "Translations provided by Osmose"
},
"improveOSM": {
"title": "ImproveOSM Detection",
"geometry_types": {
Expand Down Expand Up @@ -1653,7 +1665,7 @@
"title": "Quality Assurance",
"intro": "*Quality Assurance* (Q/A) tools can find improper tags, disconnected roads, and other issues with OpenStreetMap, which mappers can then fix. To view existing Q/A issues, click the {data} **Map data** panel to enable a specific Q/A layer.",
"tools_h": "Tools",
"tools": "The following tools are currently supported: [KeepRight](https://www.keepright.at/) and [ImproveOSM](https://improveosm.org/en/). Expect iD to support [Osmose](https://osmose.openstreetmap.fr/) and more Q/A tools in the future.",
"tools": "The following tools are currently supported: [KeepRight](https://www.keepright.at/), [ImproveOSM](https://improveosm.org/en/) and [Osmose](https://osmose.openstreetmap.fr/).",
"issues_h": "Handling Issues",
"issues": "Handling Q/A issues is similar to handling notes. Click on a marker to view the issue details in the sidebar. Each tool has its own capabilities, but generally you can comment and/or close an issue."
},
Expand Down
13 changes: 12 additions & 1 deletion modules/modes/select_error.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { modeDragNode } from './drag_node';
import { modeDragNote } from './drag_note';
import { uiImproveOsmEditor } from '../ui/improveOSM_editor';
import { uiKeepRightEditor } from '../ui/keepRight_editor';
import { uiOsmoseEditor } from '../ui/osmose_editor';
import { utilKeybinding } from '../util';


Expand Down Expand Up @@ -49,6 +50,16 @@ export function modeSelectError(context, selectedErrorID, selectedErrorService)
.show(errorEditor.error(error));
});
break;
case 'osmose':
errorEditor = uiOsmoseEditor(context)
.on('change', function() {
context.map().pan([0,0]); // trigger a redraw
var error = checkSelectedID();
if (!error) return;
context.ui().sidebar
.show(errorEditor.error(error));
});
break;
}


Expand Down Expand Up @@ -154,4 +165,4 @@ export function modeSelectError(context, selectedErrorID, selectedErrorService)


return mode;
}
}
11 changes: 3 additions & 8 deletions modules/osm/qa_error.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,8 @@ Object.assign(qaError.prototype, {
if (this.service && this.error_type) {
var serviceInfo = services[this.service];

if (serviceInfo) {
var errInfo = serviceInfo.errorTypes[this.error_type];

if (errInfo) {
this.icon = errInfo.icon;
this.category = errInfo.category;
}
if (serviceInfo && serviceInfo.errorIcons) {
this.icon = serviceInfo.errorIcons[this.error_type];
}
}

Expand All @@ -65,4 +60,4 @@ Object.assign(qaError.prototype, {
update: function(attrs) {
return qaError(this, attrs); // {v: 1 + (this.v || 0)}
}
});
});
14 changes: 8 additions & 6 deletions modules/services/improveOSM.js
Original file line number Diff line number Diff line change
Expand Up @@ -436,9 +436,11 @@ export default {
} else {
that.removeError(d);
if (d.newStatus === 'SOLVED') {
// No pretty identifier, so we just use coordinates
var closedID = d.loc[1].toFixed(5) + '/' + d.loc[0].toFixed(5);
_erCache.closed[key + ':' + closedID] = true;
// No error identifier, so we give a count of each category
if (!(d.error_key in _erCache.closed)) {
_erCache.closed[d.error_key] = 0;
}
_erCache.closed[d.error_key] += 1;
}
}
if (callback) callback(null, d);
Expand Down Expand Up @@ -486,7 +488,7 @@ export default {
},

// Used to populate `closed:improveosm` changeset tag
getClosedIDs: function() {
return Object.keys(_erCache.closed).sort();
getClosedCounts: function() {
return _erCache.closed;
}
};
};
Loading