ArcObjects Library Reference (GeoDatabase)  

ISurface.AsPolygons Method

Converts the surface to a polygon feature class representing slope or aspect.

[Visual Basic .NET]
Public Sub AsPolygons ( _
    ByVal pFeatureClass As IFeatureClass, _
    ByVal Type As esriSurfaceConversionType, _
    ByVal pClassBreaks As IDoubleArray, _
    ByVal pClassCodes As ILongArray, _
    [ByRef FieldName As Object] _
)
[C#]
public void AsPolygons (
    IFeatureClass pFeatureClass,
    esriSurfaceConversionType Type,
    IDoubleArray pClassBreaks,
    ILongArray pClassCodes,
    ref object FieldName
);
[C#]

Optional Values

FieldName   To indicate that this parameter is undefined, first define a variable object Missing = Type.Missing; then pass this in as ref Missing.
[C++]
HRESULT AsPolygons(
  IFeatureClass* pFeatureClass,
  esriSurfaceConversionType Type,
  IDoubleArray* pClassBreaks,
  ILongArray* pClassCodes,
  VARIANT* FieldName
);
[C++]

Parameters

pFeatureClass

  pFeatureClass is a parameter of type IFeatureClass

Type [in]

  Type is a parameter of type esriSurfaceConversionType

pClassBreaks [in]

  pClassBreaks is a parameter of type IDoubleArray

pClassCodes [in]

  pClassCodes is a parameter of type ILongArray

FieldName [optional]   FieldName is a parameter of type VARIANT

  To indicate this parameter is undefined pass a reference to a VARIANT with type VT_ERROR and scode value of DISP_E_PARAMNOTFOUND.

Product Availability

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

Description

Converts the surface into a 2D polygon based feature class representing areas classified by slope or aspect.

Polygons will be written to the specified 2D polygon feature class. It should be an empty feature class and is typically created immediately before calling AsPolygons.

Do not have WorkspaceEdit turned on as this member adds fields to the feature class.  The adding of fields is a schema editing operation not supported by WorkspaceEdit.

The esriSurfaceConversionType enumeration specifies whether the surface is classified on slope or aspect.

The pClassBreaks parameter is an array of doubles that defines the classification. Let's say there were 4 values placed in it: 1, 5, 10, and 15. The classification would result in 5 classes defined as follows:

 1:  <= 1
 5:  >  1 and <= 5
10:  >  5 and <= 10
15:  > 10 and <= 15
     > 15

The pClassCodes parameter is an array of long integers used to specify a class code for each class. You need to specify one more code than the number of class breaks to capture the last implied class (based on example the '>15' class). This code is written to the output feature class attribute table. The ClassCodes array can be 'Nothing' in which case the codes are automatically assigned 1..n.

When the esriSurfaceConversionType is set to esriDegreeAspect, the output code will automatically be set to -1 for polygons with undefined aspect (flat areas). This code can be overridden by providing it as an additional value at the end of the pClassCodes array. The method will know to use it because the code array will be one larger than necessary to capture the classification.

The optional FieldName argument is used to specify a name for the class code field. Defaults are provided if not specified. When esriSurfaceConversionType is esriDegreeAspect the default field name is 'AspectCode'. For both slope options it will be 'SlopeCode'. The field name is not to exceed 10 characters if writing to a shapefile as this is a dBase file limit.

See Also

ISurface Interface