Cesium, City and file formats.

Hello,

I would like to do create something like https://cesiumjs.org/NewYork/
Now, compared to this demo, I do not need to display a lot of buildings, only a small zone (so probably a tileset).

=> use <=

~ display a series of building at their real position.
~ some building are just for display
~ ome building are clickable to get their information (altitude, name...).

I have some question, because this is very confusing.

1) I heard about a lot of format and a lot of way to do thing. CityGML, COLLADA, KML, Gltf... and 3d Tileset...
  I would like to know if my understanding is clear.
  3D Tileset is made by cesium (ion) it's a custom thing on the server that just adapt wathever we import (CityGML, COLLADA, KML, Gltf) into a GLTF that are separated in tile. so when I request a certain coordinate, cesium return me
  the block coresponding to this position, and give me back my list of building.
  but, I can also import directly from my app (without cesium ion) any CityGML, COLLADA, KML, Gltf... it will just not use the tileset of cesium, so it will load everybuilding at any position on the map.

is this right ?

2) I tried to find UI clients that allow to manipulate cityGML, Gltf ... for 3d map. so imagine a Cesium app, where you upload your 3D model, place it, add information and then export it in CityGML or any other format. I didn't find anything.
(like this post say https://groups.google.com/forum/#!topic/cesium-dev/N_P1fmZmSj8). The few I found have outrageous price, and I can't really spend money on this. So I believe there is no client that allow those easy manipulation right ?
Since my buildings are few, is creating by hand the best way ? or can you point me to a simple create a 3d city representation models?

3) Now since I believe 2 doen't exist, I have a list of GLTF models, and I have their data (altitude, name...) how do I merge those two information ? I was thinking of adding a all the building indipendently in my map with a id tag.
from Cesium Entity, when I click on this buildings, i get the id, then search into a loaded json the specs of this id to get back the informations. Is this achievable ?
Also, I do not exactly understand how Gltf work, but it's a Json so. If I make a single GLTF file with different models inside, can I get every models separately or it Cesium Entity will only return the big model ( and not sub models?)

My question may be unclear, and I appreaciate and thanks anyone who will try to help.
I can explain more if needed. Thank you

4) Also, I believe it is possible to add building from OSM directly ? it is already tiled from OSM database ?
this works with 2D already => imageryProvider: Cesium.createOpenStreetMapImageryProvider({
          url : ‘https://a.tile.openstreetmap.org/
        }),

but is there something similar that would work with 3d Buildings ?

The equivalent to tiled 2D data in 3D is 3D Tiles. To be clear, 3D Tiles is an open community standard which is documented here (https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification), so it’s not a “custom thing on the server” as much as it is this open standard.

You are correct that you can either tile your data as 3D Tiles, that way you can efficiently stream/load large 3D datasets, or you can load models directly into CesiumJS yourself. I’m not aware of what all the available UI tools are for manipulating 3D buildings, but I know a lot of people in the community have built smart city planning applications on top of CesiumJS (see https://cesiumjs.org/demos/Cities/).

I think the easiest way if you have a set of models and attribute information is to construct a KML file that describes the location and any metadata for each model (and the models must be converted to COLLADA for this format. Although this is something we’d like to support glTF for in the future). There’s sample data of this as I describe in the post here: https://groups.google.com/d/msg/cesium-dev/pR4Fe_T2Pfc/fuhic3wyDwAJ

That way you can get a demo of your buildings and you can click to see their info/id, hide or style any of them just like the New York demo. I do understand it can be a bit frustrating not having better documentation/tutorials for this. It is something we have been looking to improve, but please do try out this KML+COLLADA approach for your buildings and let me know if you run into any troubles.

Thank for your reply.
Yes it's a bit more clear now, I did check this page in the repo, but since I didn't find any way to "create/convert a map to tileset" by myself, and tileset was mostly related to Cesium ion I considered it to be "magic" on cesium server.
I will read more of the specification tomorrow.

I tried to import KML directly into cesium, but the absence of support for feature like Models or gx:altitudeMode made me abort my implementation.
but you are saying that a KML without a model but a COLLADA would work as I would have the information in the KML and the building in the COLLADA ? I will also try to investigate this path.

Concerning the gltf (since the people I work with would really like to use gltf) right now, in cesium, expect uploading a block to ion, or importing them individually, there is no feature that would allow me to do something like the New York map ? so getting metadata from the gltf ?

Thank you for you time

You’re correct, there is currently no way to create a 3D Tileset with Cesium ion that preserves metadata from glTF models. This is not a limitation in the 3D Tiles format itself, just a feature we haven’t developed a workflow for. I have this feature request open for it here: https://github.com/AnalyticalGraphicsInc/cesium-ion-community/issues/132

And you are also correct that while you can add generic KML into CesiumJS, in order to tile it with Cesium ion to create a 3D Tileset, it must be in this specific format where the KML file describes the location of each building (as a COLLADA model). This isn’t something that’s currently very well documented but I hope the sample in the getting started guide provides a good example on how the data should look. (This gets converted back to glTF when uploading to Cesium ion)

Thank again, it's a lot clearer.

Just a last one then I continue my path.

If KML+COLLADA get converted in Ion to KML+Gltf (or single gltf)?) If I do not use ion at the moment, can I create and use a gltf with metadata (or KML+Gltf (for the model) in my cesiumJS app? (Without using ion, importing them by path)

I believe booth are a yes ?

Thank you again for your help and time

KML+COLLADA gets converted in Cesium ion to 3D Tiles (so there’s no more KML, but there is glTF models contained in 3D Tiles). You can certainly load your own 3D Tiles of the buildings in CesiumJS even if they aren’t created with ion since 3D Tiles is an open standard.