<?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 Measure Distance is inaccurate in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/measure-distance-is-inaccurate/m-p/487010#M3345</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I made a scale bar for my android app using Line.calculateLength2D() and GeometryEngine.distance() (both return the same value), but the value returned does not match distances measured on a physical map using a scale nor google earth's measurements.&amp;nbsp; The points I used to measure were:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
Point bottomLeft = MapView.toMapPoint(0, MapView.getHeight());
Point bottomRight = MapView.toMapPoint(MapView.getWidth(), MapView.getHeight()); 
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also used MapView.getExtent() which gave the same result.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
Polygon extent = MapView.getExtent();
Point bottomLeft = extent.getPoint(0);
Point bottomRight = extent.getPoint(1); 
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was testing this with the world imagery tile service at zoom level 15.&amp;nbsp; I noticed that wherever I was on earth, the measurement of my screen width was ALWAYS 1032m.&amp;nbsp; I measured the real distance using google earth, and found that the real distance matches ArcGIS's calculateLength2D() value at the equator, but it gets progressively smaller as latitude increases.&amp;nbsp; On a hunch, I tried multiplying the calculateLength2D() value by the cosine of the latitude, and it worked.&amp;nbsp; The product matched google earth measurements at all latitudes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not sure if this is a bug or working as intended. What's the use of calculateLength2D() and distance() if their output is only valid at the equator?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 May 2014 13:14:44 GMT</pubDate>
    <dc:creator>MichaelBucari-Tovo</dc:creator>
    <dc:date>2014-05-21T13:14:44Z</dc:date>
    <item>
      <title>Measure Distance is inaccurate</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/measure-distance-is-inaccurate/m-p/487010#M3345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I made a scale bar for my android app using Line.calculateLength2D() and GeometryEngine.distance() (both return the same value), but the value returned does not match distances measured on a physical map using a scale nor google earth's measurements.&amp;nbsp; The points I used to measure were:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
Point bottomLeft = MapView.toMapPoint(0, MapView.getHeight());
Point bottomRight = MapView.toMapPoint(MapView.getWidth(), MapView.getHeight()); 
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also used MapView.getExtent() which gave the same result.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
Polygon extent = MapView.getExtent();
Point bottomLeft = extent.getPoint(0);
Point bottomRight = extent.getPoint(1); 
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was testing this with the world imagery tile service at zoom level 15.&amp;nbsp; I noticed that wherever I was on earth, the measurement of my screen width was ALWAYS 1032m.&amp;nbsp; I measured the real distance using google earth, and found that the real distance matches ArcGIS's calculateLength2D() value at the equator, but it gets progressively smaller as latitude increases.&amp;nbsp; On a hunch, I tried multiplying the calculateLength2D() value by the cosine of the latitude, and it worked.&amp;nbsp; The product matched google earth measurements at all latitudes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not sure if this is a bug or working as intended. What's the use of calculateLength2D() and distance() if their output is only valid at the equator?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 May 2014 13:14:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/measure-distance-is-inaccurate/m-p/487010#M3345</guid>
      <dc:creator>MichaelBucari-Tovo</dc:creator>
      <dc:date>2014-05-21T13:14:44Z</dc:date>
    </item>
    <item>
      <title>Re: Measure Distance is inaccurate</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/measure-distance-is-inaccurate/m-p/487011#M3346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I ran into same problem which is the distance being inaccurate. I live in Finland and it is roughly double the distance wrong - and indeed cos 62 is ~0.47. It would give roughly correct distance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It CAN'T be intended to work like this? I queried our local dealer and they should send it as a bug. Unless your article gets noticed here (it should)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Jul 2016 05:41:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/measure-distance-is-inaccurate/m-p/487011#M3346</guid>
      <dc:creator>TeroRönkkö</dc:creator>
      <dc:date>2016-07-24T05:41:21Z</dc:date>
    </item>
  </channel>
</rss>

