When you are sending requests to a WFS server, your query can contain both a spatial filter and an extra OGC filter. With this mechanism, LuciadRIA can query only the data it will actually visualize, and let the server perform the filtering.
In the request sent to the WFS server, LuciadRIA automatically includes:
-
A spatial filter matching the map bounds
-
The extra filtering query from the
LoadingStrategy
Installing a query provider on the LoadingStrategy
ensures that LuciadRIA only requests the data that it visualizes.
This examples shows the creation of a filter for cities with a population larger than 500,000 and its installation 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 to learn more about limiting data loading in LuciadRIA. |