Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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?

(Cross-posted at ESRI Forums here)

share|improve this question
add comment

2 Answers 2

up vote 4 down vote accepted

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).

share|improve this answer
    
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
add comment

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 :-)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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