I uploaded a 3DTiles 1.0 dataset in my Cesium Ion account. I can see it zoom in at the right location, but buildings are floating way above the terrain. I have searched the forum for a couple of hours and noticed quite a few people have mentioned the issue over time but did not find an answer so let me tell you what I did.
#1 Use the default
That is
const viewer = new Cesium.Viewer(“cesiumContainer”);
and then added my asset as per “Open complete code example” at bottom right. My features (buildings) show up high above the basemap.
#2 Upload a DTM
I gave the local DTM context (a tif file uploaded as “raster terrain” to my account)
const viewer = new Cesium.Viewer(“cesiumContainer”, {
terrainProvider:
await Cesium.CesiumTerrainProvider.fromIonAssetId(my_asset_id) …
The buildings are shown a little lower above the surface than using the default terrain provider, but still quite visibly above.
Things I have seen in the forum :
“There’s no way to clamp Cesium OSM Buildings to the surface on the fly. The best you can do is adjust the tileset’s transform” Floating OSM buildings
So, what are my options here ? Try to somehow clamp by 3DTiles to the default terrain ? Add a transformin tileset.json (there is none) ? Upload another asset for basemap ?
I uploaded everything as EPSG:4326, but I’m told the vertical datum of the building dataset is CGVD2013 aka EPSG 6647. How do I squeeze that in ?
Rather : is there a way to explicitly pass the vertical datum information to Cesium ?
I also have more info :
at the center of my area, the geoid height is -20.35 m
capital H = 26.92 (orthometric z) and lowercase h=6.57 m
This is from our “datum” folks. I don’t quite grasp the meaning of it all.
Which brings me to the 3DTiles OGC community standards document. I see mentions of a series of EPSG codes in there. Is there not a sensible way to understand how we are supposed to process our data for it to be “compatible” with Cesium Terrain (or Google or what not) ?
There are some details in the approaches that you described where I’d have to read more about the context. For example, uploading a custom terrain will not affect the tileset for itself (but maybe I overlooked something in that approach that you described).
Usually, it should be possible to use the “Adjust Tileset Location” button in ion, but under certain conditions, the tileset cannot be relocated.
In theory, you also have the option to set the transform in the tileset JSON data. But I’m not sure how easily applicable this is in your case, because you’d have to download the tileset, modify the JSON file, and then upload it again.
But in general, it is always possible to arbitrarily modify the location of a tileset at runtime. The following is a sandcastle that shows a function changeHeight: This function receives a tileset and a “heightChange” (in meters):
There may be easier or more elgant solutions. And you still have to figure out what the “heightChange” has to be to exactly place the tileset on the ground. (E.g. when your tileset currently is above the ground, then you can call this with a negative value to move the tileset down). But maybe the general approach or snippet are already helpful.
If you provide additional details about how the asset was created (its source data, and the process), then it might be possible to find a way to adjust the location - preferably, via the “Adjust Tileset Location” functionality in Cesium ion.
Thank you Marco. “Adjust Tileset Location” usually stays grayed out for my datasets. Our buildings are generated from lidar data for which we have all the required projection info. I was thinking more of an API or some sort of way to pass in the proj/datum info and have Cesium reproject to terrain. Getting acquainted with Cesium Ion
Are you uploading the source lidar files or are you uploading 3D tiles to ion? When our tilers tile an asset, they embed some information in assets.extras.ion within the tileset.json that allows ion to manipulate the positions with the Adjust Tilset Location button. If the 3D Tiles tileset was created not from our tiler, those properties might be missing and hence causing the button to be disabled.
Would you be able to upload the source directly to ion? That should allow you to manipulate the position of the asset then
Thank you @Ankit_Trehan. I tried uploading both 3DTiles (1.0, from FME) and GeoJSON. When I upload a lidar tile directly in My Assets, it floats. We know the datum the lidar data is in and that it’s orthometric heights. Would our point clouds “clamp” to Cesium Terrain if we were to somehow export them to the WGS 84 ellipsoid ? And then 3D buildings derived from those lidar points would clamp too ? I am a bit lost