ArcObjects Library Reference (Geometry)  

ISpatialReferenceFactory3.ConstructHighPrecisionSpatialReference Method

Constructs a high precision spatial reference based on an existing spatial reference. xy/z/mDoubler is the number of times the respective precision is to be doubled. A value of zero will find the maximum doubling for that precision.

[Visual Basic .NET]
Public Function ConstructHighPrecisionSpatialReference ( _
    ByVal inSR As ISpatialReference, _
    ByVal xyDoubler As Integer, _
    ByVal zDoubler As Integer, _
    ByVal mDoubler As Integer _
) As ISpatialReference
[C#]
public ISpatialReference ConstructHighPrecisionSpatialReference (
    ISpatialReference inSR,
    int xyDoubler,
    int zDoubler,
    int mDoubler
);
[C++]
HRESULT ConstructHighPrecisionSpatialReference(
  ISpatialReference* inSR,
  long xyDoubler,
  long zDoubler,
  long mDoubler,
  ISpatialReference** outSR
);
[C++]

Parameters

inSR

  inSR is a parameter of type ISpatialReference

xyDoubler   xyDoubler is a parameter of type long zDoubler   zDoubler is a parameter of type long mDoubler   mDoubler is a parameter of type long outSR [out, retval]

  outSR is a parameter of type ISpatialReference

Product Availability

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

Errors Returned

 If a high precision spatial reference is passed in the operation returns E_Invalid_Arg.

Remarks

ConstructHighPrecisionSpatialReference creates a high precision copy of an existing low precision spatial reference. It is used when the new high precision spatial reference grid must mesh with the existing low precision grid. Each point of the old grid is also a point of the new grid.

The doubler parameters are exponents of powers of 2. For example, if the xyDoubler = 2, then the XY grid resolution of the output spatial reference is 4 times the input grid resolution (16 new grid cells cover 1 old grid cell). The grid also is translated so it remains centered about its current location. If a doubler parameter is -1, then the closest legal resolution to the default that covers the input XY domain and the coordinate system's horizon is chosen. If the doubler parameter is -2, the smallest possible legal resolution that covers the input XY domain and the coordinate system's horizon is chosen. In these cases, the highest exponent is chosen that will produce an output grid that both contains all the grid points defined by the input grid and covers the horizon of the input spatial reference. A doubler value of zero will maintain the existing resolution of the low precision spatial reference. It is an error to specify a doubler parameter that will result in a grid smaller than the corresponding input grid.

For ProjectedCoordinateSystems or GeographicCoordinateSystems the minimum values of the domain extent are defined just outside the envelope defined by the coordinate system's horizon.

 

[C#]

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

        ISpatialReference lowSpatialReference = spatialReferenceFactory.CreateSpatialReference(4326);

        IControlPrecision2 controlPrecision = lowSpatialReference as IControlPrecision2;
        //creates a low-precision SR
        controlPrecision.IsHighPrecision = false;

        ISpatialReferenceResolution spatialReferenceResolution = lowSpatialReference as ISpatialReferenceResolution;

        lowSpatialReference.SetFalseOriginAndUnits(-85, 120, 100000);
        //XYDoubler = -1 will result in highest legal resolution
        //M and Z doubler = 0 will result in output high precision SR matching resolution of input SR
        ISpatialReference highSpatialReference = spatialReferenceFactory.ConstructHighPrecisionSpatialReference(lowSpatialReference, -1, 0, 0);
    }

See Also

ISpatialReferenceFactory3 Interface

.NET Snippets

Convert Spatial Reference From Low To High Precision |

.NET Related Topics

Converting between high- and low-precision spatial references |