<?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 Error saving with getGeometry().toJson() in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/error-saving-with-getgeometry-tojson/m-p/1541302#M6242</link>
    <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I'm working on an app that d&lt;SPAN&gt;isplay nautical charts; i'm using a polyline to represent a "route". This route can be save in the phone as json file. To do this, i use&amp;nbsp;&lt;STRONG&gt;pathRoute.getGeometry().toJson().&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;As you can seee in the video, the route has 4 points, however, when i save the "route", it saves a lots of points in the json file. Why this's happening?&lt;/P&gt;&lt;P&gt;The nautical charts that i'm using is in 2 million scale.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your support.&lt;/P&gt;&lt;P&gt;Ma Eugenia&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;div class="lia-vid-container video-embed-center"&gt;&lt;div id="lia-vid-6362343615112w178h400r848" class="lia-video-brightcove-player-container"&gt;&lt;video-js data-video-id="6362343615112" data-account="6161463677001" data-player="default" data-embed="default" class="vjs-fluid" controls="" data-application-id="" style="width: 100%; height: 100%;"&gt;&lt;/video-js&gt;&lt;/div&gt;&lt;script src="https://players.brightcove.net/6161463677001/default_default/index.min.js"&gt;&lt;/script&gt;&lt;script&gt;(function() {  var wrapper = document.getElementById('lia-vid-6362343615112w178h400r848');  var videoEl = wrapper ? wrapper.querySelector('video-js') : null;  if (videoEl) {     if (window.videojs) {       window.videojs(videoEl).ready(function() {         this.on('loadedmetadata', function() {           this.el().querySelectorAll('.vjs-load-progress div[data-start]').forEach(function(bar) {             bar.setAttribute('role', 'presentation');             bar.setAttribute('aria-hidden', 'true');           });         });       });     }  }})();&lt;/script&gt;&lt;a class="video-embed-link" href="https://community.esri.com/t5/video/gallerypage/video-id/6362343615112"&gt;(view in My Videos)&lt;/a&gt;&lt;/div&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 23 Sep 2024 13:09:41 GMT</pubDate>
    <dc:creator>MaríaBencomo</dc:creator>
    <dc:date>2024-09-23T13:09:41Z</dc:date>
    <item>
      <title>Error saving with getGeometry().toJson()</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/error-saving-with-getgeometry-tojson/m-p/1541302#M6242</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I'm working on an app that d&lt;SPAN&gt;isplay nautical charts; i'm using a polyline to represent a "route". This route can be save in the phone as json file. To do this, i use&amp;nbsp;&lt;STRONG&gt;pathRoute.getGeometry().toJson().&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;As you can seee in the video, the route has 4 points, however, when i save the "route", it saves a lots of points in the json file. Why this's happening?&lt;/P&gt;&lt;P&gt;The nautical charts that i'm using is in 2 million scale.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your support.&lt;/P&gt;&lt;P&gt;Ma Eugenia&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;div class="lia-vid-container video-embed-center"&gt;&lt;div id="lia-vid-6362343615112w178h400r941" class="lia-video-brightcove-player-container"&gt;&lt;video-js data-video-id="6362343615112" data-account="6161463677001" data-player="default" data-embed="default" class="vjs-fluid" controls="" data-application-id="" style="width: 100%; height: 100%;"&gt;&lt;/video-js&gt;&lt;/div&gt;&lt;script src="https://players.brightcove.net/6161463677001/default_default/index.min.js"&gt;&lt;/script&gt;&lt;script&gt;(function() {  var wrapper = document.getElementById('lia-vid-6362343615112w178h400r941');  var videoEl = wrapper ? wrapper.querySelector('video-js') : null;  if (videoEl) {     if (window.videojs) {       window.videojs(videoEl).ready(function() {         this.on('loadedmetadata', function() {           this.el().querySelectorAll('.vjs-load-progress div[data-start]').forEach(function(bar) {             bar.setAttribute('role', 'presentation');             bar.setAttribute('aria-hidden', 'true');           });         });       });     }  }})();&lt;/script&gt;&lt;a class="video-embed-link" href="https://community.esri.com/t5/video/gallerypage/video-id/6362343615112"&gt;(view in My Videos)&lt;/a&gt;&lt;/div&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2024 13:09:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/error-saving-with-getgeometry-tojson/m-p/1541302#M6242</guid>
      <dc:creator>MaríaBencomo</dc:creator>
      <dc:date>2024-09-23T13:09:41Z</dc:date>
    </item>
    <item>
      <title>Re: Error saving with getGeometry().toJson()</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/error-saving-with-getgeometry-tojson/m-p/1542002#M6244</link>
      <description>&lt;P&gt;I assume the route is being drawn using your own custom code and stored as a Graphic (the pathRoute above looks like a &lt;STRONG&gt;&lt;A href="https://developers.arcgis.com/android/api-reference/reference/com/esri/arcgisruntime/mapping/GeoElement.html" target="_self"&gt;GeoElement&lt;/A&gt;&lt;/STRONG&gt; of some sort - can you confirm if it's a Graphic or a Feature, though it shouldn't make a difference).&lt;/P&gt;
&lt;P&gt;It looks like sometime between tapping the 4 points and writing it out to JSON, it is being densified somehow. Do you have any code that calls &lt;STRONG&gt;&lt;A href="https://developers.arcgis.com/android/api-reference/reference/com/esri/arcgisruntime/geometry/GeometryEngine.html#densify(com.esri.arcgisruntime.geometry.Geometry,double)" target="_self"&gt;GeometryEngine.densify()&lt;/A&gt;&lt;/STRONG&gt; or &lt;STRONG&gt;&lt;A href="https://developers.arcgis.com/android/api-reference/reference/com/esri/arcgisruntime/geometry/GeometryEngine.html#densifyGeodetic(com.esri.arcgisruntime.geometry.Geometry,double,com.esri.arcgisruntime.geometry.LinearUnit,com.esri.arcgisruntime.geometry.GeodeticCurveType)" target="_self"&gt;.densifyGeodetic()&lt;/A&gt;&lt;/STRONG&gt;?&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2024 15:52:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/error-saving-with-getgeometry-tojson/m-p/1542002#M6244</guid>
      <dc:creator>Nicholas-Furness</dc:creator>
      <dc:date>2024-09-24T15:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: Error saving with getGeometry().toJson()</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/error-saving-with-getgeometry-tojson/m-p/1542080#M6245</link>
      <description>&lt;P&gt;Hi Nicholas!&lt;/P&gt;&lt;P&gt;Yes, the route it's a graphic. I'm not using those method when i drawing the route; this how i do it.&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;public &lt;/SPAN&gt;&lt;SPAN&gt;Geometry &lt;/SPAN&gt;&lt;SPAN&gt;drawRoute&lt;/SPAN&gt;(&lt;SPAN&gt;ArrayList&lt;/SPAN&gt;&amp;lt;&lt;SPAN&gt;Point&lt;/SPAN&gt;&amp;gt; addPoint, &lt;SPAN&gt;int &lt;/SPAN&gt;value) {&lt;BR /&gt;    &lt;SPAN&gt;Geometry pathGeometry &lt;/SPAN&gt;= &lt;SPAN&gt;GeometryEngine&lt;/SPAN&gt;.&lt;SPAN&gt;densifyGeodetic&lt;/SPAN&gt;(&lt;SPAN&gt;new &lt;/SPAN&gt;Polyline(&lt;SPAN&gt;new &lt;/SPAN&gt;PointCollection(addPoint, &lt;SPAN&gt;SpatialReferences&lt;/SPAN&gt;.&lt;SPAN&gt;getWgs84&lt;/SPAN&gt;())), &lt;SPAN&gt;1.0d&lt;/SPAN&gt;, &lt;SPAN&gt;this&lt;/SPAN&gt;.&lt;SPAN&gt;mLinearUnit&lt;/SPAN&gt;, &lt;SPAN&gt;GeodeticCurveType&lt;/SPAN&gt;.&lt;SPAN&gt;GEODESIC&lt;/SPAN&gt;);&lt;BR /&gt;    &lt;SPAN&gt;pathRoute&lt;/SPAN&gt;.setGeometry(&lt;SPAN&gt;pathGeometry&lt;/SPAN&gt;);&lt;BR /&gt;    &lt;SPAN&gt;return &lt;/SPAN&gt;&lt;SPAN&gt;pathGeometry&lt;/SPAN&gt;;&lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2024 18:23:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/error-saving-with-getgeometry-tojson/m-p/1542080#M6245</guid>
      <dc:creator>MaríaBencomo</dc:creator>
      <dc:date>2024-09-24T18:23:59Z</dc:date>
    </item>
    <item>
      <title>Re: Error saving with getGeometry().toJson()</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/error-saving-with-getgeometry-tojson/m-p/1542131#M6246</link>
      <description>&lt;P&gt;Hi Nicholas.&lt;/P&gt;&lt;P&gt;I just changed&amp;nbsp;GeometryEngine.densifyGeodetic for &lt;STRONG&gt;GeometryEngine.densify&lt;/STRONG&gt;, and for a 4 point route it save in the json file 7 point...&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2024 19:11:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/error-saving-with-getgeometry-tojson/m-p/1542131#M6246</guid>
      <dc:creator>MaríaBencomo</dc:creator>
      <dc:date>2024-09-24T19:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: Error saving with getGeometry().toJson()</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/error-saving-with-getgeometry-tojson/m-p/1542232#M6247</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/558487"&gt;@MaríaBencomo&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Glad that improves things, but I'm curious why you're using densify at all. For straight-line segments you shouldn't need to. I could be missing a nuance of your use case though.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2024 22:16:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/error-saving-with-getgeometry-tojson/m-p/1542232#M6247</guid>
      <dc:creator>Nicholas-Furness</dc:creator>
      <dc:date>2024-09-24T22:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: Error saving with getGeometry().toJson()</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/error-saving-with-getgeometry-tojson/m-p/1542985#M6251</link>
      <description>&lt;P&gt;Hi Nicholas.&lt;/P&gt;&lt;P&gt;Now everything works fine. I set &lt;STRONG&gt;5.0d to maxSegmentLength&lt;/STRONG&gt;&amp;nbsp;and, now the amount of point in the json file is equal to the amount of point of the route.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Geometry pathGeometry &lt;/SPAN&gt;= &lt;SPAN&gt;GeometryEngine&lt;/SPAN&gt;.&lt;SPAN&gt;densify&lt;/SPAN&gt;(&lt;SPAN&gt;new &lt;/SPAN&gt;Polyline(&lt;SPAN&gt;new &lt;/SPAN&gt;PointCollection(addPoint)), &lt;SPAN&gt;5.0d&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2024 10:54:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/error-saving-with-getgeometry-tojson/m-p/1542985#M6251</guid>
      <dc:creator>MaríaBencomo</dc:creator>
      <dc:date>2024-09-26T10:54:46Z</dc:date>
    </item>
  </channel>
</rss>

