Features - glTF

specdraftimplproposal

Encode CityGML building features (LoD1, LoD2) as glTF 2.0.

Scope

The building block Features - glTF adds support for glTF 2.0 as a feature encoding. Supported are the CityGML feature types Building and BuildingPart.

This building block supports the glTF 2.0 Extension KHR_mesh_quantizationopen in new window for a compact encoding of vertices and normals. The use of this extension is recommended and enabled by default.

Any feature property that is included in the glTF model enables support for the glTF 2.0 extensions EXT_mesh_featuresopen in new window and EXT_structural_metadataopen in new window. The properties are stored in binary tables.

Limitations

The following restrictions apply:

  • Only CityGML buildings and building parts in LoD1 and LoD2 are supported.
  • 3D Metadata:
    • Only properties of type SCALAR, STRING and ENUM are supported.
    • Arrays are not supported.
    • Offset and scale are not supported.
    • Default values are not supported.

Conformance Classes

Features - glTF implements support for glTF 2.0open in new window with the extensions KHR_mesh_quantizationopen in new window, EXT_mesh_featuresopen in new window, and EXT_structural_metadataopen in new window.

Operations

ResourcePathMethodsMedia TypesDescription
glTF Schema
collections/{collectionId}/gltf/schema
GET
The glTF Schema resource describes the feature properties and the enumerations as encoded in the glTF models for the feature collection. See the 3D Metadata Specificationopen in new window for details.

Path Parameters

NameResourcesDescription
collectionId
Features, Feature
The identifier of the feature collection.

Query Parameters

NameResourcesDescription
Features - glTF
Features, Feature
If set to true, the z coordinates of each feature will be changed so that the bottom of the feature is on the WGS84 ellipsoid. This parameter only affects glTF models.
f
glTF Schema
Select the output format of the response. If no value is provided, the standard HTTP rules apply, i.e., the "Accept" header will be used to determine the format.

Configuration

Prerequisites

The module requires that the feature provider includes a type building. The requirements for the type are the same as in the configuration of the CityJSON encoding.

Options

NameDefaultDescriptionTypeSince
buildingBlock
Always GLTF.
string
v2.0
extensionType
Deprecated See buildingBlock.
string
v2.0
enabled
false
Enable the building block?
boolean
v2.0
transformations
{}
Property transformations do not affect data sources, they are applied on-the-fly as part of the encoding. Filter expressions do not take transformations into account, they have to be based on the source values. That means queryable properties (see queryables in Features) should not use transformations in most cases. The exception to the rule is the HTML encoding, where readability might be more important than filter support.
object
v2.0
meshQuantization
true
Enables support for the glTF 2.0 extension KHR_mesh_quantizationopen in new window.
boolean
v3.4
withNormals
true
If true, the normals are computed for every vertex.
boolean
v3.4
withOutline
false
If true, the polygon edges are outlined in Cesium.
boolean
v3.4
polygonOrientationNotGuaranteed
true
If true, materials are defined as double-sidedopen in new window.
boolean
v3.4
properties
{}
Use this option to specify which feature attributes are included in the glTF model. type is one of SCALAR, STRING or ENUM. For a scalar, specify the componentType (see 3D Metadata Specificationopen in new window), default is UNIT16. For a string, specify the stringOffsetType as UNIT8, UNIT16, or UNIT32 depending on the expected length of the string buffer, default is UNIT32. For an enum, the feature property must either have an enum constraint in the provider schema or a codelist constraint where the codelist uses an integer code; specify the componentType according to the range of code values, default is UINT32. In addition, a sentinel value can be specified using noData (see 3D Metadata Specificationopen in new window for details).
object
v3.4
withSurfaceType
false
If true, for buildings in Level-of-Detail 2 with information about the semantics of each surface (wall, roof, etc.), a property "surfaceType" is added and available for each vertex.
boolean
v3.4
maxMultiplicity
3
If the data is flattened and the feature schema includes arrays, maxMultiplicity properties will be created for each array property. If an instance has more values in an array, only the first values are included in the data.
number
v3.4

Examples


- buildingBlock: GLTF
  enabled: true
  withNormals: true
  polygonOrientationNotGuaranteed: true
  meshQuantization: true
  properties:
    gml_id:
      type: STRING
      stringOffsetType: UINT16
      noData: ''
    function:
      type: STRING
      stringOffsetType: UINT16
      noData: ''
    roofType:
      type: ENUM
      componentType: UINT16
      noData: 0
    name:
      type: STRING
      stringOffsetType: UINT16
      noData: ''