Class TLcdBingMapsModelDecoder

java.lang.Object
com.luciad.format.bingmaps.TLcdBingMapsModelDecoder
All Implemented Interfaces:
ILcdDataSourceModelDecoder, ILcdModelDecoder

@LcdService(service=ILcdModelDecoder.class, priority=20000) public class TLcdBingMapsModelDecoder extends Object implements ILcdDataSourceModelDecoder
A model decoder that creates an ILcdModel containing high resolution, multi-level Bing Maps imagery.

Input files

The decoder only accepts a ILcdBingMapsDataSource, created by either a TLcdBingMapsDataSourceBuilder or a TLcdCustomBingMapsDataSourceBuilder. This implementation doesn't support Strings as input.

Model structure

  • This model decoder creates a model per data source.

Model descriptor

  • All models returned by this model decoder have a TLcdBingMapsModelDescriptor.
  • 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 TLcdGridReference.
  • The used datum is a standard TLcdGeodeticDatum (WGS-84).
  • The used projection is TLcdPseudoMercator.
  • Note that when visualizing the model in a ILcdGXYView performance will be greatly improved if the world reference of the view is equal to this model reference.

Model elements

Sample code


 TLcdBingMapsModelDecoder decoder = new TLcdBingMapsModelDecoder();
 ILcdBingMapsDataSource source =
  new TLcdBingMapsDataSourceBuilder( application_id ).build();
 ILcdModel model = decoder.decode( source );
 

Supported file transfer protocols

This decoder makes use of the http/https protocols using the configured transport factory.

Performance tips

  • To reduce network latency, enabling Http caching is recommended. Http caching is supported by the default Transport Factory, but when that one is replaced, it must be configured. See TLcdBingMapsTransportFactory for more information on how to enable Http caching.

Thread safety

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

Limitations

Currently, Bing Maps support in LuciadLightspeed has the following limitations:
  • "Birds Eye" imagery is not supported. This type of imagery requires a different way of interaction and does not offer continuous map coverage.
  • The Bing Maps imagery service does not cover the whole world, so no imagery will be displayed near the poles. This will be especially noticeable on a 3D map.
Since:
11.0
See Also:
  • Constructor Details

    • TLcdBingMapsModelDecoder

      public TLcdBingMapsModelDecoder()
  • Method Details

    • getTransportFactory

      public ILcdTransportFactory getTransportFactory()
      Returns the used transport factory, determining the communication with the Bing Maps servers.
      Returns:
      the transport factory
    • setTransportFactory

      public void setTransportFactory(ILcdTransportFactory aTransportFactory)
      Changes the used transport factory, determining the communication with the Bing Maps servers. The default value is a standard TLcdBingMapsTransportFactory.
      Parameters:
      aTransportFactory - the transport factory. Note that the transport factory is responsible for caching.
      See Also:
    • canDecodeSource

      public boolean canDecodeSource(ILcdDataSource aDataSource)

      Checks whether this model decoder can decode the data source(s), identified by the passed ILcdDataSource.

      For performance reasons, we strongly recommend that this will only be a simple test. For example: check the instance class of aDataSource, or check the file extension if it is a TLcdDataSource.

      The default implementation of this method will check if the given ILcdDataSource is a TLcdDataSource. If not, this method returns false. Otherwise, it delegates the source to the ILcdModelDecoder.canDecodeSource(String) method.

      This implementation can decode ILcdBingMapsDataSource objects. See TLcdBingMapsDataSourceBuilder and TLcdCustomBingMapsDataSourceBuilder for info on how to create a ILcdBingMapsDataSource.

      Specified by:
      canDecodeSource in interface ILcdModelDecoder
      Parameters:
      aDataSource - the ILcdModelSource to be verified.
      Returns:
      true if this decoder can likely decode the data specified by aDataSource, false otherwise.
      See Also:
    • decodeSource

      public ILcdModel decodeSource(ILcdDataSource aDataSource) throws IOException
      Description copied from interface: ILcdModelDecoder

      Creates a new model from the given data source.

      By default, this method:

      Specified by:
      decodeSource in interface ILcdModelDecoder
      Parameters:
      aDataSource - the ILcdDataSource to be decoded.
      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 decodeSource(ILcdDataSource aDataSource) throws IOException {
         try {
           // Perform decoding ...
         } catch (RuntimeException e) {
           throw new IOException(e);
         }
       }
       
      See Also:
    • 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
      This model decoder only supports sources that are an instance of ILcdBingMapsDataSource, not String. Use the method decodeSource(com.luciad.model.ILcdDataSource) instead.
      Specified by:
      decode in interface ILcdModelDecoder
      Parameters:
      aSourceName - the data source to be decoded; typically a file name or a URL.
      Returns:
      not applicable.
      Throws:
      UnsupportedOperationException - always.
      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: