ESRI.ArcGIS.ADF.IMS
Compare(SpatialReference) Method
See Also  Example
ESRI.ArcGIS.ADF.IMS.SpatialReference Namespace > SpatialReference Class > Compare Method : Compare(SpatialReference) Method




otherSpatialReference
Compares this SpatialReference object to another SpatialReference.

Syntax

Visual Basic (Declaration) 
Public Overloads Function Compare( _
   ByVal otherSpatialReference As SpatialReference _
) As Boolean
Visual Basic (Usage)Copy Code
Dim instance As SpatialReference
Dim otherSpatialReference As SpatialReference
Dim value As Boolean
 
value = instance.Compare(otherSpatialReference)
C# 
public bool Compare( 
   SpatialReference otherSpatialReference
)

Parameters

otherSpatialReference

Return Value

Boolean value that is true for equality, false for unequality.

Example

The example below compares a newly constructed SpatialReference with the MapView's SpatialReference. The code assumes an existing MapView object.
C#Copy Code
ESRI.ArcGIS.ADF.IMS.SpatialReference newSpRef = 

    new ESRI.ArcGIS.ADF.IMS.SpatialReference(54030); 

     

bool areSameSpatialRef = newSpRef.Compare(mapView.SpatialReference); 

    
Visual BasicCopy Code
Dim newSpRef As New _

    ESRI.ArcGIS.ADF.IMS.SpatialReference(54030)



Dim areSameSpatialRef As Boolean = _

    newSpRef.Compare(mapView.SpatialReference)

Remarks

This method compares the ID values or definition strings for the CoordinateSystem and DatumTransformation of the current and input SpatialReferences. The method returns true if both CoordinateSystem and DatumTranformation values are the same. Each of the CoordinateSystem properties and DatumTransformation and properties must use the same SpatialReferenceInfo type (DefinitionSpatialReferenceInfo or IDSpatialReferenceInfo). The method does not convert between definition string and ID. For example, if one SpatialReference has a coordinate system based on the WGS84 ID of 4326, and the other uses the definition string for WGS84, this method will return false.

See Also

© 2010 All Rights Reserved.