Grasshopper

algorithmic modeling for Rhino

So djordje just introduced me to the plugin earlier today, when I was asking for a solution to generate roofs in the McNeel forum. I think it's awesome, but it's not sufficiently accurate for the area I'm working on - Maribor, Slovenia.

My goal is to generate somewhat accurate buildings on non-planar (real) terrain where building height information is limited. 

Many countries, like Slovenia, enable free access to lidar point clouds, which can be used to generate accurate terrain models, as well as for extracting roof (and other) heights.

Combining OSM and point clouds can produce more accurate buildings where no other data is available.

I spent the day playing around in grasshopper and was able to produce these results for my hometown - Maribor, Slovenia:

(Gismo generated buildings)

(My attempt - Extruding buildings to the highest point)

I'll try to explain the workflow a simple as possible. I can explain more in-depth if necessary, but it's still only a concept - ?feasibility study?

  1. Acquire lidar point clouds for Slovenia from HERE
  2. Download (GKOT) LAZ for classified raw points and DMR for cleaned terrain points.
  3. Load point clouds to CloudCompare and subsample points for more manageable file sizes.
  4. Make mesh from DMR for terrain and extract roofs from LAZ. 
  5. Load mesh and points to Rhino and link to GH
  6. Find the center coordinate of the square block and convert to WGS84 (for OSM). For example - D96TM (Slovenian CS) to WGS84 (GPS). X=549500, Y=157500 to Lat=46.55531840244368, Lon=15.645565563285729.
  7. Type WGS84 coordinate to Gismo example file, and move the generated building outlines to target coorinate (eg. 549500,157500)
  8. Move the buildings in Z to the terrain (I projected the polygon center point to the mesh)
  9. Assign points to buildings (I used Point in Curves) and sort them by Z.
  10. Find the highest (or lowest) point for each building, measure distance to ground (building center point) and extrude by measured distance.

I think this can be developed even further to generate relatively accurate roof heights by finding the lowest roof point for each building. It would be a little more challenging, because some lower points are not roofs (ground?). Maybe it can be done by manually cleaning or some other trickery (average?, culling ends of lists?).

There are some problems I encountered.

The OSM map is not 100% aligned to the terrain, roof point clouds. The center of the map seems good, but the further out you look, the more the buildings seem to be misaligned.

I think this is because I only moved the OSM map from the center to the center point of the target coordinate system. I don't really know how projections work, but I assume every point from OSM would have to be converted?

I also need to figure out how to handle multipolygons (buildings with inner lines). For now, I only used the outer line.

Maybe someone can dig further down this rabbit hole, I think I exhausted my current capabilities.

Would it be maybe also be possible to implement coordinate conversion into the plugin? Something like https://twcc.fr/en/# ?

It would be great if it was possible to convert multiple points at once to different coordinate systems.

The example files can be found HERE.

The GH file is not optimized, but should work for this example. The point is only to get the idea across for now...

Views: 1962

Replies to This Discussion

Hi Primož,

Thanks for posting the example files and detailed explanation.

We had a similar topic a while ago.


Openstreetmap depends on users to add data.
If nobody added the height information, then Gismo will use random height.
I just checked - seems like nobody added height information to any of the Maribor buildings. That's quite surprising.
You can check this by setting the "OSM 3D" component inputs: "heightPerLevel_" to "0", and "randomHeightRange_" input to "0 to 0". Gismo will then generate 3d buildings of only those that have a 'height' key values in the Openstreetmap database.
As mentioned, for Maribor - none has - which results in the first photo that you attached.


The misalignment can happen when incorrect coordinate system has been used.
I wouldn't recommend using online custom conversion of the coordinates.
Gismo has a ‘Location To XY’ component which converts a WGS84 coordinate to UTM coordinate.

The inner courtyards of the buildings are probably not tagged (if I googled it correctly).
This means that you will have to extract the inner courtyard curve from top face of the "OSM 3D" components or "OSM search" components.

If you convert your mesh terrain to a surface (extract the mesh vertices, and then use Rhino's "Patch" command with quite a lot of U and V divisions), you can add it to the "groundTerrain_" input of the "OSM 3D" component. This will align the 3D buildings to your terrain surface.

Hi djordje,

Thanks for the link to the other topic. I hat a hunch that I can't be the first one who thought of something like this :D

Regarding the mesh to surface, what I usually do is create a grid of points over the terrain, project them to the mesh and then use Surface from Points.

Can you please explain why the online coordinate conversion is not recommended?

What would be the best/easiest way to add the building height information to OSM (in bulk)?

Is the height key the total height of the building - including the roof?

Hi Primož,
The terrain mesh that you attached in the 'Test_1.3dm' file is a triangulated mesh.
If you would like to create a surface from it you have to use the "Patch" command.
"Surface from Points" you would you use if you have an ordered-rectangular mesh. Or maybe you have such a mesh in some other file.

For the online conversion: I am not sure which parameters they use.
WGS84 proj4 string that they use can have a different ellipsoid name, latitude and longitude of origin. All of these differences can result in non alignment between Gismo generated geometry and external imported geometry.

As far as I know, one can not 'insert' data in bulk to openstreetmap.
Indeed it would be useful, but I assume that reason why it is forbidden is to prevent malicious use. So you need to define the "height" tag of each building separately through a web browser. Maybe this would not be that tedious task as Maribor is not that of a big city. Plus if you would do it, this information would be recorded for you future use, and any other user's use. Here is a tutorial.

Yes, "height" includes the roof as well.

I might just do that. Thank you.

Here is a better explanation of how I usually create surfaces from terrain meshes. I find Surface from Points much more elegant than Patch.

Attachments:

Thank you for posting the solution Primož!
I was not aware of this.

So if the height includes the roof, the 3D roof should be created from the top down, not on top of the building.

Would it be possible to add an option to gismo for this?

Does gismo also look for roof shape (flat) when building roofs to skip them?

At the moment not. You need to custom move the 3d roof for its height and split the building below it for that height value, then cap.

You can check for the roof type by using the "OSM Search" component and look for the "roof:shape" key. Let's say, anything else than "flat" should be a pitched roof.

I tried the Location to XY, but it gives the wrong X location. Am I doing something wrong?

Hi,
I grouped in orange the part using ‘Location To XY’ component.

Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service