Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with extracting buildings #18

Open
Lenivedz opened this issue Feb 16, 2022 · 12 comments
Open

Problem with extracting buildings #18

Lenivedz opened this issue Feb 16, 2022 · 12 comments
Assignees

Comments

@Lenivedz
Copy link

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
Copy link
Author

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
Copy link
Author

Screenshot 2022-02-16 at 16 20 31

same place in QGIS (apartments are missing in gh)

@philipbelesky
Copy link
Owner

philipbelesky commented Feb 17, 2022

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?

@philipbelesky philipbelesky self-assigned this Feb 17, 2022
@Lenivedz
Copy link
Author

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
Copy link
Owner

philipbelesky commented Feb 18, 2022

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
Copy link

gspahr commented May 8, 2022

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
Copy link
Owner

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:

  • Some part of the building-generator-from-outlines code is choking on the more complex shapes
  • The OSM data for those buildings stores each polyline as separate pieces of data and then uses special metadata to define particular interrelationships like 'interior courtyard'. If so, a fix might required Add parsing of relation data types #4 to be tackled and take a little longer.

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
Copy link

gspahr commented May 9, 2022

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

  • Elk has given me very reliable geometry, but it is not as practical to filter out stuff as in Caribou.
  • I also tried a component from Decoding Spaces called 'Decompose Extrusion' that extracts and converts geometry from OBJ meshes (obtained through OSM2World) to Breps.
  • Dragonfly from Ladybug Tools also was able to extract correctly the buildings' geometry, but does so from a GeoJSON file that I had to create elsewhere (http:https://geojson.io/) but somehow managed to lose the building height metadata.

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

@philipbelesky
Copy link
Owner

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:

  • Perhaps making "Extract Buildings" into the more generic "Extract Volumes"
  • Either adding a new button to the Specify Features window that would pre-select all 'tags very likely to be buildings' or add a new Specify Buildings component, that will automatically generate this list of all building-like metadata.

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
Copy link

gspahr commented May 20, 2022

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
Copy link
Owner

philipbelesky commented May 21, 2022

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
Copy link

gspahr commented May 21, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants