<?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: LayerItemViewModel.GeometryType in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layeritemviewmodel-geometrytype/m-p/235926#M6074</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You are right, the geometryType is not available in the LayerItemViewModel.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;That's mostly because the geometry type is not tied to a legend item but to the layer or sublayer itself (as an example, the GeometryType would have few sense for a GraphicsLayer that can contain any geometry type).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;That being said, I guess the target of your question is an ArcGISDynamicMapServiceLayer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;From the LayerItemViewModel you can get the Layer and the subLayerID associated to the legend layer item. So your question becomes, how can I get the geometry type of an ArcGSDynamicMapServiceLayer sublayer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Answer is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- you cannot:( with out of the box method&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- but you can &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; by requesting by yourself the sublayer rest end point which is providing the info (e.g . &lt;/SPAN&gt;&lt;A href="http://services.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Diversity_US_2D/MapServer//0"&gt;http://services.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Diversity_US_2D/MapServer//0&lt;/A&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Dec 2010 15:31:47 GMT</pubDate>
    <dc:creator>DominiqueBroux</dc:creator>
    <dc:date>2010-12-09T15:31:47Z</dc:date>
    <item>
      <title>LayerItemViewModel.GeometryType</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layeritemviewmodel-geometrytype/m-p/235925#M6073</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Am I right in saying that the layer GeometryType is not available anywhere in the LayerItemViewModel object model?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is too bad.&amp;nbsp; I've added the ability for users to toggle a layer in the legend, then when they click a location on the map, it performs an identifyquery at that point.&amp;nbsp; We've got some layers that are polygons, some that are points, and others that are polyline.&amp;nbsp; We change the IdentifyQuery.Geometry based on the GeometryType of the layer selected.&amp;nbsp; A point works great for polygon layers, and a small polygon extent works better for polyline and point layers -- otherwise the user has to click exactly on the line or point.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If GeometryType is not available to me through the object model, can you think of a workaround?&amp;nbsp; And if not, can I request that it be added in the next version?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Dec 2010 14:46:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layeritemviewmodel-geometrytype/m-p/235925#M6073</guid>
      <dc:creator>AndrewWhite</dc:creator>
      <dc:date>2010-12-09T14:46:16Z</dc:date>
    </item>
    <item>
      <title>Re: LayerItemViewModel.GeometryType</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layeritemviewmodel-geometrytype/m-p/235926#M6074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You are right, the geometryType is not available in the LayerItemViewModel.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;That's mostly because the geometry type is not tied to a legend item but to the layer or sublayer itself (as an example, the GeometryType would have few sense for a GraphicsLayer that can contain any geometry type).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;That being said, I guess the target of your question is an ArcGISDynamicMapServiceLayer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;From the LayerItemViewModel you can get the Layer and the subLayerID associated to the legend layer item. So your question becomes, how can I get the geometry type of an ArcGSDynamicMapServiceLayer sublayer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Answer is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- you cannot:( with out of the box method&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- but you can &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; by requesting by yourself the sublayer rest end point which is providing the info (e.g . &lt;/SPAN&gt;&lt;A href="http://services.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Diversity_US_2D/MapServer//0"&gt;http://services.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Diversity_US_2D/MapServer//0&lt;/A&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Dec 2010 15:31:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layeritemviewmodel-geometrytype/m-p/235926#M6074</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2010-12-09T15:31:47Z</dc:date>
    </item>
    <item>
      <title>Re: LayerItemViewModel.GeometryType</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layeritemviewmodel-geometrytype/m-p/235927#M6075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Andrew,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;why not just specify the tolerance value for the IdentifyTask?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Dec 2010 16:32:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layeritemviewmodel-geometrytype/m-p/235927#M6075</guid>
      <dc:creator>DaveTimmins</dc:creator>
      <dc:date>2010-12-09T16:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: LayerItemViewModel.GeometryType</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layeritemviewmodel-geometrytype/m-p/235928#M6076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi Andrew,&lt;BR /&gt;&lt;BR /&gt;why not just specify the tolerance value for the IdentifyTask?&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for the feedback.&amp;nbsp; Using Tolerance is probably what I should use instead of Geometry in the QueryParameters.&amp;nbsp; However, that doesn't address the problem that I need one tolerance for PolyLine and Point layers, and another tolerance for Polygon layers.&amp;nbsp; Isn't that correct?&amp;nbsp; Or, will ArcServer just handle that for me?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Dec 2010 19:36:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layeritemviewmodel-geometrytype/m-p/235928#M6076</guid>
      <dc:creator>AndrewWhite</dc:creator>
      <dc:date>2010-12-09T19:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: LayerItemViewModel.GeometryType</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layeritemviewmodel-geometrytype/m-p/235929#M6077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Andrew,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've found that it doesn't really matter about adjusting the Tolerance value for differing geometry types, and really you are only that concerned with point or polyline features as polygon is more likely to succeed. I only specify a Tolerance of 2 usually and this is enough to be able to correctly identify the expected features. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not 100% sure how AGS handles the Tolerance value but I would guess that it does a buffer based on the Tolerance value and also the extent so it has a sliding ratio applied to the input geometry. The easiest thing is to just test it out for your scenario and see if it meets your needs.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Dec 2010 19:53:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layeritemviewmodel-geometrytype/m-p/235929#M6077</guid>
      <dc:creator>DaveTimmins</dc:creator>
      <dc:date>2010-12-09T19:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: LayerItemViewModel.GeometryType</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layeritemviewmodel-geometrytype/m-p/235930#M6078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;&lt;BR /&gt;The easiest thing is to just test it out for your scenario and see if it meets your needs.&lt;BR /&gt;&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Okay, I tested it out...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;First, I had to change from a QueryTask to an IdentifyTask, since the Query doesn't have Tolerance and the IdentifyParameters does.&amp;nbsp; Not a big deal though.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Second, I still have the same problem -- specifically, I have a Parcels layer (polygons) and I click right next to a line between two parcels I get both parcels in the results because the parcel on the other side of the line is within the Tolerance.&amp;nbsp; This is not really acceptable.&amp;nbsp; In this situation I want a Tolerance of 0.&amp;nbsp; However, we also have point and polyline layers, and for those we &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;do&lt;/SPAN&gt;&lt;SPAN&gt; want a bit of a tolerance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, I guess I'm left with doing a quick REST call to get the GeometryType of the layer being queried.&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks much for your input though.&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&amp;nbsp; Using Tolerance is a much better choice for those times when I want to use a bit of a buffer.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Dec 2010 20:30:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layeritemviewmodel-geometrytype/m-p/235930#M6078</guid>
      <dc:creator>AndrewWhite</dc:creator>
      <dc:date>2010-12-09T20:30:51Z</dc:date>
    </item>
    <item>
      <title>Re: LayerItemViewModel.GeometryType</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layeritemviewmodel-geometrytype/m-p/235931#M6079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This may not be the most efficient way to do this but maybe it will help:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp; FeatureLayer l = new FeatureLayer() { Url = "http://services.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Diversity_US_2D/MapServer/0" };
&amp;nbsp;&amp;nbsp; EventHandler&amp;lt;EventArgs&amp;gt; handler = null;
&amp;nbsp;&amp;nbsp; GeometryType geometryType;
&amp;nbsp;&amp;nbsp; handler = (s, e) =&amp;gt;
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; l.Initialized -= handler;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; geometryType = l.LayerInfo.GeometryType;
&amp;nbsp;&amp;nbsp;&amp;nbsp; };
&amp;nbsp;&amp;nbsp; l.Initialized += handler;
&amp;nbsp;&amp;nbsp; l.Initialize();
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:53:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layeritemviewmodel-geometrytype/m-p/235931#M6079</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2021-12-11T11:53:50Z</dc:date>
    </item>
    <item>
      <title>Re: LayerItemViewModel.GeometryType</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layeritemviewmodel-geometrytype/m-p/235932#M6080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Your code example came too late, as my code is complete.&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm just doing a quick REST call using a WebClient and parsing the results into a DataContract using a DataContractJsonSerializer.&amp;nbsp; Works great and is fast.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Dec 2010 21:30:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layeritemviewmodel-geometrytype/m-p/235932#M6080</guid>
      <dc:creator>AndrewWhite</dc:creator>
      <dc:date>2010-12-09T21:30:38Z</dc:date>
    </item>
    <item>
      <title>Re: LayerItemViewModel.GeometryType</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layeritemviewmodel-geometrytype/m-p/235933#M6081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Okay. WebClient request is the most efficient way, anyway where you can parse JSON string and decide GeometryType from there.&amp;nbsp; "geometryType" : "esriGeometryPolygon",&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Dec 2010 21:36:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/layeritemviewmodel-geometrytype/m-p/235933#M6081</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2010-12-09T21:36:34Z</dc:date>
    </item>
  </channel>
</rss>

