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

transportation_name omits short concurrencies #1553

Open
1ec5 opened this issue Jun 23, 2023 · 0 comments
Open

transportation_name omits short concurrencies #1553

1ec5 opened this issue Jun 23, 2023 · 0 comments

Comments

@1ec5
Copy link

1ec5 commented Jun 23, 2023

The transportation_name layer omits many shorter motorway-classed features that connect parts of the road network.

Example

I’ve rigged OpenStreetMap Americana to highlight the entirety of Interstate 94 in aqua, by filtering a line layer to any transportation_name feature with a route_* property set to US:I=94. I-94 runs continuously from Billings, Montana, to Sarnia, Michigan, and each of the individual route relations in this superrelation are contiguous. However, you can see bits of red peeking through gaps in the aqua, indicating segments where a feature is present in transportation but the corresponding feature is absent from transportation_name:

Interstate 94 from Billings to St. Cloud

Interstate 94 from St. Cloud to Sarnia

The gaps do not follow tile boundaries and vary in length depending on the zoom level:

Fergus Falls z8 Fergus Falls z9 Fergus Falls z11 Fergus Falls z12

You can see these same gaps when inspecting the OpenMapTiles Community Vector Tiles Server as well as MapTiler’s OpenMapTiles tileset.

To reproduce this issue in OpenStreetMap Americana, run the following in your console:

map.addLayer({
  type: "line",
  id: "road_highlighted",
  source: "openmaptiles",
  "source-layer": "transportation_name",
  filter: [
    "let",
    "query", "US:I=94",
    [
      "any",
      [
        "==",
        ["get", "route_1"],
        ["var", "query"],
      ],
      [
        "==",
        ["get", "route_2"],
        ["var", "query"],
      ],
      [
        "==",
        ["get", "route_3"],
        ["var", "query"],
      ],
      [
        "==",
        ["get", "route_4"],
        ["var", "query"],
      ],
      [
        "==",
        ["get", "route_5"],
        ["var", "query"],
      ],
      [
        "==",
        ["get", "route_6"],
        ["var", "query"],
      ],
    ]
  ], paint: {
    "line-width": 4,
    "line-color": "aqua",
  }
}, "road_surface_bridge_layer_top");

Diagnosis

The gaps appear to affect relatively short route concurrencies along motorways. For example, the following ways along Interstate 94 / U.S. Route 52 form a three-way concurrency with North Dakota Highway 1 that stretches only 7.8 kilometers (4¾ mi.):

In OpenMapTiles, the transportation_name layer’s SQL statements have various distance cutoffs, none of them shorter than 8 kilometers (5 mi.):

WHERE (highway IN ('motorway', 'trunk') OR highway = 'construction' AND subclass IN ('motorway', 'trunk'))
AND ST_Length(geometry) > 8000;
(highway IN ('motorway', 'trunk') OR highway = 'construction' AND subclass IN ('motorway', 'trunk')) AND
ST_Length(geometry) > 8000

These cutoffs were first implemented in eecb853 as part of extending motorway labels to lower zoom levels. I could understand why the layer would omit features for very short surface streets, but motorways and other highly classified roads are almost always part of a larger connected road network. It should be the client-side renderer’s responsibility to collide out any label for which there isn’t enough room.

Impact

This usually doesn’t affect road name labels to a noticeable degree, but styles that mark motorways with route shields or other symbols often omit those symbols seemingly at random. Moreover, a map about a particular route would be unable to highlight that route consistently.1

Besides route concurrencies, this issue also affects roads that alternate between highway=motorway and highway=trunk in quick succession. This pattern is common in some parts of the United States, where the authorities tend to build a short, motorway-grade bypass around each city along a route.

Footnotes

  1. This is strictly about a numbered or named route, not an ad hoc route that you’d get from a routing engine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant