ISpatialReference Interface

Provides access to members that control a SpatialReference.

Description

The spatial reference is not defined when creating a new instance of a geometry. It is the developer's responsibility to define a spatial reference that makes sense for the geometry and for the operation. To achieve precise and predictable results using the geometry library, it is essential that the spatial reference of geometries within a workflow is well defined. When performing a spatial operation using two or more geometries, for example an intersection, the coordinate systems of the two geometries must be equal. If the coordinate systems of the geometries are different or undefined, the operation could produce unexpected results.

Members

Name Description
Read-only property Abbreviation The abbreviated name of this spatial reference component.
Read-only property Alias The alias of this spatial reference component.
Method Changed Notify this object that some of its parts have changed (parameter values, z unit, etc.).
Read-only property FactoryCode The factory code (WKID) of the spatial reference.
Method GetDomain The XY domain extent.
Method GetFalseOriginAndUnits Get the false origin and units.
Method GetMDomain The measure domain extent.
Method GetMFalseOriginAndUnits Get the measure false origin and units.
Method GetZDomain The Z domain extent.
Method GetZFalseOriginAndUnits Get the Z false origin and units.
Method HasMPrecision Returns true when m-value precision information has been defined.
Method HasXYPrecision Returns true when (x,y) precision information has been defined.
Method HasZPrecision Returns true when z-value precision information has been defined.
Method IsPrecisionEqual Returns TRUE when the precision information for the two spatial references is the same.
Read-only property Name The name of this spatial reference component.
Read-only property PrecisionExImpl An opaque reference to the precision information (including z/m awareness) implementation for this spatial reference.
Read-only property PrecisionImpl An opaque reference to the precision information implementation for this spatial reference.
Read-only property Remarks The comment string of this spatial reference component.
Method SetDomain The XY domain extent.
Method SetFalseOriginAndUnits Set the false origin and units.
Method SetMDomain The measure domain extent.
Method SetMFalseOriginAndUnits Set the measure false origin and units.
Method SetZDomain The Z domain extent.
Method SetZFalseOriginAndUnits Set the Z false origin and units.
Read-only property SpatialReferenceImpl SpatialReferenceImpl.
Read/write property ZCoordinateUnit The unit for the Z coordinate.

ISpatialReference.Changed Method

Notify this object that some of its parts have changed (parameter values, z unit, etc.).

Public Sub Changed ( _
)
public void Changed (
);

ISpatialReference.GetDomain Method

The XY domain extent.

Public Sub GetDomain ( _
    ByRef XMin As Double, _
    ByRef XMax As Double, _
    ByRef YMin As Double, _
    ByRef YMax As Double _
)
public void GetDomain (
    ref double XMin,
    ref double XMax,
    ref double YMin,
    ref double YMax
);

Description

An alternative method to the GetFalseOriginAndUnits method. Returns the minimum and maximum allowed X and Y values for a spatial reference. Use GetFalseOriginAndUnits to obtain the allowed precision (1/resolution) value.

Remarks

The GetDomain and SetDomain methods are used to set and get the square domain extent of a coordinate system. The domain extent is different than the valid area of a coordinate system. The domain extent is an arbitrary square used to delimit valid coordinates for a spatial reference system and determine their resolution. It is possible that the domain extent is larger than the usable area of a coordinate system (a UTM zone, for example). A small domain extent gives you finer resolution coordinates over a smaller area. A larger domain extent lets you represent features over a larger geographic area but with coarser resolution.

//This code example shows how to get the xy domain extent of a dataset. 

private void GetSpatialReferenceProperties(IFeatureClass featureClass)

{

    IGeoDataset geoDataset = featureClass as IGeoDataset;

    //get access to SpatialReference through IGeoDataset 

    ISpatialReference spatialReference = geoDataset.SpatialReference;

    //get the xy domain extent of the dataset 

    double xMin;

    double xMax;

    double yMin;

    double yMax;

    spatialReference.GetDomain(out xMin, out xMax, out yMin, out yMax);

    System.Windows.Forms.MessageBox.Show(xMin + ", " + xMax + ", " + yMin + ", " + yMax);

}
'This code example shows how to get the xy domain extent of a dataset. 

    'This example assumes that a valid workspace object has already been established. 

    Sub GetDomain_Example(ByVal pWorkspace As IWorkspace)

        Dim pFeatWS As IFeatureWorkspace

        pFeatWS = pWorkspace

        Dim pFeatDS As IFeatureDataset

        pFeatDS = pFeatWS.OpenFeatureDataset("railroad")

        Dim pGeoDataset As IGeoDataset

        pGeoDataset = pFeatDS

        'get access to SpatialReference through IGeoDataset 

        Dim pSpatRef As ISpatialReference

        pSpatRef = pGeoDataset.SpatialReference

        Dim dXmax As Double

        Dim dYmax As Double

        Dim dXmin As Double

        Dim dYmin As Double

        'get the xy domain extent of the dataset 

        pSpatRef.GetDomain(dXmin, dXmax, dYmin, dYmax)

        Debug.Print(dXmin & ", ", dXmax & ", " & dYmin, ", " & dYmax)

    End Sub

ISpatialReference.GetFalseOriginAndUnits Method

Get the false origin and units.

Public Sub GetFalseOriginAndUnits ( _
    ByRef falseX As Double, _
    ByRef falseY As Double, _
    ByRef xyUnits As Double _
)
public void GetFalseOriginAndUnits (
    ref double falseX,
    ref double falseY,
    ref double xyUnits
);

Description

An alternative method to the GetDomain method. The falseX and falseY values correspond to the minimum X and minimum Y values of the XY domain. The xyUnits is the same as the precision or scale value. The inverse of the xyUnits defines the resolution of the data stored in the geodatabase. The resolution is used to snap data when it is stored in the geodatabase.

The falseX, falseY, and xyUnits use the same unit of measure as the coordinate system.

Sample values if data is based on a geographic coordinate system are:

falseX = -180
falseY = -90
xyUnits = 1000000
Sample values if data is based on a projected coordinate system are: 
 
falseX = 200000
falseY = 4000000
xyUnits = 100

In the first example, the data is using a geographic coordinate system so the falseX and falseY values are in degrees. The inverse of the xyUnits is 0.000001 degrees.

In the second example, the data is using a projected coordinate system. Let us assume that the unit of measure is meters. The smallest coordinates values that a feature can have is x = 200000 meters and Y = 4000000 meters. The inverse of the xyUnits is 0.01 (meters) which means data will be snapped to the closest centimeter when it is stored.

Remarks

Use this function to retrieve the following information about the spatial reference of the geometry:

falseX: XMin of the domain.

falseY: YMin of the domain.

XYUnits: Precision of the domain.

//This code example shows how to get the false origin and units of a dataset

 private void GetFalseOriginAndUnits(IFeatureClass featureClass)

 {

     IGeoDataset geoDataset = featureClass as IGeoDataset;

     //get access to SpatialReference through IGeoDataset

     ISpatialReference spatialReference = geoDataset.SpatialReference;

     //get the false origin and units of the dataset

     double falseX;

     double falseY;

     double xyUnits;

     spatialReference.GetFalseOriginAndUnits(out falseX, out falseY, out xyUnits);

     System.Windows.Forms.MessageBox.Show(falseX + ", " + falseY + ", " + xyUnits);

 }
'This code example shows how to get the false origin and units of a dataset.

     'This example assumes that a valid workspace object has already 'been established.

     Sub GetFalseOriginAndUnits_Example(ByVal pWorkspace As IWorkspace)

         Dim pFeatWS As IFeatureWorkspace

         pFeatWS = pWorkspace

         Dim pFeatDS As IFeatureDataset

         pFeatDS = pFeatWS.OpenFeatureDataset("railroad")

         Dim pGeoDataset As IGeoDataset

         pGeoDataset = pFeatDS

        'get access to SpatialReference through IGeoDataset

         Dim pSpatRef As ISpatialReference

         pSpatRef = pGeoDataset.SpatialReference

        'declare variables that will be used to store the

         'false origin and units of the dataset

         Dim dFalseX As Double

         Dim dFalseY As Double

         Dim dXYUnits As Double

         'get the false origin and units of the dataset

         pSpatRef.GetFalseOriginAndUnits(dFalseX, dFalseY, dXYUnits)

         Debug.Print(dFalseX & ", " & dFalseY & ", " & dXYUnits)

     End Sub

ISpatialReference.GetMDomain Method

The measure domain extent.

Public Sub GetMDomain ( _
    ByRef outMMin As Double, _
    ByRef outMMax As Double _
)
public void GetMDomain (
    ref double outMMin,
    ref double outMMax
);

Description

An alternative method to the GetMFalseOriginAndUnits method. Returns the minimum and maximum allowed measure values for a spatial reference. Use GetMFalseOriginAndUnits to obtain the M precision (1/resolution) value.

//This code example shows how to get the M domain extent of a dataset.

//Make sure that a M domain exists 

private void GetMDomain(IFeatureClass featureClass)

{

    IGeoDataset geoDataset = featureClass as IGeoDataset;

    //get access to SpatialReference through IGeoDataset 

    ISpatialReference spatialReference = geoDataset.SpatialReference;

    //get the M domain extent of the dataset 

    double mMin;

    double mMax;

    spatialReference.GetMDomain(out mMin, out mMax);

    System.Windows.Forms.MessageBox.Show(mMin + ", " + mMax);

}
'This code example shows how to get the M domain of a dataset. 

    'This example assumes that a valid workspace object has already been 'established. 

    Sub GetMDomain_Example(ByVal pWorkspace As IWorkspace)

        Dim pFeatWS As IFeatureWorkspace

        pFeatWS = pWorkspace

        Dim pFeatDS As IFeatureDataset

        pFeatDS = pFeatWS.OpenFeatureDataset("railroad")

        Dim pGeoDataset As IGeoDataset

        pGeoDataset = pFeatDS

        'get access to SpatialReference through IGeoDataset 

        Dim pSpatRef As ISpatialReference

        pSpatRef = pGeoDataset.SpatialReference

        'dimension variables that will be used to store the 

        'M domain of the dataset 

        Dim dMmin As Double

        Dim dMmax As Double

        'get the M domain of the dataset 

        pSpatRef.GetMDomain(dMmin, dMmax)

        Debug.Print(dMmin & ", ", dMmax)

    End Sub

ISpatialReference.GetMFalseOriginAndUnits Method

Get the measure false origin and units.

Public Sub GetMFalseOriginAndUnits ( _
    ByRef falseM As Double, _
    ByRef mUnits As Double _
)
public void GetMFalseOriginAndUnits (
    ref double falseM,
    ref double mUnits
);

Description

An alternative method to the GetMDomain method. The falseM value corresponds to the minimum measure value of the measure domain. The mUnits is the same as the precision or scale value. The inverse of the mUnits defines the resolution of the measure data stored in the geodatabase. The resolution is used to snap data when it is stored in the geodatabase.

//This code example shows how to get the M false origin and units of a dataset

//Make sure that the features in the featureClass contain falseM values

private void GetMFalseOriginAndUnits(IFeatureClass featureClass)

{

  IGeoDataset geoDataset = featureClass as IGeoDataset;

  //get access to SpatialReference through IGeoDataset

  ISpatialReference spatialReference = geoDataset.SpatialReference;

  //get the M false origin and units of the dataset

  double falseM;

  double mUnits;

  spatialReference.GetMFalseOriginAndUnits(out falseM, out mUnits);

  System.Windows.Forms.MessageBox.Show(falseM + ", " + mUnits);

}
'This code example shows how to get the M false origin and units of a 'dataset. 

    'This example assumes that a valid workspace object has already 'been established. 

    Sub GetMFalseOriginAndUnits_Example(ByVal pWorkspace As IWorkspace)

        Dim pFeatWS As IFeatureWorkspace

        pFeatWS = pWorkspace

        Dim pFeatDS As IFeatureDataset

        pFeatDS = pFeatWS.OpenFeatureDataset("railroad")

        Dim pGeoDataset As IGeoDataset

        pGeoDataset = pFeatDS

        'get access to SpatialReference through IGeoDataset 

        Dim pSpatRef As ISpatialReference

        pSpatRef = pGeoDataset.SpatialReference

        'dimension variables that will be used to store the 

        'M false origin and units of the dataset 

        Dim dFalseM As Double

        Dim dMUnits As Double

        'get the M false origin and units of the dataset 

        pSpatRef.GetMFalseOriginAndUnits(dFalseM, dMUnits)

        Debug.Print(dFalseM & ", " & dMUnits)

    End Sub

ISpatialReference.GetZDomain Method

The Z domain extent.

Public Sub GetZDomain ( _
    ByRef outZMin As Double, _
    ByRef outZMax As Double _
)
public void GetZDomain (
    ref double outZMin,
    ref double outZMax
);

Description

An alternative method to the GetZFalseOriginAndUnits method. Returns the minimum and maximum allowed Z values for a spatial reference. Use GetZFalseOriginAndUnits to obtain the Z precision (1/resolution) value.

//This code example shows how to get the Z domain extent of a dataset. 

private void GetZDomain(IFeatureClass featureClass)

{

    IGeoDataset geoDataset = featureClass as IGeoDataset;

    //get access to SpatialReference through IGeoDataset 

    ISpatialReference spatialReference = geoDataset.SpatialReference;

    //get the Z domain extent of the dataset 

    double zMin;

    double zMax;

    spatialReference.GetZDomain(out zMin, out zMax);

    System.Windows.Forms.MessageBox.Show(zMin + ", " + zMax);

}
'This code example shows how to get the Z domain extent of a dataset. 

    'This example assumes that a valid workspace object has already been 'established. 

    Sub GetZDomain_Example(ByRef pWorkspace As IWorkspace)

        Dim pFeatWS As IFeatureWorkspace

        pFeatWS = pWorkspace

        Dim pFeatDS As IFeatureDataset

        pFeatDS = pFeatWS.OpenFeatureDataset("railroad")

        Dim pGeoDataset As IGeoDataset

        pGeoDataset = pFeatDS

        'get access to SpatialReference through IGeoDataset 

        Dim pSpatRef As ISpatialReference

        pSpatRef = pGeoDataset.SpatialReference

        'dimension variables that will be used to store the Z domain extent of 

        'the dataset 

        Dim dZmin As Double

        Dim dZmax As Double

        'get the Z domain extent of the dataset 

        pSpatRef.GetZDomain(dZmin, dZmax)

        Debug.Print(dZmin & ", " & dZmax)

    End Sub

ISpatialReference.GetZFalseOriginAndUnits Method

Get the Z false origin and units.

Public Sub GetZFalseOriginAndUnits ( _
    ByRef falseZ As Double, _
    ByRef zUnits As Double _
)
public void GetZFalseOriginAndUnits (
    ref double falseZ,
    ref double zUnits
);

Description

An alternative method to the GetZDomain method. The falseZ value corresponds to the minimum Z value of the Z domain. The zUnits is the same as the precision or scale value. The inverse of the zUnits defines the resolution of the z data stored in the geodatabase. The resolution is used to snap data when it is stored in the geodatabase.

//This code example shows how to get the Z false origin and units of a dataset

//Make sure that the features in the featureClass contain falseZ values

private void GetZFalseOriginAndUnits(IFeatureClass featureClass)

{

    IGeoDataset geoDataset = featureClass as IGeoDataset;

    //get access to SpatialReference through IGeoDataset 

    ISpatialReference spatialReference = geoDataset.SpatialReference;

    //get the Z false origin and units of the dataset 

    double falseZ;

    double zUnits;

    spatialReference.GetZFalseOriginAndUnits(out falseZ, out zUnits);

    System.Windows.Forms.MessageBox.Show(falseZ + ", " + zUnits);

}
'This code example shows how to get the Z false origin and units of a 'dataset. 

    'This example assumes that a valid workspace object has already 'been established. 

    Sub GetZFalseOriginAndUnits_Example(ByRef pWorkspace As IWorkspace)

        Dim pFeatWS As IFeatureWorkspace

        pFeatWS = pWorkspace

        Dim pFeatDS As IFeatureDataset

        pFeatDS = pFeatWS.OpenFeatureDataset("railroad")

        Dim pGeoDataset As IGeoDataset

        pGeoDataset = pFeatDS

        'get access to SpatialReference through IGeoDataset 

        Dim pSpatRef As ISpatialReference

        pSpatRef = pGeoDataset.SpatialReference

        'dimension variables that will be used to store the 

        'Z false origin and units of the dataset 

        Dim dFalseZ As Double

        Dim dZUnits As Double

        'get the Z false origin and units of the dataset 

        pSpatRef.GetZFalseOriginAndUnits(dFalseZ, dZUnits)

        Debug.Print(dFalseZ & ", " & dZUnits)

    End Sub

ISpatialReference.HasMPrecision Method

Returns true when m-value precision information has been defined.

Public Function HasMPrecision ( _
) As Boolean
public bool HasMPrecision (
);

ISpatialReference.HasXYPrecision Method

Returns true when (x,y) precision information has been defined.

Public Function HasXYPrecision ( _
) As Boolean
public bool HasXYPrecision (
);

ISpatialReference.HasZPrecision Method

Returns true when z-value precision information has been defined.

Public Function HasZPrecision ( _
) As Boolean
public bool HasZPrecision (
);

ISpatialReference.IsPrecisionEqual Method

Returns TRUE when the precision information for the two spatial references is the same.

Public Sub IsPrecisionEqual ( _
    ByVal otherSR As ISpatialReference, _
    ByRef IsPrecisionEqual As Boolean _
)
public void IsPrecisionEqual (
    ISpatialReference otherSR,
    ref bool IsPrecisionEqual
);

Remarks

The IClone::IsEqual method implementation for spatial referencesonly compares the coordinate system (projection information) portion of the spatial reference. If, in addition, you need to verify that the coordinate grid portions of the spatial references are equal, apply this method after IsEqual. The XY, Z, or M domain and resolution (precision) values, as well as the XY, Z and M cluster tolerances are compared.

ISpatialReference.PrecisionExImpl Property

An opaque reference to the precision information (including z/m awareness) implementation for this spatial reference.

Public ReadOnly Property PrecisionExImpl As Long
public long PrecisionExImpl {get;}

Remarks

This property is for internal use only.

ISpatialReference.PrecisionImpl Property

An opaque reference to the precision information implementation for this spatial reference.

Public ReadOnly Property PrecisionImpl As Long
public long PrecisionImpl {get;}

Remarks

This property is for internal use only.

ISpatialReference.SetDomain Method

The XY domain extent.

Public Sub SetDomain ( _
    ByVal XMin As Double, _
    ByVal XMax As Double, _
    ByVal YMin As Double, _
    ByVal YMax As Double _
)
public void SetDomain (
    double XMin,
    double XMax,
    double YMin,
    double YMax
);

Description

An alternative method to the SetFalseOriginAndUnits method. Sets the minimum and maximum allowed X and Y values for a spatial reference. A resolution is then calculated from these extremes. Use SetFalseOriginAndUnits to set explicitly the desired scale factor (1.0/resolution) value.

Remarks

The xy domain must be square. If you set a wider X or Y extent, it will take precedence. For example, let's say you set these values:

XMin = -180

XMax = 180

YMin = -90

YMax = 90

If you then query the values with GetDomain, you will see that the YMax value is 270. That is because the X extent is 360, so the Y extent must also be 360. The minimum x and y values are always maintained.

When creating a new spatial reference with a projected or geographic coordinate system, the recommended method for defining the XY Domain is ISpatialReferenceResolution::ConstructFromHorizon, followed by ISpatialReferenceResolution::SetDefaultXYResolution and ISpatialReferenceTolerance::SetDefaultXYTolerance. These methods produce a valid domain that covers the valid coordinate range for the coordinate system and reasonable resolution and tolerance values. The default XY tolerance value is 1 mm or its equivalent based on the coordinate system's unit of measure. The default XY resolution value is 0.1 mm or its equivalent. Tolerance values must be at least two times as large as the resolution value.

//This code example shows how to set the xy domain extent of a dataset. 

    private void SetSpatialReferenceProperties(IFeatureClass featureClass)

    {

        IGeoDataset geoDataset = featureClass as IGeoDataset;

        //get access to SpatialReference through IGeoDataset 

        ISpatialReference spatialReference = geoDataset.SpatialReference;

        //set the xy domain extent for the dataset 

        spatialReference.SetDomain(10000, 90000, 10000, 90000);

    }

ISpatialReference.SetFalseOriginAndUnits Method

Set the false origin and units.

Public Sub SetFalseOriginAndUnits ( _
    ByVal falseX As Double, _
    ByVal falseY As Double, _
    ByVal xyUnits As Double _
)
public void SetFalseOriginAndUnits (
    double falseX,
    double falseY,
    double xyUnits
);

Description

An alternative to the SetDomain method. The falseX and falseY values correspond to the minimum X and minimum Y values of the XY domain. The xyUnits, also referred to as the scale factor, is the is the inverse of the resolution (which is also referred to as the precision).

Sample values if data is based on a geographic coordinate system are:

falseX = -180
falseY = -90
xyUnits = 1000000

Remarks

When creating a new spatial reference with a projected or geographic coordinate system, the recommended method for defining the XY Domain is ISpatialReferenceResolution::ConstructFromHorizon.

//This code example shows how to set the false origin and units 

    private void SetSpatialReferenceProperties(IFeatureClass featureClass)

    {

        IGeoDataset geoDataset = featureClass as IGeoDataset;

        //get access to SpatialReference through IGeoDataset 

        ISpatialReference spatialReference = geoDataset.SpatialReference;

        //set the false origin and units for the coverage where the 

        //falseX, falseY, and xyUnits numeric expressions are double 

        spatialReference.SetFalseOriginAndUnits(475006.096654, 3759312.190404, 124999.999883);

    }

ISpatialReference.SetMDomain Method

The measure domain extent.

Public Sub SetMDomain ( _
    ByVal inMMin As Double, _
    ByVal inMMax As Double _
)
public void SetMDomain (
    double inMMin,
    double inMMax
);

Description

An alternative method to the SetMFalseOriginAndUnits method. Sets the minimum and maximum allowed measure values for a spatial reference. Use SetMFalseOriginAndUnits to set explicitly the allowed measure precision value. The mUnits value is the inverse of the resolution of the measure data.

//This code example shows how to set the M domain extent of a dataset. 

    private void SetSpatialReferenceProperties(IFeatureClass featureClass)

    {

        IGeoDataset geoDataset = featureClass as IGeoDataset;

        //get access to SpatialReference through IGeoDataset 

        ISpatialReference spatialReference = geoDataset.SpatialReference;

        //set the M domain extent for the dataset 

        spatialReference.SetMDomain(0, 2147483645);

    }

ISpatialReference.SetMFalseOriginAndUnits Method

Set the measure false origin and units.

Public Sub SetMFalseOriginAndUnits ( _
    ByVal falseM As Double, _
    ByVal mUnits As Double _
)
public void SetMFalseOriginAndUnits (
    double falseM,
    double mUnits
);

Description

An alternative method to the SetMDomain method. The falseM value corresponds to the minimum measure value of the measure domain. The mUnits is the same as the precision or scale value. The inverse of mUnits is the resolution of the measure data.

//This code example shows how to set the measure false origin and units 

    private void SetSpatialReferenceProperties(IFeatureClass featureClass)

    {

        IGeoDataset geoDataset = featureClass as IGeoDataset;

        //get access to SpatialReference through IGeoDataset 

        ISpatialReference spatialReference = geoDataset.SpatialReference;

        //set the M false origin and units for the dataset where the 

        //numeric expressions that represent falseM and mUnits are double 

        spatialReference.SetMFalseOriginAndUnits(0, 1);

    }

ISpatialReference.SetZDomain Method

The Z domain extent.

Public Sub SetZDomain ( _
    ByVal inZMin As Double, _
    ByVal inZMax As Double _
)
public void SetZDomain (
    double inZMin,
    double inZMax
);

Description

An alternative method to the SetZFalseOriginAndUnits method. Sets the minimum and maximum allowed Z values for a spatial reference. Use SetZFalseOriginAndUnits to set explicitly the allowed Z precision value. The zUnits value is the inverse of the resolution of the Z data.

//This code example shows how to set the Z domain extent of a dataset. 

    private void SetSpatialReferenceProperties(IFeatureClass featureClass)

    {

        IGeoDataset geoDataset = featureClass as IGeoDataset;

        //get access to SpatialReference through IGeoDataset 

        ISpatialReference spatialReference = geoDataset.SpatialReference;

        //set the Z domain extent for the dataset 

        spatialReference.SetZDomain(0, 2000000000);

    }

ISpatialReference.SetZFalseOriginAndUnits Method

Set the Z false origin and units.

Public Sub SetZFalseOriginAndUnits ( _
    ByVal falseZ As Double, _
    ByVal zUnits As Double _
)
public void SetZFalseOriginAndUnits (
    double falseZ,
    double zUnits
);

Description

An alternative method to the SetZDomain method. The falseZ value corresponds to the minimum Z value of the Z domain. The zUnits is the same as the precision or scale value. The inverse of zUnits is the resolution of the z data.

//This code example shows how to set the Z false origin and units for a 

    //dataset.

    private void SetSpatialReferenceProperties(IFeatureClass featureClass)

    {

        IGeoDataset geoDataset = featureClass as IGeoDataset;

        //get access to SpatialReference through IGeoDataset 

        ISpatialReference spatialReference = geoDataset.SpatialReference;

        //Set the Z false origin and units for the dataset. The datatype for the 

        //numeric expressions that represent falseZ and zUnits is double. 

        spatialReference.SetZFalseOriginAndUnits(0, 1);

    }

ISpatialReference.SpatialReferenceImpl Property

SpatialReferenceImpl.

Public ReadOnly Property SpatialReferenceImpl As Long
public long SpatialReferenceImpl {get;}

Remarks

This property is for internal use only.

ISpatialReference.ZCoordinateUnit Property

The unit for the Z coordinate.

Public Property ZCoordinateUnit As ILinearUnit
public ILinearUnit ZCoordinateUnit {get; set;}

Description

The ZCoordinateUnit will return a linear unit object that represents the unit of measure used for Z coordinate values.

Inherited Interfaces

Interfaces Description
ISpatialReferenceInfo Provides access to members that control the properties common to all components of a spatial reference system.

Classes that implement ISpatialReference

Classes Description
GeographicCoordinateSystem Creates a geographic coordinate system.
ProjectedCoordinateSystem Creates a projected coordinate system.
UnknownCoordinateSystem Creates an unknown coordinate system.
The following code demonstrates how to compare two spatial references.  There are two ways shown in the example one using IClone and the other using ICompareSpatialReferences and the IsEqualNoVCS method 

 

        public static bool CompareSpatialRefs(ISpatialReference sourceSR, ISpatialReference targetSR)

        {

            IClone sClone = sourceSR as IClone;

            IClone tClone = targetSR as IClone;

            // first level test compares the coordinate system component  

            if (!sClone.IsEqual(tClone))

                return false;

            

            return true;

        }

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.