Open OmarShehata opened 4 years ago
This question came up again when working on some internal details of the ion platform. I had a case where I wanted to download files from a tileset for comparison, following external tileset links. This leads to questionable code since I either make assumptions about filenames or have to download large files just to check the first couple of bytes.
@mramato suggested this solution in another issue:
One possible solution is for there to be a mimeType or similar property that lives next to the uri. So "mimeType": "application/json" would tell you what uri is.
Other thoughts:
mimeType
in each content is too verbose we could consider defining a top-level default that can be overriden. This isn't as big a concern for implicit tiling.CC https://github.com/CesiumGS/3d-tiles/issues/341 and https://github.com/CesiumGS/3d-tiles/issues/555
Sticking to the word from the quote of this issue (that is still in the specs now, 4 years later), the sentence
Valid implementations may ignore it and identify a content's format by the magic field in its header.
should probably have been reworded.
On a technical level, there are different options for determining the content type, roughly:
Content-Type
of some HTTP header. But this is only an option, and requires the MIME types to be registered, configured properly, and ... does not work when working on the file system. So it cannot be part of the 'format specification' content.mimeType
property: This is not part of 3D Tiles 1.1, and could therefore only be added in 3D Tiles 2.0.content.gltf
file, a tileset.json
, and a shape.geojson
. If we ever publish 3D Tiles 2.0, then every valid 3D Tiles 2.0 tileset file will also be a valid glTF 2.0 asset 😕 So the options are
A related discussion is in https://github.com/KhronosGroup/glTF/issues/1966 , and the conclusion is that a specification can make recommendations or suggestions, but it's nearly impossible to specify a certain runtime behavior.
OK to close this?
The spec says:
https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification#file-extensions-and-mime-types
These two sentences seem contradictory to me. If the file extension is option, then a valid implementation must use the magic field, right?