Friday, 21 July 2017

arcgis desktop - Controlling XY Resolution on file geodatabase feature class output from Append?


This question arises from research into Appending polygon feature classes with already repaired geometry => WARNING 000442: self intersections from Check Geometry?


Before running the code snippet below the properties of feature class rwc_aurukun show:


enter image description here


inputFileGDB = 
arcpy.env.workspace = inputFileGDB

fcList =
arcpy.CreateFeatureclass_management(inputFileGDB,"RWC","POLYGON",fcList[0])
coord_sys = arcpy.Describe(fcList[0]).spatialReference
arcpy.DefineProjection_management("RWC", coord_sys)
arcpy.env.XYDomain ="-180 -90 180 90"
arcpy.env.XYTolerance = "0.000000001 DecimalDegrees"
arcpy.Append_management(fcList,"RWC","NO_TEST")

After running the code snippet the properties of feature class RWC (which is 88 feature classes appended - including rwc_aurukun) show:


enter image description here



How can I control the XY Resolution on the output feature class (RWC)?


My experimentation with arcpy.env.XYDomain and arcpy.env.XYTolerance are not achieving the result that I am after.



Answer



Using @Vince's answer to the earlier question I am gaining some control.


My code now reads:


inputFileGDB = 
arcpy.env.workspace = inputFileGDB
fcList =
sr = arcpy.Describe(fcList[0]).spatialReference
sr.setFalseOriginAndUnits(-400.0,-400.0,10000000.0) # from Vince

arcpy.CreateFeatureclass_management(inputFileGDB,"RWC","POLYGON",fcList[0],"SAME_AS_TEMPLATE","SAME_AS_TEMPLATE",sr)
arcpy.Append_management(fcList,"RWC","NO_TEST")

and the properties of the RWC feature class are now:


enter image description here


The only glitch is that 25 self intersections still remain but these now seem tiny and after a Repair Geometry were gone.


Executing: CheckGeometry C:\Temp\DCDB\Staging.gdb\RWC C:\Temp\DCDB\Staging.gdb\RWC_cg
Start Time: Fri Jun 03 12:35:37 2016
WARNING 000442: self intersections at 12986 in C:\Temp\DCDB\Staging.gdb\RWC
WARNING 000442: self intersections at 16714 in C:\Temp\DCDB\Staging.gdb\RWC

WARNING 000442: self intersections at 20151 in C:\Temp\DCDB\Staging.gdb\RWC
WARNING 000442: self intersections at 26613 in C:\Temp\DCDB\Staging.gdb\RWC
WARNING 000442: self intersections at 26629 in C:\Temp\DCDB\Staging.gdb\RWC
WARNING 000442: self intersections at 29669 in C:\Temp\DCDB\Staging.gdb\RWC
WARNING 000442: self intersections at 30888 in C:\Temp\DCDB\Staging.gdb\RWC
WARNING 000442: self intersections at 32727 in C:\Temp\DCDB\Staging.gdb\RWC
WARNING 000442: self intersections at 32867 in C:\Temp\DCDB\Staging.gdb\RWC
WARNING 000442: self intersections at 33207 in C:\Temp\DCDB\Staging.gdb\RWC
WARNING 000442: self intersections at 35415 in C:\Temp\DCDB\Staging.gdb\RWC
WARNING 000442: self intersections at 38105 in C:\Temp\DCDB\Staging.gdb\RWC

WARNING 000442: self intersections at 38197 in C:\Temp\DCDB\Staging.gdb\RWC
WARNING 000442: self intersections at 39605 in C:\Temp\DCDB\Staging.gdb\RWC
WARNING 000442: self intersections at 41180 in C:\Temp\DCDB\Staging.gdb\RWC
WARNING 000442: self intersections at 41498 in C:\Temp\DCDB\Staging.gdb\RWC
WARNING 000442: self intersections at 41501 in C:\Temp\DCDB\Staging.gdb\RWC
WARNING 000442: self intersections at 43195 in C:\Temp\DCDB\Staging.gdb\RWC
WARNING 000442: self intersections at 44768 in C:\Temp\DCDB\Staging.gdb\RWC
WARNING 000442: self intersections at 45215 in C:\Temp\DCDB\Staging.gdb\RWC
WARNING 000442: self intersections at 45644 in C:\Temp\DCDB\Staging.gdb\RWC
WARNING 000442: self intersections at 46692 in C:\Temp\DCDB\Staging.gdb\RWC

WARNING 000442: self intersections at 52702 in C:\Temp\DCDB\Staging.gdb\RWC
WARNING 000442: self intersections at 53066 in C:\Temp\DCDB\Staging.gdb\RWC
WARNING 000442: self intersections at 55112 in C:\Temp\DCDB\Staging.gdb\RWC
Succeeded at Fri Jun 03 12:40:28 2016 (Elapsed Time: 4 minutes 50 seconds)

Adding one more zero in the code above to make the line below resulted in the appended feature class having no geometry errors.


sr.setFalseOriginAndUnits(-400.0,-400.0,100000000.0)

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...