<?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 Check each row geometry is inside a perimeter with Python - how? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/check-each-row-geometry-is-inside-a-perimeter-with/m-p/8750#M726</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello Everyone&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Software version: 9.3.1 / python 2.5&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Problem: I have a polygon feature class "FC1" with 1000 records and wish to find the ones laying outside of a given perimeter (in the form of 1 record in another feature class "PERI1").&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I know about the gp.erase option but I wish to report to the user that OBJECTID x lies outside PERI1 - so I thought I could loop through FC1 and compare each row geometry withe the PERI1 feature class and report back true/false it is contained or not.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anyone point me in the right direction? Currently struggling to find an example. Much appreciated.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 14 Dec 2012 08:01:52 GMT</pubDate>
    <dc:creator>JamesMorrison1</dc:creator>
    <dc:date>2012-12-14T08:01:52Z</dc:date>
    <item>
      <title>Check each row geometry is inside a perimeter with Python - how?</title>
      <link>https://community.esri.com/t5/python-questions/check-each-row-geometry-is-inside-a-perimeter-with/m-p/8750#M726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello Everyone&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Software version: 9.3.1 / python 2.5&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Problem: I have a polygon feature class "FC1" with 1000 records and wish to find the ones laying outside of a given perimeter (in the form of 1 record in another feature class "PERI1").&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I know about the gp.erase option but I wish to report to the user that OBJECTID x lies outside PERI1 - so I thought I could loop through FC1 and compare each row geometry withe the PERI1 feature class and report back true/false it is contained or not.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anyone point me in the right direction? Currently struggling to find an example. Much appreciated.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Dec 2012 08:01:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/check-each-row-geometry-is-inside-a-perimeter-with/m-p/8750#M726</guid>
      <dc:creator>JamesMorrison1</dc:creator>
      <dc:date>2012-12-14T08:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: Check each row geometry is inside a perimeter with Python - how?</title>
      <link>https://community.esri.com/t5/python-questions/check-each-row-geometry-is-inside-a-perimeter-with/m-p/8751#M727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN style="color:#000000;"&gt;Unless there is some reason to use the geometry directly, I think the simplest way would be to use Select by Location using the "completely within" and "switch selection" options. Something like:&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
#Make Layers
arcpy.MakeFeatureLayer_management(perimeterFC, "perimeterLayer")
arcpy.MakeFeatureLayer_management(myFC, "myFCLayer")

#Perform Selection
arcpy.SelectLayerByLocation_management("myFCLayer", "COMPLETELY_WITHIN", "perimeterLayer", None, "SWITCH_SELECTION")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color:#000000;"&gt;You could then loop through that selection (i.e. print the OID's) or export out to a new table/feature class.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:21:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/check-each-row-geometry-is-inside-a-perimeter-with/m-p/8751#M727</guid>
      <dc:creator>MattSayler</dc:creator>
      <dc:date>2021-12-10T20:21:35Z</dc:date>
    </item>
  </channel>
</rss>

