Solved! Go to Solution.
The idea is simple. Given a hollow polygon as geometry A and an array of point geometries, we would like to figure out the proper intersection between the two. Below is the code used:
var geometryService = new esri.tasks.GeometryService("http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer");
var relationParams = new esri.tasks.RelationParameters();
relationParams.geometries1 = [hollowPolygonGeom];
relationParams.geometries2 = [point1geom, point2geom, ..., pointXgeom];
relationParams.relation = esri.tasks.RelationParameters.SPATIAL_REL_WITHIN;
geometryService.relation(relationParams, onSuccess, onErr);
The results returned by the service include the intersection between the "hollow" are of the polygon and the points. We also noticed that the orientation of the inner ring (the hollow shape) affects the returned results. Either way, the results are not what we wanted. Is this behavior expected? What are we missing? Is there another way to get the results we need?
Thanks in advance!
Thanks for the prompt response. Regarding what the geometry service (called using esri.tasks.GeometryService) should return: if passed a single geometry with the proper inner ring orientation (1st input) and an array of geometries (2nd input), the returned result is NOT expected to exclude the points that appear within the hollow area? It would be great if we can get some sample code that returns the proper intersection result instead of excessive validation and proceesing client-side to do the same.