Dear ESRI,
we built an application in Javascript where we are selecting a bunch of points on the ESRI map and retrieving selected points through the intersection with the graphic layer in the following way:
sketchViewModel.on("create", (event) => {
if (event.state === "complete") {
const extent = event.graphic.geometry.extent;
const intersection = graphicsLayer.graphics.filter((graphic) =>
extent.intersects(graphic.geometry)
);
console.log("Items", intersection._items)
graphicsLayer.remove(event.graphic);
that.fireEvent("select", { event: intersection._items });
}
})However, we noticed a strange behavior. We want to select all the points on a given street. If we proceed by selecting small blocks very close to the points, the process works fine, but if we select all the points together the intersection seems to take more points than requested, probably involving also the nearest points.
Look at this case. First we select 3 points

and all seems fine:

Three points are selected correctly. In the console you see 4 because one is always junk and not used.
Then we take 4 other points on the same street:

Even in this case the result is correct:

(One point is always junk and not used)
Finally, we select the remaining 2 points

and in this case too, all is correct.

So, in total, I've selected 9 points (consider that for each selection one is always dummy)
But, if select all the points together using a segmented line

it brings me more than the ones I selected

How can I fix this strange behavior? Why it's not so accurate when I extract the selected points?
Thanks