<?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: ImmutablePart::getEndPoint doesn’t return the last point in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/immutablepart-getendpoint-doesn-t-return-the-last/m-p/358743#M2335</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Henrik - I'm assuming you have got your ImmutablePart from a Polyline? I can repro that bug as you described. If you get the ImmutablePart from a Polygon, then you should find that the ImmutablePart.getEndPoint is the same as the last Point from ImmutablePart.getPoint(i). (I just double-checked the Segments and in both cases I find Segment.StartPoint and SegmentEndPoint are returning the&amp;nbsp;expected Points.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for finding and reporting this, I will enter this as an issue for us to address.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Shelly&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Feb 2017 10:17:42 GMT</pubDate>
    <dc:creator>ShellyGill1</dc:creator>
    <dc:date>2017-02-17T10:17:42Z</dc:date>
    <item>
      <title>ImmutablePart::getEndPoint doesn’t return the last point</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/immutablepart-getendpoint-doesn-t-return-the-last/m-p/358741#M2333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The last point when iterating over the points in an ImmutablePart is not the point returned in getEndPoint() on that same ImmutablePart. See my example below. Why is that? I'm on ArcGIS Runtime for Android 100.0.0.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;private void partTest(ImmutablePart part) {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;for (int i = 0; i &amp;lt; part.getPointCount(); i++) {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Point p = part.getPoint(i);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;System.out.println(i + " - " + p.getX() + ", " + p.getY());&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Point startPoint = part.getStartPoint();&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;System.out.println("Start point - " + startPoint.getX() + ", " + startPoint.getY());&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Point endPoint = part.getEndPoint();&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;System.out.println("End point - " + endPoint.getX() + ", " + endPoint.getY());&lt;BR /&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Printouts when running the above with a ImmutablePart over Stockholm:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;I/System.out: 0 - 2000955.7131845958, 8217577.284820005&lt;BR /&gt;I/System.out: 1 - 1989299.2266646507, 8248738.619869451&lt;BR /&gt;I/System.out: 2 - 2011153.6917361675, 8252952.245694454&lt;BR /&gt;I/System.out: Start point - 2000955.7131845958, 8217577.284820005&lt;BR /&gt;I/System.out: End point - 1989299.2266646507, 8248738.619869451&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Henrik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Feb 2017 12:10:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/immutablepart-getendpoint-doesn-t-return-the-last/m-p/358741#M2333</guid>
      <dc:creator>HenrikPierrou</dc:creator>
      <dc:date>2017-02-16T12:10:16Z</dc:date>
    </item>
    <item>
      <title>Re: ImmutablePart::getEndPoint doesn’t return the last point</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/immutablepart-getendpoint-doesn-t-return-the-last/m-p/358742#M2334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I found&amp;nbsp;the problem. In the current version of the runtime the index of the last point in an ImmutablePart is calculated based on the number of segments instead of the number of points. In the decompiled ImmutablePart, the getEndPoint method looks like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;public Point getEndPoint() {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;if(this.mEndPoint == null &amp;amp;&amp;amp; !this.isEmpty()) {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;this.mEndPoint = Point.createFromInternal(this.mCoreImmutablePart.b((long)(this.size() - 1)));&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;return this.mEndPoint;&lt;BR /&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Instead of “this.size() - 1”, I guess it should be “this.getPointCount() - 1”&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Feb 2017 13:17:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/immutablepart-getendpoint-doesn-t-return-the-last/m-p/358742#M2334</guid>
      <dc:creator>HenrikPierrou</dc:creator>
      <dc:date>2017-02-16T13:17:35Z</dc:date>
    </item>
    <item>
      <title>Re: ImmutablePart::getEndPoint doesn’t return the last point</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/immutablepart-getendpoint-doesn-t-return-the-last/m-p/358743#M2335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Henrik - I'm assuming you have got your ImmutablePart from a Polyline? I can repro that bug as you described. If you get the ImmutablePart from a Polygon, then you should find that the ImmutablePart.getEndPoint is the same as the last Point from ImmutablePart.getPoint(i). (I just double-checked the Segments and in both cases I find Segment.StartPoint and SegmentEndPoint are returning the&amp;nbsp;expected Points.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for finding and reporting this, I will enter this as an issue for us to address.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Shelly&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Feb 2017 10:17:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/immutablepart-getendpoint-doesn-t-return-the-last/m-p/358743#M2335</guid>
      <dc:creator>ShellyGill1</dc:creator>
      <dc:date>2017-02-17T10:17:42Z</dc:date>
    </item>
    <item>
      <title>Re: ImmutablePart::getEndPoint doesn’t return the last point</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/immutablepart-getendpoint-doesn-t-return-the-last/m-p/358744#M2336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great, thank you Shelly!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Henrik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Feb 2017 14:26:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/immutablepart-getendpoint-doesn-t-return-the-last/m-p/358744#M2336</guid>
      <dc:creator>HenrikPierrou</dc:creator>
      <dc:date>2017-02-17T14:26:05Z</dc:date>
    </item>
  </channel>
</rss>

