Class SortingWFSClient
WFSClient that lets a WFS 2.0.0 server sort, when the capabilities have the ImplementsSorting
constraint. GeoTools 35.2 only lets a WFS 1.1.0 server sort.
When the client can't sort, ContentFeatureSource sorts each page of features in memory after getting it
from the server with STARTINDEX and COUNT. Each page is sorted on its own, which gives a wrong order
across pages, and it fails when a feature has an attribute that isn't Serializable, such as an
Instant for a date. That also happens without a sort order, because ContentFeatureSource adds
NATURAL_ORDER when paging.
For WFS 2.0.0 the StrictWFS_2_0_Strategy GeoTools picks is replaced with SortingWFS_2_0_Strategy,
which sends the sort order to the server. The client then always says it can sort, so GeoTools never sorts in memory:
in memory sorting is wrong with paging, and paging is always used for the attribute list. Instead:
- Natural order (also the one
ContentFeatureSourceadds when paging) is not sent, so the server uses its own order. WFS 2.0 (ISO 19142) 7.9.2.5.4.4 requires that order to be the same across executions of the same query, so it is stable across pages. - Sorting on an attribute when the capabilities don't have the
ImplementsSortingconstraint is an error, seeSortingWFS_2_0_Strategy.
Other strategies, such as ArcGisStrategy_2_0, are left to GeoTools: no sorting on the server, and each
page sorted in memory.
This can be removed when GeoTools supports sorting for WFS 2.0.0 itself.
-
Field Summary
Fields inherited from class org.geotools.data.wfs.internal.WFSClient
configFields inherited from class org.geotools.data.ows.AbstractOpenWebService
capabilities, headers, hints, info, resourceInfo, serverURL, specification, specs -
Constructor Summary
ConstructorsConstructorDescriptionSortingWFSClient(URL capabilitiesURL, org.geotools.http.HTTPClient httpClient, org.geotools.data.wfs.internal.WFSConfig config) -
Method Summary
Methods inherited from class org.geotools.data.wfs.internal.WFSClient
canCount, canFilter, canLimit, canOffset, canRetype, createDescribeFeatureTypeRequest, createDescribeStoredQueriesRequest, createGetFeatureRequest, createInfo, createInfo, createListStoredQueriesRequest, createTransaction, getAxisOrderFilter, getBounds, getCapabilities, getCapabilitiesURL, getConfig, getDefaultCRS, getDescribeFeatureTypeGetURL, getInfo, getRemoteTypeNames, getStrategy, internalIssueRequest, issueComplexRequest, issueRequest, issueRequest, issueRequest, issueRequest, issueRequest, issueTransaction, isUseProvidedFIDSupported, setupSpecifications, splitFilters, supportsStoredQueries, supportsTransactionMethods inherited from class org.geotools.data.ows.AbstractOpenWebService
getHints, getHTTPClient, getInfo, negotiateVersion, setHints, setHttpClient, setLoggingLevel
-
Constructor Details
-
SortingWFSClient
public SortingWFSClient(URL capabilitiesURL, org.geotools.http.HTTPClient httpClient, org.geotools.data.wfs.internal.WFSConfig config) throws IOException, org.geotools.ows.ServiceException - Throws:
IOExceptionorg.geotools.ows.ServiceException
-
-
Method Details
-
canSort
public boolean canSort()- Overrides:
canSortin classorg.geotools.data.wfs.internal.WFSClient
-