Not sure, but I bet FindIdentical simply rounds the values - maybe with the xy tolerance value (or some derivation of it) of the FC?All I'm really interested in is which shapes are identical to each other after a union operation on buffers.
I assume to figure out overlaps? I do this too... I just round the values of the centroid x/y coordinates and the polygon area. If it helps give you ideas:#Flatten this puppy!
shatteredFC = fgdbPath + "\\shattered"
arcpy.Union_analysis(dissolveFC, shatteredFC, "ALL", "1 FEET", "GAPS"); showGpMessage()
singlePartFC = fgdbPath + "\\single_part"
arcpy.MultipartToSinglepart_management(shatteredFC, singlePartFC); showGpMessage()
searchRows = arcpy.da.SearchCursor(singlePartFC, ["SHAPE@","*"])
polyIdDict = {}
polyIdValue = 1
decimalTolerance = 2
for searchRow in searchRows:
shapeFieldValue = searchRow[searchRows.fields.index("SHAPE@")]
xCentroidValue = round(shapeFieldValue.centroid.X, decimalTolerance)
yCentroidValue = round(shapeFieldValue.centroid.Y, decimalTolerance)
areaValue = round(shapeFieldValue.area, decimalTolerance)
axyValue = (xCentroidValue,yCentroidValue,areaValue)
catagoryNameValue = searchRow[searchRows.fields.index("CATEGORY")]
releaseYearValue = searchRow[searchRows.fields.index("RELEASE_YR")]
retentionPctValue = searchRow[searchRows.fields.index("RETENTION_PCNT")]
forestedFlagValue = searchRow[searchRows.fields.index("FORESTED")]
if axyValue not in polyIdDict:
polyIdDict[axyValue] = polyIdValue, [catagoryNameValue], [releaseYearValue],[retentionPctValue],[forestedFlagValue]
polyIdValue = polyIdValue + 1
else:
polyIdDict[axyValue][1].append(catagoryNameValue)
polyIdDict[axyValue][2].append(releaseYearValue)
polyIdDict[axyValue][3].append(retentionPctValue)
polyIdDict[axyValue][4].append(forestedFlagValue)
del searchRow, searchRows
#Sort the thing the way we want it
for axyValue in polyIdDict:
polyIdDict[axyValue][1].sort() #catagory name
polyIdDict[axyValue][2].sort(reverse=True) #release year
polyIdDict[axyValue][3].sort(reverse=True) #retention percent
polyIdDict[axyValue][4].sort() #forested
arcpy.AddField_management(singlePartFC, "POLY_ID", "LONG"); showGpMessage()
arcpy.AddField_management(singlePartFC, "LCL_RSN", "TEXT", "", "", "150"); showGpMessage()
arcpy.AddField_management(singlePartFC, "RELEASE_YR_MAX", "SHORT"); showGpMessage()
arcpy.AddField_management(singlePartFC, "RETENTION_PCNT_MAX", "SHORT"); showGpMessage()
arcpy.AddField_management(singlePartFC, "FORESTED_MAX", "TEXT", "", "", "1"); showGpMessage()
arcpy.AddField_management(singlePartFC, "LCL_RP_FLG", "SHORT"); showGpMessage()
arcpy.AddField_management(singlePartFC, "LCL_UP_FLG", "SHORT"); showGpMessage()
arcpy.AddField_management(singlePartFC, "LCL_US_FLG", "SHORT"); showGpMessage()
arcpy.AddField_management(singlePartFC, "LCL_WT_FLG", "SHORT"); showGpMessage()
updateRows = arcpy.da.UpdateCursor(singlePartFC, ["SHAPE@","*"])
for updateRow in updateRows:
shapeFieldValue = updateRow[updateRows.fields.index("SHAPE@")]
xCentroidValue = round(shapeFieldValue.centroid.X, decimalTolerance)
yCentroidValue = round(shapeFieldValue.centroid.Y, decimalTolerance)
areaValue = round(shapeFieldValue.area, decimalTolerance)
axyValue = (xCentroidValue,yCentroidValue,areaValue)
updateRow[updateRows.fields.index("POLY_ID")] = polyIdDict[axyValue][0]
updateRow[updateRows.fields.index("LCL_RSN")] = ",".join(i for i in sorted(set(polyIdDict[axyValue][1])))
updateRow[updateRows.fields.index("RELEASE_YR_MAX")] = polyIdDict[axyValue][2][0]
updateRow[updateRows.fields.index("RETENTION_PCNT_MAX")] = polyIdDict[axyValue][3][0]
updateRow[updateRows.fields.index("FORESTED_MAX")] = polyIdDict[axyValue][4][0]
if "RIPARIAN_AREA" in polyIdDict[axyValue][1] or "RMZ" in polyIdDict[axyValue][1]:
updateRow[updateRows.fields.index("LCL_RP_FLG")] = 1
if "WETLAND" in polyIdDict[axyValue][1] or "WMZ" in polyIdDict[axyValue][1]:
updateRow[updateRows.fields.index("LCL_WT_FLG")] = 1
if 'SLOPE_STABILITY_ISSUE' in polyIdDict[axyValue][1] or 'SLOPE_STABILITY_POTENTIAL' in polyIdDict[axyValue][1] or 'SLOPE_STABILITY_VERIFIED' in polyIdDict[axyValue][1] or 'UNSTABLE_SLOPES' in polyIdDict[axyValue][1]:
updateRow[updateRows.fields.index("LCL_US_FLG")] = 1
#A bit of a work around just for SPS - untl the new schema is completed...
if 'AREA_REGULATION' in polyIdDict[axyValue][1] and polyIdDict[axyValue][3][0] < 50:
updateRow[updateRows.fields.index("RETENTION_PCNT_MAX")] = 50
updateRows.updateRow(updateRow)
del updateRow, updateRows