Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

City GML → Cesium ion Uploader Demo

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.

Features

  • 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.

Requirements

  • A Cesium ion account and an access token with the assets:read, assets:write and assets:list scopes (create one at https://cesium.com/ion/tokens).

Run it

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:8080

On Windows, python may resolve to the Microsoft Store app-execution-alias stub, which prints "Python" and exits without starting a server. Use the py launcher 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.)

How it works

The upload follows the Cesium ion REST API:

  1. POST /v1/assets with type: "3DTILES", options.sourceType: "CITYGML" → returns temporary S3 upload credentials.
  2. Every selected file is uploaded to ion's S3 bucket via the AWS SDK (folder paths preserved so texture references keep resolving).
  3. POST the onComplete URL to start tiling.
  4. Poll GET /v1/assets/{id} until status === "COMPLETE".
  5. Load the asset with Cesium3DTileset.fromIonAssetId(id) and zoom to it.

Sample data

Use the files in the bldg/ folder, e.g. 51357289_bldg_6697_op.gml together with its 51357289_bldg_6697_appearance/ folder.

Files

  • 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.

About

Processor for PLATEAU City GML data

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages