<?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: Selecting Features Within a Polygon in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/selecting-features-within-a-polygon-solved/m-p/852807#M4341</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No change.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Aug 2017 19:26:47 GMT</pubDate>
    <dc:creator>DrewD</dc:creator>
    <dc:date>2017-08-28T19:26:47Z</dc:date>
    <item>
      <title>Selecting Features Within a Polygon [solved]</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/selecting-features-within-a-polygon-solved/m-p/852803#M4337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I was wondering if I could get some help with this problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently I'm using this line of code to select point features inside of a polygon.&amp;nbsp;&lt;/P&gt;&lt;P&gt;MapView.Active.SelectFeatures(polygon, SelectionCombinationMethod.Add, true, false);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However I noticed it is not very.. accurate? the description for this method is that it selects features that intersect a geometry, however clearly that's not whats happening as the points are outside of the polygon. What would be a functioning equivalent to the geoprocessing tool Select by Location? As the SelectFeatures method is unclear as to what it actually does.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;------------------------------------------------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The solution I found was to use a SpatialQueryFilter&amp;nbsp;(below)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SpatialQueryFilter sqf = new SpatialQueryFilter { FilterGeometry = polygon, SpatialRelationship = SpatialRelationship.Contains };&lt;/P&gt;&lt;P&gt;[pointlayer].Select(sqf);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of&amp;nbsp;MapView.Active.SelectFeatures(polygon), which doesn't work properly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Aug 2017 18:51:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/selecting-features-within-a-polygon-solved/m-p/852803#M4337</guid>
      <dc:creator>DrewD</dc:creator>
      <dc:date>2017-08-28T18:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting Features Within a Polygon</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/selecting-features-within-a-polygon-solved/m-p/852804#M4338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you using 2-D or 3-D? The third parameter (&lt;EM&gt;isVisualIntersect&lt;/EM&gt;) is for 3-D while the fourth parameter (&lt;EM&gt;isWhollyWithin&lt;/EM&gt;) is for 2-D. What happens when you use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MapView.Active.SelectFeatures(polygon, SelectionCombinationMethod.Add, false, true);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should make this a &lt;A _jive_internal="true" href="https://community.esri.com/docs/DOC-1087"&gt;Question&lt;/A&gt; rather than a Discussion&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Aug 2017 19:05:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/selecting-features-within-a-polygon-solved/m-p/852804#M4338</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2017-08-28T19:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting Features Within a Polygon</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/selecting-features-within-a-polygon-solved/m-p/852805#M4339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG __jive_id="368871" alt="Result" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/368871_pic2.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using 2D only. This is with&amp;nbsp;MapView.Active.SelectFeatures(polygon, SelectionCombinationMethod.Add, false, true);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Aug 2017 19:11:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/selecting-features-within-a-polygon-solved/m-p/852805#M4339</guid>
      <dc:creator>DrewD</dc:creator>
      <dc:date>2017-08-28T19:11:01Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting Features Within a Polygon</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/selecting-features-within-a-polygon-solved/m-p/852806#M4340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah, that is strange. What happens if you set both booleans to true?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Aug 2017 19:22:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/selecting-features-within-a-polygon-solved/m-p/852806#M4340</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2017-08-28T19:22:30Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting Features Within a Polygon</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/selecting-features-within-a-polygon-solved/m-p/852807#M4341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No change.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Aug 2017 19:26:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/selecting-features-within-a-polygon-solved/m-p/852807#M4341</guid>
      <dc:creator>DrewD</dc:creator>
      <dc:date>2017-08-28T19:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting Features Within a Polygon [solved]</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/selecting-features-within-a-polygon-solved/m-p/852808#M4342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Drew,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;MapView.Active.SelectFeatures(...) does a visual select so you get the results for what you are viewing currently. With &lt;EM style="border: 0px;"&gt;isWhollyWithin&amp;nbsp;&lt;/EM&gt;set to TRUE, a point feature would only get selected if the symbol for the point feature is completely within the selected polygon feature. You might also get different results if you zoom-in/out of the view as the point symbol that was initially just inside the polygon geometry might now fall completely or partially outside the polygon boundary when you zoom out.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;The results shown in the screenshots you shared seem correct to me. Also your&amp;nbsp;solution of using SpatialQueryFilter and layer select is good and will get you the results you were expecting.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Thanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Aug 2017 22:58:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/selecting-features-within-a-polygon-solved/m-p/852808#M4342</guid>
      <dc:creator>DeepinderDeol</dc:creator>
      <dc:date>2017-08-31T22:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting Features Within a Polygon [solved]</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/selecting-features-within-a-polygon-solved/m-p/852809#M4343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Zooming in and out had no effect, which is why I perceived it as a broken function. Thanks for the confirmation though!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Sep 2017 12:39:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/selecting-features-within-a-polygon-solved/m-p/852809#M4343</guid>
      <dc:creator>DrewD</dc:creator>
      <dc:date>2017-09-01T12:39:03Z</dc:date>
    </item>
  </channel>
</rss>

