Select to view content in your preferred language

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

1793
5
Jump to solution
10-21-2014 08:10 PM
xiaoyunnsongb
Deactivated User

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

5 Replies
xiaoyunnsongb
Deactivated User

i don't want  this polygon  not intersect  with others

0 Kudos
xiaoyunnsongb
Deactivated User

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
Deactivated User

Dear Mr Robert Scheitlin:

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

0 Kudos
YugandharTilak
New Contributor

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)

 

0 Kudos