Geodan / pg2b3dm

Tool for creating 3D Tiles from PostGIS geometries
MIT License
361 stars 69 forks source link

tile creation fails #94

Closed QSafariallahkheili closed 1 year ago

QSafariallahkheili commented 1 year ago

I am trying to create tiles for building dataset with triangulated geometries (using tesselate_building tool) following the steps and dataset in tutorial. However, afeter running pg2b3dm and providing the table specifications I get the following error:

pg2b3dm -h localhost -U berlinberlin -c geom_triangle -t delaware_buildings -d brandenburg -a id,height --shaderscolumn shaders

Unhandled exception. System.IndexOutOfRangeException: Index was outside the bounds of the array. (below screenshot)

Screenshot 2023-05-19 at 09 47 10

I am using pg2b3dm 1.5.3.0, Tesselate buildings 0.2.0.0, PostGIS 3.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1

I would appreciate any response or possible solution.

bertt commented 1 year ago

Hi, your geometries are in '3857' (for MapBox) but should be in '4978' for Cesium

Spatial reference of delaware_buildings.geom_triangle: 4978

Did you run tesselate_building as stated in the getting started (including -f cesium)?

$ tesselate_building -h localhost -U postgres -d postgres -f cesium -t delaware_buildings -i wkb_geometry -o geom_triangle --idcolumn ogc_fid --stylecolumn style --shaderscolumn shaders
GinaStavropoulou commented 1 year ago

I have exactly the same issue. When I tesselate with -f cesium the next step is running fine but if I tesselate with -f mapbox then the next step fails with Index was outside the bounds of the array.

bertt commented 1 year ago

@GinaStavropoulou we stopped supporting MapBox, it may still work with older versions of pg2b3dm

GinaStavropoulou commented 1 year ago

Thank you! I will be using just cesium then!

QSafariallahkheili commented 1 year ago

@bertt Thanks for your response.

I am using Maplibre GL JS with DeckGL. I tried to tesselate building with -f cesium then create tiles with pg2b3dm 0.16.0.0 as the deckgl fails to render tiles with implicit tiling. However it does render the tiles but the rendering performance is very poor as the deckgl tries to call b3dms outside of the area of interest (focus area).

however I created mapbox tile (EPSG:3857) and tried to render the tile with @geodanresearch/mapbox-3dtiles package but it fails because of dependency conflict or no vivid reason. Do you have any recommendation on how can I mapbox tile in my existing Maplibre application?

bertt commented 1 year ago

@QSafariallahkheili as stated above, you can try to use pg2b3dm version < 1.0 for MapBox, maybe it works with @geodanresearch/mapbox-3dtiles