I have a map service which are points. I have a polygon shape which intersects with the points. How do I find the points that are outside (i.e. excluded / differentiated ) the polygon shape? So this is essentially the opposite of "intersect", kind of like cutting a whole in the points with the polygon.
I know with intersect, I can do the following:
var queryParams = new Query();
queryParams.geometry = geometry; // This is the polygon shape.
queryParams.spatialRelationship = Query.SPATIAL_REL_INTERSECTS; // Optional as it is the default.
// ... QueryTask will execute with the above QueryParams to find intersected points on a layer. //
Is there something like:
var queryParams = new Query();
queryParams.geometry = geometry; // This is the polygon shape.
queryParams.spatialRelationship = Query.SPATIAL_REL_DIFFERENCE; // Or something like that.
// QueryTask will execute with the QueryParams to find the difference between the points and polygon. //
I have tried to use "SPATIAL_REL_RELATION" but no luck:
var queryParams = new Query();
queryParams.geometry = geometry; // This is the polygon shape.
queryParams.spatialRelationship = Query.SPATIAL_REL_RELATION;
queryParams.relationParam = "G1 NOT INTERSECT G2";
I have a huge number of points to deal with, so it is not practical to get all points, then find the intersected points, then subtract.
I am using ArcGIS API for JavaScript version 3.22.