Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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.

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 '14 at 19:37

Your Answer


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.