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


ISpatialReferenceTolerance.SetMinimumXYTolerance Method (ArcObjects .NET 10.6 SDK)
ArcObjects Library Reference (Geometry)  

ISpatialReferenceTolerance.SetMinimumXYTolerance Method

Sets the xy cluster tolerance to be 2.0 * resolution. Use this value for compatibility with pre-9.2 topological and relational operators.

[Visual Basic .NET]
Public Sub SetMinimumXYTolerance ( _
)
[C#]
public void SetMinimumXYTolerance (
);
[C++]
HRESULT SetMinimumXYTolerance(
void
);

Product Availability

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

Errors Returned

2147220990 -  FDO_E_INDEX_OUT_OF_RANGE

The spatial reference object's resolution is undefined (NaN).  Use one of the methods on ISpatialReferenceResolution to define a resolution value before calling SetMinimumXYTolerance.

 

 

Remarks

The SetMinimumXYTolerance method sets the tolerance to the value of the spatial reference's grid resolution (or 2.0 * XYResolution). Setting the XYTolerance using this method provides a mechanism to maintain backward compatibility with ArcGIS 9.1 geometric and relational operators. At version 9.1 and before, this is the only tolerance value used by geometric and relational operators.

[C#]

    private void SetMinimumXYTolerance()
    {
        // use activator class with SpatialReferenceEnvironment singleton
        Type factoryType=Type.GetTypeFromProgID("esriGeometry.SpatialReferenceEnvironment");
        System.Object obj=Activator.CreateInstance(factoryType);
        ISpatialReferenceFactory3 spatialReferenceFactory=obj as ISpatialReferenceFactory3;

        ISpatialReference spatialReference=spatialReferenceFactory.CreateSpatialReference(32610);

        if (spatialReference == null)
            return;

        ISpatialReferenceResolution spatialRefResolution=spatialReference as ISpatialReferenceResolution;
        try
        {
            // 9.3 releases and earlier did not set the domain, resolution or
            // Set the domain extent based on the SpatialReference horizon.
            spatialRefResolution.ConstructFromHorizon();
            spatialRefResolution.SetDefaultXYResolution();
        }

        catch (Exception ex)
        {
            throw new NullReferenceException(ex.Message);
        }
        ISpatialReferenceTolerance spatialRefTolerance =
          spatialRefResolution as ISpatialReferenceTolerance;
        spatialRefTolerance.SetMinimumXYTolerance();
    }

See Also

ISpatialReferenceTolerance Interface