createDissolvedGDB to create a file gdb on the workspace
suggest changeThe snippet assumes arcpy is already imported. Despite the name, the function only creates a file geodatabase, replacing it when that path already exists. It does not dissolve features.
def createDissolvedGDB(workspace, gdbName):
gdb_name = workspace + "/" + gdbName + ".gdb"
if arcpy.Exists(gdb_name):
arcpy.Delete_management(gdb_name)
arcpy.CreateFileGDB_management(workspace, gdbName, "")
else:
arcpy.CreateFileGDB_management(workspace, gdbName, "")
return gdb_name
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents