When you are sending requests to a WFS server, your query can contain both a spatial filter and an extra OGC filter. This mechanism allows LuciadRIA to query only the data it will actually visualize, and lets the server perform the filtering.

LuciadRIA will automatically:

  • Include a spatial filter matching the map bounds

  • Include the extra filtering query from the LoadingStrategy

in the request sent to the WFS server.

As such, installing a query (provider) on the LoadingStrategy ensures that LuciadRIA only requests the data that will be visualized. In the following example, we create a filter for cities with a population larger than 500,000 and install it on the layer:

//Create the filter using the factory methods
//of the FilterFactory module
const ogcFilter = gt(property("TOT_POP"), literal(500000));

//Install the filter on the LoadingStrategy
const citiesLoadingStrategy = new LoadEverything({query: {filter: ogcFilter}});

//Create a layer using that LoadingStrategy
const citiesLayer = new FeatureLayer(citiesModel, {
  label: "WFS Cities Layer",
  loadingStrategy: citiesLoadingStrategy
});

See Dealing with large feature data sets for more details on how to limit data loading in LuciadRIA.