angelablanco79

Geodatabase as workspace in Python

Discussion created by angelablanco79 on Feb 2, 2013
Latest reply on Feb 2, 2013 by Wayne_Whitley
I want to create a geodatabase as workspace using python. It woks if the Geodatabase is called data.gdb. But if I change the name of the geodatabase, the FC are stored as shapefile in the external folder but not into the geodatabase

import os
import arcpy
import sys
from arcpy import env
import os.path as path
import arcpy.cartography as CA

arcpy.env.overwriteOutput = True
Building = sys.argv [1]
DirOutPut = sys.argv[2]


arcpy.management.CreateFileGDB(sys.argv[2], "data_building.gdb", "CURRENT")
##With this Geodatabase name does not work. But it works with the name data.gdb, I need that the GDB has different name than data
results_gdb = os.path.join(DirOutPut + "\\"+"data_building.gdb")

arcpy.env.workspace = results_gdb

CA.SimplifyBuilding(Building ,"Building_symply", 0.5)

Outcomes