jg1295

Using Python, can't get Batch Project outputs to save in a feature dataset

Discussion created by jg1295 on Sep 14, 2011
Latest reply on Aug 15, 2015 by sharifulislamsium
When attempting to batch project in ArcGIS (using either arcpy or arcgisscripting), I cannot get my geoprocessing results to drop into the feature dataset that I specify. The results instead are dropped in the root of the Geodatabase (*.mdb).

Here's an abbreviated version of what I have so far:

import arcgisscripting, os
gp = arcgisscripting.create(9.3)

#set date
dmy = datetime.now()
currentDate = str(dmy.month) + "-" + str(dmy.day) + "-" + str(dmy.year)

outputfolder = gp.getparameterastext(0) #where we're going to drop the gdb
citydata = gp.getparameterastext(1)

gp.workspace = outputfolder
projectedfolder = os.path.join(outputfolder, "projected")
gp.CreateFolder_management(*os.path.split(projectedfolder))
gdb = "Projected_Data_" + currentDate + ".mdb"

#set coordinate system
outputCS = gp.CreateObject("SpatialReference")
outputCS.createFromFile(os.path.join(gp.getinstallinfo()['InstallDir'], "Coordinate Systems\\Geographic Coordinate Systems\\North America\\NAD 1983.prj"))
transformation = ""

gp.AddMessage("Creating City feature dataset")
gp.CreateFeatureDataset(os.path.join(projectedfolder, gdb), "City", outputCS)

gp.AddMessage("Loading in City feature classes")
arcpy.BatchProject_management(citydata, os.path.join(projectedfolder, gdb, "City"), outputCS, "", transformation)


Obviously, the part I'm having trouble with is the Output Path in the last line. I've also hard-coded the path to the "City" feature dataset, but still drops it in the root. Any ideas?

Outcomes