Skip to content

Commit daf7cb9

Browse files
authored
Added PMTiles #17 (#18)
1 parent 4531dbe commit daf7cb9

File tree

5 files changed

+59
-2
lines changed

5 files changed

+59
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
### Added
1010

11-
- OGC WMS (Basic WMS only)
12-
- 3D Tiles
11+
- PMTiles
1312

1413
### Changed
1514

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ The following services are supported:
1515
- [3D Tiles](#3d-tiles)
1616
- [OGC WMS](#ogc-wms)
1717
- [OGC WMTS](#ogc-wmts)
18+
- [PMTiles](#pmtiles)
1819
- [TileJSON](#tilejson)
1920
- [XYZ](#xyz)
2021

@@ -80,6 +81,23 @@ you'd provide `https://example.com/geoserver/service/wmts` as `href`.
8081

8182
The `href` can contain an optional server placeholder `{s}`. If `{s}` is used, the field [`href:servers`](#hrefservers) MUST be provided.
8283

84+
### PMTiles
85+
86+
Links to a [PMTiles](https://github.com/protomaps/PMTiles/blob/main/spec/v3/spec.md) file (versions 3.x).
87+
88+
| Field Name | Type | Description |
89+
| --------------- | -------------------- | ----------- |
90+
| rel | string | **REQUIRED**. Must be set to `pmtiles`. |
91+
| href | string | **REQUIRED**. Link to a PMTiles file (usually ends with `.pmtiles`). |
92+
| type | string | Recommended to be set to `application/vnd.pmtiles`. |
93+
| pmtiles:layers | \[string] | For vector tiles, the layers to show on the map by default. If not provided, it's up to the discretion of the implementation to choose a layer from the `vector_layers` in the PMTiles metadata. |
94+
95+
The [Tile Type](https://github.com/protomaps/PMTiles/blob/main/spec/v3/spec.md#tile-type-tt) of the
96+
PMTiles data source can be read from the first 127 bytes of the the binary header.
97+
98+
It is typical to assume a tile size of 256x256 pixels for raster tiles and 512x512 pixels for vector tiles,
99+
but they could also be inferred from the first file.
100+
83101
### XYZ
84102

85103
Links to a XYZ, also known as slippy map.

examples/collection.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,15 @@
8686
"rel": "3d-tiles",
8787
"title": "3D Tiles",
8888
"type": "application/json"
89+
},
90+
{
91+
"href": "https://maps.example.com/item/example.pmtiles",
92+
"rel": "pmtiles",
93+
"title": "PMTiles",
94+
"type": "application/vnd.pmtiles",
95+
"pmtiles:layers": [
96+
"streets"
97+
]
8998
}
9099
]
91100
}

examples/item.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,15 @@
8383
"rel": "3d-tiles",
8484
"title": "3D Tiles",
8585
"type": "application/json"
86+
},
87+
{
88+
"href": "https://maps.example.com/item/example.pmtiles",
89+
"rel": "pmtiles",
90+
"title": "PMTiles",
91+
"type": "application/vnd.pmtiles",
92+
"pmtiles:layers": [
93+
"streets"
94+
]
8695
}
8796
],
8897
"assets": {}

json-schema/schema.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"wms",
3939
"wmts",
4040
"tilejson",
41+
"pmtiles",
4142
"3d-tiles"
4243
]
4344
}
@@ -140,6 +141,27 @@
140141
}
141142
}
142143
}
144+
},
145+
{
146+
"$comment": "Defines PMTiles links",
147+
"if": {
148+
"properties": {
149+
"rel": {
150+
"const": "pmtiles"
151+
}
152+
}
153+
},
154+
"then": {
155+
"properties": {
156+
"pmtiles:layers": {
157+
"type": "array",
158+
"items": {
159+
"type": "string",
160+
"minLength": 1
161+
}
162+
}
163+
}
164+
}
143165
}
144166
]
145167
}

0 commit comments

Comments
 (0)