Wednesday 3 June 2015

arcgis desktop - Appending polygon feature classes with already repaired geometry => WARNING 000442: self intersections from Check Geometry?



I have an ArcGIS 10.2.2 for Desktop process which:



  1. Uses the Data Interoperability extension and the Feature Class To Feature Class tool to convert 88 MapInfo TAB files (with the same schema, representing different geographic areas) to 88 file geodatabase feature classes.

  2. Performs a Repair Geometry on each of those 88 feature classes

  3. Performs a Create Feature Class, Project Define (using one of the 88 feature classes as the spatial reference source) and then Append (with NOTEST) on those 88 feature classes to get a merged feature class. Note: I did not use the Merge tool because when I tried to do that only about 6 feature classes were merged before the tool reported that it had completed successfully.


The process appeared to work fine to create the merged feature class of 2.5 million polygons. However, when I ran Check Geometry on this feature class it started to report self intersections before appearing to hang and then failing with an ERROR 999999 five minutes later..


Executing: CheckGeometry C:\Temp\DCDB\Staging.gdb\DCDB C:\Temp\DCDB\RWC_CheckGeom.dbf
Start Time: Fri Jun 03 09:42:08 2016
WARNING 000442: self intersections at 883 in C:\Temp\DCDB\Staging.gdb\DCDB

WARNING 000442: self intersections at 1479 in C:\Temp\DCDB\Staging.gdb\DCDB
WARNING 000442: self intersections at 6003 in C:\Temp\DCDB\Staging.gdb\DCDB
WARNING 000442: self intersections at 6004 in C:\Temp\DCDB\Staging.gdb\DCDB
WARNING 000442: self intersections at 6015 in C:\Temp\DCDB\Staging.gdb\DCDB
WARNING 000442: self intersections at 6016 in C:\Temp\DCDB\Staging.gdb\DCDB
WARNING 000442: self intersections at 6417 in C:\Temp\DCDB\Staging.gdb\DCDB
WARNING 000442: self intersections at 7285 in C:\Temp\DCDB\Staging.gdb\DCDB
WARNING 000442: self intersections at 11813 in C:\Temp\DCDB\Staging.gdb\DCDB
WARNING 000442: self intersections at 12127 in C:\Temp\DCDB\Staging.gdb\DCDB
WARNING 000442: self intersections at 14861 in C:\Temp\DCDB\Staging.gdb\DCDB

WARNING 000442: self intersections at 16328 in C:\Temp\DCDB\Staging.gdb\DCDB
WARNING 000442: self intersections at 16847 in C:\Temp\DCDB\Staging.gdb\DCDB
WARNING 000442: self intersections at 16893 in C:\Temp\DCDB\Staging.gdb\DCDB
WARNING 000442: self intersections at 21008 in C:\Temp\DCDB\Staging.gdb\DCDB
WARNING 000442: self intersections at 22254 in C:\Temp\DCDB\Staging.gdb\DCDB
WARNING 000442: self intersections at 25064 in C:\Temp\DCDB\Staging.gdb\DCDB
WARNING 000442: self intersections at 26671 in C:\Temp\DCDB\Staging.gdb\DCDB
WARNING 000442: self intersections at 26872 in C:\Temp\DCDB\Staging.gdb\DCDB
WARNING 000442: self intersections at 27513 in C:\Temp\DCDB\Staging.gdb\DCDB
WARNING 000442: self intersections at 27521 in C:\Temp\DCDB\Staging.gdb\DCDB

WARNING 000442: self intersections at 27540 in C:\Temp\DCDB\Staging.gdb\DCDB
WARNING 000442: self intersections at 27579 in C:\Temp\DCDB\Staging.gdb\DCDB
WARNING 000442: self intersections at 27600 in C:\Temp\DCDB\Staging.gdb\DCDB
WARNING 000442: self intersections at 27603 in C:\Temp\DCDB\Staging.gdb\DCDB
ERROR 999999: Error executing function.
Failed to execute (CheckGeometry).
Failed at Fri Jun 03 09:47:19 2016 (Elapsed Time: 5 minutes 10 seconds)

Should appending polygon feature classes with already repaired geometry be expected to produce a feature class that can pass the Check Geometry test?



Answer




The Understanding Coordinate Management in the Geodatabase whitepaper is still the gold standard for understanding what's happening behind the scenes.


The key things to remember are:



  1. Esri coordinate references encompass far more than coordinate system

  2. The coordinate reference of a feature class cannot be changed

  3. If you let ArcGIS choose your coordinate reference by just selecting coordinate system, it will choose a resolution that equates to 1/10th of a millimeter


If you are using the right-click New -> Feature Class.. from a folder which is a file or enterprise geodatabase, the first page is the name and geometry type, the second is the coordinate system, and the third page is the Tolerance:


XY Tolerance


Notice the checkbox! If you uncheck the default, then the fourth page allows the XY Resolution to be set:



XY Resolution


Of course, if your feature class is 3D or Measured, then the tolerance and precision pages will also include Z and M values.


The equivalent process in Python works by customizing a SpatialReference then using that in the creation request:


sr = arcpy.SpatialReference(4326) 
sr.setFalseOriginAndUnits(-400.0,-400.0,10000000.0)
arcpy.CreateFeatureclass_management(connPath,tabName,
'POLYGON',spatial_reference=‌​sr,config_keyword=dbtuneOpt)

The default tolerance when set by units is twice the multiplicative inverse of the scale.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...