How get the intersect polygons Of polygon, exclude the adjacent polygons

1392
4
Jump to solution
10-21-2014 08:10 PM
xiaoyunnsongb
New Contributor III

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:

      eee.png

pic2:

bbb.png

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

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?

View solution in original post

4 Replies
xiaoyunnsongb
New Contributor III

i don't want  this polygon  not intersect  with others

0 Kudos
xiaoyunnsongb
New Contributor III

i don't want  this polygon   intersect  with others

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

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?

xiaoyunnsongb
New Contributor III

Dear Mr Robert Scheitlin:

       I use SPATIAL_REL_OVERLAPS is ok, thanks very much, wish you happy every day.

0 Kudos