openstreetmap / iD

🆔 The easy-to-use OpenStreetMap editor in JavaScript.
https://www.openstreetmap.org/edit?editor=id
ISC License
3.34k stars 1.2k forks source link

Adjust preset list based on connected or nearby features #4139

Open bhousel opened 7 years ago

bhousel commented 7 years ago

Currently the preset list is ordered by most recently used followed by the default common presets. We can improve the ranking of some presets based on connected or nearby features.

Examples:

Connected features
Nearby features (also see everything in #4138)

etc..

cc @1ec5

1ec5 commented 7 years ago

There’s a neverending list of presets we could helpfully suggest, so it’ll be a an area for continuous improvement – and a boon for micromapping. 😄

More connected features:

More nearby features:

bhousel commented 7 years ago

Good suggestions, @1ec5.

Also I want to add, we have traditionally avoided building this kind of OSM tagging logic into iD itself, (as you said, it's a "neverending list of presets"). So the rules for this issue and #4138 should exist in the preset definitions, not in JavaScript code. Something like:

{
    "icon": "park",
    "geometry": [
        "point",
        "area"
    ],
    "related": {
        "contains": [
            "leisure/picnic_table",
            "amenity/bench",
            "amenity/bbq",
            "amenity/fountain",
            ...
        ],
        "nearby": [
            "highway/footpath",
            ...
        ]
    },
    "terms": [ ... ],
    "tags": {
        "leisure": "park"
    },
    "name": "Park"
}
{
    "icon": "poi-traffic-signals",
    "geometry": [
        "vertex"
    ],
    "fields": [
        "traffic_signals"
    ],
    "related": {
        "connects": [
            "highway/trunk",
            "highway/primary",
            "highway/secondary",
            ...
        ]
    },
    "tags": {
        "highway": "traffic_signals"
    },
    "terms": [ ... ],
    "name": "Traffic Signals"
}
1ec5 commented 6 years ago

More nearby features

Note that whether something is “nearby” can depend on the latitude, as seen in #5101 and #1520.