How to construct a high- or low-precision spatial reference

Constructing a high- or low-precision spatial reference

The following code example determines whether you are constructing a high- or low-precision spatial reference and sets the default resolution and default tolerance:
static void constructCoordinateSystem(boolean highPrecision)throws Exception{
    ISpatialReferenceFactory3 spatialReferenceFactory = new
    ISpatialReference3 spatialReference = (ISpatialReference3)
        "C:\\Program Files\\ArcGIS\\Coordinate Systems\\Geographic Coordinate Systems\\World\\WGS 1984.prj");

    IControlPrecision2 controlPrecision = (IControlPrecision2)spatialReference;

    //Determines whether you are constructing a high or low.
    ISpatialReferenceResolution spatialReferenceResolution = 

    //These three methods are the keys, construct horizon, then set the default x,y resolution and tolerance.

    //Set the default x,y resolution value.

    //Set the default x,y tolerance value.
    ISpatialReferenceTolerance spatialReferenceTolerance = 

    double xMin[] = new double[1];
    double xMax[] = new double[1];
    double yMin[] = new double[1];
    double yMax[] = new double[1];
    spatialReference.getDomain(xMin, xMax, yMin, yMax);

    System.out.println("Domain : " + xMin[0] + ", " + xMax[0] + ", " + yMin[0] + 
        ", " + yMax[0]);

See Also:

How to import or export a spatial reference

Additional Requirements
  • This article assumes your project includes references to the ESRI Geometry assembly.

Development licensingDeployment licensing
ArcGIS for Desktop BasicArcGIS for Desktop Basic
ArcGIS for Desktop StandardArcGIS for Desktop Standard
ArcGIS for Desktop AdvancedArcGIS for Desktop Advanced
Engine Developer KitEngine