Class TLcdAzureMapsModelDecoder

java.lang.Object
com.luciad.format.azuremaps.TLcdAzureMapsModelDecoder
All Implemented Interfaces:
ILcdModelDecoder

@LcdService(service=ILcdModelDecoder.class, priority=20000) public class TLcdAzureMapsModelDecoder extends Object implements ILcdModelDecoder
A model decoder that creates an ILcdModel containing high resolution, multi-level geospatial maps served by Azure Maps.

Input files

The decoder only accepts a TLcdAzureMapsDataSource, created by an TLcdAzureMapsDataSource.Builder. 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 TLcdAzureMapsModelDescriptor.
  • 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 an ILcdGXYView performance will be greatly improved if the world reference of the view is equal to this model reference.

Model elements

  • Each decoded model contains a single implementation of ALcdImage.

Sample code

    TLcdAzureMapsModelDecoder decoder = new TLcdAzureMapsModelDecoder();
    TLcdAzureMapsDataSource source = TLcdAzureMapsDataSource.newBuilder()
                                                            .subscriptionKey(subscriptionKey)
                                                            .build();
    ILcdModel model = decoder.decodeSource(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 TLcdTransportFactory 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.

Authentication/h3> This Azure Maps model decoder supports the Shared Key authentication approach discussed on the Authentication with Azure Maps website. You need to supply your subscription key to the TLcdAzureMapsDataSource builder. Other authentication approaches such as Microsoft Entra are currently not supported.

Limitations

Currently, Azure Maps support has the following limitations:
  • This decoder supports loading Azure Maps raster (image) tiles. Azure Maps vector tiles are currently not supported.
  • The Azure 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:
2025.0
See Also:
  • Constructor Details

    • TLcdAzureMapsModelDecoder

      public TLcdAzureMapsModelDecoder()
  • Method Details

    • getTransportFactory

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

      public void setTransportFactory(ILcdTransportFactory aTransportFactory)
      Changes the used transport factory, determining the communication with the Azure Maps servers.

      The default value is a standard TLcdTransportFactory, initialized as follows:

      
       TLcdTransportFactory transportFactory = new TLcdTransportFactory();
       transportFactory.setCaching(true);
       transportFactory.setMaxCacheEntries(1000);
       transportFactory.setAutoRequestRetryCount(3);
       
      Parameters:
      aTransportFactory - the transport factory. Note that the transport factory is responsible for caching.
    • 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 TLcdAzureMapsDataSource objects. See TLcdAzureMapsDataSource.Builder for info on how to create a TLcdAzureMapsDataSource.

      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 TLcdAzureMapsDataSource, 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: