[OSM-dev] proposal to kill areas

Nigel Magnay nigel.magnay at gmail.com
Sat Jul 22 14:27:32 BST 2006


>
> Areas are clearly not a "subtype" in the terms of the liskov's
> substitution principle (The meaning in almost any OO-language). This is
> because you cannot just replace any occourences of "way" with "area" and
> expect anything to have the correct behaviour.
>
> Beg to all: Please don't fall in the classic square/rectangle - pit. ;)
>

I think some people clealy *are* arguing that they're subtypes (e.g.
'it's just a way with area=true'), and that you can subtitute all
instances of area with ways (for those tools that don't understand
areas).

I'm relatively agnostic. It is a collection of nodes, whether those
nodes are represented by segments makes little difference to me for
everthing else. There's additional processing you want to undertake if
you're processing areas as opposed to ways (e.g. ways can only
intersect your bbox, areas can totally overlap), so they should be
first-class things in the API.

>
> > Exactly the same thing is true of
> > segments - currently, the segments returned for a given bbox includes
> > any segment that has at least one node inside the bounding box.
> > However, this is not correct, since there is the possibility that a
> > segment may run through a bbox, but have no nodes inside it (e.g. a
> > road segment starting outside-left the bbox, and ending
> > outside-right).
> >
> > The API should be returning this segment.
>
> Yep. This is a known bug. It isn't fixed and it is more likely, that the
> definition of "map request" will be changed to something very strange
> than this get fixed into the current server ;-).
>
> There was a proposal how to "fix this a bit" some time ago, but never
> got into code.
>

quadtrees. I have an implementation for ways, nodes and segments, and
it could be reasonably easily extended to areas - if I get a chance
before I go on holiday, I'll post the code, then someone with more
spare time might think about putting it into the sever ;)

>
> > Areas are no worse in this regard, though are more likely to cause
> > problems because segment sizes are usually small, and areas are
> > probably bigger (e.g area of 'outline of UK' for example).
>
> Areas are MUCH more likely to be skipped out by requests, as the example
> from 80n shows. Segments are usually extremly small, whereas areas can
> also be used for things like "germany".
>
> Now we discuss about whether or not a request should return objects,
> whose describing data is not within the bounding box. This is
> independent of how the area should be laid out, except that it may be
> faster to implement correct requests with an data structure describing
> areas as node-lists.
>
> Ciao, Imi.
>
>
>
> _______________________________________________
> dev mailing list
> dev at openstreetmap.org
> http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev
>




More information about the dev mailing list