2

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.

1 Answer 1

1

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);
1
  • 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. Mar 11, 2014 at 19:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.