The majority of formats require the same two steps for visualization on a Lightspeed view. To visualize WMTS data:
-
Decode the data into an
ILcdModelusing anILcdModelDecoder. -
Create an
ILspLayerfor theILcdModeland add it to theILspView.
//First create the model
//Start by creating a TLcdWMTSDataSource for the coverage
String serverURL = "https://sampleservices.luciad.com/wmts";
String layerName = "4ceea49c-3e7c-4e2d-973d-c608fb2fb07e";
TLcdWMTSDataSource dataSource = TLcdWMTSDataSource.newBuilder()
.uri(serverURL)
.layer(layerName)
.build();
//Decode the model by passing the datasource to the model decoder
ILcdModelDecoder decoder =
new TLcdCompositeModelDecoder(TLcdServiceLoader.getInstance(ILcdModelDecoder.class));
ILcdModel model = decoder.decodeSource(dataSource);
//Create a layer for the model with default styling
ILspLayer layer = TLspRasterLayerBuilder.newBuilder()
.model(model)
.build();
//Add the layer to the Lightspeed view (an ILspView)
view.addLayer(layer);
This results in a WMTS layer with default styling. See Visualizing Raster Data for more information about visualizing and styling raster data.
|
This code snippet uses the The model decoder class that is actually responsible for decoding WMTS data is the
|