dan.nguyen27

Create Feature Class, can the output be a file geodatabase instead of shape file?

Discussion created by dan.nguyen27 on Oct 1, 2010
Latest reply on Oct 1, 2010 by Hornbydd
Does anyone know if it is possible to specify the output of the 'CreateFeatureClass' method to be a file geodatabase type instead of shape file?

I use the method in the python script below and the code blowed up when the output shape file got too big.  I am thinking if I specify a geodatabse file output, it will avoid this problem.

Any help will be appreciated!

*******
# Create geoprocessing dispatch object
import arcgisscripting, os, sys

gp = arcgisscripting.create()
gp.overwriteoutput = 1

# gp.Workspace = "C:\Documents and Settings\dnguye1\Desktop\ToNearestMain\Test"
gp.Workspace = sys.argv[0]
fc = sys.argv[1]
out_feat_class = sys.argv[2]

gp.toolbox = "management"

   
if not gp.Exists(fc):
  print "The Customers feature class does not exists"
   
dsc = gp.describe(fc)
geomFld = dsc.ShapeFieldName

curOld = gp.SearchCursor (fc)
rowOld = curOld.Next()

gp.CreateFeatureClass(gp.Workspace, out_feat_class, "POLYLINE", fc, "", "", fc)
                   
curNew = gp.InsertCursor (out_feat_class)
arrayNew = gp.CreateObject("Array")
pntNew = gp.CreateObject("point")

while rowOld <> None:
  
    feat = rowOld.shape
   
    pntOld = feat.getpart()
    pntNew.X = pntOld.x
    pntNew.Y = pntOld.y
    arrayNew.Add(pntNew)
   
    pntNew.X = rowOld.PIPE_X
    pntNew.Y = rowOld.PIPE_Y
    arrayNew.Add(pntNew)

    rowNew = curNew.NewRow()
   
    rowNew.setValue("PREM_ID", rowOld.getValue("PREM_ID"))
    rowNew.Shape = arrayNew
    curNew.InsertRow(rowNew)

    arrayNew.RemoveAll()

    rowOld = curOld.Next()
   
del curOld, rowOld, curNew, arrayNew, pntNew, rowNew
del gp
*****

Outcomes