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 use ArcGIS .NET SDK in C#.

I'm able to load some DTED files in my ArcMap and show them in proper colors. What I want is to concat/merge/mosaic some DTED files. How can I do this?

I want to mosaic IRaster or IRasterDataset. I googled A LOT and struggled with ArcObjects Help, but still unsuccessful.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

I solved my problem and recorded the solution (with code) in the ArcGIS Discussion Forums:

First, you should create a IRasterCollection and add some IRasterDataset into it. Then you should create ISaveAs2 and cast rc to it. Then create IRasterStorageDef stuff. Finally, use ISaveAs2's SaveAsRasterDataset function to save merged/mosaicked RasterDataset to file and use it's return value as IRasterDataset. resultDataset contains the merged dataset.

IRasterCollection rc = (IRasterCollection) new MosaicRasterClass();

#region Add some IRasterDataset to the rc (IRasterCollection)
rc.Insert(0, rasterDataset0);
rc.Insert(1, rasterDataset1);
rc.Insert(2, rasterDataset2);
rc.Insert(3, rasterDataset3);
#endregion

ISaveAs2 save = (ISaveAs2) rc;
IRasterStorageDef st = new RasterStorageDefClass();
IRasterStorageDef3 store = (IRasterStorageDef3)st;
store.CompressionType = esriRasterCompressionType.esriRasterCompressionUncompressed;
store.Tiled = false;
IRasterDataset resultDataset = save.SaveAsRasterDataset("ResultDTED.dt0", _workspace_, "DEM", store);
share|improve this answer

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

1  
it would be good to have at least the gist of that other post here. In the course of time the link will be broken, and then this will be just empty and not help anyone. –  matt wilkie Mar 11 at 19:37

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.