<?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: Get the point along a curve in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/get-the-point-along-a-curve/m-p/500197#M13437</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;For a curve, I want to get the point at a distance from the curve's start point.&amp;nbsp; A piece of code is below:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ICurve pCurve = (ICurve)feature.ShapeCopy;&amp;nbsp;&amp;nbsp; // feature is a IFeature&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IPoint startPoint = pCurve.FromPoint;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IPoint toPoint = pCurve.ToPoint;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; double distanceOnCurve = 0.4 * pCurve.Length;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; double offset = double.NaN;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bool isRightSide = false;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bool asRatio = false;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pCurve.QueryPointAndDistance(esriSegmentExtension.esriNoExtension, startPoint, asRatio, toPoint,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ref distanceOnCurve, ref offset, ref isRightSide);&lt;BR /&gt;But I don't know how the result be returned as a Point.&amp;nbsp; Appreciate in advance if you can provide a hint.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't think this is the method you want to use.&amp;nbsp; ToPoint is the output point that is positioned along the line at the closest location to the input point (startPoint).&amp;nbsp; Since the input point is your from point of the line, that is where the output point will be.&amp;nbsp; The distanceOnCurve value you are specifying is ignored, since that is an output parameter and will return position 0 for the first point in the line every time.&amp;nbsp; This method is used to find the distance along the line of the input point, so if you had a point that was at 40% down the line, you could use this method to determine that is in fact where the point was located.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If what you really want is to create a point that is at a position 40% down the curve's length from the line's beginning then you need to use the &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#//000w00000115000000"&gt;GetPoint method&lt;/A&gt;&lt;SPAN&gt;.&amp;nbsp; This will create a point anywhere along the line or on the projection of the line's end points.&amp;nbsp; So you can actually ask for positions extending beyond the end points of the line in addition to points that actually fall on the line.&amp;nbsp; This method will create an output point at the 40% position along your line, based on a ratio of the line length or an actual distance measured along the line.&amp;nbsp; So a distance along of 0.4 with the ratio flag set to true is the same as a distance along of 0.4 * pCurve.Length when the ratio flag is set to false.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Sep 2013 20:51:09 GMT</pubDate>
    <dc:creator>RichardFairhurst</dc:creator>
    <dc:date>2013-09-27T20:51:09Z</dc:date>
    <item>
      <title>Get the point along a curve</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/get-the-point-along-a-curve/m-p/500194#M13434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;For a curve, I want to get the point at a distance from the curve's start point.&amp;nbsp; A piece of code is below:&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;&amp;nbsp;&amp;nbsp; ICurve pCurve = (ICurve)feature.ShapeCopy;&amp;nbsp;&amp;nbsp; // feature is a IFeature&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;&amp;nbsp;&amp;nbsp; IPoint startPoint = pCurve.FromPoint;&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;&amp;nbsp;&amp;nbsp; IPoint toPoint = pCurve.ToPoint;&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;&amp;nbsp;&amp;nbsp; double distanceOnCurve = 0.4 * pCurve.Length;&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;&amp;nbsp;&amp;nbsp; double offset = double.NaN;&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;&amp;nbsp;&amp;nbsp; bool isRightSide = false;&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;&amp;nbsp;&amp;nbsp; bool asRatio = false;&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;&amp;nbsp;&amp;nbsp; pCurve.QueryPointAndDistance(esriSegmentExtension.esriNoExtension, startPoint, asRatio, toPoint,&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ref distanceOnCurve, ref offset, ref isRightSide);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But I don't know how the result be returned as a Point.&amp;nbsp; Appreciate in advance if you can provide a hint.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Sep 2013 16:24:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/get-the-point-along-a-curve/m-p/500194#M13434</guid>
      <dc:creator>ShaningYu</dc:creator>
      <dc:date>2013-09-27T16:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: Get the point along a curve - solved</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/get-the-point-along-a-curve/m-p/500195#M13435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The problem has been solved by the procedure below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1)&amp;nbsp; Define a curve (or a line) and get its FromPoint (and ToPoint).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2)&amp;nbsp; Break the curve (or line) to multiple points, as returned as &amp;lt;List&amp;gt;IPoint.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3)&amp;nbsp; Loop the List, and calculate the distance between FromPoint to the point in the List.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4)&amp;nbsp; If the distance calculated is below the allowed value (e.g. 0.1 or 0.2, or even smaller), return the result as this point.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your review my thread.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Sep 2013 17:59:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/get-the-point-along-a-curve/m-p/500195#M13435</guid>
      <dc:creator>ShaningYu</dc:creator>
      <dc:date>2013-09-27T17:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: Get the point along a curve</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/get-the-point-along-a-curve/m-p/500196#M13436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Did you try the method QueryPoint in ICurve? That may also work&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Sep 2013 19:10:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/get-the-point-along-a-curve/m-p/500196#M13436</guid>
      <dc:creator>HailiangShen</dc:creator>
      <dc:date>2013-09-27T19:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: Get the point along a curve</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/get-the-point-along-a-curve/m-p/500197#M13437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;For a curve, I want to get the point at a distance from the curve's start point.&amp;nbsp; A piece of code is below:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ICurve pCurve = (ICurve)feature.ShapeCopy;&amp;nbsp;&amp;nbsp; // feature is a IFeature&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IPoint startPoint = pCurve.FromPoint;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IPoint toPoint = pCurve.ToPoint;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; double distanceOnCurve = 0.4 * pCurve.Length;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; double offset = double.NaN;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bool isRightSide = false;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bool asRatio = false;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pCurve.QueryPointAndDistance(esriSegmentExtension.esriNoExtension, startPoint, asRatio, toPoint,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ref distanceOnCurve, ref offset, ref isRightSide);&lt;BR /&gt;But I don't know how the result be returned as a Point.&amp;nbsp; Appreciate in advance if you can provide a hint.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't think this is the method you want to use.&amp;nbsp; ToPoint is the output point that is positioned along the line at the closest location to the input point (startPoint).&amp;nbsp; Since the input point is your from point of the line, that is where the output point will be.&amp;nbsp; The distanceOnCurve value you are specifying is ignored, since that is an output parameter and will return position 0 for the first point in the line every time.&amp;nbsp; This method is used to find the distance along the line of the input point, so if you had a point that was at 40% down the line, you could use this method to determine that is in fact where the point was located.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If what you really want is to create a point that is at a position 40% down the curve's length from the line's beginning then you need to use the &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#//000w00000115000000"&gt;GetPoint method&lt;/A&gt;&lt;SPAN&gt;.&amp;nbsp; This will create a point anywhere along the line or on the projection of the line's end points.&amp;nbsp; So you can actually ask for positions extending beyond the end points of the line in addition to points that actually fall on the line.&amp;nbsp; This method will create an output point at the 40% position along your line, based on a ratio of the line length or an actual distance measured along the line.&amp;nbsp; So a distance along of 0.4 with the ratio flag set to true is the same as a distance along of 0.4 * pCurve.Length when the ratio flag is set to false.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Sep 2013 20:51:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/get-the-point-along-a-curve/m-p/500197#M13437</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2013-09-27T20:51:09Z</dc:date>
    </item>
  </channel>
</rss>

