Hi,
we are performing spatial queries on multiple feature layers at once. At some cases the given geometry is pretty big and causes performance issues.
I am looking for a way to limit the query in time or amount instead of waiting til end or aborting it at al.
This is my current code:
const bufferGeometry = bufferOperator.execute(centerFeature.geometry!, 200, { unit: "meters"});
const bufferSearchResult = await Promise.all(searchLayers.map((l: FeatureLayer) => {
const query = l.createQuery();
query.geometry = bufferGeometry
return l.queryFeatures(query);
}))
I could make a timeout on the promise, but that way I am not getting any result at all.
I could limit the results after the query has finisehd but this needs the query to fully perform.
Both is not suitable for us.
Best case we are looking for can:
- limit the query running in time and return all results found so far
- limit the query running by a maximum of results and return as soon as the maximum is reached
Hope to see some ideas, thanks.