philipbelesky / Caribou

Caribou is a Grasshopper plugin for parsing downloaded Open Street Map data into Rhino geometry. Caribou is currently in beta.
GNU Lesser General Public License v3.0
24 stars 3 forks source link

Problem with extracting buildings #18

Open Lenivedz opened 2 years ago

Lenivedz commented 2 years ago

Hi, i faced with a problem while making gh definition.

I'm using "extract ways" node to extrude building, but I found, that it didn't extract all buildings from file. For sure I opened same file in QGIS and missing buildings was there.

So I'm wandering where is problem (I tried to select all features for node, didn't help)

(img1 after adding missing buildings) (img2 after baking definition)

photo_2022-02-16 16 18 12 photo_2022-02-16 16 18 05

Lenivedz commented 2 years ago

I heard that OSM don't extract buildings with mark "building=yes" maybe that an issue

Screenshot 2022-02-16 at 16 51 33

?

Lenivedz commented 2 years ago
Screenshot 2022-02-16 at 16 20 31

same place in QGIS (apartments are missing in gh)

philipbelesky commented 2 years ago

Hi Lenivedz, thanks for posting this issue. I'll need to take a look at the raw data to see if this is an issue with OSM or an issue with Caribou. Could you post the the .osm file you downloaded? If it wont fit as an attachment, maybe link me to the area you are looking at. And, just to confirm, the buildings that didn't come through with height data are the white-colored ones in your first render?

Lenivedz commented 2 years ago

Hi, I can't attach osm.xlm file, so here is approximately area https://www.openstreetmap.org/#map=17/59.95610/30.30597

Yes, white ones are made manually (I made them by exporting vectors from same file in QGIS)

I didn't use height data actually, i extruded buildings by extracting levels data and multiply it by 3.2 m.

philipbelesky commented 2 years ago

Hey, thanks for posting the site location, that makes it much easier for me to look into. I've been able to confirm a couple of things:

1) Some of the shapes in this site aren't properly closed curves which caused an error in Caribou when it tried to make them into BREPs. This then prevented other geometry from being processed — probably some buildings. I've added some code to handle this more gracefully so that the other geometry is not affected. If you update Caribou in the Package Manger it should contain this fix - let me know if it doesn't address the problem.

2) I'm not sure exactly which buildings you manually added heights for, but there definitely isn't height data in OSM for all buildings on the site. If you look at the definition in the zip file below (and plug in your OSM file) you can see the metadata for each building. If it has a height or levels Caribou will use that to make a 3D shape, the presence or absence of building=yes shouldn't matter. Do let me know if QGIS is able to add heights for buildings that don't have a height/level/floor value in Caribou/Grasshopper as I'd be interested to look into how they do this.

Caribou OSM info.ghx.zip .

gspahr commented 2 years ago

Hi, I've been using your Caribou library since yesterday and encountered this building import error... a superficial analysis of buildings that weren't imported revealed that their base geometry was a little more complex than just closed polygons, but in fact had one or more holes through them (example, interior courtyards).

OSM

GH

Malaga MAP.zip

philipbelesky commented 2 years ago

Hey, thanks for bringing this to my attention and for posting a clear test case. I should have some time to look at this over the next week. I think it should be either:

If there is another Grasshopper OSM importer that handles these types of geometries, let me know as it could help to narrow down the issue.

gspahr commented 2 years ago

Sure, I've been trying other importers, I will enumerate what I've tried so far:

I hope this helps you towards reaching the easier solution possible!

philipbelesky commented 2 years ago

Hey, thanks for bearing with me. It turns out this seems to be an issue with the metadata rather than anything too Caribou specific.

In the file you've provided, the missing buildings don't actually have any height data specified for them in Open Street Map. You can verify this using the "Query Features" option in the OSM web viewer. In many cases, they also aren't tagged as "buildings", but it looks like the OSM web viewer has some smarts to interpret other metadata like amenity=hospital or landuse=residential as equivalent to a building tag.

I can see in Elk that it provides building outlines (not heights) in a similar fashion - presumably it has a special list of metadata that aren't building=something but can be assumed to be buildings. I'm not sure I like this behaviour as part of Caribou's workflow involves being very explicit about the kinds of metadata you are looking for. I wonder if this could be solved by either:

What were your thoughts? I realise that making 3D volumes from buildings is like 80% of the job for this kind of plugin in an architectural setting, but I'd like to not compromise the more GIS/meta-data stuff that I think is the most interesting part about Caribou.

gspahr commented 2 years ago

Hi, sorry for the delay.

I've been looking at the query function on OSM and the unimported buildings I identified are indeed tagged as buildings building=hospital, building=public, building=apartments and so on, but what I can appreciate is that they have an extra type=multipolygon tag that is in fact related to the presence of inner courtyards geometries. As an example I'm pasting here the metadata for one of the buildings highlighted on my previous posts.

hospital

You are very right that being able to quickly import the geometries is one the most important aspects of my workflow where I'm trying to simulate urban weather. I hope this issue can be circumvented since Caribou makes it really easy to filter by metadata and in no way would I want it to compromise this aspect.

philipbelesky commented 2 years ago

Hey, thanks for the follow up. I thought I had mentioned this in my original reply, but you are definitely right about the lack of multipolygon description precluding import of many of the buildings. That feature is definitely planned and involves parsing and grouping those geometry types as described here: #4. I might try and do a quick solution sometime soon, but the delay in getting to this was that I wanted to add it in without slowing down the parsing speed overall. I'll keep you posted when I get to it and when there's anything to test.

gspahr commented 2 years ago

Absolutely! My pleasure to bring up the issue and definitely will be looking forward to the next update.