Another thing I want to suggest is to
Bring the Segments data type back
Rationale
As of now, a Way is simply an ordered set of Nodes. The difference between a Way and a Relations, which is an ordered set of other elements, is not obvious. A Way is a distinct type of relation.
If we start with the assumption that a Way is a Relation, then we move on to the next point. What do Segments have to do with it?
Segments can be:
- Regular – consists of two points: “start” and “end.”
- Arcs – consist of three points: “start,” “intermediate,” and “end.” (re https://stackoverflow.com/questions/22791951/algorithm-to-find-an-arc-its-center-radius-and-angles-given-3-points)
Each Segment has a direction, from the start node to the end node.
A Way is a relation of an ordered set of Segments (regular and arcs) and has its own direction. Segments that go in the same direction as the Way have the role forward
. Segments that go in the opposite direction of the Way have the role backward
. One segment can be part of several Ways, with the corresponding role indicating whether its direction coincides with the direction of a particular Way.
What do we get?
- Arcs allow you to show smooth bends in the geometry without adding extra points to approximate them.
- Circles and Ellipses are Ways consisting at least of two arcs (using four nodes).
- MultiWays (MultiLines): A single Way relation contains sequences of Segments that form one, two, or more Ways that share common characteristics (e.g., dual carriageways, streets, etc.).
Finally, the Polygon and MultiPolygon data types, where outer/inner loops are ordered sets of Segments, use the direction of the Segments sequences to determine the inside and outside of the polygon. Everything to the right of the sequence of segments is outside the polygon, and everything to the left is inside. The outer loop has a counterclockwise direction, and the inner loop of the multipolygon has a clockwise direction. MiltiPolygon can have several outer and inner loops. This solves the problem of rendering incomplete Polygons.
It is crucial to acknowledge that a Segment is a Relation.