<?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 arcpy RepairGeometry flakiness (ERROR 160189: The spatial index grid size is invalid.) in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-repairgeometry-flakiness-error-160189-the/m-p/1129217#M63359</link>
    <description>&lt;P&gt;I'm using Python 3.7 and ArcGIS Pro 2.8 (arcpy 2.8, py37_arcgispro_29734).&lt;/P&gt;&lt;P&gt;In working with data from a public source, I encounter issues with repair geometry (OGC validation).&amp;nbsp; Fairly often I get a message of "ERROR 160189: The spatial index grid size is invalid."&amp;nbsp; What's maddening, though, is that the error seems to be randomly occurring.&amp;nbsp; Of the seven layers in the file, three sometimes have errors: one rarely (1 in 20), one usually (19 in 20), and one some of the time (12 in 20).&lt;/P&gt;&lt;P&gt;It is quite frustrating seeing that the same inputs (I'm wiping out the fgdb between trials and re-extracting from a single ZIP) are giving different results, and makes me think there is an issue in the RepairGeometry function (maybe a buffer problem or a race condition).&lt;/P&gt;&lt;P&gt;Attached is code to reproduce the issue including some statistics.&amp;nbsp; Apologies that the original dataset is larger than ideal for a minimal example, but copying the problem features is hard (ArcGIS Pro UX problems being a separate issue altogether).&lt;/P&gt;&lt;P&gt;Overview:&lt;/P&gt;&lt;P&gt;Download data; 10x loop: clean data directory except for zip file, extract zip file, repair the three problem layers, noting if they encountered errors; aggregate statistics and write that out to a file.&amp;nbsp; Functions are used to make it easier to step through manually/interactively.&lt;/P&gt;&lt;P&gt;The table that is output shows True if errors were encountered, False if it completed smoothly.&lt;/P&gt;&lt;P&gt;Example output:&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;   Hennepin  Dakota  Scott
0     False   False  False
1      True    True   True
2      True    True  False
3      True    True  False
4      True    True  False
5     False    True  False
6      True    True  False
7     False    True  False
8      True    True  False
9     False    True  False&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;Requires:&lt;/P&gt;&lt;P&gt;arcpy, requests, pandas&lt;/P&gt;</description>
    <pubDate>Tue, 28 Dec 2021 18:10:10 GMT</pubDate>
    <dc:creator>BillMitchell</dc:creator>
    <dc:date>2021-12-28T18:10:10Z</dc:date>
    <item>
      <title>arcpy RepairGeometry flakiness (ERROR 160189: The spatial index grid size is invalid.)</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-repairgeometry-flakiness-error-160189-the/m-p/1129217#M63359</link>
      <description>&lt;P&gt;I'm using Python 3.7 and ArcGIS Pro 2.8 (arcpy 2.8, py37_arcgispro_29734).&lt;/P&gt;&lt;P&gt;In working with data from a public source, I encounter issues with repair geometry (OGC validation).&amp;nbsp; Fairly often I get a message of "ERROR 160189: The spatial index grid size is invalid."&amp;nbsp; What's maddening, though, is that the error seems to be randomly occurring.&amp;nbsp; Of the seven layers in the file, three sometimes have errors: one rarely (1 in 20), one usually (19 in 20), and one some of the time (12 in 20).&lt;/P&gt;&lt;P&gt;It is quite frustrating seeing that the same inputs (I'm wiping out the fgdb between trials and re-extracting from a single ZIP) are giving different results, and makes me think there is an issue in the RepairGeometry function (maybe a buffer problem or a race condition).&lt;/P&gt;&lt;P&gt;Attached is code to reproduce the issue including some statistics.&amp;nbsp; Apologies that the original dataset is larger than ideal for a minimal example, but copying the problem features is hard (ArcGIS Pro UX problems being a separate issue altogether).&lt;/P&gt;&lt;P&gt;Overview:&lt;/P&gt;&lt;P&gt;Download data; 10x loop: clean data directory except for zip file, extract zip file, repair the three problem layers, noting if they encountered errors; aggregate statistics and write that out to a file.&amp;nbsp; Functions are used to make it easier to step through manually/interactively.&lt;/P&gt;&lt;P&gt;The table that is output shows True if errors were encountered, False if it completed smoothly.&lt;/P&gt;&lt;P&gt;Example output:&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;   Hennepin  Dakota  Scott
0     False   False  False
1      True    True   True
2      True    True  False
3      True    True  False
4      True    True  False
5     False    True  False
6      True    True  False
7     False    True  False
8      True    True  False
9     False    True  False&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;Requires:&lt;/P&gt;&lt;P&gt;arcpy, requests, pandas&lt;/P&gt;</description>
      <pubDate>Tue, 28 Dec 2021 18:10:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-repairgeometry-flakiness-error-160189-the/m-p/1129217#M63359</guid>
      <dc:creator>BillMitchell</dc:creator>
      <dc:date>2021-12-28T18:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy RepairGeometry flakiness (ERROR 160189: The spatial index grid size is invalid.)</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-repairgeometry-flakiness-error-160189-the/m-p/1129219#M63360</link>
      <description>&lt;P&gt;are there any multipart features in the geometry?&lt;/P&gt;</description>
      <pubDate>Tue, 28 Dec 2021 18:26:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-repairgeometry-flakiness-error-160189-the/m-p/1129219#M63360</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-12-28T18:26:51Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy RepairGeometry flakiness (ERROR 160189: The spatial index grid size is invalid.)</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-repairgeometry-flakiness-error-160189-the/m-p/1129231#M63361</link>
      <description>&lt;P&gt;There are many multi-part geometries in here.&amp;nbsp; The issues I've been seeing most frequently, though, are on features where there are differences between the Esri and OGC validity models (inner hole touches outer ring in one place).&lt;/P&gt;</description>
      <pubDate>Tue, 28 Dec 2021 19:00:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-repairgeometry-flakiness-error-160189-the/m-p/1129231#M63361</guid>
      <dc:creator>BillMitchell</dc:creator>
      <dc:date>2021-12-28T19:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy RepairGeometry flakiness (ERROR 160189: The spatial index grid size is invalid.)</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-repairgeometry-flakiness-error-160189-the/m-p/1129271#M63362</link>
      <description>&lt;P&gt;The script you posted doesn't suggest anything, but I routinely convert multipart geometry to singlepart whether or not I am checking/repairing geometry.&amp;nbsp; I would give multiparttosinglepart a prior to repair geometry to see if that improves things.&amp;nbsp; Should you need to dissolve the geometries to simplify attribute representation, you can do it after the geometry is checked (and I would use both check geometry methods as well)&lt;/P&gt;</description>
      <pubDate>Tue, 28 Dec 2021 20:48:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-repairgeometry-flakiness-error-160189-the/m-p/1129271#M63362</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-12-28T20:48:13Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy RepairGeometry flakiness (ERROR 160189: The spatial index grid size is invalid.)</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-repairgeometry-flakiness-error-160189-the/m-p/1129275#M63363</link>
      <description>&lt;P&gt;Thanks.&amp;nbsp; I'll definitely look into that, as going to singlepart does seem to reduce issues.&amp;nbsp; What surprises/irks me is that the results vary each time RepairGeometry runs on the same input data.&amp;nbsp; That makes me think there are underlying issues in the RepairGeometry function (race conditions, memory/buffer issues).&amp;nbsp; I would expect that, regardless of the success/failure of the repairs, that it would behave consistently each time.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Dec 2021 20:56:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-repairgeometry-flakiness-error-160189-the/m-p/1129275#M63363</guid>
      <dc:creator>BillMitchell</dc:creator>
      <dc:date>2021-12-28T20:56:26Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy RepairGeometry flakiness (ERROR 160189: The spatial index grid size is invalid.)</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-repairgeometry-flakiness-error-160189-the/m-p/1129322#M63366</link>
      <description>&lt;P&gt;Old but interesting... there are a number of issues with repair geometry, and the validation methods, but you identified one that may be a cause&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.esri.com/en/bugs/nimbus/QlVHLTAwMDA5MDgyNw==" target="_blank"&gt;BUG-000090827: The Repair Geometry tool does not identify (or fix) .. (esri.com)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;try Integrate as well, self intersections (not necessarily crossings!) are tricky&lt;/P&gt;</description>
      <pubDate>Tue, 28 Dec 2021 23:37:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-repairgeometry-flakiness-error-160189-the/m-p/1129322#M63366</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-12-28T23:37:35Z</dc:date>
    </item>
  </channel>
</rss>

