When creating an ILcdModel
for a single WFS feature type, you can skip the creation of a
TLcdWFSDataSource
by specifying the needed feature type directly in the server URL:
String serverURL = "https://sampleservices.luciad.com/wfs";
String featureTypeName = "cities";
//Concat the url and layer name to a single string
String sourceName = String.format("%s?data=%s", serverURL, featureTypeName);
//Decode the model
ILcdModelDecoder decoder = new TLcdWFSModelDecoderDecorator();
ILcdModel model = decoder.decode(sourceName);
is the equivalent of
String serverURL = "https://sampleservices.luciad.com/wfs";
String featureTypeName = "cities";
//Create the data source
TLcdWFSDataSource dataSource = TLcdWFSDataSource.newBuilder()
.uri(serverURL)
.featureTypeName(featureTypeName)
.build();
//Decode the model
ILcdModelDecoder decoder = new TLcdWFSModelDecoderDecorator();
ILcdModel model = decoder.decodeSource(dataSource);