Class TLcdPointCloudModelDecoder

java.lang.Object
com.luciad.format.tiled3d.lpc.TLcdPointCloudModelDecoder
All Implemented Interfaces:
ILcdModelDecoder

@LcdService(service=ILcdModelDecoder.class, priority=20000) public final class TLcdPointCloudModelDecoder extends Object implements ILcdModelDecoder
This model decoder decodes point clouds in the Luciad point cloud file format (tilestore.lpc files).

Input files

File Required Entry point Description
tilestore.lpc x x Entry point of the point cloud dataset.
tiles x Directory containing the tile data.

Supported file transfer protocols

As random access to the data is required, this decoder only reads from files. So it can for example not read from an InputStream, from a http connection or from a file inside a jar file.

Model structure

Model descriptor

  • The type name of the model descriptor is "LuciadPC".

Model reference

Model elements

The model elements are bounded instances, of which the bounds can be retrieved using the ALcdBounds.fromDomainObject(Object) method.

Thread safety

  • The decoded models are thread-safe for read access.

Sample code

Visualizing point cloud data sets on a Lightspeed view is done by using this model decoder and the TLsp3DTileLayerBuilder. It is not possible to visualize the data on a GXY view.

   String source = "tilestore.lpc";
   TLcdPointCloudModelDecoder modelDecoder = new TLcdPointCloudModelDecoder();
   if(modelDecoder.canDecodeSource(source)){
     ILcdModel model = modelDecoder.decode(source);
     ILspLayer layer = TLsp3DTileLayerBuilder.newBuilder().model(model).build();
   }
 
Since:
2018.0
  • Field Details

  • Constructor Details

    • TLcdPointCloudModelDecoder

      public TLcdPointCloudModelDecoder()
  • Method Details

    • getDisplayName

      public String getDisplayName()
      Description copied from interface: ILcdModelDecoder
      Returns a short, displayable name for the format that is decoded by this ILcdModelDecoder.
      Specified by:
      getDisplayName in interface ILcdModelDecoder
      Returns:
      the displayable name of this ILcdModelDecoder.
    • canDecodeSource

      public boolean canDecodeSource(String aSourceName)
      Description copied from interface: ILcdModelDecoder
      Checks whether this model decoder can decode the specified data source. It is acceptable for this method to return true for a source name while decode throws 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:
      canDecodeSource in interface ILcdModelDecoder
      Parameters:
      aSourceName - the data source to be verified; typically a file name or a URL.
      Returns:
      true if this decoder can likely decode the data specified by the source name, false otherwise.
      See Also:
    • decode

      public ILcdModel decode(String aSourceName) throws IOException
      Description copied from interface: ILcdModelDecoder
      Creates a new model from the given data source.
      Specified by:
      decode in interface ILcdModelDecoder
      Parameters:
      aSourceName - the data source to be decoded; typically a file name or a URL.
      Returns:
      A model containing the decoded data. While null is 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: