<?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 avoid Null Geometry in Point FC in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-avoid-null-geometry-in-point-fc/m-p/403885#M31799</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You missed a small, yet very important, comma when copying my code snippet from &lt;A _jive_internal="true" class="link-titled" href="https://community.esri.com/thread/181543-nullempty-geometry-in-python?commentID=812139#comment" title="https://community.esri.com/thread/181543-nullempty-geometry-in-python?commentID=812139#comment"&gt;https://community.esri.com/thread/181543-nullempty-geometry-in-python?commentID=812139#comment&lt;/A&gt;&amp;nbsp; :&lt;/P&gt;&lt;P&gt;Line 08 should either be:&lt;/P&gt;&lt;PRE class=""&gt;&lt;CODE&gt;for row, in cursor:&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;or Line 09 should be:&lt;/P&gt;&lt;PRE class=""&gt;&lt;CODE&gt;if row[0] is None:&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The reason your existing code snippet isn't finding the records is because &lt;CODE&gt;[None] is None &lt;/CODE&gt; is False.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Jul 2019 17:43:02 GMT</pubDate>
    <dc:creator>JoshuaBixby</dc:creator>
    <dc:date>2019-07-25T17:43:02Z</dc:date>
    <item>
      <title>How to avoid Null Geometry in Point FC</title>
      <link>https://community.esri.com/t5/python-questions/how-to-avoid-null-geometry-in-point-fc/m-p/403884#M31798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As a follow up to an e&lt;A _jive_internal="true" href="https://community.esri.com/thread/236684-arcgis-pro-create-locator-fails" target="_blank"&gt;arly post where the Create Locator too&lt;/A&gt;l in ArcGIS 2.4 is failing for me due to Null Geometry in two point features, I'm trying to find those records and not select them.&amp;nbsp; The initial data source is an Enter Geodatabase (aka SDE) point feature class, however I make a selection on those records based on a specific requirement and copy just those features to a scratch file geodatabase.&amp;nbsp; I'd like to avoid the null geometry points as part of that selection process as well.&amp;nbsp; That's where I'm getting stuck.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I ran the check geometry tool on my file geodatabase feature class and it returns 2 records; that tool creates a table of problems, and I can identify the two records easily with a relate:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="454340" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/454340_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In &lt;A _jive_internal="true" href="https://community.esri.com/thread/181543-nullempty-geometry-in-python?commentID=812139#comment" target="_blank"&gt;this post&lt;/A&gt;, &lt;A href="https://community.esri.com/migrated-users/3420" target="_blank"&gt;Joshua Bixby&lt;/A&gt; suggests a snippet of code to delete those records.&amp;nbsp; Rather than delete, I just tried to see I a search cursor can find them, but I get no returns:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;import arcpy

arcpy.env.workspace = r'J:\LocatorTesting\Scratch.gdb'
fc = 'AddPntsProtected'

fields = ['SHAPE@']
with arcpy.da.SearchCursor(fc,fields)as cursor:
    for row in cursor:
        if row is None:
            print('Found it')‍‍‍‍‍‍‍‍‍‍&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I altered line 6 to 'SHAPE@XY' without success; tried 'SHAPE@X'; tried 'SHAPE@Y'; all without success.&amp;nbsp;&amp;nbsp;How can I isolate the two problem records from the original selection I make to the EGDB?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/148353" target="_blank"&gt;Eric Anderson&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited to add:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This shows some promise as the 'SHAPE@XY' returns a tuple, so if I tease either X or Y out for None, I should be good to go:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'J:\LocatorTesting\Scratch.gdb'&lt;/SPAN&gt;
fc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'AddPntsProtected'&lt;/SPAN&gt;

fields &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'OBJECTID'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'SHAPE@XY'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;fields&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; None&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
            &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="number token"&gt;454702&lt;/SPAN&gt;
&lt;SPAN class="number token"&gt;454703&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:24:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-avoid-null-geometry-in-point-fc/m-p/403884#M31798</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-12-11T18:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid Null Geometry in Point FC</title>
      <link>https://community.esri.com/t5/python-questions/how-to-avoid-null-geometry-in-point-fc/m-p/403885#M31799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You missed a small, yet very important, comma when copying my code snippet from &lt;A _jive_internal="true" class="link-titled" href="https://community.esri.com/thread/181543-nullempty-geometry-in-python?commentID=812139#comment" title="https://community.esri.com/thread/181543-nullempty-geometry-in-python?commentID=812139#comment"&gt;https://community.esri.com/thread/181543-nullempty-geometry-in-python?commentID=812139#comment&lt;/A&gt;&amp;nbsp; :&lt;/P&gt;&lt;P&gt;Line 08 should either be:&lt;/P&gt;&lt;PRE class=""&gt;&lt;CODE&gt;for row, in cursor:&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;or Line 09 should be:&lt;/P&gt;&lt;PRE class=""&gt;&lt;CODE&gt;if row[0] is None:&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The reason your existing code snippet isn't finding the records is because &lt;CODE&gt;[None] is None &lt;/CODE&gt; is False.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jul 2019 17:43:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-avoid-null-geometry-in-point-fc/m-p/403885#M31799</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2019-07-25T17:43:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid Null Geometry in Point FC</title>
      <link>https://community.esri.com/t5/python-questions/how-to-avoid-null-geometry-in-point-fc/m-p/403886#M31800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ha...&amp;nbsp; this one:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;PRE class="" style="color: #000000; background: #f5f2f0; border: 0px; margin: 0.5em 0px; padding: 1em 1em 1em 3.8em;"&gt;&lt;CODE style="border: 0px; font-weight: inherit;"&gt;shp&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;,&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jul 2019 17:49:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-avoid-null-geometry-in-point-fc/m-p/403886#M31800</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2019-07-25T17:49:44Z</dc:date>
    </item>
  </channel>
</rss>

