<?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: Displaying the ratio scale of a map in Java Maps SDK Questions</title>
    <link>https://community.esri.com/t5/java-maps-sdk-questions/displaying-the-ratio-scale-of-a-map/m-p/290409#M848</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jon,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We already have implemented a tool to measure distances using &lt;A href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fdevelopers.arcgis.com%2Fjava%2Flatest%2Fapi-reference%2Freference%2Fcom%2Fesri%2Farcgisruntime%2Fgeometry%2FGeometryEngine.html%23distanceGeodetic%28com.esri.arcgisruntime.geometry.Point%2Ccom.esri.arcgisruntime.geometry.Point%2Ccom.esri.arcgisruntime.geometry.LinearUnit%2Ccom.esri.arcgisruntime.geometry.AngularUnit%2Ccom.esri.arcgisruntime.geometry.GeodeticCurveType%29" rel="nofollow" target="_blank"&gt;GeometryEngine.distanceGeodetic()&lt;/A&gt; and it has been working as intended at any scale since the beginning, so no issues with that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We also performed some tests with the ScaleBar from the Java Toolkit &lt;A class="link-titled" href="https://github.com/Esri/arcgis-runtime-toolkit-java" title="https://github.com/Esri/arcgis-runtime-toolkit-java"&gt;GitHub - Esri/arcgis-runtime-toolkit-java: Runtime Java SE toolkit&lt;/A&gt; and no issues with that either.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that the scale ratio returned by ArcGIS does not reflect what's displayed on the screen.&amp;nbsp; When they select 1:10000, our users are expecting that the ratio on the screen is very close to 1:10000 (like if they were looking a printed map), not 1:12387 or something like that.&amp;nbsp; How can we do this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Mar 2020 15:44:01 GMT</pubDate>
    <dc:creator>MartinBoulanger</dc:creator>
    <dc:date>2020-03-23T15:44:01Z</dc:date>
    <item>
      <title>Displaying the ratio scale of a map</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/displaying-the-ratio-scale-of-a-map/m-p/290403#M842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to get the scale of a simple base map.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #0000ff; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ArcGISMap map = new ArcGISMap(SpatialReferences.getWebMercator());&lt;/EM&gt;&lt;BR /&gt;&lt;EM style="color: #0000ff; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.setBasemap(Basemap.createImagery());&lt;/EM&gt;&lt;BR /&gt;&lt;EM style="color: #0000ff; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.setMaxScale(MAX_DISPLAYABLE_SCALE);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #0000ff; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MapView mapView = new MapView();&lt;/EM&gt;&lt;BR /&gt;&lt;EM style="color: #0000ff; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mapView.setMap(map);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The scale returned by the following code seems to be inaccurate and I cannot figure out why.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #0000ff; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mapview.addMapScaleChangedListener(scale-&amp;gt;System.out.println(scale.getSource().getMapScale()));&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using this code: &lt;A class="link-titled" href="https://github.com/Esri/arcgis-runtime-toolkit-java" title="https://github.com/Esri/arcgis-runtime-toolkit-java"&gt;GitHub - Esri/arcgis-runtime-toolkit-java: Runtime Java SE toolkit&lt;/A&gt;, I was able to display a scale bar which seems to be of the right length.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I doing something wrong?&amp;nbsp; Did I forget something?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Mar 2020 17:09:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/displaying-the-ratio-scale-of-a-map/m-p/290403#M842</guid>
      <dc:creator>MartinBoulanger</dc:creator>
      <dc:date>2020-03-02T17:09:32Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying the ratio scale of a map</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/displaying-the-ratio-scale-of-a-map/m-p/290404#M843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Martin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would you be able to share some details regarding the inaccuracy you are observing in the return values of &lt;EM style="color: #0000ff;"&gt;.getMapScale()&lt;/EM&gt;&lt;EM&gt; &lt;/EM&gt;? This might help us better understand the issue and offer some more focused support.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Mar 2020 23:11:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/displaying-the-ratio-scale-of-a-map/m-p/290404#M843</guid>
      <dc:creator>JonL</dc:creator>
      <dc:date>2020-03-05T23:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying the ratio scale of a map</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/displaying-the-ratio-scale-of-a-map/m-p/290405#M844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jonathan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the quick reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first thing I did was to measure the length of some real world object using Google Map measuring tool.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Measuring a distance with Google Map" class="jive-emoji image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/484405_image-2020-03-03-10-23-50-051.png" /&gt;&lt;/P&gt;&lt;P&gt;Then I measured that same object on my screen (in my application developed using ArcGIS Java SDK), using the scale to calculate the real world distance.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/484415_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;As you can see the result is off by more than a 123 meters.&amp;nbsp; The scale returned by ArcGÌS does not seem to be accurate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Mar 2020 13:34:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/displaying-the-ratio-scale-of-a-map/m-p/290405#M844</guid>
      <dc:creator>MartinBoulanger</dc:creator>
      <dc:date>2020-03-07T13:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying the ratio scale of a map</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/displaying-the-ratio-scale-of-a-map/m-p/290406#M845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Martin, &lt;/P&gt;&lt;P&gt;an you clarify how you "measured that same object on my screen". Did you try creating and measuring a Line Graphic in the GraphicOverlay, or measure a distance with the GeometryEngine?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Gayle.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Mar 2020 16:42:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/displaying-the-ratio-scale-of-a-map/m-p/290406#M845</guid>
      <dc:creator>GayleYoung</dc:creator>
      <dc:date>2020-03-09T16:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying the ratio scale of a map</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/displaying-the-ratio-scale-of-a-map/m-p/290407#M846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gayle,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I basically did the same thing as you would do with any map, I physically measured the distance between two points on the map with a ruler (using a popular photo editing software to be more precise).&amp;nbsp; This gave me 12.33 cm as shown on the screenshot in my previous message.&amp;nbsp; I was then able to estimate the real distance by multiplying this by the scale ratio returned by ArcGIS.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Our users want the scale ratio displayed on the map and to be able to "jump" to specific ratio (1:10000, 1:50000, 1:100000, ...).&amp;nbsp; How can I achieve this?&amp;nbsp; Is the ratio published by ArcGIS reliable?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2020 12:03:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/displaying-the-ratio-scale-of-a-map/m-p/290407#M846</guid>
      <dc:creator>MartinBoulanger</dc:creator>
      <dc:date>2020-03-20T12:03:35Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying the ratio scale of a map</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/displaying-the-ratio-scale-of-a-map/m-p/290408#M847</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Martin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The best way to measure distances using the API is with &lt;A href="https://developers.arcgis.com/java/latest/api-reference/reference/com/esri/arcgisruntime/geometry/GeometryEngine.html#distanceGeodetic(com.esri.arcgisruntime.geometry.Point,com.esri.arcgisruntime.geometry.Point,com.esri.arcgisruntime.geometry.LinearUnit,com.esri.arcgisruntime.geometry.AngularUnit,com.esri.arcgisruntime.geometry.GeodeticCurveType)"&gt;GeometryEngine.distanceGeodetic()&lt;/A&gt; or &lt;A href="https://developers.arcgis.com/java/latest/api-reference/reference/com/esri/arcgisruntime/geometry/GeometryEngine.html#lengthGeodetic(com.esri.arcgisruntime.geometry.Geometry,com.esri.arcgisruntime.geometry.LinearUnit,com.esri.arcgisruntime.geometry.GeodeticCurveType)"&gt;GeometryEngine.lengthGeodetic()&lt;/A&gt;, as that will take into accound the map's spatial reference correctly.&lt;/P&gt;&lt;P&gt;We've double checked, and the distances returned by this method are correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For setting the viewpoint to a specific scale, you could use &lt;A class="link-titled" href="https://developers.arcgis.com/java/latest/api-reference/reference/com/esri/arcgisruntime/mapping/view/MapView.html#setViewpointScaleAsync(double)" title="https://developers.arcgis.com/java/latest/api-reference/reference/com/esri/arcgisruntime/mapping/view/MapView.html#setViewpointScaleAsync(double)"&gt;MapView.setViewpointScaleAsync(double)&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or &lt;A class="link-titled" href="https://developers.arcgis.com/java/latest/api-reference/reference/com/esri/arcgisruntime/mapping/view/MapView.html#setViewpointCenterAsync(com.esri.arcgisruntime.geometry.Point,double)" title="https://developers.arcgis.com/java/latest/api-reference/reference/com/esri/arcgisruntime/mapping/view/MapView.html#setViewpointCenterAsync(com.esri.arcgisruntime.geometry.Point,double)"&gt;.setViewpointCenterAsync(Point,double)&lt;/A&gt; .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let us know if this works well for you, or if you have any other questions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Mar 2020 10:46:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/displaying-the-ratio-scale-of-a-map/m-p/290408#M847</guid>
      <dc:creator>JonL</dc:creator>
      <dc:date>2020-03-23T10:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying the ratio scale of a map</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/displaying-the-ratio-scale-of-a-map/m-p/290409#M848</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jon,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We already have implemented a tool to measure distances using &lt;A href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fdevelopers.arcgis.com%2Fjava%2Flatest%2Fapi-reference%2Freference%2Fcom%2Fesri%2Farcgisruntime%2Fgeometry%2FGeometryEngine.html%23distanceGeodetic%28com.esri.arcgisruntime.geometry.Point%2Ccom.esri.arcgisruntime.geometry.Point%2Ccom.esri.arcgisruntime.geometry.LinearUnit%2Ccom.esri.arcgisruntime.geometry.AngularUnit%2Ccom.esri.arcgisruntime.geometry.GeodeticCurveType%29" rel="nofollow" target="_blank"&gt;GeometryEngine.distanceGeodetic()&lt;/A&gt; and it has been working as intended at any scale since the beginning, so no issues with that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We also performed some tests with the ScaleBar from the Java Toolkit &lt;A class="link-titled" href="https://github.com/Esri/arcgis-runtime-toolkit-java" title="https://github.com/Esri/arcgis-runtime-toolkit-java"&gt;GitHub - Esri/arcgis-runtime-toolkit-java: Runtime Java SE toolkit&lt;/A&gt; and no issues with that either.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that the scale ratio returned by ArcGIS does not reflect what's displayed on the screen.&amp;nbsp; When they select 1:10000, our users are expecting that the ratio on the screen is very close to 1:10000 (like if they were looking a printed map), not 1:12387 or something like that.&amp;nbsp; How can we do this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Mar 2020 15:44:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/displaying-the-ratio-scale-of-a-map/m-p/290409#M848</guid>
      <dc:creator>MartinBoulanger</dc:creator>
      <dc:date>2020-03-23T15:44:01Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying the ratio scale of a map</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/displaying-the-ratio-scale-of-a-map/m-p/290410#M849</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the detail Martin. We are trying to understand the problem. Is it that&lt;/P&gt;&lt;P&gt;1) the user selects 1:10000 and getScale returns, for example, 1:12387. If so, can you confirm which calls you make to allow the user to select scale. Is the method as in your original post using &lt;EM style="color: #0000ff;"&gt;map.setMaxScale(MAX_DISPLAYABLE_SCALE); &lt;/EM&gt;or is it using &lt;A class="" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fdevelopers.arcgis.com%2Fjava%2Flatest%2Fapi-reference%2Freference%2Fcom%2Fesri%2Farcgisruntime%2Fmapping%2Fview%2FMapView.html%23setViewpointScaleAsync%28double%29" rel="nofollow" target="_blank"&gt;MapView.setViewpointScaleAsync(double)&lt;/A&gt;&amp;nbsp;suggested above, or similar?&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;2) that the scale return by getScale does not now seem accurate even when you measure using &lt;A href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fdevelopers.arcgis.com%2Fjava%2Flatest%2Fapi-reference%2Freference%2Fcom%2Fesri%2Farcgisruntime%2Fgeometry%2FGeometryEngine.html%23distanceGeodetic%28com.esri.arcgisruntime.geometry.Point%2Ccom.esri.arcgisruntime.geometry.Point%2Ccom.esri.arcgisruntime.geometry.LinearUnit%2Ccom.esri.arcgisruntime.geometry.AngularUnit%2Ccom.esri.arcgisruntime.geometry.GeodeticCurveType%29" rel="nofollow" target="_blank"&gt;GeometryEngine.distanceGeodetic()&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Mar 2020 09:51:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/displaying-the-ratio-scale-of-a-map/m-p/290410#M849</guid>
      <dc:creator>GayleYoung</dc:creator>
      <dc:date>2020-03-24T09:51:17Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying the ratio scale of a map</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/displaying-the-ratio-scale-of-a-map/m-p/290411#M850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's more like:&lt;/P&gt;&lt;P&gt;3) That the scale returned by getScale does not seem to be accurate with what's physically displayed on the screen.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;For example:&lt;/P&gt;&lt;P&gt;-We know that the length of a bridge is 1km in the "real world"&lt;/P&gt;&lt;P&gt;-The bridge is displayed in ArcGIS and getMapScale() gives us a scale of 1:10000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Knowing that, the length of the bridge displayed on the computer screen should be 1km/10000=0.0001km=10cm&lt;BR /&gt;But it's not the case, we get something closer to 13 or 14 cm.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Of course, GeometryEngine.distanceGeodetic() will always return the right distance, but the use case here is to display the current scale ratio accurately, like on "standard paper" map.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Mar 2020 13:39:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/displaying-the-ratio-scale-of-a-map/m-p/290411#M850</guid>
      <dc:creator>MartinBoulanger</dc:creator>
      <dc:date>2020-03-24T13:39:43Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying the ratio scale of a map</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/displaying-the-ratio-scale-of-a-map/m-p/1330899#M2792</link>
      <description>&lt;P&gt;Hi, we are trying to do the same thing.&amp;nbsp; Is there a solution for this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2023 01:07:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/displaying-the-ratio-scale-of-a-map/m-p/1330899#M2792</guid>
      <dc:creator>FayGlunt</dc:creator>
      <dc:date>2023-09-21T01:07:52Z</dc:date>
    </item>
  </channel>
</rss>

