<?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: Geometry from featureCursor (Spatial Query) in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/geometry-from-featurecursor-spatial-query/m-p/722910#M19280</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;using featureCursor.NextFeature() in a loop will retrieve all the features. Use ITopologicalOperator.ConstructUnion method to merge the geometries.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

IGeometryCollection unionCol = new GeometryBag() as IGeometryCollection;
ITopologicalOperator unionPoly = new PolygonClass() as ITopologicalOperator;
object Missing = Type.Missing;

IFeature pFeature = featureCursor.NextFeature(); 

while(pFeature!=null)
{

&amp;nbsp;&amp;nbsp;&amp;nbsp; IGeometry pGeometry = pFeature.Shape;
&amp;nbsp;&amp;nbsp;&amp;nbsp; unionCol.AddGeometry(pGeometry , ref Missing, ref Missing);
&amp;nbsp;&amp;nbsp;&amp;nbsp; pFeature = featureCursor.NextFeature(); 

}
 unionPoly.ConstructUnion((IEnumGeometry)unionCol);

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 06:55:35 GMT</pubDate>
    <dc:creator>sapnas</dc:creator>
    <dc:date>2021-12-12T06:55:35Z</dc:date>
    <item>
      <title>Geometry from featureCursor (Spatial Query)</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/geometry-from-featurecursor-spatial-query/m-p/722907#M19277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I�??m trying to run a intersect spatial query (Feaure2) based on the attribute query results of my first feature (Feature1) &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I do an attribute search on my first feature , What I am returned from my attribute search is FeatureCursor, I how do I get the geomentry from a featureCursor to pass as my spatial query geometry. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The is the function I want to pass my attribute geometry results into &lt;/SPAN&gt;&lt;A href="http://edndoc.esri.com/arcobjects/9.2/java/engine_samples/geodatabase.accessing_data.performspatialquery/example.html"&gt;http://edndoc.esri.com/arcobjects/9.2/java/engine_samples/geodatabase.accessing_data.performspatialquery/example.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Appreciate the help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;VB&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jan 2012 14:26:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/geometry-from-featurecursor-spatial-query/m-p/722907#M19277</guid>
      <dc:creator>DanielLaidlaw</dc:creator>
      <dc:date>2012-01-26T14:26:42Z</dc:date>
    </item>
    <item>
      <title>Re: Geometry from featureCursor (Spatial Query)</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/geometry-from-featurecursor-spatial-query/m-p/722908#M19278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN style="font-size:2;"&gt; &lt;PRE class="lia-code-sample line-numbers language-none"&gt; IFeature pFeature = featureCursor.NextFeature(); 

IGeometry pGeometry = pFeature.Shape;
&lt;/PRE&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 06:55:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/geometry-from-featurecursor-spatial-query/m-p/722908#M19278</guid>
      <dc:creator>sapnas</dc:creator>
      <dc:date>2021-12-12T06:55:32Z</dc:date>
    </item>
    <item>
      <title>Re: Geometry from featureCursor (Spatial Query)</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/geometry-from-featurecursor-spatial-query/m-p/722909#M19279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You�??re partially right as that will just give me the last value of the shape geometry in the cursor, how do I union them when I have more than one record in my cursor result.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jan 2012 18:17:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/geometry-from-featurecursor-spatial-query/m-p/722909#M19279</guid>
      <dc:creator>DanielLaidlaw</dc:creator>
      <dc:date>2012-01-26T18:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: Geometry from featureCursor (Spatial Query)</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/geometry-from-featurecursor-spatial-query/m-p/722910#M19280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;using featureCursor.NextFeature() in a loop will retrieve all the features. Use ITopologicalOperator.ConstructUnion method to merge the geometries.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

IGeometryCollection unionCol = new GeometryBag() as IGeometryCollection;
ITopologicalOperator unionPoly = new PolygonClass() as ITopologicalOperator;
object Missing = Type.Missing;

IFeature pFeature = featureCursor.NextFeature(); 

while(pFeature!=null)
{

&amp;nbsp;&amp;nbsp;&amp;nbsp; IGeometry pGeometry = pFeature.Shape;
&amp;nbsp;&amp;nbsp;&amp;nbsp; unionCol.AddGeometry(pGeometry , ref Missing, ref Missing);
&amp;nbsp;&amp;nbsp;&amp;nbsp; pFeature = featureCursor.NextFeature(); 

}
 unionPoly.ConstructUnion((IEnumGeometry)unionCol);

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 06:55:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/geometry-from-featurecursor-spatial-query/m-p/722910#M19280</guid>
      <dc:creator>sapnas</dc:creator>
      <dc:date>2021-12-12T06:55:35Z</dc:date>
    </item>
  </channel>
</rss>

