<?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: Get coordinate count only in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/get-coordinate-count-only/m-p/284318#M7414</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;From ArcGIS server 10.0 you can also use the maxAllowableOffset option which can be used for generalizing geometries returned by a &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Tasks.Query~MaxAllowableOffset.html"&gt;query&lt;/A&gt;&lt;SPAN&gt;, an &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Tasks.IdentifyParameters~MaxAllowableOffset.html"&gt;identify &lt;/A&gt;&lt;SPAN&gt;or a &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Tasks.FindParameters~MaxAllowableOffset.html"&gt;find &lt;/A&gt;&lt;SPAN&gt;task.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Apr 2011 13:47:11 GMT</pubDate>
    <dc:creator>DominiqueBroux</dc:creator>
    <dc:date>2011-04-26T13:47:11Z</dc:date>
    <item>
      <title>Get coordinate count only</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/get-coordinate-count-only/m-p/284316#M7412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I there a way to get only the coordinate count or size of a feature with the one of the ESRI tasks?&amp;nbsp; I have some very large polygons that hang-up my application when a user tries to download and highlight the geometry.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Apr 2011 23:11:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/get-coordinate-count-only/m-p/284316#M7412</guid>
      <dc:creator>BradBarnell</dc:creator>
      <dc:date>2011-04-17T23:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: Get coordinate count only</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/get-coordinate-count-only/m-p/284317#M7413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;As far as I know there is no query that can give you this. When you perform a query task with ReturnGeometry=True, you get the shape of the geometry. You may perform Linq query on this result. For example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
var largest = e.FeatureSet.Features.Max(g =&amp;gt; g.Geometry.GetArea());
var graphic = e.FeatureSet.Features.FirstOrDefault(g =&amp;gt; g.Geometry.GetArea() == largest);
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, this is not very efficient and the result may not be correct. A diagonal polyline's extent is not necessarily its true area. Also the number of vertices does not always guarantee that it will be the largest polygon.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
public static class GeometryExtension
{
 public static double GetArea(this Geometry geom)
 {
&amp;nbsp; if (geom == null || geom.Extent == null) return 0;
&amp;nbsp; return geom.Extent.Height * geom.Extent.Width;
 }

 public static int GetVerticesCount(this Geometry geom)
 {
&amp;nbsp; if (geom is Polygon)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; Polygon polygon = geom as Polygon;
&amp;nbsp;&amp;nbsp; if (polygon.Rings == null) return 0;
&amp;nbsp;&amp;nbsp; int count = 0;
&amp;nbsp;&amp;nbsp; foreach (var pc in polygon.Rings)
&amp;nbsp;&amp;nbsp;&amp;nbsp; count += pc.Count;
&amp;nbsp;&amp;nbsp; return count;
&amp;nbsp; }
&amp;nbsp; return 0;
 }
}
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:45:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/get-coordinate-count-only/m-p/284317#M7413</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2021-12-11T13:45:12Z</dc:date>
    </item>
    <item>
      <title>Re: Get coordinate count only</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/get-coordinate-count-only/m-p/284318#M7414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;From ArcGIS server 10.0 you can also use the maxAllowableOffset option which can be used for generalizing geometries returned by a &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Tasks.Query~MaxAllowableOffset.html"&gt;query&lt;/A&gt;&lt;SPAN&gt;, an &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Tasks.IdentifyParameters~MaxAllowableOffset.html"&gt;identify &lt;/A&gt;&lt;SPAN&gt;or a &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Tasks.FindParameters~MaxAllowableOffset.html"&gt;find &lt;/A&gt;&lt;SPAN&gt;task.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Apr 2011 13:47:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/get-coordinate-count-only/m-p/284318#M7414</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2011-04-26T13:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: Get coordinate count only</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/get-coordinate-count-only/m-p/284319#M7415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;On a slight tangent,&amp;nbsp; I do not see Return Count Only available via the Tasks.Query Class.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have version 2.2.0.629 &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I see only ReturnIdsOnly and ReturnGeometry, but I cannot set ReturnCountOnly via the ArcGIS api for silverlight.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What gives???&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 May 2012 18:18:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/get-coordinate-count-only/m-p/284319#M7415</guid>
      <dc:creator>AnastasiaAourik</dc:creator>
      <dc:date>2012-05-31T18:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: Get coordinate count only</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/get-coordinate-count-only/m-p/284320#M7416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;On a slight tangent, I do not see Return Count Only available via the Tasks.Query Class.&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;The method is called &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/2.2/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Tasks.QueryTask~ExecuteCountAsync.html"&gt;ExecuteCountAsync&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It is available from SLAPI 2.1 but needs ArcGIS Server 10.0 SP1 to work.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jun 2012 06:21:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/get-coordinate-count-only/m-p/284320#M7416</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2012-06-01T06:21:12Z</dc:date>
    </item>
  </channel>
</rss>

