<?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: ArcObjects iSpatialFilter - How To in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-ispatialfilter-how-to/m-p/314798#M8215</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Put the selected polygon (IFeature.Shape) into the ISpatialFilter.Geometry and open a new cursor with the ISpatialFilter. You must set the ISpatialFilter.SpatialRel too.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Have Fun&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mody&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Apr 2011 04:21:40 GMT</pubDate>
    <dc:creator>ModyBuchbinder</dc:creator>
    <dc:date>2011-04-26T04:21:40Z</dc:date>
    <item>
      <title>ArcObjects iSpatialFilter - How To</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-ispatialfilter-how-to/m-p/314797#M8214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am having trouble using the iSpatialFilter interface.&amp;nbsp; I have selected a polygon feature using a query filter, and now I would like to select features from 'points' that are within the selected features of 'polygons'.&amp;nbsp; I cannot figure out how to tell the spatial filter to only use the selected features in the polygon layer.&amp;nbsp; Does anyone have advice or a code sample to get me started?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ArcGIS Desktop 10 VBA&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Justin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Apr 2011 17:58:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-ispatialfilter-how-to/m-p/314797#M8214</guid>
      <dc:creator>JustinConklin</dc:creator>
      <dc:date>2011-04-25T17:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: ArcObjects iSpatialFilter - How To</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-ispatialfilter-how-to/m-p/314798#M8215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Put the selected polygon (IFeature.Shape) into the ISpatialFilter.Geometry and open a new cursor with the ISpatialFilter. You must set the ISpatialFilter.SpatialRel too.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Have Fun&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mody&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Apr 2011 04:21:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-ispatialfilter-how-to/m-p/314798#M8215</guid>
      <dc:creator>ModyBuchbinder</dc:creator>
      <dc:date>2011-04-26T04:21:40Z</dc:date>
    </item>
    <item>
      <title>Re: ArcObjects iSpatialFilter - How To</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-ispatialfilter-how-to/m-p/314799#M8216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Justin,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If your attribute query is selecting more than 1 polygon then you need to bind your selection into a "single" geometry which you pass to an object of type ISpatialFilter. Below is some code that I have used to achieve this, alternatively you could call the SelectByLocation Geo-Processing tool to achieve the same thing...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Dim pSelectionSet_Nodes As ISelectionSet
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pSelectionSet_Nodes = pFeatureSelection_Nodes.SelectionSet
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pEnumGeometry As IEnumGeometry
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pEnumGeometryBind As IEnumGeometryBind
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pEnumGeometry = New EnumFeatureGeometry
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pEnumGeometryBind = pEnumGeometry
&amp;nbsp;&amp;nbsp;&amp;nbsp; pEnumGeometryBind.BindGeometrySource Nothing, pSelectionSet_Nodes
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pGeometryFactory As IGeometryFactory
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pGeometryFactory = New GeometryEnvironment
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pGeometry As IGeometry
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pGeometry = pGeometryFactory.CreateGeometryFromEnumerator(pEnumGeometry)
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pSpatialFilter As ISpatialFilter
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pSpatialFilter = New SpatialFilter
&amp;nbsp;&amp;nbsp;&amp;nbsp; With pSpatialFilter
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set .Geometry = pGeometry
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .GeometryField = "SHAPE"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .SpatialRel = esriSpatialRelIntersects
&amp;nbsp;&amp;nbsp;&amp;nbsp; End With
&amp;nbsp;&amp;nbsp;&amp;nbsp; pFeatureSelection_Rivers.SelectFeatures pSpatialFilter, esriSelectionResultNew, False&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Duncan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:59:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-ispatialfilter-how-to/m-p/314799#M8216</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2021-12-11T14:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: ArcObjects iSpatialFilter - How To</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-ispatialfilter-how-to/m-p/314800#M8217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you both.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My attribute query only selects one polygon, but it is stored in a SelectionSet rather than feature.&amp;nbsp; I saw the need to get it as a "single" geometry but could not QI it withought getting a type mismatch.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I will give your code a try Duncan, Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Apr 2011 20:17:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-ispatialfilter-how-to/m-p/314800#M8217</guid>
      <dc:creator>JustinConklin</dc:creator>
      <dc:date>2011-04-26T20:17:52Z</dc:date>
    </item>
    <item>
      <title>Re: ArcObjects iSpatialFilter - How To</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-ispatialfilter-how-to/m-p/314801#M8218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Use ISelectionSet.Search to get a cursor on your selection set. From the cursor you can get the feature.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Have Fun&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mody&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Apr 2011 03:56:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-ispatialfilter-how-to/m-p/314801#M8218</guid>
      <dc:creator>ModyBuchbinder</dc:creator>
      <dc:date>2011-04-27T03:56:36Z</dc:date>
    </item>
  </channel>
</rss>

