Is there a format that CesiumJS can read by default and we do not need to convert the map data into tiles?
I don’t need to display any terrain data, I just need to read the map data and display the images on the map.
So basically I’m looking for a native format that CesiumJS can interpret and I do not need to use any map server for convertion.
These are the formats accepted:
The question might be lacking some detail.
CesiumJS itself can load and display several types of data. For example, 3D Models as glTF or GLB, or certain kinds of vector data (some data sources are shown in Cesium Sandcastle ), and of course images like PNG or JPG. When the goal is to visualize large amounts of data, then there is 3D Tiles, which (very roughly speaking) structures and subdivides the data, and where the actual payload (i.e. the geometry data) is delivered as glTF.
The “Tiler Data Types and Formats” page shows the data formats that are accepted and processed by Cesium ion. These data formats can be uploaded to the Cesium ion platform, where they are preprocessed and optimized (and, for example, converted into 3D Tiles) so that they can be streamed to clients and visualized in CesiumJS.
That’s the point that is not entirely clear: In which format do you currently have this ‘map data’? If this is just a set of PNG/JPG images, then you can simply display it, for example, as the texture of a material. But if it is structured data in any form (i.e. something similar to what is delivered by Bing Maps), then more details may be necessary here.
@Marco13 thanks for the reply. So I have a few map file that are .img, jp2, and a few other formats. Right now we are using gdal2tile to convert them into JPG files so we can display it on cesiumJS. But depending on how large the are is this process can take a few minutes to a few hours.
So that was why I was trying to see if its possible to not have to convert them into PNG or JPG.
I’m not so deeply familiar with these file formats. But they are not natively supported by browsers, and reading and processing them appears to be not trivial, and when the conversion with gdal2tiles
takes a long time, then this suggests that the input files are large.
The goal of CesiumJS is to display imagery data efficiently, and in order to achieve that, the input has to be in a form that can be decoded and displayed efficiently - which means that it has to be something like JPG or PNG, and it will likely need some form of hierarchical structure.
To put it that way: If CesiumJS could load the JP2 file directly, wouldn’t it have to do roughly the same as gdal2tiles
, meaning that starting the application would then take “a few minutes to a few hours”? (Again: I don’t know that for sure, but am wondering). I don’t want to say that it’s not possible to directly load such files in a browser application, but am not aware of any library or application that reliably could do that. Maybe someone else knows a viable approach here…