<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: how to enumerate through a Polyline in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-enumerate-through-a-polyline/m-p/499607#M13412</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Maybe I'm missing something but IPolyline has a Length property that returns the length of the line.&amp;nbsp; Is this not what you're looking for?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Oct 2013 16:12:20 GMT</pubDate>
    <dc:creator>NeilClemmons</dc:creator>
    <dc:date>2013-10-10T16:12:20Z</dc:date>
    <item>
      <title>how to enumerate through a Polyline</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-enumerate-through-a-polyline/m-p/499604#M13409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have two points on a hydrography layer which we want the distance.&amp;nbsp; Originally it was a simple call in the Military layer but since that was pulled in 10.1 I'm taking this approach:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm planning on using one of the spatial functions passing the start point and end point.&amp;nbsp; The one function I found returns a PolyLine with the line having a 'value of 3 if it is a single connection'. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to "walk" through that polyline adding up the connections to get the total distance.&amp;nbsp; I'm new to ArcGIS and their lack of documentation for developers.&amp;nbsp; How do I enumerate through that polyline to a) find that line and b) is it correct to assume that once I know the resolution that adding up the number of cells with the value of 3 will give me the distance via n*res.&amp;nbsp; If I can pull out the collection of points can I use the lat/long to compute this?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Oct 2013 10:58:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-enumerate-through-a-polyline/m-p/499604#M13409</guid>
      <dc:creator>MichaelEber</dc:creator>
      <dc:date>2013-10-10T10:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: how to enumerate through a Polyline</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-enumerate-through-a-polyline/m-p/499605#M13410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Mike,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not really understanding your question, may be you could upload an image sketching out what you are asking? Anyway if you are asking to "walk" along a polyline a segment at a time then you would cast your polyline into an &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/ISegmentCollection_Interface/002m0000035r000000/"&gt;ISegmentCollection&lt;/A&gt;&lt;SPAN&gt; interface and then enumerate the segments. If you have a bunch of points that you want to know the distance along a polyline they are the IPolyline has a method &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/IPolyline_Interface/002m000002p0000000/"&gt;QueryPointAndDistance&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Duncan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Oct 2013 14:12:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-enumerate-through-a-polyline/m-p/499605#M13410</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2013-10-10T14:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: how to enumerate through a Polyline</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-enumerate-through-a-polyline/m-p/499606#M13411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Given the following scenario (see attached image) I think it is called the CostDistance which returns the PolyLine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(assumed to be represented by the red line in the drawing)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I need to do is basically "walk" along that polyline to compute the nautical miles between the two points that the PolyLine represents.&amp;nbsp; We have a raster that represents the hydrography so that we only look at water.&amp;nbsp; And since we are on water all paths have the same weight, thus we should get only one path in the PolyLine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This will serve as a utility for future tools.&amp;nbsp; 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.&amp;nbsp; (we can then use nautical maps to confirm the NM calculation before we go to the next level of use.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The polyline seemed the best method to call since a) it should return a single line as an answer&amp;nbsp; b) it should be easier to compute the actual length which I will probably make as an Extension Method to the PolyLine class&amp;nbsp;&amp;nbsp; c) gives us the future option to then draw that line on the map to represent Response Force movement to a target.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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.&amp;nbsp; 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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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 :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int index = 0; index &amp;lt; responseArray.Length; index++)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ICurve temp = responseArray[index] as ICurve;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; distance[index] = temp.QueryPointAndDistance(station, .., targets[index], distanceToTarget, ..&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Oct 2013 16:09:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-enumerate-through-a-polyline/m-p/499606#M13411</guid>
      <dc:creator>MichaelEber</dc:creator>
      <dc:date>2013-10-10T16:09:20Z</dc:date>
    </item>
    <item>
      <title>Re: how to enumerate through a Polyline</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-enumerate-through-a-polyline/m-p/499607#M13412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Maybe I'm missing something but IPolyline has a Length property that returns the length of the line.&amp;nbsp; Is this not what you're looking for?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Oct 2013 16:12:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-enumerate-through-a-polyline/m-p/499607#M13412</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2013-10-10T16:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: how to enumerate through a Polyline</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-enumerate-through-a-polyline/m-p/499608#M13413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The length of the polyline depends on the coordinate system distortion.&amp;nbsp; The length reported is the length in that coordinate system with distortion, not the length along a geodetic great circle.&amp;nbsp; Use the wrong coordinate system a path of 200kM becomes 300...&amp;nbsp; Assuming the distance is large enough to make a difference, to get real length you nee a geodesic operation.&amp;nbsp; IGeoPolyline exists in 10.1 as part of defenseSolutions library.&amp;nbsp; The polyline has a ISegmentCollention interface which has an enumSegments.&amp;nbsp;&amp;nbsp; Segments have a from and to point...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Oct 2013 16:25:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-enumerate-through-a-polyline/m-p/499608#M13413</guid>
      <dc:creator>AlexanderGray</dc:creator>
      <dc:date>2013-10-10T16:25:17Z</dc:date>
    </item>
    <item>
      <title>Re: how to enumerate through a Polyline</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-enumerate-through-a-polyline/m-p/499609#M13414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;The length of the polyline depends on the coordinate system distortion.&amp;nbsp; The length reported is the length in that coordinate system with distortion, not the length along a geodetic great circle.&amp;nbsp; Use the wrong coordinate system a path of 200kM becomes 300...&amp;nbsp; Assuming the distance is large enough to make a difference, to get real length you nee a geodesic operation.&amp;nbsp; IGeoPolyline exists in 10.1 as part of defenseSolutions library.&amp;nbsp; The polyline has a ISegmentCollention interface which has an enumSegments.&amp;nbsp;&amp;nbsp; Segments have a from and to point...&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I thought they dropped support for Defense Solutions with 10.1.&amp;nbsp; At least that is what I gathered from all of the mixed messages coming out of ESRI.&amp;nbsp; But if I can use this, what do I call to get an IGeoPolyline?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Oct 2013 16:37:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-enumerate-through-a-polyline/m-p/499609#M13414</guid>
      <dc:creator>MichaelEber</dc:creator>
      <dc:date>2013-10-10T16:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: how to enumerate through a Polyline</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-enumerate-through-a-polyline/m-p/499610#M13415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Maybe I'm missing something but IPolyline has a Length property that returns the length of the line.&amp;nbsp; Is this not what you're looking for?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The documentation for Polyline only lists a ton of interfaces.&amp;nbsp; It does not show a property of length in the SDK!&amp;nbsp; And since we are under a tight schedule I do not want to write a ton of code only to find I've gone down a wrong path.&amp;nbsp; So lot's of questions at this moment.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Oct 2013 16:39:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-enumerate-through-a-polyline/m-p/499610#M13415</guid>
      <dc:creator>MichaelEber</dc:creator>
      <dc:date>2013-10-10T16:39:45Z</dc:date>
    </item>
    <item>
      <title>Re: how to enumerate through a Polyline</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-enumerate-through-a-polyline/m-p/499611#M13416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;The documentation for Polyline only lists a ton of interfaces.&amp;nbsp; It does not show a property of length in the SDK!&amp;nbsp; And since we are under a tight schedule I do not want to write a ton of code only to find I've gone down a wrong path.&amp;nbsp; So lot's of questions at this moment.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Neil said the IPolyline had a length field, not Polyline.&amp;nbsp; IPolyline is an interface on Polyline.&amp;nbsp; PolylineClass has about 50 interfaces and 5 or 6 of which I regularly use.&amp;nbsp;&amp;nbsp; Reading the documentation is much more efficient than writing a ton of code, but you have to spend the time up front to understand this difficult API...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Oct 2013 16:49:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-enumerate-through-a-polyline/m-p/499611#M13416</guid>
      <dc:creator>AlexanderGray</dc:creator>
      <dc:date>2013-10-10T16:49:50Z</dc:date>
    </item>
  </channel>
</rss>

