[josm-dev] JOSM BBoxes in and out

Sebastian Klein bastikln at googlemail.com
Mon Apr 26 09:50:34 BST 2010


Rolf Bode-Meyer wrote:
> Hi!
> 
> I think that slowly but surely I've gone mad. I'm trying to understand
> org.openstreetmap.josm.data.osm.BBox.inside(BBox b) for over an hour
> now, but I just don't get it.
> In both of the following cases inside called from the larger with the
> smaller as argument it returns true.
> +---------+   +-------+
> | +-----+ |   |  +----+-+
> | |     | |   |  |    | |
> | |     | |   |  |    | |
> | +-----+ |   |  +----+-+
> +---------+   +-------+
> 
> Is this really the desired effect? Is my understanding of inside and
> outside different?
> Please enlighten me.


It's a classical rectangle "intersects" test, so the function should
better be renamed...
This did not cause any misbehaviour because it is used just once and in 
that context it works correctly.

Sebastian





More information about the josm-dev mailing list