<?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: Spatial Query in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/spatial-query/m-p/147161#M1666</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mohammed,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using &lt;STRONG&gt;GeometryEngine.Intersection()&lt;/STRONG&gt; method, I was able to select the cities with a state. Below is the code, since it has the XAML part for the Graphics Overlay, I have attached the&amp;nbsp;project, the project is in WPF..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// City Layer&lt;BR /&gt;&lt;SPAN&gt; FeatureLayer cityLayer = new FeatureLayer(new Uri("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fsampleserver6.arcgisonline.com%2Farcgis%2Frest%2Fservices%2FUSA%2FMapServer%2F0" rel="nofollow" target="_blank"&gt;http://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer/0&lt;/A&gt;&lt;SPAN&gt;"));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;// State Layer&lt;BR /&gt;&lt;SPAN&gt; FeatureLayer stateLayer = new FeatureLayer(new Uri("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fsampleserver6.arcgisonline.com%2Farcgis%2Frest%2Fservices%2FUSA%2FMapServer%2F2" rel="nofollow" target="_blank"&gt;http://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer/2&lt;/A&gt;&lt;SPAN&gt;"));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MyMap.OperationalLayers.Add(cityLayer);&lt;BR /&gt; MyMap.OperationalLayers.Add(stateLayer);&lt;BR /&gt; &lt;BR /&gt; // State Query&lt;BR /&gt; QueryParameters stateQueryParameters = new QueryParameters();&lt;/P&gt;&lt;P&gt;// only select one polygon from State layer&lt;BR /&gt; stateQueryParameters.WhereClause = "state_name = 'California'";&lt;/P&gt;&lt;P&gt;// Query the State feature table &lt;BR /&gt; FeatureQueryResult stateQueryResult = await stateLayer.FeatureTable.QueryFeaturesAsync(stateQueryParameters);&lt;BR /&gt; var stateResult = stateQueryResult.ToList();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// City Query&lt;BR /&gt; QueryParameters cityQueryParameter = new QueryParameters();&lt;BR /&gt; cityQueryParameter.WhereClause = "1=1";&lt;/P&gt;&lt;P&gt;// Query the City feature table &lt;BR /&gt; FeatureQueryResult cityQueryResult = await cityLayer.FeatureTable.QueryFeaturesAsync(cityQueryParameter);&lt;BR /&gt; var cities = cityQueryResult.Select(feature =&amp;gt; feature.Geometry);&lt;BR /&gt; &lt;BR /&gt; &lt;STRONG&gt;var citiesWithinState = cities&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; .Select(city =&amp;gt; GeometryEngine.Intersection(city, stateResult[0].Geometry))&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; .Select(city =&amp;gt; new Graphic(city, _markerSymbol));&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; foreach (Graphic g in citiesWithinState)&lt;BR /&gt; {&lt;BR /&gt; _pointFeatureOverlay.Graphics.Add(g);&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; }&lt;IMG alt="GeometryEngine.Intersection" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/363330_SpatialFilter.PNG" style="width: 620px; height: 321px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nagma&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Jul 2017 04:27:14 GMT</pubDate>
    <dc:creator>NagmaYasmin</dc:creator>
    <dc:date>2017-07-19T04:27:14Z</dc:date>
    <item>
      <title>Spatial Query</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/spatial-query/m-p/147160#M1665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;dear&lt;/P&gt;&lt;P&gt;i'm developing gis xamarin app&lt;/P&gt;&lt;P&gt;how i can make spatial query&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i select 1 region from first layer&lt;/P&gt;&lt;P&gt;and i want to select all cities within selected resgion&lt;/P&gt;&lt;P&gt;i pass geometry of selected feature to the query but it not work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any help plz&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jul 2017 11:16:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/spatial-query/m-p/147160#M1665</guid>
      <dc:creator>mohammedalsaleh</dc:creator>
      <dc:date>2017-07-18T11:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Query</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/spatial-query/m-p/147161#M1666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mohammed,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using &lt;STRONG&gt;GeometryEngine.Intersection()&lt;/STRONG&gt; method, I was able to select the cities with a state. Below is the code, since it has the XAML part for the Graphics Overlay, I have attached the&amp;nbsp;project, the project is in WPF..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// City Layer&lt;BR /&gt;&lt;SPAN&gt; FeatureLayer cityLayer = new FeatureLayer(new Uri("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fsampleserver6.arcgisonline.com%2Farcgis%2Frest%2Fservices%2FUSA%2FMapServer%2F0" rel="nofollow" target="_blank"&gt;http://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer/0&lt;/A&gt;&lt;SPAN&gt;"));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;// State Layer&lt;BR /&gt;&lt;SPAN&gt; FeatureLayer stateLayer = new FeatureLayer(new Uri("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fsampleserver6.arcgisonline.com%2Farcgis%2Frest%2Fservices%2FUSA%2FMapServer%2F2" rel="nofollow" target="_blank"&gt;http://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer/2&lt;/A&gt;&lt;SPAN&gt;"));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MyMap.OperationalLayers.Add(cityLayer);&lt;BR /&gt; MyMap.OperationalLayers.Add(stateLayer);&lt;BR /&gt; &lt;BR /&gt; // State Query&lt;BR /&gt; QueryParameters stateQueryParameters = new QueryParameters();&lt;/P&gt;&lt;P&gt;// only select one polygon from State layer&lt;BR /&gt; stateQueryParameters.WhereClause = "state_name = 'California'";&lt;/P&gt;&lt;P&gt;// Query the State feature table &lt;BR /&gt; FeatureQueryResult stateQueryResult = await stateLayer.FeatureTable.QueryFeaturesAsync(stateQueryParameters);&lt;BR /&gt; var stateResult = stateQueryResult.ToList();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// City Query&lt;BR /&gt; QueryParameters cityQueryParameter = new QueryParameters();&lt;BR /&gt; cityQueryParameter.WhereClause = "1=1";&lt;/P&gt;&lt;P&gt;// Query the City feature table &lt;BR /&gt; FeatureQueryResult cityQueryResult = await cityLayer.FeatureTable.QueryFeaturesAsync(cityQueryParameter);&lt;BR /&gt; var cities = cityQueryResult.Select(feature =&amp;gt; feature.Geometry);&lt;BR /&gt; &lt;BR /&gt; &lt;STRONG&gt;var citiesWithinState = cities&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; .Select(city =&amp;gt; GeometryEngine.Intersection(city, stateResult[0].Geometry))&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; .Select(city =&amp;gt; new Graphic(city, _markerSymbol));&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; foreach (Graphic g in citiesWithinState)&lt;BR /&gt; {&lt;BR /&gt; _pointFeatureOverlay.Graphics.Add(g);&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; }&lt;IMG alt="GeometryEngine.Intersection" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/363330_SpatialFilter.PNG" style="width: 620px; height: 321px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nagma&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jul 2017 04:27:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/spatial-query/m-p/147161#M1666</guid>
      <dc:creator>NagmaYasmin</dc:creator>
      <dc:date>2017-07-19T04:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Query</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/spatial-query/m-p/147162#M1667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;Nagma&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;its worked with me&lt;/P&gt;&lt;P&gt;but i have problem&lt;/P&gt;&lt;P&gt;by rendering graphics the result is 100% true&lt;/P&gt;&lt;P&gt;but when i make add watch and i tracing the (&lt;SPAN style="background-color: #ffffff;"&gt;citiesWithinState&lt;/SPAN&gt;) parameter it not have just features withen first result geometry&lt;/P&gt;&lt;P&gt;it have all cities in the gdb (because i want to binding cities name also how i can get it)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jul 2017 12:16:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/spatial-query/m-p/147162#M1667</guid>
      <dc:creator>mohammedalsaleh</dc:creator>
      <dc:date>2017-07-19T12:16:35Z</dc:date>
    </item>
  </channel>
</rss>

