<?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: Need to query graphics inside of a polygon in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/need-to-query-graphics-inside-of-a-polygon/m-p/724936#M18580</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks so much for the help.&amp;nbsp; The query below gives me exactly what I'm looking for.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;env &lt;/STRONG&gt;&lt;SPAN&gt;is the envelope of the rectangle drawn on the DrawSurface.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;MyGraphics &lt;/STRONG&gt;&lt;SPAN&gt;is the graphics layer containing the data points I'm trying to select.&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;SearchResults&lt;/STRONG&gt;&lt;SPAN&gt; is a List&amp;lt;Graphic&amp;gt; of the graphics inside the drawn box.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;SearchResults = (from Graphic g in ((GraphicsLayer)MyMap.Layers["MyGraphics"]).Graphics where&amp;nbsp; env.Intersects(g.Geometry.Extent) select g).ToList();&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Apr 2011 14:17:41 GMT</pubDate>
    <dc:creator>GaryButler</dc:creator>
    <dc:date>2011-04-14T14:17:41Z</dc:date>
    <item>
      <title>Need to query graphics inside of a polygon</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/need-to-query-graphics-inside-of-a-polygon/m-p/724934#M18578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sorry for the newbie question...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have two graphics layers on my map.&amp;nbsp; One layer contains graphics of the data I'm interested in - in this case it is leaking pipe information.&amp;nbsp; The second layer contains the DrawSurface where I can draw a rectangle or other geometry to "select" these graphics.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My question is now that I can draw rectangles and display my graphics, how can I query the graphics that are located within the geometry I've drawn.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've seen other posts that mention converting the drawn rectangle to an envelope and use Linq but I don't know where to start.&amp;nbsp; Can someone point me in the right direction?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance for your help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Apr 2011 22:45:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/need-to-query-graphics-inside-of-a-polygon/m-p/724934#M18578</guid>
      <dc:creator>GaryButler</dc:creator>
      <dc:date>2011-04-13T22:45:41Z</dc:date>
    </item>
    <item>
      <title>Re: Need to query graphics inside of a polygon</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/need-to-query-graphics-inside-of-a-polygon/m-p/724935#M18579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If your first layer is a feature layer you can use a spatial query. In this case the server is doing the geometry calculations : see sample &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#SpatialQuery"&gt;http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#SpatialQuery&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If your first layer is a pure graphics layer with objects only existing at the client side, it's not that easy.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You can approximate the search by using the intersection of envelopes : see documentation &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Geometry.Envelope~Intersects.html"&gt;http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Geometry.Envelope~Intersects.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If you need more precision by taking care of the polygon edges, you will have either to write some math and geometry code or to use a geometry service (&lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#Intersect"&gt;sample&lt;/A&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Apr 2011 06:12:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/need-to-query-graphics-inside-of-a-polygon/m-p/724935#M18579</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2011-04-14T06:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: Need to query graphics inside of a polygon</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/need-to-query-graphics-inside-of-a-polygon/m-p/724936#M18580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks so much for the help.&amp;nbsp; The query below gives me exactly what I'm looking for.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;env &lt;/STRONG&gt;&lt;SPAN&gt;is the envelope of the rectangle drawn on the DrawSurface.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;MyGraphics &lt;/STRONG&gt;&lt;SPAN&gt;is the graphics layer containing the data points I'm trying to select.&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;SearchResults&lt;/STRONG&gt;&lt;SPAN&gt; is a List&amp;lt;Graphic&amp;gt; of the graphics inside the drawn box.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;SearchResults = (from Graphic g in ((GraphicsLayer)MyMap.Layers["MyGraphics"]).Graphics where&amp;nbsp; env.Intersects(g.Geometry.Extent) select g).ToList();&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Apr 2011 14:17:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/need-to-query-graphics-inside-of-a-polygon/m-p/724936#M18580</guid>
      <dc:creator>GaryButler</dc:creator>
      <dc:date>2011-04-14T14:17:41Z</dc:date>
    </item>
  </channel>
</rss>

