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 a points shapefile with City, State, Zip columns. I want to merge the column data together into a new column containing: City-State-Zip (with the hyphen).

Can I merge column data like this using a IFeatureClass? If not what should I try?

share|improve this question
    
Is a Calculate Field or IFeatureCursor operation not within the scope of this task? –  Nathanus Dec 6 '11 at 19:48
    
@Nathanus IFeatureCursor worked. Thanks. –  patrick Dec 6 '11 at 21:47
    
Let me type you up an answer... –  Nathanus Dec 6 '11 at 21:51
add comment

1 Answer

up vote 2 down vote accepted

Depending on whether you want to update all rows or just the selected row, you could make use of IFeatureClass's Search or Update methods to obtain an IFeatureCursor that you could then use to create your concatenated attribute value and then plop it into the IFeature using IFeature.Value if I'm not mistaken.

Personally, however, I always prefer to cast an IFeatureClass to an ITable. I just find myself more comfortable working with them. :)

share|improve this answer
2  
+1 Don't forget to call ReleaseComObject on the cursor when done with it. –  Kirk Kuykendall Dec 6 '11 at 22:04
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.