Class TLcdBingMapsModelDecoder
- All Implemented Interfaces:
ILcdDataSourceModelDecoder
,ILcdModelDecoder
ILcdModel
containing high resolution, multi-level Bing Maps imagery.
Input files
The decoder only accepts aILcdBingMapsDataSource
, 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
- Each decoded model contains a single implementation of
ALcdImage
andILcdEarthTileSet
.
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 theconfigured 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. SeeTLcdBingMapsTransportFactory
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canDecodeSource
(ILcdDataSource aDataSource) Checks whether this model decoder can decode the data source(s), identified by the passedILcdDataSource
.boolean
canDecodeSource
(String aSourceName) Checks whether this model decoder can decode the specified data source.This model decoder only supports sources that are an instance of ILcdBingMapsDataSource, not String.decodeSource
(ILcdDataSource aDataSource) Creates a new model from the given data source.Returns a short, displayable name for the format that is decoded by thisILcdModelDecoder
.Returns the used transport factory, determining the communication with the Bing Maps servers.void
setTransportFactory
(ILcdTransportFactory aTransportFactory) Changes the used transport factory, determining the communication with the Bing Maps servers.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.model.ILcdModelDecoder
decodeModelMetadata, decodeModelMetadata, discoverDataSources
-
Constructor Details
-
TLcdBingMapsModelDecoder
public TLcdBingMapsModelDecoder()
-
-
Method Details
-
getTransportFactory
Returns the used transport factory, determining the communication with the Bing Maps servers.- Returns:
- the transport factory
-
setTransportFactory
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
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 aTLcdDataSource
.The default implementation of this method will check if the given
ILcdDataSource
is aTLcdDataSource
. If not, this method returns false. Otherwise, it delegates the source to theILcdModelDecoder.canDecodeSource(String)
method.This implementation can decode
ILcdBingMapsDataSource
objects. SeeTLcdBingMapsDataSourceBuilder
andTLcdCustomBingMapsDataSourceBuilder
for info on how to create aILcdBingMapsDataSource
.- Specified by:
canDecodeSource
in interfaceILcdModelDecoder
- Parameters:
aDataSource
- theILcdModelSource
to be verified.- Returns:
true
if this decoder can likely decode the data specified byaDataSource
,false
otherwise.- See Also:
-
decodeSource
Description copied from interface:ILcdModelDecoder
Creates a new model from the given data source.
By default, this method:
- Throws a
NullPointerException
when anull
data source is passed. - Delegates to the
ILcdModelDecoder.decode(String)
method when aTLcdDataSource
is passed. - Throws an IOException in other case.
- Specified by:
decodeSource
in interfaceILcdModelDecoder
- Parameters:
aDataSource
- theILcdDataSource
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:
- Throws a
-
getDisplayName
Description copied from interface:ILcdModelDecoder
Returns a short, displayable name for the format that is decoded by thisILcdModelDecoder
.- Specified by:
getDisplayName
in interfaceILcdModelDecoder
- Returns:
- the displayable name of this
ILcdModelDecoder
.
-
canDecodeSource
Description copied from interface:ILcdModelDecoder
Checks whether this model decoder can decode the specified data source. It is acceptable for this method to returntrue
for a source name whiledecode
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 interfaceILcdModelDecoder
- 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
This model decoder only supports sources that are an instance of ILcdBingMapsDataSource, not String. Use the methoddecodeSource(com.luciad.model.ILcdDataSource)
instead.- Specified by:
decode
in interfaceILcdModelDecoder
- 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:
-