Class TLcdUSRPModelDecoder

java.lang.Object
com.luciad.format.usrp.TLcdUSRPModelDecoder
All Implemented Interfaces:
ILcdInputStreamFactoryCapable, ILcdModelDecoder

@LcdService(service=ILcdModelDecoder.class, priority=20000) public class TLcdUSRPModelDecoder extends Object implements ILcdModelDecoder, ILcdInputStreamFactoryCapable
This model decoder decodes rasters in the USRP, ASRP, and ADRG formats. More specifically, these formats are:
  • the UTM/UPS Standard Raster Product format (USRP, versions 1.2 and 1.3), as used by the French Defense Mapping Agency,
  • the Arc Standard Raster Product format (ASRP, versions 1.0 and 1.2), as used by the British Military Survey Agency,
  • the Arc Digitized Raster Graphics format (ADRG).

Input files

File Required Entry point Description
TRANSH01.THF
x Transmittal Header File
*01.GEN x x General Information file, containing raster metadata
*01.GER
x Georeference file, always specifying the geodetic datum WGS84
*01.QAL x x Quality file, containing accuracy metadata
*.SOU
x Source file, containing image metadata
*.IMG x x Image file, containing the actual raster data

Supported file transfer protocols

  • This model decoder supports all transfer protocols that are supported by the inputStreamFactory of this decoder.

Model structure

Model descriptor

  • When decoding a TRANSH01.THF file, the model descriptor of the decoded model is a TLcdUSRPModelDescriptor.
  • Otherwise, the model descriptor of the decoded model is a TLcdUSRPDatasetModelDescriptor.
  • The type name of the model descriptor is the display name of this decoder.

Model reference

Model elements

  • Raster data are decoded as an implementation of ALcdImage and (ILcdraster) elements. Each raster contains a single TLcdUSRPTile instance that corresponds to a USRP/ASRP/ADRG zone. It contains additional information about the zone.

Sample code


 ILcdModelDecoder decoder = new TLcdUSRPModelDecoder();

 ILcdModel model = decoder.decode("TRANSH01.THF");
 

Performance tips

  • USRP rasters can be large. Precomputing and storing multiple levels of detail may speed up visualization and some computations. The TLcdGeoTIFFModelEncoder can create compressed multilevel GeoTIFF files that can replace the original USRP files.

Thread safety

  • The decoding of models is thread-safe, as long as no properties are changed during the decoding.
  • The decoded models and elements are thread-safe for read access, on the condition that a thread-safe buffer is used.

Supported versions and specifications

  • The UTM/UPS Standard Raster Product Specification (USRP, Editions 1.2 and 1.3, August 1997)
  • The ARC Standard Raster Product Specification (ASRP, Editions 1.0 and 1.2, March 1995)
  • ARC Digitized Graphics (ADRG, MIL-A-89007, February 1990)

Known limitations

  • The current implementation does not support 12-bits grayscale JPEG images.

Requirements

  • This decoder is part of the Defense Standards component.
Since:
2.3
  • Constructor Details

    • TLcdUSRPModelDecoder

      public TLcdUSRPModelDecoder()
      Creates a new TLcdUSRPModelDecoder, with a globally shared buffer for caching tiles.
      See Also:
    • TLcdUSRPModelDecoder

      public TLcdUSRPModelDecoder(ILcdBuffer aBuffer)
      Creates a new TLcdUSRPModelDecoder, with the given shared buffer for caching tiles.
  • Method Details

    • setInputStreamFactory

      public void setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
      Sets the input stream factory that will be used for creating input streams given source names.
      Specified by:
      setInputStreamFactory in interface ILcdInputStreamFactoryCapable
      Parameters:
      aInputStreamFactory - the input stream factory to be used.
    • getInputStreamFactory

      public ILcdInputStreamFactory getInputStreamFactory()
      Returns the input stream factory that is used for creating input streams given source names.
      Specified by:
      getInputStreamFactory in interface ILcdInputStreamFactoryCapable
      Returns:
      the input stream factory that is used.
    • setCreateModelTreeNodes

      public void setCreateModelTreeNodes(boolean aCreateModelTreeNodes)
      Specifies whether an ILcdModelTreeNode or a TLcdModelList should be created when decoding a .THF file.
      Parameters:
      aCreateModelTreeNodes - true if an ILcdModelTreeNode should be created, false if a TLcdModelList should be created.
    • isCreateModelTreeNodes

      public boolean isCreateModelTreeNodes()
      Returns whether an ILcdModelTreeNode or a TLcdModelList is created when decoding a .THF file. The default is true, which means that by default ILcdModelTreeNode instances are used.
      Returns:
      true if an ILcdModelTreeNode is created when decoding a source, false if a TLcdModelList is be created.
    • 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:
      "USRP".
    • 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 the file extension of the given source name is "01.THF", "01.GEN", "01.QAL", ".SOU", or ".IMG", 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:
    • decodeModelMetadata

      public TLcdModelMetadata decodeModelMetadata(String aSourceName) throws IOException
      Description copied from interface: ILcdModelDecoder
      Decodes metadata for the specified data source. By default, this decodes the model and returns the model metadata found on that model. Implementations can override this method to speed up the retrieval.
      Specified by:
      decodeModelMetadata in interface ILcdModelDecoder
      Parameters:
      aSourceName - the data source to be decoded; typically a file name or a URL.
      Returns:
      the model metadata for the data source, never null.
      Throws:
      IOException - if the metadata cannot be decoded for some reason.
      See Also: