@LcdService(service=ILcdModelDecoder.class, priority=20000) public class TLcdWMTSModelDecoder extends Object implements ILcdModelDecoder,ILcdDataSourceModelDecoder
ILcdModel
object.
TLcdWMTSDataSource
.data=layerName
key/value pair.ILcdModelTreeNode
is returned that contains an {code ILcdModel} for each individual WMTS layer.ILcd2DBoundsIndexedModel
and ILcdMultiDimensionalModel
. In case the WMTS layer defines dimensions,
ILcdMultiDimensionalModel
can be used to support dimensional filtering.TLcdWMTSModelDescriptor
.ILcdImageModelDescriptor
, indicating that
the model data can be accessed through the ALcdImage
API.ILcdGridReference
or
an ILcdGeodeticReference
.ALcdMultilevelImageMosaic
.
If the tile pyramid has a quad-tree structure, it is also of the type ILcdEarthTileSet
.ILcdWMTSClientProvider
, to allow retrieving the
TLcdWMTSClient
instance that is used to communicate with the WMTS server.ILcdTransport
is thread-safe (default).ILcdTransport
is thread-safe.Decoding a WMTS data source:
String serverURL = "https://sampleservices.luciad.com/wmts";
String layerName = "4ceea49c-3e7c-4e2d-973d-c608fb2fb07e";
//Create the data source
TLcdWMTSDataSource dataSource = TLcdWMTSDataSource.newBuilder()
.uri(serverURL)
.layer(layerName)
.build();
//Decode the model
ILcdModelDecoder decoder = new TLcdWMTSModelDecoder();
ILcdModel model = decoder.decodeSource(dataSource);
Decoding a string containing the server URL and WMTS layer name
String serverURL = "https://sampleservices.luciad.com/wmts";
String layerName = "4ceea49c-3e7c-4e2d-973d-c608fb2fb07e";
//Concat the url and layer name to a single string
String sourceName = String.format("%s?data=%s", serverURL, layerName);
//Decode the model
ILcdModelDecoder decoder = new TLcdWMTSModelDecoder();
ILcdModel model = decoder.decode(sourceName);
Constructor and Description |
---|
TLcdWMTSModelDecoder()
Creates a new WMTS model decoder with
a built-in HTTP transport . |
TLcdWMTSModelDecoder(ILcdOWSTransport aTransport)
Creates a new WMTS model decoder using the given transport.
|
TLcdWMTSModelDecoder(ILcdTransport aTransport)
Creates a new WMTS model decoder using the given transport.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canDecodeSource(ILcdDataSource aDataSource)
Checks whether the given source represents WMTS data.
|
boolean |
canDecodeSource(String aSourceName)
Checks whether the given source is a WMTS server.
|
ILcdModel |
decode(String aSourceName)
Creates a new model for the WMTS data in the server.
|
ILcdModel |
decodeSource(ILcdDataSource aDataSource)
Creates a new model for the WMTS data in the server represented by a
TLcdWMTSDataSource . |
List<TLcdWMTSDataSource> |
discoverDataSources(String aSource)
Discovers all the WMTS layers a given source has to offer and returns them as a list of data sources.
|
String |
getDisplayName()
Returns a short, displayable name for the format that is decoded by this
ILcdModelDecoder . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
decodeModelMetadata, decodeModelMetadata
public TLcdWMTSModelDecoder()
a built-in HTTP transport
.public TLcdWMTSModelDecoder(ILcdTransport aTransport)
aTransport
- The transport used for connections to the server.TLcdTransportFactory: create a default transport
public TLcdWMTSModelDecoder(ILcdOWSTransport aTransport)
aTransport
- The transport used for connections to the server.TLcdOWSHTTPTransport: the default OWS transport
public String getDisplayName()
ILcdModelDecoder
.getDisplayName
in interface ILcdModelDecoder
public boolean canDecodeSource(String aSourceName)
Returns true
if:
canDecodeSource
in interface ILcdModelDecoder
aSourceName
- the data source to be verified.true
if the source represents a WMTS server, false
otherwise.ILcdModelDecoder.decode(String)
,
ILcdModelDecoder.decodeModelMetadata(String)
public boolean canDecodeSource(ILcdDataSource aDataSource)
Returns true
if the object is
a TLcdWMTSDataSource
.
This call will not make a connection to the server.
canDecodeSource
in interface ILcdModelDecoder
aDataSource
- the source to be verified.true
if the source is a TLcdWMTSDataSource
, false
otherwise.ILcdModelDecoder.decodeSource(ILcdDataSource)
,
ILcdModelDecoder.decodeModelMetadata(ILcdDataSource)
public ILcdModel decode(String aSourceName) throws IOException
The model will be a ILcdModelTreeNode
that contains another ILcdModel
for each available WMTS layer on the
server.
The models for each layer contain:
ILcdEarthTileSet
and ALcdMultilevelImageMosaic
ALcdMultilevelImageMosaic
The aSourceName
parameter is expected in the format of URI?data=LayerName
.
Additionally, the contained model instance is also of the type ILcdWMTSClientProvider
,
to allow retrieving the TLcdWMTSClient
instance that is used to communicate with the WMTS server.
All models have a TLcdWMTSModelDescriptor
.
decode
in interface ILcdModelDecoder
aSourceName
- the source to be decoded, can be a formatted as URI?data=LayerName
to identify the server URI and layer name.IOException
- If the connections to the server fails, or if the server is not a WMTS server, or if aSourceName
is not well formatted.ILcdModelDecoder.canDecodeSource(String)
public ILcdModel decodeSource(ILcdDataSource aDataSource) throws IOException
TLcdWMTSDataSource
. If the data source does not specify a layer
, the model will be a ILcdModelTreeNode
that
contains another ILcdModel
for each available WMTS layer on the server.
If the data source does specify a layer, a single model for this layer will be returned.
The models for each layer contain:
ILcdEarthTileSet
and ALcdMultilevelImageMosaic
ALcdMultilevelImageMosaic
Additionally, the contained model instance is also of the type ILcdWMTSClientProvider
,
to allow retrieving the TLcdWMTSClient
instance that is used to communicate to the WMTS server.
All models will have a TLcdWMTSModelDescriptor
.
decodeSource
in interface ILcdModelDecoder
aDataSource
- the source to be decoded, must be a TLcdWMTSDataSource
.IOException
- If the connections to the server fails, or if the server is not a WMTS
server.ILcdModelDecoder.canDecodeSource(ILcdDataSource)
public List<TLcdWMTSDataSource> discoverDataSources(String aSource) throws IOException
canDecodeSource(String)
.
Once you have the list of data sources, you can select and decode them using decodeSource(com.luciad.model.ILcdDataSource)
.
discoverDataSources
in interface ILcdModelDecoder
aSource
- the source, which must be a valid WMTS URInull
IOException
- if the given source is not a valid WMTS URI, or if something goes wrong connecting to the URI