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


IGeometryServer.Densify Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Geometry > ESRI.ArcGIS.Geometry > Interfaces > IG > IGeometryServer Interface > IGeometryServer.Densify Method
ArcGIS Developer Help

IGeometryServer.Densify Method

Applies the ArcObjects 'Densify' operation to each element of the geometry array.

[Visual Basic .NET]
Public Function Densify ( _
    ByVal pSR As ISpatialReference, _
    ByVal pInGeometries As IGeometryArray, _
    ByVal maxSegmentLength As Double, _
    ByVal useDeviationDensification As Boolean, _
    ByVal densificationParameter As Double _
) As IGeometryArray
[C#]
public IGeometryArray Densify (
    ISpatialReference pSR,
    IGeometryArray pInGeometries,
    double maxSegmentLength,
    bool useDeviationDensification,
    double densificationParameter
);
[C++]
HRESULT Densify(
  ISpatialReference* pSR,
  IGeometryArray* pInGeometries,
  double maxSegmentLength,
  VARIANT_BOOL useDeviationDensification,
  double densificationParameter
);
[C++]
Parameters
pSR 

pSR is a parameter of type ISpatialReference* pInGeometries
pInGeometries is a parameter of type IGeometryArray* maxSegmentLength
maxSegmentLength is a parameter of type double useDeviationDensification
useDeviationDensification is a parameter of type bool densificationParameter
densificationParameter is a parameter of type double

Product Availability

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

Remarks

Replaces each curve segment, and optionally each line segment, in a polyline or polygon with line segments. Other types of input geometries will be ignored. All geometries are assumed to be in the spatial reference pSR, which cannot be nil.

When maxSegmentLength is greater than zero, lines and curves greater than that length will be replaced with lines at most maxSegmentLength long, and curves shorter than that will be replaced with lines connecting their endpoints. If maxSegmentLength is 0, then only curve segments will be densified, as explained below. 

In general, this method provides three ways to densify curves:

  1. based on length
  2. based on central angle
  3. based on maximum distance of replacement line from input curve (deviation)

The following table explains how the input parameters work together.

When MaxSegmentLength is and angleOrDeviation is then
> 0 0 All segments longer than maxSegmentLength are replaced with sequences of lines no longer than maxSegmentLength. Curves shorter than maxSegmentLength are replaced with lines connecting the curve endpoints. This is method 1, above, for densifying curves.
0 > 0 Input lines are copied to the output geometries. Input curves are densified using either method 2 or method 3, based on the value of the useDeviationDensification parameter.
> 0 > 0 Lines longer than maxSegmentLength units are replaced with sequences of lines no longer than maxSegmentLength; curves are replaced with sequences of lines using either method 2 or method 3, based on the value of the useDeviationDensification parameter.

When UseDeviationDensification is false the DensificationParameter is interpreted as a central angle, instead of a deviation.

Refer to IGeometryServer for additional details on how the input spatial reference is interpreted.

If the geometries are in a geographic coordinate system, then “linear” densification distances are in units of degrees (or some other gcs angular unit). This isn’t meaningful if you expect output segments to have a constant ground length, but it still accomplishes the purpose of densifying the geometries, which is useful if you subsequently want to project them more accurately.

See Also

IGeometryServer Interface