When attempting to batch project in ArcGIS 9.3 or 10 (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")
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?

(Cross-posted at ESRI Forums here)


Many people have asked about this. At least one request (NIM013677) has been rejected with the status "as designed." The reason given is:

Because when using the script version, the tool cannot know whether the target is a dataset or a feature class. It is designed to not support a feature dataset.

Std Disclaimer: I work at Esri, but not on the geoprocessing team (who made this decision).

  • Thanks for the info, mkennedy. It seems odd that the script version of the tool is 'designed to not support a feature dataset' when it is a legitimate output workspace in virtually every other capacity
    – J Graham
    Sep 14 '11 at 20:43
  • Update: the ESRI forums cross-post has some interesting discussion about this issue for those interested.
    – J Graham
    Sep 16 '11 at 15:07

This is fixed in ArcGIS 10.1: http://forums.arcgis.com/threads/39448-Using-Python-can-t-get-Batch-Project-outputs-to-save-in-a-feature-dataset?p=244841&viewfull=1#post244841

I tested it in the Python Window in ArcMap 10.1, it works :-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.