Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

For some graph work, I need the value of X,y tolerance. I found ISpatialReferenceTolerance.XYTolerance Property. But I couldn't find any option that how can I get ISpatialReferenceTolerance interface from the map? Can anybody give me some pointer?

Thanks.

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted
    double GetXyTolerance()
    {
        var map = ArcMap.Document.FocusMap;
        var spatialRef = map.SpatialReference;
        if (spatialRef!=null && spatialRef.HasXYPrecision())
        {
            var spRefTolerance = spatialRef as ISpatialReferenceTolerance;
            if (spRefTolerance != null && spRefTolerance.XYToleranceValid == esriSRToleranceEnum.esriSRToleranceOK)
                return spRefTolerance.XYTolerance;
        }
        return -1.0;
    }
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.