Select to view content in your preferred language

How to get the intersecting point from two buffers

705
2
Jump to solution
03-24-2022 04:56 AM
JayakumarPD
Frequent Contributor

Hi, 

       We are intersecting two circles(buffer geometry), but getting all the x,y coordinates of intersected area.  But we need only two point where it has a intersections.  Kindly help us.  The graphical representation of the problem is given in the attachment also. 

 

 

geometryService.intersect(
                        [P1_Geometry],
                        P2_Geometry ,
                        function(intersectionObject) {

                            for(var i = 0; i < intersectionObject[0].rings[0].length; i++) {
                             console.log(new Point([
                             intersectionObject[0].rings[0][i][0],
                             intersectionObject[0].rings[0][i][1]
                             ],
                             intersectionObject[0].spatialReference));
                             var symbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 10, null, new Color([255, 0, 0]));

                             var graphic = new Graphic(new Point([
                             intersectionObject[0].rings[0][i][0],
                             intersectionObject[0].rings[0][i][1]
                             ],
                             intersectionObject[0].spatialReference)
                             , symbol);
                             map.graphics.add(graphic);
                             }
                        },
                        function(){console.log(arguments)}
                );

 

 

 

0 Kudos
1 Solution

Accepted Solutions
JayakumarPD
Frequent Contributor

Thank you. I think it will work. will try

View solution in original post

0 Kudos
2 Replies
HuubZwart
Frequent Contributor

How about converting your original P1_Geometry and P2_Geometry into polylines first? The result of your intersection should then only contain the two points you need

JayakumarPD
Frequent Contributor

Thank you. I think it will work. will try

0 Kudos