How to increase the speed of spatial query

389
2
07-31-2017 09:53 PM
IT_AppLayers
New Contributor

hi all, I am using ArcGIS API for JavaScript v4.3 queryFeatures to get features in a layer.

var query = new Query({ returnGeometry: true, outFields: ["*"] });
query.geometry = geometryEngine.union(geometries);
self.censusLayers[layerID].queryFeatures(query).then(function (results) {
   //task/
});

Is there a way to increase the speed of execute this query? (assume the query geometries will be a 30 km radius circle and the query result will be 8000 SA1 geometries)

Thanks.

0 Kudos
2 Replies
JayantaPoddar
MVP Esteemed Contributor

Adding Spatial Index to the table could speed up the process.



Think Location
0 Kudos
ThomasSolow
Occasional Contributor III

If you have all the geometries that you're searching for in the client then you can perform the query there, without making a network request.  In my experience the bottleneck is usually the network request, so performing the search in the client should speed things up.

Which version of the API are you using?  And for each "census layer," are all features in the client?  Or are they being fetched on demand (only available in the 3.XX API)?

0 Kudos