3DBAG / 3dbag-viewer

https://3dbag.nl
GNU General Public License v3.0
35 stars 10 forks source link

Triangulate BAG 3D DBDump #89

Closed Roempie closed 1 year ago

Roempie commented 1 year ago

I want to triangulate the lod22_3d geometry column for converting it to 3D Tiles using pg2b3dm. However when I use ST_Tesselate an error occurs. What way is recommended to traingulate these multipolygons?

Roempie commented 1 year ago

For anyone wondering for the solution I used bertt's triangulator library to tesselate. Before tesselation the multipolygon should be conveted to polyhedralsurfaces. This can be done by just replacing AsText MULTIPOLYGON text with POLYHEDRALSURFACE.

After that the idea is to loop over every geometry within the db, loop over every polygon within a polyhedralsurface and convert those and writing the traingulated converted polygons back to a new polyhedralsurface instance. And updating the database record ofcourse.