OvertureMaps / io-site

MIT License
33 stars 5 forks source link

Building with parts not displayed - only parts. #107

Open atiannicelli opened 2 months ago

atiannicelli commented 2 months ago

Description

When looking at the map for buildings I noticed that a building that "has_parts=true" is not displayed on the map. I believe the proper way to deal with buildings that have parts is to render the building as a 2 demential polygon. And then render all the parts as 3d polygons. So basically if a building "has_parts=true" then render it as though it has no height field. Then you can render all the parts as usual.

In the specific case the building 08b2a3046ab4cfff020048b4280fe91a has a height of 75.3. If it didn't have parts then we should render it as a 3d polygon, but I'm proposing that since it has parts then we should render it without height. This building only has one part (08b2a3046ab6bfff0201e3d47a4fa533) that has a height of 84 (since it is a communications tower). This part should be rendered as a 3d polygon.

On a separate case, the mapper SHOULD have mapped a "part" to represent the rest of the building and we will try to get editors to fix this type of issue, but when it does exist it would be nice to render the "building" and the "building parts" so that we can see where the footprint of the building is if it has not been completely covered by parts.

Here is a pic of the case:

Screenshot 2024-07-24 at 9 58 30 AM

and what it is missing as seen in rapid (w213703943 and w1151199622): Screenshot 2024-07-24 at 9 59 06 AM

What browser are you seeing the problem on? What version are you running?

Chrome

The OS you're using

MacOS

Steps to reproduce

Go to the link below or find a building with parts that don't completely cover the footprint of the building.

GERS ID of the entity in question (if applicable)

08b2a3046ab4cfff020048b4280fe91a

The browser URL at the time you encountered the bug

https://explore.overturemaps.org/#17.77/42.705155/-71.16455/33.5/11

Bonkles commented 2 months ago

Possibly related to #92. Looks like we should get with the buildings folks and do an investigation on what is in the data, what is making it into the visualized tiles, etc.

atiannicelli commented 2 months ago

What I'm asking for here is that when rendering a building we currently seem to already have logic that says that if a building "has_parts=yes" then we don't render that building at all. I hope we can add logic that simply says if the building "has_parts=yes" then render the building with height=0

atiannicelli commented 2 months ago

This turned out to be not related to #92 . That issue was resolved in the latest version.

atiannicelli commented 2 months ago

@Bonkles do you think there is a way in the renderer to handle this case as stated above?

Bonkles commented 2 months ago

So the problem I'm wrestling with here is- the building may have a height that is the max height of all its constituent parts.

Related: https://github.com/facebook/Rapid/issues/1062

If we have a building with parts and no height, you'd like to see it as a 2d 'footprint' enclosing the parts. If we have a building with parts AND a height, we should ignore the height and just render the footprint still as the 3d shape isn't really reflective of the actual state of the building.

But! if the building has a height but no parts specified, there's no way for us to tell if it's a 'bounding box' with building parts inside it without doing a bunch of exhaustive footprint intersection checks. This would get pretty expensive CPU wise, so we might do what I did in the bugfix and just do that checking when we're super zoomed in.

jenningsanderson commented 2 months ago

Buildings TF - July 30: Do we solve this at the data processing / ingestion or at the renderer?

@Bonkles to investigate if this is a tile / logic in the renderer issue?

Bonkles commented 2 months ago

Looks like the base building is indeed in the tiles:

image

So I believe this is something the site code is doing to filter 'buildings with parts' out. Will investigate further...

StrandedKitty commented 2 months ago

Just my 2 cents: on streets.gl and on shadowmap.org we're showing building outlines as long as less than 90% of their area is covered by building:parts. This approach handles the case when you have an unconventionally mapped 3D building outline with only a tiny part inside it -- outline stays visible, and it also works fine for conventionally mapped 3D buildings -- outline gets hidden as expected.

jwass commented 2 months ago

I do like @StrandedKitty's proposed logic. But the explore site is supposed to be an x-ray view for really getting into the weeds of the underlying data. Omitting the outline entirely loses the information associated with it, including the source data info and the attributes, which likely differ from all the parts. So I lean towards somehow always showing the outline.

We added a "has_parts" attribute on the building outlines to help here. Maybe it's as simple as always show the outline, but only extrude it if it has a height and does not have parts.

atiannicelli commented 2 weeks ago

@Bonkles do we have any plan to fix this? I'm just hoping we at least see buildings with has_parts=true get rendered as a 2d geometry.