0

I was trying to create a topology with some rule, but I have problems with the rule "Must Be Covered By Feature Class Of".

I get the error "999999: Error executing function."

This is the code:

WU = r"C:\Users\Sergio\Documents\argongra\PRUEBAS\wu16.shp"

AOI = r"C:\Users\Sergio\Documents\argongra\PRUEBAS\wu16_AOI.shp"
carpeta = r"C:/Users/Sergio/Desktop/prueba"


arcpy.CreateFileGDB_management (carpeta, "topologias", "")

arcpy.CreateFeatureDataset_management (carpeta+"/topologias.gdb", "topologias", 3035)
FD = carpeta+"/topologias.gdb/topologias"

arcpy.FeatureClassToGeodatabase_conversion (WU,  FD)
arcpy.FeatureClassToGeodatabase_conversion (AOI,  FD)

WU_FD = FD+"/wu16"
AOI_FD = FD +"/wu16_AOI"

topologia_path = carpeta +"/topologias.gdb/topologias"
arcpy.CreateTopology_management (topologia_path, "errores", 0.01)

arcpy.AddFeatureClassToTopology_management(topologia_path+"\errores", WU_FD, "", "")
arcpy.AddFeatureClassToTopology_management(topologia_path+"\errores", AOI_FD, "", "")



arcpy.AddRuleToTopology_management (topologia_path+ "\errores", "Must Not Have Gaps (Area)",  WU_FD, "", "", ""  )

arcpy.AddRuleToTopology_management (topologia_path+ "\errores", "Must Not Overlap (Area)",  WU_FD , "", "", "")

arcpy.AddRuleToTopology_management (topologia_path+ "\errores", "Must Be Covered By Feature Class Of (Area-Area)",  WU_FD,  AOI_FD , "", "")

arcpy.AddRuleToTopology_management (topologia_path+ "\errores", "Must Be Covered By Feature Class Of (Area-Area)",  AOI_FD , WU_FD, "", "")
  • Which line of code give error? Use os.path.join to combine paths and filenames, or the backslashes might get interpreted as escape characters. – BERA Aug 16 '18 at 18:46
  • Line 30, the first Must Be Covered By Feature Class Of – geoamateur Aug 24 '18 at 17:18
  • Fixed. The mistake was the AOI_FD wasn't in the right place, it should be in the next gap. arcpy.AddRuleToTopology_management (topologia_path+ "\errores", "Must Be Covered By Feature Class Of (Area-Area)", WU_FD, "" , AOI_FD, "") – geoamateur Aug 24 '18 at 19:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.