<?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 geometry prior to running a geoprocess using a loop? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-check-geometry-prior-to-running-a/m-p/514339#M40362</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Connor, use the new data access cursors&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/arcpy/get-started/describing-data.htm" title="https://pro.arcgis.com/en/pro-app/arcpy/get-started/describing-data.htm"&gt;Describing data—ArcPy Get Started | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #aa0d91; font-family: &amp;amp;quot; consolas&amp;amp;quot;,&amp;amp;quot;andale mono&amp;amp;quot;,&amp;amp;quot;lucida console&amp;amp;quot;,&amp;amp;quot;monaco&amp;amp;quot;,monospace; font-size: 14.46px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #595959; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 0.85em; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.4rem; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;desc = arcpy.da.Describe(inFC)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #aa0d91; font-family: &amp;amp;quot; consolas&amp;amp;quot;,&amp;amp;quot;andale mono&amp;amp;quot;,&amp;amp;quot;lucida console&amp;amp;quot;,&amp;amp;quot;monaco&amp;amp;quot;,monospace; font-size: 14.46px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #595959; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 0.85em; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.4rem; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt; desc[&lt;/SPAN&gt;&lt;SPAN style="color: #c41a16; font-family: &amp;amp;quot; consolas&amp;amp;quot;,&amp;amp;quot;andale mono&amp;amp;quot;,&amp;amp;quot;lucida console&amp;amp;quot;,&amp;amp;quot;monaco&amp;amp;quot;,monospace; font-size: 14.46px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;'shapeType'&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #595959; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 0.85em; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.4rem; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;] == &lt;/SPAN&gt;&lt;SPAN style="color: #c41a16; font-family: &amp;amp;quot; consolas&amp;amp;quot;,&amp;amp;quot;andale mono&amp;amp;quot;,&amp;amp;quot;lucida console&amp;amp;quot;,&amp;amp;quot;monaco&amp;amp;quot;,monospace; font-size: 14.46px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;"Point"&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 May 2019 19:18:38 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2019-05-22T19:18:38Z</dc:date>
    <item>
      <title>How to check geometry prior to running a geoprocess using a loop?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-check-geometry-prior-to-running-a/m-p/514338#M40361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Working on a portion of a script that needs to check each feature class in the geodatabase for geometry type. If the geometry is a point, it SHOULD NOT move into the loop of geoprocesses. If it is not a point i WANT it to iterate through the loop. The loop generates a feature class of points from polygons and polylines that intersect a user defined "Input_Centerline" (polyline).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Input_Centerline = arcpy.GetParameterAsText(0)&lt;/P&gt;&lt;P&gt;Folder &lt;SPAN&gt; &lt;/SPAN&gt;= "C:\\......."&lt;/P&gt;&lt;P&gt;WS = arcpy.CreateFolder_management(Folder, Date)&lt;/P&gt;&lt;P&gt;TEMP = arcpy.CreateFileGDB_management(WS, "TEMP", "CURRENT")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.env.workspace = str(TEMP)&lt;BR /&gt;fcList2 = arcpy.ListFeatureClasses()&lt;BR /&gt;for fc in fcList2:&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;fc_desc = arcpy.Describe(fc)&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;fc_gm = fc_desc.shapeType&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&lt;STRONG&gt;&amp;nbsp;if fc_gm is not "Point":&lt;/STRONG&gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fc_xing = arcpy.Intersect_analysis([Input_Centerline, fc], str(TEMP) + "\\" + str(fc) + "_XING", "", "", "POINT")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bolded is the line where i believe my issue is. So it runs through the loop just fine but it does EVERY feature class and ignores the if statement. I have tried using '&amp;lt;&amp;gt;' in place of 'is not' and yields the same results.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 May 2019 19:14:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-check-geometry-prior-to-running-a/m-p/514338#M40361</guid>
      <dc:creator>ConnorMcivor</dc:creator>
      <dc:date>2019-05-22T19:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to check geometry prior to running a geoprocess using a loop?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-check-geometry-prior-to-running-a/m-p/514339#M40362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Connor, use the new data access cursors&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/arcpy/get-started/describing-data.htm" title="https://pro.arcgis.com/en/pro-app/arcpy/get-started/describing-data.htm"&gt;Describing data—ArcPy Get Started | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #aa0d91; font-family: &amp;amp;quot; consolas&amp;amp;quot;,&amp;amp;quot;andale mono&amp;amp;quot;,&amp;amp;quot;lucida console&amp;amp;quot;,&amp;amp;quot;monaco&amp;amp;quot;,monospace; font-size: 14.46px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #595959; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 0.85em; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.4rem; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;desc = arcpy.da.Describe(inFC)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #aa0d91; font-family: &amp;amp;quot; consolas&amp;amp;quot;,&amp;amp;quot;andale mono&amp;amp;quot;,&amp;amp;quot;lucida console&amp;amp;quot;,&amp;amp;quot;monaco&amp;amp;quot;,monospace; font-size: 14.46px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #595959; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 0.85em; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.4rem; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt; desc[&lt;/SPAN&gt;&lt;SPAN style="color: #c41a16; font-family: &amp;amp;quot; consolas&amp;amp;quot;,&amp;amp;quot;andale mono&amp;amp;quot;,&amp;amp;quot;lucida console&amp;amp;quot;,&amp;amp;quot;monaco&amp;amp;quot;,monospace; font-size: 14.46px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;'shapeType'&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #595959; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 0.85em; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.4rem; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;] == &lt;/SPAN&gt;&lt;SPAN style="color: #c41a16; font-family: &amp;amp;quot; consolas&amp;amp;quot;,&amp;amp;quot;andale mono&amp;amp;quot;,&amp;amp;quot;lucida console&amp;amp;quot;,&amp;amp;quot;monaco&amp;amp;quot;,monospace; font-size: 14.46px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;"Point"&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 May 2019 19:18:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-check-geometry-prior-to-running-a/m-p/514339#M40362</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2019-05-22T19:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to check geometry prior to running a geoprocess using a loop?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-check-geometry-prior-to-running-a/m-p/514340#M40363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have now tried this approach however im getting the following errors:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;AttributeError: 'module' object has no attribute 'Describe'&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;When i use :&lt;/P&gt;&lt;P&gt;fcList2 = arcpy.ListFeatureClasses()&lt;BR /&gt;for fc in fcList2:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;fc_desc = arcpy.da.Describe(fc)&amp;nbsp; &amp;lt;&amp;lt;&amp;lt; ERROR HERE&lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if fc_desc['shapeType'] &amp;lt;&amp;gt; "Point":&amp;nbsp;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fc_xing = arcpy.Intersect_analysis([Input_Centerline, fc], str(TEMP) + "\\" + str(fc) + "_XING", "", "", "POINT")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;TypeError: 'geoprocessing describe data object' object has no attribute '__getitem__'&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;When i use:&lt;/P&gt;&lt;P&gt;fcList2 = arcpy.ListFeatureClasses()&lt;BR /&gt;for fc in fcList2:&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fc_desc = arcpy.Describe(fc)&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;if fc_desc['shapeType'] &amp;lt;&amp;gt; "Point":&amp;nbsp;&amp;lt;&amp;lt;&amp;lt; ERROR Here&lt;/STRONG&gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fc_xing = arcpy.Intersect_analysis([Input_Centerline, fc], str(TEMP) + "\\" + str(fc) + "_XING", "", "", "POINT")&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first error was using ".da" prior to the "Describe" module&lt;/P&gt;&lt;P&gt;The second error i have no idea whats going on. Im still trying variations of this approach.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 May 2019 20:21:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-check-geometry-prior-to-running-a/m-p/514340#M40363</guid>
      <dc:creator>ConnorMcivor</dc:creator>
      <dc:date>2019-05-22T20:21:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to check geometry prior to running a geoprocess using a loop?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-check-geometry-prior-to-running-a/m-p/514341#M40364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;a &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Point"&lt;/SPAN&gt;

a &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Point"&lt;/SPAN&gt;  &lt;SPAN class="comment token"&gt;# ---- is equal&lt;/SPAN&gt;
&lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;

a &lt;SPAN class="operator token"&gt;&amp;lt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Point"&lt;/SPAN&gt;  &lt;SPAN class="comment token"&gt;# ---- not, not equalo&lt;/SPAN&gt;
  File &lt;SPAN class="string token"&gt;"&amp;lt;ipython-input-3-d6a10bb86c6a&amp;gt;"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; line &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;
    a &lt;SPAN class="operator token"&gt;&amp;lt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Point"&lt;/SPAN&gt;
       &lt;SPAN class="operator token"&gt;^&lt;/SPAN&gt;
SyntaxError&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; invalid syntax


a &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Point"&lt;/SPAN&gt;   &lt;SPAN class="comment token"&gt;# --- not equal&lt;/SPAN&gt;
&lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If you are using recent versions of ArcMap and/or Pro the new cursors are available&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:28:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-check-geometry-prior-to-running-a/m-p/514341#M40364</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T22:28:56Z</dc:date>
    </item>
  </channel>
</rss>

