The I3SConverter
class converts a 3D Tiles tileset to I3S layer.
import {I3SConverter} from '@loaders.gl/tile-converter';
const converter = new I3SConverter();
const tilesetJson = await converter.convert({
inputUrl: TILESET_URL,
outputPath: 'data',
tilesetName: 'BatchedColors'
});
// The converted tiles are written to the specified output path
const rootTileJson = await fs.readFile('data/BatchedColors/layers/0/nodes/root/index.json', 'utf8');
Constructs a new I3SConverter
instance.
Converts a tileset to I3S format
options.inputUrl
the url to read the tileset fromoptions.outputPath
the output filenameoptions.tilesetName
the output name of the tilesetoptions.maxDepth
The max tree depth of conversionoptions.slpk
Whether the resulting layer be saved as "*.slpk" packageoptions.sevenZipExe
Windows only. The path of 7-zip archiver tool for creating "*.slpk" fileoptions.egmFilePath
location of *.pgm file to convert heights from ellipsoidal to gravity-related format. A model file can be loaded from GeographicLib https://geographiclib.sourceforge.io/html/geoid.htmloptions.token
ION token of input tilesetoptions.draco
Whether the converter create DRACO compressed geometry in path "layers/0/nodes/xxx/geometries/1" along with non-compressed geometry in path "layers/0/nodes/xxx/geometries/0"options.validate
Enable ValidationBy specifying the --validate
parameter, the tile-converter will perform checks on the tileset data. The following checks are performed: