A minimal browser demo that uploads CityGML data (a .gml file plus its
*_appearance texture folder) straight to Cesium ion, tiles it into 3D
Tiles, and streams the finished asset onto the globe.
- Globe (OpenStreetMap base) shown immediately on launch — no token needed to start.
- Token button (top-right): paste your ion access token once; it is cached in
the browser (
localStorage) and reused on the next visit. The dot turns green when a token is stored. - Upload model button (top-right): pick a GML file and its appearance folder, upload directly to ion, watch the upload and tiling progress bars, then see the asset appear on the globe.
- Longitude, Latitude coordinates toggle mirroring the ion upload dialog.
- Clamp buildings to terrain toggle.
- A Cesium ion account and an access token with the
assets:read,assets:writeandassets:listscopes (create one at https://cesium.com/ion/tokens).
Because the app makes authenticated fetch calls, serve it over http:// rather
than opening the file directly:
# from this folder (use the py launcher, not `python`)
py -m http.server 8080
# then open http://localhost:8080On Windows,
pythonmay resolve to the Microsoft Store app-execution-alias stub, which prints "Python" and exits without starting a server. Use thepylauncher instead, or disable the alias in Settings → Apps → App execution aliases.
Node is also available as an alternative:
npx http-server -p 8080(or use any static server, e.g. the VS Code "Live Server" extension.)
The upload follows the Cesium ion REST API:
POST /v1/assetswithtype: "3DTILES",options.sourceType: "CITYGML"→ returns temporary S3 upload credentials.- Every selected file is uploaded to ion's S3 bucket via the AWS SDK (folder paths preserved so texture references keep resolving).
POSTtheonCompleteURL to start tiling.- Poll
GET /v1/assets/{id}untilstatus === "COMPLETE". - Load the asset with
Cesium3DTileset.fromIonAssetId(id)and zoom to it.
Use the files in the bldg/ folder, e.g. 51357289_bldg_6697_op.gml together
with its 51357289_bldg_6697_appearance/ folder.
index.html— layout, toolbar, panels, CDN scripts (CesiumJS + AWS SDK).css/styles.css— styling for the toolbar, panels and progress bars.js/app.js— viewer setup, token handling, and the full upload/tiling flow.