<?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: How to check if a Polygon is inside another Polygon w/o using Select By Location? in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/how-to-check-if-a-polygon-is-inside-another/m-p/715948#M23713</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In v10 you would probably have to install any modules you wanted to use via v10 in C:\Python26\ArcGIS10.0 folder rather than the default C:\Python26. Note the similar contents of C:\Python26\ArcGIS10.0\Lib and C:\Python26\Lib.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 03 Jan 2011 15:31:24 GMT</pubDate>
    <dc:creator>ChrisSnyder</dc:creator>
    <dc:date>2011-01-03T15:31:24Z</dc:date>
    <item>
      <title>How to check if a Polygon is inside another Polygon w/o using Select By Location?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-check-if-a-polygon-is-inside-another/m-p/715944#M23709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Happy New Year everyone!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need your help on this after googling for days.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using ArcGIS 9.3 and want to develop a Python code (Python version = 2.6) to recognize if a polygon is inside another polygon. These polygons are created by codes and not in any shapefiles or feature class. Therefore, I don't want to create a new shapefile to just use Select By Location.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I wish there is something like: aPolygon.contains(aPolygon) = True/False&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried shapely.geometry but ArcToolbox doesn't recognize this line: "from shapely.geometry import Polygon". Shapely can do the topological relationship very simple.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any helps is appreciated.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Jan 2011 04:20:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-check-if-a-polygon-is-inside-another/m-p/715944#M23709</guid>
      <dc:creator>TrungTran</dc:creator>
      <dc:date>2011-01-02T04:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if a Polygon is inside another Polygon w/o using Select By Location?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-check-if-a-polygon-is-inside-another/m-p/715945#M23710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Happy New Year everyone!!&lt;BR /&gt;&lt;BR /&gt;I need your help on this after googling for days.&lt;BR /&gt;&lt;BR /&gt;I am using ArcGIS 9.3 and want to develop a Python code (Python version = 2.6) to recognize if a polygon is inside another polygon. These polygons are created by codes and not in any shapefiles or feature class. Therefore, I don't want to create a new shapefile to just use Select By Location.&lt;BR /&gt;I wish there is something like: aPolygon.contains(aPolygon) = True/False&lt;BR /&gt;&lt;BR /&gt;I tried shapely.geometry but ArcToolbox doesn't recognize this line: "from shapely.geometry import Polygon". Shapely can do the topological relationship very simple.&lt;BR /&gt;&lt;BR /&gt;Any helps is appreciated.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Plese check the below forums...they might help you&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.esri.com/thread.asp?c=93&amp;amp;f=993&amp;amp;t=115654"&gt;http://forums.esri.com/thread.asp?c=93&amp;amp;f=993&amp;amp;t=115654&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.esri.com/thread.asp?c=93&amp;amp;f=1729&amp;amp;t=147931"&gt;http://forums.esri.com/thread.asp?c=93&amp;amp;f=1729&amp;amp;t=147931&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Jan 2011 11:16:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-check-if-a-polygon-is-inside-another/m-p/715945#M23710</guid>
      <dc:creator>VivekPrasad</dc:creator>
      <dc:date>2011-01-02T11:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if a Polygon is inside another Polygon w/o using Select By Location?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-check-if-a-polygon-is-inside-another/m-p/715946#M23711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;does the script in arctoolbox recognize a straight import of the shapely module? If not, then it may be an installation issue of shapely.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This capability has been added to ArcMap 10 for future reference, through the arcpy module&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy
square = [[0,0],[0,1],[1,1],[1,0]]
small_square = [[0.1, 0.1],[0.1, 0.9], [0.9,0.9], [0.9,0.1]]
pnt = arcpy.Point()
array = arcpy.Array()

for a_pnt in square:
&amp;nbsp; pnt.X = a_pnt[0]; pnt.Y = a_pnt[1]
&amp;nbsp; array.add(pnt)
poly1 = arcpy.Polygon(array)
array.removeAll()

for a_pnt in small_square:
&amp;nbsp; pnt.X = a_pnt[0]; pnt.Y = a_pnt[1]
&amp;nbsp; array.add(pnt)
poly2 = arcpy.Polygon(array)
array.removeAll()

print "poly 1 contains poly2 :", poly1.contains(poly2)
print "poly 2 contains poly1 :", poly2.contains(poly1)
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 06:40:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-check-if-a-polygon-is-inside-another/m-p/715946#M23711</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-12T06:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if a Polygon is inside another Polygon w/o using Select By Location?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-check-if-a-polygon-is-inside-another/m-p/715947#M23712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Vara and Dan.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Actually, I can do with VBA but just want to do this in Python because I have some other functions in Python as well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This command "&lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;From shapely.geometry import Polygon&lt;/SPAN&gt;&lt;SPAN&gt;" was understood in Python Shell. However, when I created a script and ran it through ArcToolbox, the geoprocessing message window kept saying &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;--------------------&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;type 'exceptions Import.Error'&amp;gt;: "No module named shapely.geometry&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Fail to execute (test)."&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;--------------------&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any thoughts?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Jan 2011 14:18:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-check-if-a-polygon-is-inside-another/m-p/715947#M23712</guid>
      <dc:creator>TrungTran</dc:creator>
      <dc:date>2011-01-02T14:18:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if a Polygon is inside another Polygon w/o using Select By Location?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-check-if-a-polygon-is-inside-another/m-p/715948#M23713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In v10 you would probably have to install any modules you wanted to use via v10 in C:\Python26\ArcGIS10.0 folder rather than the default C:\Python26. Note the similar contents of C:\Python26\ArcGIS10.0\Lib and C:\Python26\Lib.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Jan 2011 15:31:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-check-if-a-polygon-is-inside-another/m-p/715948#M23713</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2011-01-03T15:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if a Polygon is inside another Polygon w/o using Select By Location?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-to-check-if-a-polygon-is-inside-another/m-p/715949#M23714</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;Not much help at 9.3 I know, but ArcPy geometry objects have a "contains" method:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Polygon/000v000000n1000000/"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Polygon/000v000000n1000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jan 2011 12:55:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-to-check-if-a-polygon-is-inside-another/m-p/715949#M23714</guid>
      <dc:creator>BruceHarold</dc:creator>
      <dc:date>2011-01-04T12:55:19Z</dc:date>
    </item>
  </channel>
</rss>

