Yet another topic about Vector Tiles

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: https://github.com/icemagno/cesium-providers/tree/master/buildingsprovider

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.

This is my first pointcloud Vector Provider:

I’m curious why you chose to implement point clouds in this way, since massive point clouds are already well supported in CesiumJS with 3D Tiles.

I haven’t looked at your implementation, but have you seen this article on using the Primitive API (https://cesium.com/docs/tutorials/geometry-and-appearances/) ? What you could do is detect when the camera moves, and destroy/recreate the geometry as needed. Using the Primitive API will give you more control over how to batch this geometry, or create it asynchronously if needed etc.

I didn’t realize your goal was to display 3D buildings though. I think this approach is definitely going to be harder and slow for large data. This is why we handle the tiling and clamping to ground as an offline process, so it can be fast at runtime even with hundreds of millions of buildings (see Announcing Cesium OSM Buildings). Do you have a way of exporting your data as CityGML or KML/COLLADA?

Im developing military applications. Not everybody can use Ion. I must use a closed environment.

Converting data from one format to another is painful to do everytyme. I must use vectors as is since it is changing everytime.

Can 3DTiles read json directly from a postgis database with pgpointcloud extension? This is my need.

No. I can’t keep doing conversions forever. Military ops working with very dynamic and volatile data. Receiving data from camp, converting to database, convert to format foo and then to a format usable by cesium is not possible. It need to be fast and easy because they are not cartographs and understand only military stuff. Only the data colectors knows about gis.

They have in most cases small data. My method can serve buildings of a town or a city with easy. This is more than enough.

About point clouds this is only for my joy. I need to know if Im capable to do it. Not for production.

Hey @icemagno, I appreciate your explanation. We can’t discuss military applications on this public forum, so we’ll need to close this topic.