This document is archived and information here might be outdated.  Recommended version.


Create MADtedLayer Snippet (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference

Create MADtedLayer Snippet

Returns an MADtedLayer from a RasterWorkspaceEx and a DTED catalog name string.

[C#]
///<summary>Returns an MADtedLayer from a RasterWorkspaceEx and a DTED catalog name string.</summary>
/// 
///<param name="rasterWorkspaceEx">An IRasterWorkspaceEx interface</param>
///<param name="rasterCatalogName">A System.String of an existing DTED layer. Example: "myRatserCatalog"</param>
///  
///<returns>An IMADTEDLayer interface or Nothing</returns>
///  
///<remarks></remarks>
public ESRI.ArcGIS.DefenseSolutions.IMADtedLayer CreateMADtedLayer(ESRI.ArcGIS.Geodatabase.IRasterWorkspaceEx rasterWorkspaceEx, System.String rasterCatalogName)
{
  // Open the raster catalog
  ESRI.ArcGIS.Geodatabase.IRasterCatalog rasterCatalog=rasterWorkspaceEx.OpenRasterCatalog(rasterCatalogName);

  // Create the MADtedLayer
  ESRI.ArcGIS.DefenseSolutions.IMADtedLayer maDtedLayer=new ESRI.ArcGIS.DefenseSolutions.MADtedLayerClass();
  if (!(maDtedLayer.Setup((ESRI.ArcGIS.Geodatabase.ITable)rasterCatalog) == true)) // Explicit Cast
  {
    return null;
  }
  else
  {
    return maDtedLayer;
  }
}
[Visual Basic .NET]
'''<summary>Returns an MADtedLayer from a RasterWorkspaceEx and a DTED catalog name string.</summary>
''' 
'''<param name="rasterWorkspaceEx">An IRasterWorkspaceEx interface</param>
'''<param name="rasterCatalogName">A System.String of an existing DTED layer. Example: "myRatserCatalog"</param>
'''  
'''<returns>An IMADTEDLayer interface or Nothing</returns>
'''  
'''<remarks></remarks>
Public Function CreateMADtedLayer(ByVal rasterWorkspaceEx As ESRI.ArcGIS.Geodatabase.IRasterWorkspaceEx, ByVal rasterCatalogName As System.String) As ESRI.ArcGIS.DefenseSolutions.IMADtedLayer

  'Open the raster catalog
  Dim rasterCatalog As ESRI.ArcGIS.Geodatabase.IRasterCatalog=rasterWorkspaceEx.OpenRasterCatalog(rasterCatalogName)

  'Create the MADtedLayer
  Dim maDtedLayer As ESRI.ArcGIS.DefenseSolutions.IMADtedLayer=New ESRI.ArcGIS.DefenseSolutions.MADtedLayerClass

  If Not maDtedLayer.Setup(CType(rasterCatalog, ESRI.ArcGIS.Geodatabase.ITable))=True Then
    Return Nothing
  Else
    Return maDtedLayer
  End If

End Function

Additional Requirements
  • The code in this document requires the following References added to the Visual Studio project:
  • ESRI.ArcGIS.DefenseSolutions
  • ESRI.ArcGIS.Geodatabase
  • ESRI.ArcGIS.System