A Digital Elevation Model Utility

Created:11/20/2001
Description:

This tool provides a dialog allowing for the direct import of Digital Elevation Model (DEM) files into ArcMap or ArcScene. These files can be in the format of SDTS modules or ascii DEM text files. Occasionally, as when downloading USGS DEM quads, the SDTS modules will be compressed into ZIP files. This utility can extract selected ZIP files using a command line program such as PKZIP and\or will import the appropriate SDTS prefix found. This utility will also merge selected RASTERS. Optionally, values can be specified to be filled in the target RASTER, such as NODATA values or other 'rogue' values. Occasionally, public domain USGS DEMs may contain an incorrect value such as '32767', since the value of '-32767' can designate NODATA. This utility can issue a FOCALMEAN command which can cause an interpolation to fill NODATA values, or will directly replace of designated values.

The target output can be opened into the application. In the case of ArcScene, relavent 3D layer properties such as BaseHeight, the display interpolator, and the shading properties will be set as well.

This sample aims to demonstrate the use of RASTER operators, the modification of layer properties, querying a RASTER dataset for its properties, and the creation and loading of layer files into an ArcGIS applications.



How to use:

    Steps for adding a command/tool from a DLL:

  1. Register the DLL: SxMxDEMUtil.dll.
  2. In ArcScene's Customize dialog, click on 'Add from file' and select this sample's dll.
  3. Under the Commands tab, highlight the 3D Developer Samples item, and drag the DEMUtil command to a toolbar. Dismiss the Customize dialog.

    Importing a DEM:

  1. Open the DEM Utility dialog by clicking on the DEM Utility command. Browse for a folder which contains the SDTS modules, DEM, or zipped SDTS files to import. Double click or drag the the dataset in the file listbox to add it to the Import box.
  2. Select the Import command from the command drop down list. Choose the output directory, name, and RASTER format type to import. Choose Apply to start the import, or Run to import and immediately dismiss the dialog.

    Merging Multiple RASTER datasets:

  1. Browse for a folder which contains the RASTER datasets to merge. Double click or drag the the datasets from the file listbox to add it to the Import box.
  2. Choose the Merge command from the command drop down list. Choose the output directory, name, and output RASTER format for the Merge operation. Chose Apply or Run to start the Merge operation.

    Filling Nodata or other values of a RASTER:

  1. Browse for a folder which contains the RASTER datasets to fill. Double click or drag the the datasets from the file listbox to add it to the Import box.
  2. Choose the 'Fill Data' command from the command drop down list, set the appropriate output paths. Choose the Properties command on the operation frame to open a property dialog for the Fill Data command. Choose "Replace Value" or "Fill NODATA". Dismiss the property dialog to return to the main command dialog, and choose Apply or Run.

    To recompile or to view the complete source code for this project:

  1. The shared code modules should be downloaded and in the correct relative path to this project. (See link below to download the '3D Analyst Developer Sample utilties').

  2. The proper location for the utilities source code is:

    <ArcGISInstallPath>\ArcObjects Developer Kit\Samples\3D Analyst\Utilities\*.*, and for this tool:

    <ArcGISInstallPath>\ArcObjects Developer Kit\Samples\3D Analyst\Data Conversion\Dem Utility\*.*

Application:
ArcScene, ArcMap

Requires: Requires a Spatial Analyst license focalmean operations. Requires the pkzip25.exe program for extracting zipped SDTS files, or these can be unzipped first by the user.

Difficulty: Intermediate


Visual Basic
File Description
frmDEM.frm The DEM Utility dialog.
frmFillSettings.frm The properties for the optional focal mean command.
frmProperties.frm The property dialog for the tool.
frmType.frm Dialog used to define values for unknown data types.
DEMUtility.vbp VB project file for this sample.
clsDEMUtil.cls Command button for this tool.
SxMxDEMUtil.dll The compiled library for the DEM Utility tool.
(3D Analyst Developer Sample utilties) This project also references shared code located in Visual Basic code modules. To compile this project, these files are necessary in the location: '<ARCGIS INSTALL PATH > \ArcObjects Developer Kit\Samples\3D Analyst\Utilities\ '


Key CoClasses: RasterWorkspaceFactory, TextFileWorkspaceFactory, RasterConversionOp
Key Interfaces: IDatasetName, IEnumDatasetName, IRasterImportOp, I3DProperties, ISurface
Key Members: IRasterImportOp::ImportFromUSGSDEM, IRasterWorkspace::OpenRasterDataset