Closed despainm closed 9 months ago
Thanks for bringing this in @despainm, and for the great write up and code link. We'll address ASAP.
@rgwozdz When fixing this, it might be helpful to add a objectIds
flag to the filtersApplied
object so providers can indicate if they have already filtered features by that parameter. This would help reduce post processing for providers like Elastic that can do this filtering in the data query.
Fix in progress.
@despainm - try @koopjs/koop-core@8.0.10
Thanks @rgwozdz! koop-core 8.0.10 worked for us (we are setting the featureCollection.filtersApplied.objectIds = true;
). It appears to have fixed this issue and https://github.com/koopjs/koop/issues/605.
When executing a query that specifies
objectIds=1&outFields=MY_FIELD
the featureserver filters out features if the OBJECTID attribute is not provided in the data attributes.Our provider supplies the featureserver with data attributes based on the
outFields
list. If OBJECTID is not part of theoutFields
list all the data attributes do not include the OBJECTID so all features are filtered out. To workaround this our provider checks for the condition whereobjectIds
andoutFields
is specified and theoutFields
does not include the OBJECTID field. The provider modifies the req.query to add the OBJECTID field to theoutFields
, and provide the OBJECTID attribute in the data. The features that match the objectIds are returned, but the result also includes the OBJECTID attribute.It seems like the provider should provide featureserver with the OBJECTID attribute in the data so it can filter results, but featureserver should honor the
outFields
list and not return the OBJECTID in the result unless it is part of the original request outFields.