When creating an ILcdModel
for a single WCS coverage, you can skip the creation of a
TLcdWCSDataSource
by specifying the needed coverage directly in the server URL:
String serverURL = "https://sampleservices.luciad.com/wcs";
String coverageName = "world_elevation_6714a770-860b-4878-90c9-ab386a4bae0f";
//Concat the url and layer name to a single string
String sourceName = String.format("%s?data=%s", serverURL, coverageName);
//Decode the model
ILcdModelDecoder decoder = new TLcdWCSCoverageModelDecoder();
ILcdModel model = decoder.decode(sourceName);
is the equivalent of
String serverURL = "https://sampleservices.luciad.com/wcs";
String coverageName = "world_elevation_6714a770-860b-4878-90c9-ab386a4bae0f";
//Create the data source
TLcdWCSDataSource dataSource = TLcdWCSDataSource.newBuilder()
.uri(serverURL)
.coverageName(coverageName)
.build();
//Decode the model
ILcdModelDecoder decoder = new TLcdWCSCoverageModelDecoder();
ILcdModel model = decoder.decodeSource(dataSource);