ArcGIS Developer Help  (Geometry)    

ISpatialReference Interface

Provides access to members that control a SpatialReference.

Product Availability

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

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 Changed Notify this object that some of its parts have changed (parameter values, z unit, etc.).
Read-only property FactoryCode The factory code of the spatial reference.
Method GetDomain Get the domain extent.
Method GetFalseOriginAndUnits Get the false origin and units.
Method GetMDomain Get the measure domain extent.
Method GetMFalseOriginAndUnits Get the measure false origin and units.
Method GetZDomain Get 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 Remarks The comment string of this spatial reference component.
Method SetDomain Set the xy domain extent.
Method SetFalseOriginAndUnits Set the false origin and units.
Method SetMDomain Set the measure domain extent.
Method SetMFalseOriginAndUnits Set the measure false origin and units.
Method SetZDomain Set 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
ISpatialReferenceInfo Provides access to members that control the properties common to all components of a spatial reference system.

CoClasses that implement ISpatialReference

CoClasses and Classes Description
GeographicCoordinateSystem Creates a geographic coordinate system.
ProjectedCoordinateSystem Creates a projected coordinate system.
UnknownCoordinateSystem Creates an unknown coordinate system.
[Visual Basic 6.0]

The following code example demonstrates how to compare two spatial references. It uses the ISpatialReference2 interface to compare the XY precision in addition to the coordinate system. This is the same type of comparison that is performed by the Copy/Paste functionality in ArcCatalog.

Public Function CompareSpatialReferences(ByVal pSourceSR As ISpatialReference, ByVal pTargetSR As ISpatialReference) As Boolean
 
  Dim pSourceClone As IClone
  Dim pTargetClone As IClone
  Dim bSREqual As Boolean
 
  Set pSourceClone = pSourceSR
  Set pTargetClone = pTargetSR
 
  'Compare the coordinate system component of the spatial reference
  bSREqual = pSourceClone.IsEqual(pTargetClone)
 
  'If the comparison failed, return false and exit
  If Not bSREqual Then
    CompareSpatialReferences = False
    Exit Function
  End If
 
  'We can also compare the XY precision to ensure the spatial references are equal
  Dim pSourceSR2 As ISpatialReference2
  Dim bXYIsEqual As Boolean
 
  Set pSourceSR2 = pSourceSR
  bXYIsEqual = pSourceSR2.IsXYPrecisionEqual(pTargetSR)
 
  'If the comparison failed, return false and exit
  If Not bXYIsEqual Then
    CompareSpatialReferences = False
    Exit Function
  End If
 
  CompareSpatialReferences = True
 
End Function

 


Feedback Send feedback on this page