|
| 1 | +# 3D Tiles |
| 2 | + |
| 3 | +This service provides 3D tiles through a RESTful API, implementing the [Cesium 3D Tiles specification](https://github.com/CesiumGS/3d-tiles). |
| 4 | + |
| 5 | +<ApiCodeBlock url="https://3d.geo.admin.ch/<LayerName>/<Version>/<Time>/<Z>/<X>/<Y>.b3dm" method="GET" /> |
| 6 | + |
| 7 | +Use the following parameters to define your request: |
| 8 | + |
| 9 | +| Parameter | Example | Description | |
| 10 | +| --------- | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| 11 | +| layerName | ch.swisstopo.swissbuildings3d.3d | The technical name of the 3D layer. Possible values are: `ch.swisstopo.swissbuildings3d.3d`, `ch.swisstopo.swisstlm3d.3d`, `ch.swisstopo.swissnames3d.3d`, `ch.swisstopo.vegetation.3d` | |
| 12 | +| Version | v1 | API version. `v1` means tiles generated with 3D Tiles | |
| 13 | +| Time | 20240501 | Date of tileset generation in (ISO-8601, e.g. YYYYMMDD) | |
| 14 | +| Z | 7 | Zoom level | |
| 15 | +| X | 54 | Tile column index | |
| 16 | +| Y | 21 | Tile row index | |
| 17 | + |
| 18 | +A 3D tile request for swissBUILDINGS3D dataset: |
| 19 | + |
| 20 | +```http |
| 21 | +curl -o demo.b3dm https://3d.geo.admin.ch/ch.swisstopo.swissbuildings3d.3d/v1/20240501/7/54/21.b3dm |
| 22 | +``` |
| 23 | + |
| 24 | +## Metadata |
| 25 | + |
| 26 | +The `tileset.json` file describes the available set of tiles. |
| 27 | +It can be used directly by [CesiumJS](https://github.com/CesiumGS/cesium). |
| 28 | + |
| 29 | +<ApiCodeBlock url="https://3d.geo.admin.ch/<LayerName>/<Version>/<Time>/tileset.json" method="GET" /> |
| 30 | + |
| 31 | +| Parameter | Example | Description | |
| 32 | +| --------------- | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| 33 | +| Time (optional) | 20201203 | Date of tile generation in (ISO-8601). | |
| 34 | +| layerName | ch.swisstopo.swissbuildings3d.3d | The technical name of the 3D layer. Possible values are: `ch.swisstopo.swissbuildings3d.3d`, `ch.swisstopo.swisstlm3d.3d`, `ch.swisstopo.swissnames3d.3d`, `ch.swisstopo.vegetation.3d` | |
| 35 | + |
| 36 | +A metadata request for the Vegetation dataset: |
| 37 | + |
| 38 | +<ExampleCodeBlock |
| 39 | +request="curl https://3d.geo.admin.ch/ch.swisstopo.vegetation.3d/v1/tileset.json" |
| 40 | +example='{ |
| 41 | + "asset": { |
| 42 | + "version": "1.0", |
| 43 | + "extras": { |
| 44 | + "ion": { |
| 45 | + "georeferenced": true, |
| 46 | + "movable": false |
| 47 | + } |
| 48 | + } |
| 49 | + }, |
| 50 | + "geometricError": 54.7213621044866, |
| 51 | + "root": { |
| 52 | + "boundingVolume": { |
| 53 | + "region": [ |
| 54 | + 0.10395173048091878, 0.799669540091651, 0.18307746929258154, |
| 55 | + 0.83441919811829, -10003.500000067055, 2799.070391970873 |
| 56 | + ] |
| 57 | + }, |
| 58 | + "geometricError": 54.7213621044866, |
| 59 | + "refine": "ADD", |
| 60 | + "children": [...] |
| 61 | + } |
| 62 | +}' |
| 63 | +/> |
| 64 | + |
| 65 | +## Example: Cesium |
| 66 | + |
| 67 | +An example Cesium application using terrain tiles, 3D buildings and WMTS. |
| 68 | + |
| 69 | +<iframe height="600" style="width: 100%;" scrolling="no" title="Geoadmin Terrain, Buildings and WMTS CesiumJS integration" src="https://codepen.io/geoadmin/embed/zBEYGE?default-tab=js%2Cresult&editable=true&zoom=0.5" frameborder="no" loading="lazy" allowtransparency="true" allowfullscreen="true"> |
| 70 | +</iframe> |
0 commit comments