a-b-street / osm2streets

Convert OSM to street networks with detailed geometry
https://a-b-street.github.io/osm2streets
Apache License 2.0
102 stars 10 forks source link

Introduce a semantic representation for road markings #181

Closed BudgieInWA closed 1 year ago

BudgieInWA commented 1 year ago

This PR adds a suite of types for representing road markings, breaking them into a few broad categories based on geometry, then further distinguishing them by their meaning. Each marking type can be enhanced with properties describing the possible variations, such as the ability to overtake across road dividing center lines.

It is going to be a bit tricky to include all the information needed to define all the markings in a locale-independent way, as different locales will use different treatments. For example, the buffer rendering lacks the diagonal lines, because a reference line is needed to determine the angles for the hatches over the length of the median.

The tradeoff though, is a powerful separation of concerns, with output.rs determining which markings should be present and paint.rs handling the minutiae of rendering them into painted areas. I found it very easy to keep things in the right place during the implementation of this PR.

This changes a lot of the markings arbitrarily, but I'm keen to cut over the goejson rendering to output.rs as soon as possible, so we're all looking at and testing the same rendering code. That might mean implementing get_designations and an "inspection" geojson layer for all the misc. info that should be displayed in StreetExplorer.

BudgieInWA commented 1 year ago

image

image

BudgieInWA commented 1 year ago

@dabreegster I've added some docs and did some renames over the last few commits that you should find interesting. I'm going to merge this shortly, in preparation for tackling turn arrows and intersection markings.

Stop lines have also been added, and look great! It's obvious playing in JOSM that many stop lines aren't picked up, but I'm glad we've got some coming through!

image