When you add WFS data to your map, LuciadLightspeed automatically sends a WFS request to the WFS server with a spatial filter that matches the area that you are visualizing. You can also add your own filters to further restrict the data that you want to query and visualize.

To add such a filter, construct an OGC Filter with your filter criteria, and set it on the WFS model.

This example shows how you can add a filter for a US Cities WFS feature type. We want to query only those cities that have a name starting with "New":

// Create a WFS model for the WFS feature type 'cities' provided by the WFS server 'http://sampleservices.luciad.com/wfs'.
TLcdWFSProxyModel model = TLcdWFSProxyModel.Builder.newBuilder().server("http://sampleservices.luciad.com/wfs").featureTypeName("cities").build();

// We only want to query cities of which the name starts with "New".
// To achieve this, we can rely on the IsLike filter operator, which can compare a property with a value containing a wildcard.
TLcdOGCFilter filter = new TLcdOGCFilter(TLcdOGCFilterFactory.like(TLcdOGCFilterFactory.property("CITY"), "New*"));

// By setting an explicit filter on the WFS model, all future access to the WFS data will include the filter.
model.setFilter(filter);