Skip to content

Commit ce33436

Browse files
committed
Add terrain tiles, with elevations encoded as RGB values.
1 parent 0cebcae commit ce33436

2 files changed

Lines changed: 22 additions & 2 deletions

File tree

spec/v3/CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## Version 3.6
4+
- Add RGB-shuffled terrain tiles.
5+
36
## Version 3.5
47
- add [MapLibre Vector Tile](https://github.com/maplibre/maplibre-tile-spec) `.mlt` enum by @msbarry [#596]
58

@@ -18,4 +21,4 @@
1821
## Version 3.1
1922
- added `metadata` details about `vector_layers`.
2023
- Clarified that directory entry lengths must be nonzero, and directories must be non-empty.
21-
- add AVIF to TileTypes.
24+
- add AVIF to TileTypes.

spec/v3/spec.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,25 @@ Additionally, this specification defines the following keys, which MAY be includ
372372
|`name`|A name describing the tileset|string|
373373
|`description`|A text description of the tileset|string|
374374
|`attribution`|An attribution to be displayed when the map is shown to a user. Implementations MAY decide to treat this as HTML or literal text. |string|
375-
|`type`|The type of the tileset |a string with a value of either `overlay` or `baselayer`|
375+
|`type`|The type of the tileset |a string with a value of either `overlay`, `baselayer` or `terrain`|
376376
|`version`|The version number of the tileset|a string containing a valid version according to [Semantic Versioning 2.0.0](https://semver.org/spec/v2.0.0.html) |
377+
|`rgb_shuffle`|An optional dictionary to re-interpret RGB pixels, as described in section 5.1. |
378+
379+
380+
## 5.1 RGB Shuffle
381+
382+
If the JSON metadata contains a key `rgb_shuffle`, its value MUST be a JSON
383+
dictionary with floating-point numbers for `redFactor`, `greenFactor`,
384+
`blueFactor` and `baseShift`. To interpret an RGB pixel, compute
385+
`value = R * redFactor + G * greenFactor + B * blueFactor - baseShift`.
386+
This is useful to encode Digital Terrain Models, where values are
387+
elevations in fractional meters above ground, as WebP or PNG color images.
388+
389+
Implementations MAY provide specially optimized code paths for the parameters
390+
`{"redFactor": 256.0, "greenFactor": 0.0, "blueFactor": 0.00390625, "baseShift": -32768.0}`.
391+
However, parameters that aren’t powers of two MUST be supported as well,
392+
such as a `blueFactor` of 0.1.
393+
377394

378395
---
379396

0 commit comments

Comments
 (0)