Intersect tool for javascript

4757
4
Jump to solution
11-27-2012 06:41 AM
TimMcCurdy
New Contributor II
Hello,

I am looking to work out the lengths of polyline (road) intersections on a polygon (user selection). It looks like something the Intersect tool would be perfect for, but I cannot find it for javascript.

Is this feature present for the javascript API? If not is there any plans to add it? Can it be emulated using code already in the API, or will I have to write my own?

Thanks
Tim
0 Kudos
1 Solution

Accepted Solutions
JohnGravois
Frequent Contributor
try the intersect method of the geometry task.  we don't have any sample applications which call this method, but it would probably be helpful to check out our other geometry service samples here.

View solution in original post

0 Kudos
4 Replies
JohnGravois
Frequent Contributor
try the intersect method of the geometry task.  we don't have any sample applications which call this method, but it would probably be helpful to check out our other geometry service samples here.
0 Kudos
TimMcCurdy
New Contributor II
try the intersect method of the geometry task.  we don't have any sample applications which call this method, but it would probably be helpful to check out our other geometry service samples here.


Thanks that's what I was looking for. Didn't show up on a search.

Had to push all of my features into a geometry array for the input:

               if (identifyResults.length > 0) {
                  var geometryStack = [];
                  for (var k = 0; k < identifyResults.length; k++) {
                     geometryStack.push(identifyResults.feature.geometry);
                  }
                  var geoService = new esri.tasks.GeometryService("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer");
                  geoService.intersect(geometryStack, geometry, onCompleteFunc, onErrorFunc);
0 Kudos
JohnGravois
Frequent Contributor
glad to hear it 🙂
0 Kudos
ana_salgado
New Contributor II

where I can review sample intersect method, I want to make a method that interceste a service layer and a point specified by the user