<?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 GeometryService LengthsAsync units not being respected. in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/geometryservice-lengthsasync-units-not-being/m-p/441110#M11437</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I seem to be having problems getting GeometryTask's LengthsAsync call to respect measurement units.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm currently building a measurement tool for a map viewer. The map I am working with right now is in 102100 Web Mercator. In the future, I will be projecting geometry into more suitable projections for doing measurement.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;No matter what I pass into LengthsAsync as my unit, I get back what appears to be meters. Why is this? &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Tasks.GeometryService~LengthsAsync(IList`1,Nullable`1,Boolean,Object).html" rel="nofollow noopener noreferrer" target="_blank"&gt;The documentation for LengthsAsync&lt;/A&gt;&lt;SPAN&gt; says:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;lengthUnit&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; The length unit in which perimeters of polygons will be calculated. If unit is not specified, the units are derived from the Spatial Reference of the geometry.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GeometryService geometryService = new GeometryService(GeometryServiceUri);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; geometryService.Failed += new EventHandler&amp;lt;TaskFailedEventArgs&amp;gt;(GeometryServiceMeasureSegment_Failed);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; geometryService.LengthsCompleted += new EventHandler&amp;lt;LengthsEventArgs&amp;gt;(GeometryServiceMeasureSegment_Completed);

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; geometryService.LengthsAsync(geometryToMeasure, CurrentLengthUnit, true, null);&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"CurrentLengthUnit" is a LinearUnit. Changing it between feet/kilometres/nautical miles/etc. has absolutely no effect on the resulting lengths.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is anybody able to shed some light on why this is? Does it have to do with the projection I'm currently using (102100)? Why is lengthUnit ignored?!?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 19:45:00 GMT</pubDate>
    <dc:creator>JasonScharf</dc:creator>
    <dc:date>2021-12-11T19:45:00Z</dc:date>
    <item>
      <title>GeometryService LengthsAsync units not being respected.</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/geometryservice-lengthsasync-units-not-being/m-p/441110#M11437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I seem to be having problems getting GeometryTask's LengthsAsync call to respect measurement units.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm currently building a measurement tool for a map viewer. The map I am working with right now is in 102100 Web Mercator. In the future, I will be projecting geometry into more suitable projections for doing measurement.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;No matter what I pass into LengthsAsync as my unit, I get back what appears to be meters. Why is this? &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Tasks.GeometryService~LengthsAsync(IList`1,Nullable`1,Boolean,Object).html" rel="nofollow noopener noreferrer" target="_blank"&gt;The documentation for LengthsAsync&lt;/A&gt;&lt;SPAN&gt; says:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;lengthUnit&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; The length unit in which perimeters of polygons will be calculated. If unit is not specified, the units are derived from the Spatial Reference of the geometry.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GeometryService geometryService = new GeometryService(GeometryServiceUri);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; geometryService.Failed += new EventHandler&amp;lt;TaskFailedEventArgs&amp;gt;(GeometryServiceMeasureSegment_Failed);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; geometryService.LengthsCompleted += new EventHandler&amp;lt;LengthsEventArgs&amp;gt;(GeometryServiceMeasureSegment_Completed);

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; geometryService.LengthsAsync(geometryToMeasure, CurrentLengthUnit, true, null);&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"CurrentLengthUnit" is a LinearUnit. Changing it between feet/kilometres/nautical miles/etc. has absolutely no effect on the resulting lengths.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is anybody able to shed some light on why this is? Does it have to do with the projection I'm currently using (102100)? Why is lengthUnit ignored?!?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:45:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/geometryservice-lengthsasync-units-not-being/m-p/441110#M11437</guid>
      <dc:creator>JasonScharf</dc:creator>
      <dc:date>2021-12-11T19:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: GeometryService LengthsAsync units not being respected.</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/geometryservice-lengthsasync-units-not-being/m-p/441111#M11438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can you try using the same parameters outside the SL app? You can use fiddler to see what requests are made by the SL app. Use the same parameters in your browser.&amp;nbsp; This will help us narrow down the issue. Try a different WKID too if you see any difference.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The sample in our SDK uses miles and it works fine.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#Lengths"&gt;http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#Lengths&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Oct 2010 16:47:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/geometryservice-lengthsasync-units-not-being/m-p/441111#M11438</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2010-10-07T16:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: GeometryService LengthsAsync units not being respected.</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/geometryservice-lengthsasync-units-not-being/m-p/441112#M11439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Jennifer,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've tried a few different combination of projections and units, and the unit seems to be completely ignored.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the URI I'm using:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer/lengths?sr=2264&amp;amp;polylines=[{"paths"%3a[[[1431405.14392891%2c562178.084391688]%2c[1412393.4856485%2c549785.157225033]]]}]&amp;amp;lengthUnit=9002&amp;amp;geodesic=true&amp;amp;f=json&amp;amp;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Changing lengthUnit does absolutely nothing. Is there some reason why sampleserver1 would ignore this?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Oct 2010 18:37:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/geometryservice-lengthsasync-units-not-being/m-p/441112#M11439</guid>
      <dc:creator>JasonScharf</dc:creator>
      <dc:date>2010-10-07T18:37:35Z</dc:date>
    </item>
    <item>
      <title>Re: GeometryService LengthsAsync units not being respected.</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/geometryservice-lengthsasync-units-not-being/m-p/441113#M11440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ok, problem found. The geometry service I was using was on sampleserver1 running ArcGIS 9.31 and the lengthUnit parameter is not present. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I guess my issue now is that a user of mine may very well configure an ArcGIS 9.31 geometry service to be used in my viewer. I must detect this, and if so I will need to do all the unit conversion myself, based on what measurement units are being returned.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In this case, I'll need to obtain the measurement unit used for a particular spatial reference. Hopefully ArcGIS provides an easy way to do this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the help!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Oct 2010 18:51:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/geometryservice-lengthsasync-units-not-being/m-p/441113#M11440</guid>
      <dc:creator>JasonScharf</dc:creator>
      <dc:date>2010-10-07T18:51:09Z</dc:date>
    </item>
  </channel>
</rss>

