AnsweredAssumed Answered

Using esri.tasks.geometry to get a polygon with holes and a set of points

Question asked by naderc@wsn.net on Jun 11, 2012
Latest reply on Jun 11, 2012 by naderc@wsn.net
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!

Outcomes