[OSM-talk] Mapping everything as areas

Anthony osm at inbox.org
Sat Nov 28 14:25:10 GMT 2009


On Sat, Nov 28, 2009 at 8:47 AM, Steve Bennett <stevagewp at gmail.com> wrote:
> Maybe I missed the crucial bit, but presumably any area=yes highway
> has an implicit line running down the middle of it. The renderer would
> use that line at lower zoom levels exactly as it uses any other line.

That kind of destroys the whole point of highway areas, which is that
you are free to travel in any direction you want.

If I were going to write a renderer for it, I'd take the N nodes which
connect in and then make (N)(N-1) lines connecting them via the
shortest path (lines as straight as possible such that they fit within
the area, I'm sure there's a simple algorithm for it).  That'd be run
as a pre-processing step, at which point I'd throw away the areas.

> This does all assume that the area really does behave like a line. If
> people get creative with T shapes or whatever, then it would break
> down.

The whole point of using an area is that it doesn't behave like a
line, though.  If all you have is a line with a width, use a line with
a width tag.

> I was thinking about this before, surely you can directionalise an
> area by defining a start *way* and an end *way* just as a line has a
> start node and end node. Again, assumes an area that is still kind of
> linear in shape.

In many cases this wouldn't even be necessary, because the connecting
ways will be one-way.  Even with a T-shape, if the ins and outs are
one-way, so is the area by implication.  In more complicated
situations, turn restrictions could work.

However, yes, once it's anything but a line with a width, you're not
representing a typical street.  And even if you do have a line with a
width, if there's more than one lane you're not really capturing the
true rules of the road, which include a requirement to generally stay
in one lane.  A two-lane area stretching for a kilometer would imply
to routers that it's perfectly acceptable to drive in a diagonal line
from one lane to another - generally not something that's allowed.

If you want to go in the direction of mapping the purely physical,
then for a multi-lane roadway you'd want to map the area and the lane
separators.  Then the routers would have a lot of pre-processing work
ahead of them, where they'd probably take all those areas and convert
them (back) into lines and nodes.  On the other hand, renderers would
have a piece of cake.




More information about the talk mailing list