To simply load and visualize data from a WFS, you can creata a model through TLcdWFSDataSource and TLcdWFSModelDecoderDecorator, as explained in the Basics. The information in this guide is only needed if you want to have additional customization options to load WFS data, such as using custom data exchange formats (other than GML) or setting a fixed data filter.

Using a proxy model

LuciadLightspeed uses proxy models for connections with OGC services. When added to a layer in a view, they automatically obtain the data (features, images …​) from the OGC service, making the service connection transparent to the user. The OGC client APIs create these proxy models by default, using a data source and model decoder.

To support customization possibilities, the OGC clients offer additional API related to the proxy model. Examples include the configuration of constraints on what data should be retrieved or which data exchange format should be used.

Creating a WFS proxy model

Use the class TLcdWFSProxyModel.Builder to create and customize a WFS proxy model. The required input parameters of the builder are a server and the name of the requested feature type. Additional customization parameters are available, including the possibility to configure the data exchange format.

The builder will return a TLcdWFSProxyModel, which contains domain objects equivalent to those that would be produced by TLcdGMLModelDecoder.

Optionally, users can specify a TLcdOGCFilter to be applied to the feature data, using the setFilter method of the proxy model. This will restrict the data that is retrieved from the WFS server.