#1506

Roads merged from several OSM ways take one way's surface for their whole length (a gravel track drawn as grass)

OpenTachyopened 1d ago

Summary

A road segment that Overture merged from several OpenStreetMap ways is drawn with the surface of one of those ways along its whole length. A gravel track becomes a grass track (with grass growing on it), a gravel road becomes asphalt, and the same road can even look different from one map cell to the next.

Example: Herrenweg, Sulzburg (Germany), 47.8425 N 7.6925 E

In OpenStreetMap this stretch is six ways:

waysurfaceshare of the merged segment
w1563038665, w1563038666(unpaved) / asphalt8 %
w50822566grass35 %
w50822567gravel32 %
w1563039712asphalt1 %
w1563039711gravel24 %

Overture merges all six into one road segment, because there is no junction in between. In game the whole segment, including the 56 % that is gravel, is a grass track, and the ground cover grows grass on it.

Why it happens

  1. Overture keeps every source way of a merged segment with its range along it. BeamNG.Earth reads them into the src_ways rule (overture.way_sources).
  2. To add OpenStreetMap's own tags (lanes, width, surface, ...), osmtags.join picks one way per segment: the one covering most of it (src_record). Here that's the grass track w50822566.
  3. roads._map_surface_value then takes that way's surface for the whole segment. Overture's own surface rules, which have every way's surface along the segment, are never read when an OSM value exists.

Point 2 also makes the result depend on the cell. When the chosen way's tags are not in a cell's tag set, the join falls back to the same-named way nearby. So the Herrenweg came out as grass in one cell and gravel in the next.

How common is it?

These counts come from the 1,261 road cells in my local cache (mostly Germany and Italy, plus a few US places):

  • 214,856 road segments.
  • 27,383 (13 %) are merged from several ways.
  • 18,272 of those carry an OSM surface.
  • With the fix below, 79 segments (29.4 km) change how they look. For example:
    • asphalt → gravel: Via di Isola (Italy), 31 % asphalt and 69 % pebblestone, was drawn as asphalt.
    • grass → gravel: the Herrenweg.
    • asphalt → paving stones: footways and service roads.

The count is small but scattered everywhere, and it lands where players notice it: tracks, field roads, village lanes.

Related

  • #683 / PR #689 (same family): "Roads in an OSM route relation take a neighbour's tags". That fix made src_record the road's own way, the one covering most of the segment, instead of the route relation. This issue is the next step: on a segment of several ways, "most of it" is still only one of them.
  • PR #213: OSM tags lost on relation-sourced roads (the _named_way fallback). That fallback is why the result can differ between cells.
  • Not this bug: I checked the locations in #1321 (dirt vs paved in Georgia/Alabama) and #1367 (paved streets as dirt, Oidtweilerweg area, NRW). Their roads carry no surface value in OSM and are single-way segments, so their surface comes from the regional or aerial guess, not from a merged segment.

Proposed fix

I have a fix ready and will open a PR for it, which closes this issue. It takes the surface the merged segment mostly has, and is limited to roads.py. It needs no Rust and no map data refetch.

Activity

0

No activity yet.