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.

I want to bath split analysis tool using Arcpy . I have some feature classes in a feature dataset.I want to Split All of feature classes uisng a shapefile but after split two feature classes, the runtime error raised( Runtime error : Failed to execute. Parameters are not valid. ERROR 000728: Field Province does not exist within table Failed to execute (Split)). My input feature has a province field and the result of the split is fine for a feature class but not for all of them .How can i solve the problem ? another qestion is that is there any way to change the output featureclasses? for example province name with underline featreclass name. thanks for advance

import arcpy 
arcpy.env.workspace = "D:/split_test.gdb/split" 
fcl = arcpy.ListFeatureClasses() 
for fc in fcl:
    arcpy.Split_analysis("province",fc,"province","D:/output_split.gdb","")
share|improve this question
    
If you are attempting to split your fc features, they should be the first parameter in the Split tool. help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//… –  AlmaThom Sep 30 '13 at 19:01
    
@AlmaThom . the parameters are set in arpy.Split_analysis and split work properly for one feature class but not for all of them –  wetland Sep 30 '13 at 19:06
    
That is weird, because it shouldn't. With the code you show above, you are telling the tool to split your Province feature class using the fc layer's 'province' field. –  AlmaThom Sep 30 '13 at 20:06
    
I think you need to add a print statement to show which feature class this is bailing on, and then to carefully check that the field is present and called province (not Province or PROVINCE). –  PolyGeo Sep 30 '13 at 22:33
    
I think we need you to provide more details because your additional question "is there any way to change the output featureclasses?" seems at odds with how Split derives feature class names from the Split field values. –  PolyGeo Oct 1 '13 at 3:54

1 Answer 1

Would something like this work for you? I haven't tried it in 10.1 but it's worked in the past in 10 for me!

share|improve this answer
    
I want to split by location using python –  wetland Sep 30 '13 at 21:26

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.