LuciadCPillar 2023.1.03
luciad::Ogc3DTilesModelDecoder Class Referencefinal

This class can be used to create an ITileSet3DModel implementation that can read OGC 3D Tiles data. More...

#include <luciad/formats/ogc3dtiles/Ogc3DTilesModelDecoder.h>

Classes

class  Options
 Options for decoding OGC 3D Tiles data. More...
 

Public Member Functions

 Ogc3DTilesModelDecoder ()=delete
 
 ~Ogc3DTilesModelDecoder ()=delete
 

Static Public Member Functions

static luciad::expected< std::shared_ptr< ITileSet3DModel >, ErrorInfodecode (const std::string &source)
 An OGC 3D Tiles model connects to a 3D tile service to retrieve tiles for a TileSet3DLayer. More...
 
static luciad::expected< std::shared_ptr< ITileSet3DModel >, ErrorInfodecode (const std::string &source, const Options &options)
 An OGC 3D Tiles model connects to a 3D tile service to retrieve tiles for a TileSet3DLayer. More...
 

Detailed Description

This class can be used to create an ITileSet3DModel implementation that can read OGC 3D Tiles data.

See Ogc3DTilesModelDecoder::decode for more details.

Since
2022.0

Constructor & Destructor Documentation

◆ Ogc3DTilesModelDecoder()

luciad::Ogc3DTilesModelDecoder::Ogc3DTilesModelDecoder ( )
delete

◆ ~Ogc3DTilesModelDecoder()

luciad::Ogc3DTilesModelDecoder::~Ogc3DTilesModelDecoder ( )
delete

Member Function Documentation

◆ decode() [1/2]

static luciad::expected< std::shared_ptr< ITileSet3DModel >, ErrorInfo > luciad::Ogc3DTilesModelDecoder::decode ( const std::string &  source)
static

An OGC 3D Tiles model connects to a 3D tile service to retrieve tiles for a TileSet3DLayer.

Parameters
sourcethe OGC 3D tiles endpoint url or the path to the entry point file
Returns
either the new created model, or error information. The possible error codes are :
  • FileNotFound: when the file or url does not exist.
  • RuntimeError: in case of an error encountered while decoding the file tileset.json.
The error information contains a textual description that gives more information about the issue.
See also
decode(const std::string&, const Options&)

◆ decode() [2/2]

static luciad::expected< std::shared_ptr< ITileSet3DModel >, ErrorInfo > luciad::Ogc3DTilesModelDecoder::decode ( const std::string &  source,
const Options options 
)
static

An OGC 3D Tiles model connects to a 3D tile service to retrieve tiles for a TileSet3DLayer.

Input files
File Entry point Description
tileset.json/root.json x File containing the root tile metadata as well as links to the sub-tiles/content.
*.json Files containing sub-tile metadata as well as links to its sub-tiles/content.
*.b3dm File containing Batched 3D Model data. See the B3DM documentation for more information about this file.
*.pnts File containing batched Point Cloud data. See the PNTS documentation for more information about this file.
Model reference

The decoder assumes a Geocentric reference system.

Supported versions

The current OGC 3D Tiles model supports the OGC 3D Tiles 1.0 specification. It explicitly supports:

  • Decoding from the tileset.json file entry point, with full metadata support, including property values and ranges.
  • B3DM payload for the visualization of 3D meshes.
  • Both GLTF 1.0 and GLTF 2.0 in the B3DM payload.
  • Draco compressed meshes in the GLTF data.
  • JPG/PNG images in the GLTF data.
  • GLTF models referencing multiple textures.
  • PNTS payload for the visualization of point clouds, including Draco compression.
  • Additive and Replace refinement for tileset.json.
  • Styling and filtering of point cloud data sets with full expression language support for dynamic, GPU-based styling and filtering of point clouds.
  • Quality management to trade off between visual quality and performance, through the quality factor setting in the API.
Limitations
  • Instanced 3D Model (I3DM) tiles are not supported.
  • Composite Tile Model (CMPT) tiles are not supported.
  • B3DM does not support animations.
  • Embedded binary textures are supported, but externally referenced textures are not.
  • glTF materials extensions are not supported.
  • Declarative Styling in tileset.json is not supported directly, but can be achieved using expressions, based on StyleExpressionFactory.
  • Complex, hierarchical batch table properties are not supported.
  • KTX2/CRN/WEBP images in the GLTF data.
  • PBR shading properties are picked up, but not used.
Performance considerations

Since OGC 3DTiles relies on a tree structure to determine which tile to load. This means the way this tree is built can impact performance. An ideal tree has enough level of details to avoid loading highly details at an early stage while loading those when fully zoomed-in.

Available attributes for styling

OGC 3D tiles point clouds data can be styled using style expressions that make use of attributes. An attribute represents additional metadata for each of the points in the point cloud. Typical attributes are intensity, color, height, etc...

When attributes are available, they can be discovered by manually inspecting the top-level tileset.json or root.json file. That file can contain a section called "properties". It's a list of attribute names, with (optionally) range indications.

This is an example of the attributes that you can find in this file:

"properties" : {
  "Intensity" : {
    "minimum" : 0.0,
    "maximum" : 65535.0
  },
  "Classification" : {
    "minimum" : 2.0,
    "maximum" : 4.0
  },
  "ReturnNumber" : {
    "minimum" : 1.0,
    "maximum" : 7.0
  },
  "Height" : {
    "minimum" : 29.02975082397461,
    "maximum" : 116.85025024414062
  }
}

Additional properties can be discovered by manually inspecting the data itself. More concretely, b3dm files contain a header section that describe these properties. This is an example of the attributes that you can find in a b3dm file:

{
  "fid": {
    "componentType": "INT",
    "type": "SCALAR",
    "byteOffset": 0
  },
  "height" : {
    "componentType" : "FLOAT",
    "type" : "SCALAR",
    "byteOffset" : 24
  }
}
Example: decoding and visualizing OGC 3D Tiles data

This article provides more information and example code.

Parameters
sourcethe OGC 3D tiles endpoint url or the path to the entry point file
optionsoptions for decoding OGC 3D Tiles data, for example an optional custom loader implementation to fetch the OGC 3D Tiles resources.
Returns
either the new created model, or error information. The possible error codes are :
  • FileNotFound: when the file or url does not exist.
  • RuntimeError: in case of an error encountered while decoding the file tileset.json.
The error information contains a textual description that gives more information about the issue.
Since
2022.1