createDissolvedGDB to create a file gdb on the workspace

suggest change

The 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

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents