You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| 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. |
| 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
+
| pmtiles:layer_properties| Map<string, Map<string, JSON Schema Object>> | For vector tiles, the properties/fields available for each layer and their corresponding [JSON Schema](#json-schema-object) as an object. |
94
95
95
96
The [Tile Type](https://github.com/protomaps/PMTiles/blob/main/spec/v3/spec.md#tile-type-tt) of the
96
97
PMTiles data source can be read from the first 127 bytes of the the binary header.
97
98
98
99
It is typical to assume a tile size of 256x256 pixels for raster tiles and 512x512 pixels for vector tiles,
99
100
but they could also be inferred from the first file.
100
101
102
+
#### pmtiles:layer_properties
103
+
104
+
Assuming the PMTiles file has a single layer `roads` with the following fields:
105
+
-`type` - a string with one of the following values: trunk, primary, secondary
106
+
-`lanes` - an integer with numbers between 1 and 10
107
+
-`name` - a free-form text
108
+
-`sidewalks` - a boolean value
109
+
110
+
The `pmtiles:layer_properties` value could be the following object:
111
+
```json
112
+
{
113
+
"roads": {
114
+
"type": {
115
+
"title": "Road Type",
116
+
"type": "string",
117
+
"enum": [
118
+
"trunk",
119
+
"primary",
120
+
"secondary"
121
+
]
122
+
},
123
+
"lanes": {
124
+
"title": "Number of Lanes",
125
+
"type": "integer",
126
+
"minimum": 1,
127
+
"maximum": 10
128
+
},
129
+
"name": {
130
+
"title": "Road Name",
131
+
"type": "string"
132
+
},
133
+
"sidewalks": {
134
+
"title": "Has Sidewalks",
135
+
"type": "boolean"
136
+
}
137
+
}
138
+
}
139
+
```
140
+
141
+
The layer names (top-level keys) and property names (second level keys) must correcspond exactly to
142
+
the information provided in the `vector_layers` in the PMTiles metadata.
143
+
144
+
##### JSON Schema Object
145
+
146
+
Each schema must be valid against all corresponding values available for the property.
147
+
Empty schemas are discouraged.
148
+
149
+
JSON Schema draft-07 is the only officially supported JSON Schema version to align with the JSON Schemas provided by STAC.
150
+
Validation uses the JSON Schema meta-schema for draft-07.
151
+
It is allowed to use you use other versions of JSON Schema, but they may not get validated properly.
152
+
153
+
For an introduction to JSON Schema, see "[Learn JSON Schema](https://json-schema.org/learn/)".
0 commit comments