ArcObjects Library Reference (Geometry)  

IGeometryServer2.Difference Method

Returns an array of geometries where each result geometry R[i] is (array1[i] difference G2).

[Visual Basic .NET]
Public Function Difference ( _
    ByVal pSR As ISpatialReference, _
    ByVal pInGA1 As IGeometryArray, _
    ByVal pInG2 As IGeometry _
) As IGeometryArray
[C#]
public IGeometryArray Difference (
    ISpatialReference pSR,
    IGeometryArray pInGA1,
    IGeometry pInG2
);
[C++]
HRESULT Difference(
  ISpatialReference* pSR,
  IGeometryArray* pInGA1,
  IGeometry* pInG2,
  IGeometryArray** pDifferenceGA
);
[C++]

Parameters

pSR

  pSR is a parameter of type ISpatialReference

pInGA1

  pInGA1 is a parameter of type IGeometryArray

pInG2

  pInG2 is a parameter of type IGeometry

pDifferenceGA [out, retval]

  pDifferenceGA is a parameter of type IGeometryArray

Product Availability

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

Remarks

This operation constructs the set-theoretic difference between each element of the input array and InGeometry2. Each result is placed at the corresponding index in the output array – that is, Result[i] = InGeometryArray1[i] Difference InGeometry2. The only restriction on combinations of geometry types is that the dimension of InGeometry2 must be equal to or greater than the dimensions of the elements of InGeometryArray1. Any inputs that are completely within InGeometry2 are represented by empty geometries of the same type in the output array.

The figure below shows an example of the difference operation. The geometry array contains all geometries shown with the exception of the central circular polygon. The output array contains the modified geometries shown in the right part of the figure. Note that one of the output points will be “empty” because the corresponding input is inside the circular polygon.

Difference

See Also

IGeometryServer2 Interface