This document is archived and information here might be outdated.  Recommended version.


ISpatialReference2 Interface (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference (Geometry)  

ISpatialReference2 Interface

Provides access to additional members that control a SpatialReference. Note: the ISpatialReference2 interface has been superseded byISpatialReference3. Please consider using the more recent version.

Product Availability

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

Description

Extends the ISpatialReference interface by adding functions to compare precision (resolution) of two spatial references, and round off coordinate data to the current resolution.

Members

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 ApplyPrecision Applies the measure and z value precisions.
Method ApplyXYPrecision Applies the XY precision.
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 IsMPrecisionEqual Returns true if the measure precisions of the two spatial references are the same.
Method IsPrecisionEqual Returns TRUE when the precision information for the two spatial references is the same.
Method IsXYPrecisionEqual Returns true if the XY precisions of the two spatial references are the same.
Method IsZPrecisionEqual Returns true if the Z precisions of the two spatial references are the same.
Read-only property Name The name of this spatial reference component.
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/write property ZCoordinateUnit The unit for the Z coordinate.

Inherited Interfaces

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

CoClasses that implement ISpatialReference2

CoClasses and Classes Description
GeographicCoordinateSystem Creates a geographic coordinate system.
ProjectedCoordinateSystem Creates a projected coordinate system.
UnknownCoordinateSystem Creates an unknown coordinate system.
[C#]
        public static bool CompareSpatialRefs2(ISpatialReference2 sourceSR, ISpatialReference2 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;
            // Can also check just Horizontal Coordinate System equality 
            bool SREqual=true;
            ICompareCoordinateSystems compare=sourceSR as ICompareCoordinateSystems;
            compare.IsEqualNoVCS(targetSR, ref SREqual);
            if (!SREqual)
                return false;
            return true;
        }

.NET Snippets

Get Azimuth from Two Points | Get Distance from Two Points

.NET Related Topics

How to import or export a spatial reference