Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,18 @@ function visualizeDataItems(): DefaultTheme.SidebarItem[] {
return [
{ text: "WMS", link: "/docs/wms" },
{ text: "WMTS", link: "/docs/wmts" },
{ text: "XYZ", link: "/docs/xyz" },
{
text: "Mapbox Vector Tiles",
link: "/docs/mapbox-vector-tiles",
text: "Vector Tiles",
link: "/docs/vector-tiles",
},
{
text: "3D",
link: "/docs/3d",
text: "Terrain Service",
link: "/docs/terrain-service",
},
{
text: "3D Tiles",
link: "/docs/3d-tiles",
},
];
}
Expand Down
70 changes: 70 additions & 0 deletions docs/3d-tiles.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# 3D Tiles

This service provides 3D tiles through a RESTful API, implementing the [Cesium 3D Tiles specification](https://github.com/CesiumGS/3d-tiles).

<ApiCodeBlock url="https://3d.geo.admin.ch/<LayerName>/<Version>/<Time>/<Z>/<X>/<Y>.b3dm" method="GET" />

Use the following parameters to define your request:

| Parameter | Example | Description |
| --------- | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 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` |
| Version | v1 | API version. `v1` means tiles generated with 3D Tiles |
| Time | 20240501 | Date of tileset generation in (ISO-8601, e.g. YYYYMMDD) |
| Z | 7 | Zoom level |
| X | 54 | Tile column index |
| Y | 21 | Tile row index |

A 3D tile request for swissBUILDINGS3D dataset:

```http
curl -o demo.b3dm https://3d.geo.admin.ch/ch.swisstopo.swissbuildings3d.3d/v1/20240501/7/54/21.b3dm
```

## Metadata

The `tileset.json` file describes the available set of tiles.
It can be used directly by [CesiumJS](https://github.com/CesiumGS/cesium).

<ApiCodeBlock url="https://3d.geo.admin.ch/<LayerName>/<Version>/<Time>/tileset.json" method="GET" />

| Parameter | Example | Description |
| --------------- | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Time (optional) | 20201203 | Date of tile generation in (ISO-8601). |
| 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` |

A metadata request for the Vegetation dataset:

<ExampleCodeBlock
request="curl https://3d.geo.admin.ch/ch.swisstopo.vegetation.3d/v1/tileset.json"
example='{
"asset": {
"version": "1.0",
"extras": {
"ion": {
"georeferenced": true,
"movable": false
}
}
},
"geometricError": 54.7213621044866,
"root": {
"boundingVolume": {
"region": [
0.10395173048091878, 0.799669540091651, 0.18307746929258154,
0.83441919811829, -10003.500000067055, 2799.070391970873
]
},
"geometricError": 54.7213621044866,
"refine": "ADD",
"children": [...]
}
}'
/>

## Example: Cesium

An example Cesium application using terrain tiles, 3D buildings and WMTS.

<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">
</iframe>
82 changes: 0 additions & 82 deletions docs/3d.md

This file was deleted.

65 changes: 0 additions & 65 deletions docs/mapbox-vector-tiles.md

This file was deleted.

59 changes: 59 additions & 0 deletions docs/terrain-service.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Terrain Service

This service delivers multi-resolution 3D terrain data as quantized mesh tiles, fully compliant with the [Cesium Quantized Mesh 1.0 specification](https://github.com/AnalyticalGraphicsInc/quantized-mesh).
Tiles are organized and served following the [Tile Map Service (TMS) specification](http://wiki.osgeo.org/wiki/Tile_Map_Service_Specification) using a global-geodetic profile (latitude/longitude coordinates),

<ApiCodeBlock url="https://3d.geo.admin.ch/ch.swisstopo.terrain.3d/<Version>/<Time>/<Zoom>/<X>/<Y>.terrain" method="GET" />

Use the following parameters to define your request:

| Parameter | Example | Description |
| ---------- | --------------- | -------------------------------------------------- |
| ServerName | 3d.geo.admin.ch | |
| Version | v1 | v1 means terrain tiles generated with cesium tiles |
| Time | 20201203 | Date of tile generation in (ISO-8601). |
| Zoom | 12 | Zoom level |
| X | 4309 | The longitude index |
| Y | 3111 | The latitude index |

An example of a terrain tile request:

```http
curl -o demo.terrain https://3d.geo.admin.ch/ch.swisstopo.terrain.3d/v1/20201203/7/136/98.terrain?v=3924.0.0
```

## Metadata

The `layer.json` file provides metadata that describes the availability and structure of the terrain tiles at a given timestamp.

<ApiCodeBlock url="https://3d.geo.admin.ch/ch.swisstopo.terrain.3d/v1/<Time>/layer.json" method="GET" />

| Parameter | Example | Description |
| --------------- | -------- | ------------------------------------------------------------------------------------------------------------------------- |
| Time (optional) | 20201203 | Date of tile generation in (ISO-8601). If no date is provided, it returns the metadata for the most recent terrain tiles. |

Example of a metadata request for the date `20201203`:

<ExampleCodeBlock
request="curl --compressed https://3d.geo.admin.ch/ch.swisstopo.terrain.3d/v1/20201203/layer.json"
example='{
"attribution": "Put something there",
"available": [...],
"bounds": [-180, -90, 180, 90],
"description": "Nice terrains",
"format": "quantized-mesh-1.0",
"minzoom": 0,
"projection": "EPSG:4326",
"scheme": "tms",
"tilejson": "2.1.0",
"tiles": ["{z}/{x}/{y}.terrain?v={version}"],
"version": "3924.0.0"
}'
/>

## Example: Cesium

An example Cesium application using terrain tiles, 3D buildings and WMTS.

<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">
</iframe>
Loading