stephen.miller4

AGSFeatureLayer.selectFeatures is very slow for point selection

Discussion created by stephen.miller4 on Jul 15, 2019
Latest reply on Jul 26, 2019 by stephen.miller4

I'm trying to select polygons based on where the user clicks. In order to do that I have

 

let mapPointQuery = AGSQueryParameters()
mapPointQuery.geometry = mapPoint

 

This eventually works, but is EXTREMELY slow. When I pass in a rectangle for the geometry it is able to select a dozen or so polygons in ~2 seconds, but when I pass in a point it takes ~13 seconds to select a single polygon. It's roughly the same no matter what spatialRelationship I choose. I've tried a few alternative that haven't worked very well:

- The identifyLayers function is faster, but I need to be able to pass in a whereClause query and selection mode

- expanding the point into a small envelope works ok, but it almost always selects multiple polygons and I really want to only select a single one.

 

Is there some way to speed things up so that point select and rectangle select perform similarly? It seems like the huge difference in performance points to something that can be optimized on the ArcGIS side.

Outcomes