Using colour to distinguish a node's role in a relation in an overpass query

I’m sure this is possible, but the Overpass documentation is unhelpful.

Basically, I’m looking for an overpass query that shows something a bit like this but with the different node relation roles in different colours - so that this node is displayed differently to this one.

Any overpass query that assigns colours based on role relation would be helpful; I’ll be able to figure the rest out from there.

Does the following work?

1 Like

Not possible in Overpass Turbo’s MapCSS MapCSS/0.2 - OpenStreetMap Wiki
Overpass Turbo should be able to do it in MapLibre. Unfortunately with inline YAML support seems bugged that it can’t run anything on my side. You might have to try in with an entire file hosted online. You can start with a copy of the default to make you own changes.
The GeoJSON has added complexity from the nesting. The "role" “tag” is inside a JSON inside an array inside the "@relation" string.

      "type": "Feature",
      "properties": {
        "@id": "node/11068010896",
        "@relations": [
            "role": "marker",
            "rel": 9487,
            "reltags": {
              "colour": "red",
              "cycle_network": "UK:National Cycle Network",
              "designation": "NCN National Route 65",
              "name": "The White Rose Cycle Route",
              "network": "ncn",
              "operator": "Sustrans",
              "ref": "65",
              "route": "bicycle",
              "type": "route"
      "geometry": {
        "type": "Point",
        "coordinates": [
      "id": "node/11068010896"

I’m guessing it should be something similar to "filter": ["all", ["==", ["get","role",["at",0,["get","@relations"]]], "marker"]] , but I can’t get it to work on my first experience with this. Need @Minh_Nguyen or someone else’s help.
If it works, you add a new layer that changes "circle-color" in "paint"

        "id": "overpass-poi",
        "type": "circle",
        "source": "OverpassAPI",
        "filter": ["all", ["==", ["geometry-type"], "Point"]],
        "paint": {
            "circle-stroke-width": 2,
            "circle-stroke-color": "rgba(0, 51, 255, 0.6)",
            "circle-color": "rgba(255, 204, 0, 0.6)"

(this is the default)

Would something like Amanda’s Waterways map - OSM River Basins work?