Package com.luciad.format.i3s
Class TLcdI3SModelDecoder
java.lang.Object
com.luciad.format.i3s.TLcdI3SModelDecoder
- All Implemented Interfaces:
ILcdInputStreamFactoryCapable,ILcdModelDecoder
@LcdService(service=ILcdModelDecoder.class,
priority=20000)
public class TLcdI3SModelDecoder
extends Object
implements ILcdModelDecoder, ILcdInputStreamFactoryCapable
This model decoder decodes OGC I3S datasets.
Input
| File | Required | Entry point | Description |
|---|---|---|---|
| *.slpk | x | x | The Scene Layer Package input file |
| https://.../SceneServer | x | x | The I3S SceneServer endpoint |
Supported transfer protocols
-
SceneServer endpoints and all resources referenced by them are accessed through the configured
input stream factory. By default, the decoder uses a composite of theILcdInputStreamFactoryimplementations registered asservices, which supports HTTP(S) sources.
You can set a custom input stream factory, for example to access authenticated SceneServer endpoints. The custom factory replaces the default factory and must be able to open the endpoint and every resource it references. - SLPK files are read directly from the file system. The configured input stream factory is not used for SLPK files.
Model structure
- This model decoder creates a model per entry SLPK file or SceneServer endpoint.
- This model decoder returns a single read-only
ALcdModel. -
By default, this decoder returns a flat model containing all geometry. When working with a Building Scene Layer
dataset, you can preserve the sublayer grouping in a model tree. Set the
setCreateModelTrees(boolean)flag totruefor this behavior: the resulting model will be a model tree (anILcdModelTreeNode) that preserves the I3S sublayer hierarchy.
Model descriptor
-
When the I3S dataset contains point cloud data in a Point Cloud Scene Layer (PCSL), the model descriptor will be
an
ILcdDataModelDescriptor. Although the elements in the model are notdata objectsthemselves, you can still use the data model to access properties of individual points to buildexpressionsfor use in styling. UseILcdDataModelDescriptor.getModelTypes()to obtain the single data type that consists of the properties available in the PCSL data. -
For all other types of I3S datasets, the model descriptor will be an
ILcdModelDescriptor. - The type name of the model descriptor is the display name of this decoder.
Model reference
- All models returned by this model decoder have a geocentric reference.
Model elements
- Each decoded model contains elements that extend
Object.
Sample code
ILcdModelDecoder decoder = new TLcdI3SModelDecoder();
ILcdModel model = decoder.decode(sourceName);
Thread safety
- The decoding of models is thread-safe, as long as no properties are changed during the decoding.
- The decoded models are thread-safe for read access.
Supported versions and specifications
- OGC I3S version 1.3
- Supported scene layers:
- Point Cloud
- 3D Object
- Building
- Integrated Mesh
Known limitations
- Point Scene Layers are not supported. Point Cloud Scene Layers are supported.
- Draco-compressed mesh geometry is not supported. The decoder only uses the uncompressed geometry, which the I3S specification requires to be available alongside Draco-compressed geometry.
- When a SceneServer endpoint defines multiple Scene Layers, only the first layer will be decoded.
- Since:
- 2026.1
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanDecodeSource(String aSourceName) Checks whether this model decoder can decode the specified data source.Creates a new model from the given data source.Returns a short, displayable name for the format that is decoded by thisILcdModelDecoder.Returns the input stream factory that is used.booleanReturns whether the decoder preserves the I3S sublayer grouping in a model tree.voidsetCreateModelTrees(boolean aCreateModelTrees) Sets whether the decoder preserves the I3S sublayer grouping in a model tree.voidsetInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory) Sets the input stream factory to be used.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.luciad.model.ILcdModelDecoder
canDecodeSource, decodeModelMetadata, decodeModelMetadata, decodeSource, discoverDataSources
-
Field Details
-
TYPE_NAME
- See Also:
-
-
Constructor Details
-
TLcdI3SModelDecoder
public TLcdI3SModelDecoder()
-
-
Method Details
-
getDisplayName
Description copied from interface:ILcdModelDecoderReturns a short, displayable name for the format that is decoded by thisILcdModelDecoder.- Specified by:
getDisplayNamein interfaceILcdModelDecoder- Returns:
- the displayable name of this
ILcdModelDecoder.
-
getInputStreamFactory
Description copied from interface:ILcdInputStreamFactoryCapableReturns the input stream factory that is used.- Specified by:
getInputStreamFactoryin interfaceILcdInputStreamFactoryCapable- Returns:
- the input stream factory that is used.
-
setInputStreamFactory
Description copied from interface:ILcdInputStreamFactoryCapableSets the input stream factory to be used.- Specified by:
setInputStreamFactoryin interfaceILcdInputStreamFactoryCapable- Parameters:
aInputStreamFactory- the input stream factory to be used.
-
canDecodeSource
Description copied from interface:ILcdModelDecoderChecks whether this model decoder can decode the specified data source. It is acceptable for this method to returntruefor a source name whiledecodethrows an exception for that same source name.For performance reasons, we strongly recommend that this will only be a simple test. For example: check the file extension of a file, but not that the file exists or contains expected content.
- Specified by:
canDecodeSourcein interfaceILcdModelDecoder- Parameters:
aSourceName- the data source to be verified; typically a file name or a URL.- Returns:
trueif this decoder can likely decode the data specified by the source name,falseotherwise.- See Also:
-
isCreateModelTrees
public boolean isCreateModelTrees()Returns whether the decoder preserves the I3S sublayer grouping in a model tree.- Returns:
trueif the decoder creates a model tree,falseif it returns a flat model.- See Also:
-
setCreateModelTrees
public void setCreateModelTrees(boolean aCreateModelTrees) Sets whether the decoder preserves the I3S sublayer grouping in a model tree.When set to
true(the default), the resulting model will be anILcdModelTreeNodethat preserves the I3S sublayer hierarchy. When set tofalse, the decoder returns a flat model containing all the geometry.Note that this only applies to
Buildingscene layers.- Parameters:
aCreateModelTrees-trueto create a model tree,falsefor a flat model.- See Also:
-
decode
Description copied from interface:ILcdModelDecoderCreates a new model from the given data source.- Specified by:
decodein interfaceILcdModelDecoder- Parameters:
aSourceName- the data source to be decoded; typically a file name or a URL.- Returns:
- A model containing the decoded data. While
nullis allowed, implementors are advised to throw an error instead. - Throws:
IOException- for any exceptions caused by IO problems or invalid data. Since decoding invalid data almost always results in RunTimeExceptions (NullPointerException, IndexOutOfBoundsException, IllegalArgumentException, ...) on unexpected places, implementations are advised to catch RuntimeExceptions in their decode() method, and wrap them into an IOException, as illustrated in the code snippet below.public ILcdModel decode( String aSourceName ) throws IOException { try (InputStream input = fInputStreamFactory.createInputStream(aSourceName)) { // Perform decoding ... } catch (RuntimeException e) { throw new IOException(e); } }- See Also:
-