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 have seen ERROR 000728 several times and I could never figure out why it happens.

Here is a snippet from my code:

str_Dissolve = arcpy.Dissolve_management(Intersect_str, "in_memory/str_Dissolve", "FID_Con_st", "", "MULTI_PART", "DISSOLVE_LINES") 

I do have a field named "FID_Con_st".

There is no space in the field name and it doesn't seem to be any refresh bug, because it persists after closing the script. These were possible causes suggested by an earlier Question and an ArcGIS Discussion Form Posting.

Are there other possible causes that anyone can suggest?

share|improve this question
1  
The comment thread in the question you reference indicates this was caused by a "refresh bug." You can improve your question by showing how you have ruled out all the other hypotheses suggested in that comment thread; otherwise, people will just repeat the same suggestions and redo that research (which is why we try not to maintain duplicate questions). –  whuber Oct 4 '13 at 14:52

1 Answer 1

Confirm that the field FID_Con_st exists immediately before your line of code tries to use it by running this test.

for field in arcpy.ListFields(Intersect_str):
    print field.name
str_Dissolve = arcpy.Dissolve_management(Intersect_str, "in_memory/str_Dissolve", ["FID_Con_st"], "", "MULTI_PART", "DISSOLVE_LINES")

My suspicion, from the fact that you are trying to write your output feature class to an in_memory workspace, is that the Intersect_str variable may be set to something already in memory - and there is no guarantee that a feature class held in memory has the basic set of fields you come to expect in a feature class stored in a file geodatabase.

For background on why I have suggested the in_memory workspace be considered a possible cause see here and the related bug NIM063795.

Note: The test below shows that an in_memory workspace can be used with Dissolve so I think your question needs to be re-focussed on what you are using as your dissolve field and your code snippet does not explain where that is coming from.

import arcpy

if arcpy.Exists("C:/Temp/Test.gdb"):
    arcpy.Delete_management("C:/Temp/Test.gdb")

if arcpy.Exists("in_memory"):
    arcpy.Delete_management("in_memory")

arcpy.CreateFileGDB_management("C:/Temp","test","CURRENT")
arcpy.CreateFishnet_management("C:/Temp/test.gdb/fishnetPolys","0 0","0 1","1","1","2","2","#","NO_LABELS","#","POLYGON")
arcpy.AddField_management("C:/temp/test.gdb/fishnetPolys","DissolveField","TEXT","#","#","#","#","NULLABLE","NON_REQUIRED","#")
arcpy.CalculateField_management("C:/temp/test.gdb/fishnetPolys","DissolveField","'Any Value To Dissolve On'","PYTHON_9.3","#")
arcpy.CopyFeatures_management("C:/temp/test.gdb/fishnetPolys","in_memory/fishnetPolysInMemory","#","0","0","0")
print "Try dissolving with input and output both on disk ..."
arcpy.Dissolve_management("C:/temp/test.gdb/fishnetPolys","C:/temp/test.gdb/fishnetPolysDissolved","DissolveField","#","MULTI_PART","DISSOLVE_LINES")
print "Worked!"
print "Try dissolving with input in memory and output on disk ..."
arcpy.Dissolve_management("in_memory/fishnetPolysInMemory","C:/temp/test.gdb/fishnetPolysDissolvedFromMemory","DissolveField","#","MULTI_PART","DISSOLVE_LINES")
print "Worked!"
print "Try dissolving with input and output both in memory ..."
arcpy.Dissolve_management("in_memory/fishnetPolysInMemory","in_memory/fishnetPolysDissolvedInMemory","DissolveField","#","MULTI_PART","DISSOLVE_LINES")
print "Worked!"
print "Try dissolving with input on disk and output in memory ..."
arcpy.Dissolve_management("C:/temp/test.gdb/fishnetPolys","in_memory/fishnetPolysDissolvedToMemory","DissolveField","#","MULTI_PART","DISSOLVE_LINES")
print "Worked!"
share|improve this answer
1  
as you guessed, for some reasons in_memory along with dissolve causes the problem. I saved the the feature classes on my local hard drive and I no longer get the error! –  Arash Oct 4 '13 at 3:55

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.