Hi all,
This is my first post here. My apologies if I broke any rule.
I need some opinions on what I’m doing here: cesium-providers/buildingsprovider at master · icemagno/cesium-providers · GitHub
I’ve started this work a week ago and it is in very early stage, but I’ve achieved some good results. Basicaly I’ve created a PostgreSQL function to take a box and serve all buildings from that box as GeoJSON. I need to prepare the planet_osm_polygon
table a little to discard all not buildings with a correct height value (the height value must be exposed from hstore in import process).
After that, I’ve created a small Java (Spring Boot) app to serve a REST (get) endpoint. This will be the interface between Cesium and the database. This may not be necessary because Geoserver can do this job too using SQL View Layer.
Then I took the TileLonlatsImageryProvider
(don’t remember where. Sorry). It basicaly ask you a canvas in the requestImage
function.
My concern is not properly the canvas, but how this Provider can take the tile square box coordinates. So I have an idea: take this coordinates and use it to query my function by GeoJSON polygons.
The actual canvas was send back in black but I can still draw on it (I’ve used to debug purposes).
Well, now I use the Cesium.GeoJsonDataSource.load( url )
promisse to load this small square from database without block the script. Now I have about 90, 150 Primitive Polygons for each tile. Just need to extrude them and conform them to the terrain using Cesium.sampleTerrainMostDetailed
.
This is working very well but needs to take care about many details like memory, LOL, discard policy, etc…
The polys are ugly but as we can take properties from database within the Polygon data I think we can improve them somehow.
I start a little conversation with Omar on Github issue 9056 and found this kind of Provider is not the best way to achieve this but I understand nothing about Cesium and liked this way to take small boxes coordinates. If you know a best way be free to correct me.
I will really appreciate any opinion or criticism about it. It may not be the best approach but it the best I can do alone.