ArcObjects Library Reference (Geometry)  

ISpatialReferenceResolution Interface

Provides access to members that control the resolution of a spatial reference.

Product Availability

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

Members

Description
Method ConstructFromHorizon Defines the XY resolution and domain extent of this spatial reference based on the extent of its horizon. Low precision SRs will have minimum resolution of 1/10mm in current units.
Read/write property MResolution The M, or measure, resolution of this spatial reference.
Method SetDefaultMResolution Sets the m coordinate grid resolution to 1 mm for a low precision spatial reference or 1/10 mm for a high precision spatial reference.
Method SetDefaultXYResolution defaults: PCS(hi): 1/10 mm; PCS(lo): 1 mm; GCS(hi): 1/10,000 arc-second; GCS(lo): 1/500 arc-second; UCS(hi): 1/10 mm (assumed); UCS(lo): 1 mm (assumed).
Method SetDefaultZResolution Sets the z coordinate grid resolution to 1 mm for a low precision spatial reference or 1/10 mm for a high precision spatial reference.
Read/write property XYResolution The XY resolution (distance in SR units between distinguishable grid points) of this spatial reference. Reported in meters for PCS/UCS and degrees for GCS when bStandardUnits is true or in current units of SR when it is false.
Read/write property ZResolution The Z resolution (height/depth distance between distinguishable grid points) of this spatial reference. Reported in meters when bStandardUnits is true or in current units of SR when it is false.

CoClasses that implement ISpatialReferenceResolution

CoClasses and Classes Description
GeographicCoordinateSystem Creates a geographic coordinate system.
ProjectedCoordinateSystem Creates a projected coordinate system.
UnknownCoordinateSystem Creates an unknown coordinate system.

Remarks

The ISpatialReferenceResolution interface is used to define default and custom grid origins, extents and resolutions for the XY, Z and M coordinate grids associated with a spatial reference. The terms resolution and precision are synonymous within the context of the spatial reference system and the former refers to the inverse of the scale factor. Methods on this interface can define coordinate grid resolutions and extent based on a known spatial reference horizon, or alter extents and resolutions in a controlled way (for example, enlarge the extent about its current center by specifying a larger (coarser) target resolution).

[C#]

//The following code shows how to use ISpatialReferenceResolution interface and methods

ISpatialReferenceFactory spatialReferenceFactory = new SpatialReferenceEnvironmentClass();
ISpatialReference spatialReference = spatialReferenceFactory.CreateESRISpatialReferenceFromPRJFile("C:\\Program Files\\ArcGIS\\Coordinate Systems\\Geographic Coordinate Systems\\World\\WGS 1984.prj");

IControlPrecision2 controlPrecision = spatialReference as IControlPrecision2;
//Flip this to false if low precision
controlPrecision.IsHighPrecision = true;

ISpatialReferenceResolution spatialReferenceResolution = spatialReference as ISpatialReferenceResolution;
//this is the KEY, Construct Horizon THEN
spatialReferenceResolution.ConstructFromHorizon();
//Set Default  
spatialReferenceResolution.SetDefaultXYResolution();
double xMin;
double xMax;
double yMin;
double yMax;
spatialReference.GetDomain(out xMin, out xMax, out yMin, out yMax);
System.Windows.Forms.MessageBox.Show("Domain : " + xMin + ", " + xMax + ", " + yMin + ", " + yMax);

[Visual Basic .NET]

'The following code shows how to use ISpatialReferenceResolution interface and methods

        Dim pSR As ISpatialReference2
        Dim pSRF As ISpatialReferenceFactory3
        Dim pSRResolution As ISpatialReferenceResolution
        Dim pControlPrecision2 As IControlPrecision2
        Dim XMin As Double
        Dim XMax As Double
        Dim YMin As Double
        Dim YMax As Double

        pSRF = New SpatialReferenceEnvironment
        pSR = pSRF.CreateESRISpatialReferenceFromPRJFile("D:\ArcGIS\Coordinate Systems\Geographic Coordinate Systems\World\WGS 1984.prj")

        pSRResolution = pSR
        pControlPrecision2 = pSR

        pControlPrecision2.IsHighPrecision = True   'Flip this to false if low precision

        pSRResolution.ConstructFromHorizon()     'this is the KEY, Construct Horizon THEN
        pSRResolution.SetDefaultXYResolution()   'Set Default

        pSR.GetDomain(XMin, XMax, YMin, YMax)

        Debug.Print("Domain : ", XMin, XMax, YMin, YMax)