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


IDynamicSurface3.Contour Method (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference (GeoDatabaseExtensions)  

IDynamicSurface3.Contour Method

Generate contours of the terrain surface based on a root value and an interval.

[Visual Basic .NET]
Public Sub Contour ( _
    ByVal pAOI As IEnvelope, _
    ByVal Resolution As Double, _
    ByVal referenceContourHeight As Double, _
    ByVal interval As Double, _
    ByVal elevationFieldName As String, _
    ByVal indexContourFactor As Integer, _
    ByVal indexContourFieldName As String, _
    ByVal digitsAfterDecimalPoint As Integer, _
    ByVal pOutFeatureClass As IFeatureClass, _
    ByVal pTrackCancel As ITrackCancel _
)
[C#]
public void Contour (
    IEnvelope pAOI,
    double Resolution,
    double referenceContourHeight,
    double interval,
    string elevationFieldName,
    int indexContourFactor,
    string indexContourFieldName,
    int digitsAfterDecimalPoint,
    IFeatureClass pOutFeatureClass,
    ITrackCancel pTrackCancel
);
[C++]
HRESULT Contour(
  IEnvelope* pAOI,
  double Resolution,
  double referenceContourHeight,
  double interval,
  BSTR elevationFieldName,
  long indexContourFactor,
  BSTR indexContourFieldName,
  long digitsAfterDecimalPoint,
  IFeatureClass* pOutFeatureClass,
  ITrackCancel* pTrackCancel
);
[C++]

Parameters pAOI [in]
pAOI is a parameter of type IEnvelope Resolution [in] Resolution is a parameter of type double referenceContourHeight [in] referenceContourHeight is a parameter of type double interval [in] interval is a parameter of type double elevationFieldName [in] elevationFieldName is a parameter of type BSTR indexContourFactor [in] indexContourFactor is a parameter of type long indexContourFieldName [in] indexContourFieldName is a parameter of type BSTR digitsAfterDecimalPoint [in] digitsAfterDecimalPoint is a parameter of type long pOutFeatureClass [in]
pOutFeatureClass is a parameter of type IFeatureClass pTrackCancel [in]
pTrackCancel is a parameter of type ITrackCancel

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Description

Generates contours from the terrain writing the output to a feature class.

pAOI is the area of interest. This is the area that will be contoured. Pass a NULL pointer if you want the entire terrain to be contoured.

Resolution is used to indicate which pyramid level of the surface to use. This should match the resolution of an existing pyramid level. If there's not an exact match the next smaller resolution level (more detailed) that's actually in the terrain will be used.

referenceHeight and interval are used together to determine what contours are made. The referenceHeight is a starting point from which you add and subtract the interval. This gives you a set of values that go on forever in both positive and negative directions (...-10, -5, 0, 5, 10,...). The contours that actually get created are those that belong to this set and are also within the z range of the surface. The referenceHeight used by most applications is 0.0. A non-zero value acts as an offset. For example a root of 1.0 and interval of 5 used on a surface with a z range between 100 and 120 will yield contours with heights at 101, 106, 111, and 116.

elevationFieldName is the name of the field that contour heights will be written to. The field can already exist in pOutFeatureClass or you can rely on the method to add the field which it will do if it doesn't find it. If it's created ahead of time, which is recomended, make sure the field type is long or double.

indexContourFactor is the multiple used to flag special contours for the sake of cartographic embellishment. Typically, topographic maps draw every 5th contour in a thicker line symbol so the map is easier to read. To replicate that provide a factor of 5. The determination of 'nth contour' is made relative to the referenceHeight.

indexContourFieldName is the name of the field used distinguish regular contours from index contours. Regular contours are assigned a value of 0. Index contours a value of 1. The field can already exist in pOutFeatureClass or you can rely on the method to add the field which it will do if it doesn't find it. If it's created ahead of time, which is recomended, make sure the field type is small integer or integer.

digitsAfterDecimal is used to define the output field type and number of decimal places for the output elevation field if this method creates the field. If the field already exists digitsAfterDecimal is ignored. Otherwise, the field will be created. If digitsAfterDecimal is 0 the field type will be a long. A non-zero value will result in a field type of double. If the output feature class is a shapefile or resides in an SDE geodatabase the number of decimal places will be set to digitsAfterDecimal. It's not used for file and personal geodatabases since these do not support the property. See field 'scale' for more information.

pOutFeatureClass is the target 2D polyline feature class where the contours will be written.

pTrackCancel is a reference to a CancelTracker to support progress reporting and the ability to halt the process. To bypass this feature pass a NULL pointer.

 

Notes:

While this method will add fields if they don't already exist it's best to add them first. This gives you the opportunity to place the feature class into LoadOnly mode (if not a shapefile) before calling the method. It's not recommended for anything to be adding fields while in LoadOnly mode.

The index contour field must be type SmallInteger or Integer.

Local pits at same height of contour may result in degenerate contours. Find and eliminate searching for 0 length lines in the resulting feature class.

This method honors the setting for MinimizeResourceUsage.

See Also

IDynamicSurface3 Interface