Greetings! Working in ArcGIS JS API 4.22:
I am trying to query a feature layer (polygons) with a large amount of points (~1000) in order to find which polygons the points intersect with (by name only, no need for geometries. Doing this with a loop for each point individually is extremely slow and errors out. I've tried condensing the points to a multipoint geometry in hopes of speeding the process to no avail. Is there a solution to this that I am just overlooking?
const layer = new FeatureLayer({
url: "https://arcgis-server.lsa.umich.edu/arcgis/rest/services/IFR/glahf_classification_poly/MapServer/0",
outFields: ["AEU_Code"],
});
//gets a server error at about 250 points
var multipoint = new Multipoint({
points: [
[-86, 45],
[-85, 47],
[-84, 49]
]
});
const query = new Query();
query.geometry = multipoint;
query.outSpatialReference = { wkid: 102100 };
query.returnGeometry = false;
query.outFields = ["AEU_Code"];
layer.queryFeatures(query).then(function (results) {
console.log(results.features); // prints the array of features to the console
});Thanks!