Select to view content in your preferred language

WFS queryFeatures() unexpected behavior.

419
0
03-11-2022 07:49 PM
loeff081
New Contributor

Hi all thanks for taking a look at this issue!

I'm running into some odd behavior when querying a WFSlayer that's hosted using Geoserver. I'm aiming to query the service using a geometry intersection.

What I'm seeing happen in the browser network tools is the query returning all features (up to the server-side configured limit), and then these features appear to be filtered client side based on the intersection geometry before being returned by queryFeatures(). The service has tens of thousands of features, so this leads to poor performance and silently missing features.

What I expected is for the query to be formatted such that it is performed server side and returns only the features matching the query parameters.

Is there any way to accomplish this using the API, or should I be rolling my own WFS query functionality and handling the returned features on my own?

Here's my basic workflow more or less copied from the documentation examples:

 

 

  const wfsLayer = new WFSLayer({url, name});
  const query = new Query();
  query.returnGeometry = true;
  query.spatialRelationship = "intersects";
  query.geometry = geometry;
  query.outSpatialReference = spatialReference;

  const features = await wfsLayer.queryFeatures(query);

 

Thanks for any insights!

0 Kudos
0 Replies