Hello every superiors:
Now I have a question ,thanks you for lost several minutes.
Q: I draw many polygons, when I draw another polygon i don't want this polygon not intersect with others, so I should to query the intersect polygons with this polygon ,i use the code:
var query = new esri.tasks.Query();
query.outSpatialReference = map.spatialReference;
query.spatialRelationship = esri.tasks.Query.SPATIAL_REL_INTERSECTS;
query.geometry = queryGeometry;
query.returnGeometry = true;
query.outFields = ["*"];
var queryTask = new esri.tasks.QueryTask(url);
queryTask.execute(query)
but this code not only find the interset polygons but the adjacent polygons(the polygon‘s border line is one with this polygon),like pic1
A and B use the common border,I don’t Want this (B)be searched ; pic2 B is intersect wich A, this should be searched and the code can searched it。
How can I only seach the intersect polygons with it not adjacent ,thanks very much.
pic1:
pic2:
Solved! Go to Solution.
Xiaoyunn,
You mention that you are drawing these polygons. Are you drawing them using the JS API? Are you making sure to snap to vertexes? Have you tried other spatial relations like: SPATIAL_REL_OVERLAPS or SPATIAL_REL_CROSSES?
i don't want this polygon not intersect with others
i don't want this polygon intersect with others
Xiaoyunn,
You mention that you are drawing these polygons. Are you drawing them using the JS API? Are you making sure to snap to vertexes? Have you tried other spatial relations like: SPATIAL_REL_OVERLAPS or SPATIAL_REL_CROSSES?
Dear Mr Robert Scheitlin:
I use SPATIAL_REL_OVERLAPS is ok, thanks very much, wish you happy every day.
interSectedPolygon = GeometryEngine.Instance.Intersection(aJob.Boundary, interSectedPolygon, GeometryDimensionType.EsriGeometry2Dimension);
Polygon resultPolygon = interSectedPolygon as Polygon;
Here, resultPolygon is the intersected polygon of 2 overlapped polygons (arcGIS Pro 3.2)