Skip to content

"partIsInside" causes odd renderings. It is not "The part must be totally inside the building" #145

@DerKarlos

Description

@DerKarlos

This Issue may relate or partly be the cause of #42

I tried your function partIsInside and had odd effects.
It returns true if one of the points is inside or at the border of the shape.
If neighbour parts share the same Node as the building, partIsInside will return true.
(Check if ANY point in a part is within this building's outline.)
But the OSM/F4map rule is: the part must be totally inside the building.
I see this Wiki definition: "2D footprints can (and often need to) overlap"
only for parts, not for overlapping the outer/building footprint.

But that may not apply vor building:part=balcony

You may invert it’s logic:

partIsInside(part) {
    const shape = part.shape;
    for (const vector of shape.extractPoints().shape) {
      if (!BuildingShapeUtils.surrounds(this.outerElement.shape, [vector.x, vector.y])) {
        return false;
      }
    }
    return true;
  }

There are two examples: 440257472 and 440257471
They are even more crazy. The neighbour parts get visible, but the building it selves not.

I changed my copy of your code and it looks good - mostly:
Way 316556318 includes a roof-relation 4166727, but our "surrounds" calculates Node 37 outside.
Hard to tell why. A drawing may help, made by "surrounds".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions