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

4095
11
09-14-2011 05:35 AM
JamesGraham
New Contributor III
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?
0 Kudos
11 Replies
NobbirAhmed
Esri Regular Contributor
Hi Gregory (and all others interested), good news is that finally we have implemented the desired behavior in 10.1 🙂

It works for Project and Batch Project tool.

Please let us know if you find any anomaly in expected behavior.
0 Kudos
SharifulIslam
New Contributor III

Hi all,

It may be a general problem, by the way.

Does the problem of outputting geo-processing in "Feature Dataset" still remains?

I am failing to output result of  "arcpy.JSONToFeatures_conversion" tool in "Feature Dataset" in ArcMap 10.3 (Advanced). When i run script, output goes directly into the parent "Geodatabase" though the projection of that "Feature Dataset" is the exact of the output of that tool.

Thanks

Shariful

0 Kudos