<?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 How to do 'Target layer(s) has their centroid in the source layer by ArcObjects? in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-do-target-layer-s-has-their-centroid-in-the/m-p/629142#M16955</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;ArcObjects 10 has esriSpatialRelEnum 9 Constants. When we use ArcMap 10.2, we can do ‘Select by location’ by&amp;nbsp; 'Target layer(s) has their centroid in the source layer feature’.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;is there an equivalent of esriSpatialRelEnum constant in ArcObjects&amp;nbsp; to 'Target layer(s) has their centroid in the source layer feature' in ArcMap 10.2 Select by Location?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030; font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;"&gt;I need to find if the centroid(s) of legal parcel (s)&amp;nbsp; in one Polygon layer are within the selected Tax parcel polygon in another polygon layer.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;&lt;SPAN style="font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;"&gt;I found a very similar discussion "&lt;SPAN style="text-align: left; text-indent: 0px;"&gt;Select by centroid within using ArcObjects&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;"&gt;" in ESRI Archived Forums, which helps. However, I'd like to have some code snippets to start.&amp;nbsp; Appreciate your help!&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Jan 2015 23:44:29 GMT</pubDate>
    <dc:creator>SteveXu</dc:creator>
    <dc:date>2015-01-14T23:44:29Z</dc:date>
    <item>
      <title>How to do 'Target layer(s) has their centroid in the source layer by ArcObjects?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-do-target-layer-s-has-their-centroid-in-the/m-p/629142#M16955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;ArcObjects 10 has esriSpatialRelEnum 9 Constants. When we use ArcMap 10.2, we can do ‘Select by location’ by&amp;nbsp; 'Target layer(s) has their centroid in the source layer feature’.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;is there an equivalent of esriSpatialRelEnum constant in ArcObjects&amp;nbsp; to 'Target layer(s) has their centroid in the source layer feature' in ArcMap 10.2 Select by Location?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030; font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;"&gt;I need to find if the centroid(s) of legal parcel (s)&amp;nbsp; in one Polygon layer are within the selected Tax parcel polygon in another polygon layer.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;&lt;SPAN style="font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;"&gt;I found a very similar discussion "&lt;SPAN style="text-align: left; text-indent: 0px;"&gt;Select by centroid within using ArcObjects&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;"&gt;" in ESRI Archived Forums, which helps. However, I'd like to have some code snippets to start.&amp;nbsp; Appreciate your help!&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 23:44:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-do-target-layer-s-has-their-centroid-in-the/m-p/629142#M16955</guid>
      <dc:creator>SteveXu</dc:creator>
      <dc:date>2015-01-14T23:44:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to do 'Target layer(s) has their centroid in the source layer by ArcObjects?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-do-target-layer-s-has-their-centroid-in-the/m-p/629143#M16956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not aware of any enumerate that maps to &lt;SPAN style="color: #303030; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;'Target layer(s) has their centroid in the source layer feature'. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;If you think about it that is a two-stage process. The input feature class could be a point, line or polygon so the first stage would be extract the centroid &lt;EM&gt;then&lt;/EM&gt; do the spatial relationship test.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;To get the centroid of a geometry use the interface &lt;STRONG&gt;IArea&lt;/STRONG&gt; then you would need to test every point against the input layer using an &lt;STRONG&gt;IspatialFilter&lt;/STRONG&gt;. There are many examples on the esri forum for this.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;An alternative to using low level Arcobjects is to use the &lt;STRONG&gt;IGeoProcessor &lt;/STRONG&gt;and call the the Select Layer by Location tool?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 15:57:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-do-target-layer-s-has-their-centroid-in-the/m-p/629143#M16956</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2015-01-15T15:57:28Z</dc:date>
    </item>
  </channel>
</rss>

