<?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 Scaling Gameobjects to N meters in ArcGIS Maps SDK for Unity Questions</title>
    <link>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/scaling-gameobjects-to-n-meters/m-p/1265657#M466</link>
    <description>&lt;P&gt;This feels like a simple question, but I just want to clarify the relationship between ArcGIS distance and Unity's unit system.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Problem:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I want to scale a cylinder to N meters (for instance set its diameter to 100 meters)&lt;/P&gt;&lt;P&gt;In this example, I'm scaling a circle to 100 on the x and z-axis.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="alex_p_1-1678301030290.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/64725iC629480D1C0CF5D8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="alex_p_1-1678301030290.png" alt="alex_p_1-1678301030290.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;alex_p_1-1678301030290.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;For the circle's radius (as illustrated by the red line) I would expect a distance of 50 meters (if the unit system is using meters as default)&lt;/P&gt;&lt;P&gt;Using the following code:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;    void Start()
    {
        var map = GameObject.Find("ArcGISMap").GetComponent&amp;lt;ArcGISMapComponent&amp;gt;();

        var center = CoordinatesUtility.UnityWorldToCoordinates(centerPoint.position, map).ToArcGISPoint();
        var right = CoordinatesUtility.UnityWorldToCoordinates(rightPoint.position, map).ToArcGISPoint();

        ArcGISAngularUnitId unitDegree = (ArcGISAngularUnitId)9102;

        var simpleDistance = ArcGISGeometryEngine.Distance(center, right);
        
        Debug.LogError($"ArcGISGeometryEngine.Distance = {simpleDistance}");
        
        var distance = ArcGISGeometryEngine.DistanceGeodetic(center, right,
            new ArcGISLinearUnit(ArcGISLinearUnitId.Meters),
            new ArcGISAngularUnit(unitDegree), ArcGISGeodeticCurveType.Geodesic).Distance;

        Debug.Log($"ArcGISGeometryEngine.DistanceGeodetic = {distance}");
    }
}&lt;/LI-CODE&gt;&lt;P&gt;I get the following results:&lt;/P&gt;&lt;P&gt;ArcGISGeometryEngine.Distance =&amp;nbsp;0.000449157642059106&lt;/P&gt;&lt;P&gt;ArcGISGeometryEngine.DistanceGeodetic = 49.913152025082&lt;/P&gt;&lt;P&gt;So unless I'm mistaken it looks like the default unit system is in meters. Is this correct?&lt;/P&gt;&lt;P&gt;Also, why do I get such a weird value for&amp;nbsp;ArcGISGeometryEngine.Distance? Is it due to the spatial reference? The origin is using 4326 and the map type is local. The &lt;A href="https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer" target="_self"&gt;base map&lt;/A&gt; I believe is in&amp;nbsp;&lt;SPAN&gt;3857.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 08 Mar 2023 19:09:40 GMT</pubDate>
    <dc:creator>alex_p</dc:creator>
    <dc:date>2023-03-08T19:09:40Z</dc:date>
    <item>
      <title>Scaling Gameobjects to N meters</title>
      <link>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/scaling-gameobjects-to-n-meters/m-p/1265657#M466</link>
      <description>&lt;P&gt;This feels like a simple question, but I just want to clarify the relationship between ArcGIS distance and Unity's unit system.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Problem:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I want to scale a cylinder to N meters (for instance set its diameter to 100 meters)&lt;/P&gt;&lt;P&gt;In this example, I'm scaling a circle to 100 on the x and z-axis.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="alex_p_1-1678301030290.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/64725iC629480D1C0CF5D8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="alex_p_1-1678301030290.png" alt="alex_p_1-1678301030290.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;alex_p_1-1678301030290.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;For the circle's radius (as illustrated by the red line) I would expect a distance of 50 meters (if the unit system is using meters as default)&lt;/P&gt;&lt;P&gt;Using the following code:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;    void Start()
    {
        var map = GameObject.Find("ArcGISMap").GetComponent&amp;lt;ArcGISMapComponent&amp;gt;();

        var center = CoordinatesUtility.UnityWorldToCoordinates(centerPoint.position, map).ToArcGISPoint();
        var right = CoordinatesUtility.UnityWorldToCoordinates(rightPoint.position, map).ToArcGISPoint();

        ArcGISAngularUnitId unitDegree = (ArcGISAngularUnitId)9102;

        var simpleDistance = ArcGISGeometryEngine.Distance(center, right);
        
        Debug.LogError($"ArcGISGeometryEngine.Distance = {simpleDistance}");
        
        var distance = ArcGISGeometryEngine.DistanceGeodetic(center, right,
            new ArcGISLinearUnit(ArcGISLinearUnitId.Meters),
            new ArcGISAngularUnit(unitDegree), ArcGISGeodeticCurveType.Geodesic).Distance;

        Debug.Log($"ArcGISGeometryEngine.DistanceGeodetic = {distance}");
    }
}&lt;/LI-CODE&gt;&lt;P&gt;I get the following results:&lt;/P&gt;&lt;P&gt;ArcGISGeometryEngine.Distance =&amp;nbsp;0.000449157642059106&lt;/P&gt;&lt;P&gt;ArcGISGeometryEngine.DistanceGeodetic = 49.913152025082&lt;/P&gt;&lt;P&gt;So unless I'm mistaken it looks like the default unit system is in meters. Is this correct?&lt;/P&gt;&lt;P&gt;Also, why do I get such a weird value for&amp;nbsp;ArcGISGeometryEngine.Distance? Is it due to the spatial reference? The origin is using 4326 and the map type is local. The &lt;A href="https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer" target="_self"&gt;base map&lt;/A&gt; I believe is in&amp;nbsp;&lt;SPAN&gt;3857.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2023 19:09:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/scaling-gameobjects-to-n-meters/m-p/1265657#M466</guid>
      <dc:creator>alex_p</dc:creator>
      <dc:date>2023-03-08T19:09:40Z</dc:date>
    </item>
  </channel>
</rss>

