Aside from geometryEngine.geodesicBuffer(), all other methods do not have a WORKING SAMPLE.
kindly help me with this. thanks.
If you are trying to evaluate a existing featureclass for intersects, there are many things that are just better done using ArcGIS Desktop. If it is a requirement for this to be done clientside then prepare for a slow process of looping through each line and evaluating if that line intersects with each other line in your loop and then move to the next line in the loop and repeat the process again. Unlike ArcMap where you can say take FC1 and Intersect with FC2, the JS API works with individual geometries.
Are all the line geometries in the same layer?
Are you trying to evaluate if a current layer has any geometries that intersect or are you allowing the user to draw geometry and what to know if that drawn geometry intersects another?
Thanks for your quick response.
The geometries came from a 2 query results and both are returning polyline as geometry. I am using GraphicsLayer to store the geometry of two different lines. Then using the geometryEngine.intersects() method to evaluate whether the 2 polylines intersects. When the method return true, I want to get the point (xy or LongLat) from the intersection to do another process.
In the image above is the result from a query which are stored in a GraphicsLayer. The Green Lines that are intersected by Blue Line visually. In the next image, I put Red Points. Those points are the one that I want to get from the intersection of the 2 lines.
I am frustrated because the geometryEngine class do not have a WORKING SAMPLE other than the geometryEngine.geodesicBuffer() method.
I hope you can help with this. Thank you.
The intersect method is designed to return the geometry of the intersection in the lowest dimension of the two input geometries. Since this case uses two lines (which are one dimensional) the output must also be a line. Because this seems counterintuitive, we're looking at the possibility of adding GeometryEngine support for returning a lower dimension than the inputs for this very reason. With two lines you expect to get a point (or several points) back, not necessarily a line.
Just know that this is the current expected behavior, it's on our radar, and we're looking at improving it. Also note that this isn't a simple problem to solve. Because lines can be complex, containing many segments and vertices, processing this on the client can potentially be heavy.