Specification of MIME Types (Media Types) in 3D Tiles
javagl opened this issue · 4 comments
This is related to #341 .
This is an attempt to collect the information about media types and file extensions for 3D Tiles, which could go into the specification at some point. (This information is already available to some extent, but summarized and extended here).
File Extensions and Media Types
-
For the 3D tiles core specification:
-
Tileset JSON files should use the
.json
extension and theapplication/json
Media Type. -
Tileset Style JSON files should use the
.json
extension and theapplication/json
Media Type. -
Tile Formats:
- Batched 3D Models should use the the
.b3dm
extension and theapplication/octet-stream
Media Type. - Composite Tiles should use the the
.cmpt
extension and theapplication/octet-stream
Media Type. - Instanced 3D Models should use the the
.i3dm
extension and theapplication/octet-stream
Media Type. - Point Clouds should use the the
.pnts
extension and theapplication/octet-stream
Media Type.
- Batched 3D Models should use the the
-
-
For the 3DTILES_implicit_tiling extension:
- Subtree JSON files should use the
.json
extension and theapplication/json
Media Type. - Subtree Binary files should use the
.subtree
extension, and theapplication/octet-stream
Media Type.
- Subtree JSON files should use the
-
For the 3DTILES_metadata extension:
- Schema JSON files that are referred to via the
schemaUri
should use the.json
extension, and theapplication/json
Media Type.
- Schema JSON files that are referred to via the
-
For the
3DTILES_content_gltf
extension:- The glTF files that may be used as the tile content should follow the glTF 2.0 Specification. This also refers to the files that are referenced by glTF files, namely binary buffers and image files.
-
Quantized Mesh - TODO
In the definitions above, "should" means "SHOULD" as in https://www.rfc-editor.org/info/bcp14. Specifically: File extensions are generally considered to be optional. But without any file extension and explicit MIME type determination, it can be hard to differentiate between a Tileset JSON and a glTF JSON, for example (see #341 (comment) for related discussion). The implicit tiling specification originally defined a mimeType
field for the conetnt
, but this has been removed at some point. Some related discussion about determining the type of image data (and all the options and caveats) can be found in KhronosGroup/glTF#1966 .
A related question is whether there should be efforts to officially register certain MIME types for 3D Tiles, but this might better fit into #341 .
- Tileset JSON files should use the
.tileset
extension and theapplication/json
Media Type.
"tileset.json"
is so ubiquitous at this point that I think the recommended extension should stay .json
.
The subtree file extension should probably be .json
as well.
Subtree Binary files should use the .subtree extension, and the application/octet-stream Media Type.
Or .subt
if we want something shorter
Quantized Mesh - TODO
Probably out of scope for this
Until we've officially registered media types there's also the option of using vendor prefixes, e.g. application/vnd.3dtiles.tileset+json
, application/vnd.3dtiles.subtree+json
,application/vnd.3dtiles.schema+json
Sorry, the .tileset
was a Copy+Paste error (I shouldn't have submitted it without proofreading, despite the call 2 minutes later...).
I had seen the use of the vnd.
prefix for vnd.quantized-mesh
, but wasn't sure whether there are plans for registering MIME types.
Also, the question of whether the MIME types are supposed to be encoded in some content { mimeType: "...", ... }
property demains to be decided.
The 3D Tiles 1.1 specification contains a section that summarizes the MIME types (Media Types). And it generally says that one should not rely on file extensions. Further clarifications or additions (like a mimeType
property in content
objects and such) would be a change that could go into the next version.