Given the following scenario (see attached image) I think it is called the CostDistance which returns the PolyLine.
(assumed to be represented by the red line in the drawing)
What I need to do is basically "walk" along that polyline to compute the nautical miles between the two points that the PolyLine represents. We have a raster that represents the hydrography so that we only look at water. And since we are on water all paths have the same weight, thus we should get only one path in the PolyLine.
This will serve as a utility for future tools. Our current one isn't much, a grid of starting station, all known targets, and then once this service is called it will populate with the nautical miles between the station and each target. (we can then use nautical maps to confirm the NM calculation before we go to the next level of use.
The polyline seemed the best method to call since a) it should return a single line as an answer b) it should be easier to compute the actual length which I will probably make as an Extension Method to the PolyLine class c) gives us the future option to then draw that line on the map to represent Response Force movement to a target.
On the other hand if QueryPointAndDistance does the trick for me, then my job just got a whole heck of a lot easier, given the situation. I am assuming, though, that due to the nature of the raster we are likely to get an answer that contains multiple points along the line, but I just want the distance from start to end, not each waypoint inbetween.
Reading the documentation it looks like I would call my service, get back a PolyLineArray of PolyLines (one station to multiple target distances) and then :
for (int index = 0; index < responseArray.Length; index++)
{
ICurve temp = responseArray[index] as ICurve;
distance[index] = temp.QueryPointAndDistance(station, .., targets[index], distanceToTarget, ..
);
}