Provides access to additional members that control a SpatialReference.
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
Name | Description | |
---|---|---|
Abbreviation | The abbreviated name of this spatial reference component. | |
Alias | The alias of this spatial reference component. | |
ApplyPrecision | Applies the measure and z value precisions. | |
ApplyXYPrecision | Applies the XY precision. | |
Changed | Notify this object that some of its parts have changed (parameter values, z unit, etc.). | |
FactoryCode | The factory code (WKID) of the spatial reference. | |
GetDomain | The XY domain extent. | |
GetFalseOriginAndUnits | Get the false origin and units. | |
GetMDomain | The measure domain extent. | |
GetMFalseOriginAndUnits | Get the measure false origin and units. | |
GetZDomain | The Z domain extent. | |
GetZFalseOriginAndUnits | Get the Z false origin and units. | |
HasMPrecision | Returns true when m-value precision information has been defined. | |
HasXYPrecision | Returns true when (x,y) precision information has been defined. | |
HasZPrecision | Returns true when z-value precision information has been defined. | |
IsMPrecisionEqual | Returns true if the measure precisions of the two spatial references are the same. | |
IsPrecisionEqual | Returns TRUE when the precision information for the two spatial references is the same. | |
IsXYPrecisionEqual | Returns true if the XY precisions of the two spatial references are the same. | |
IsZPrecisionEqual | Returns true if the Z precisions of the two spatial references are the same. | |
Name | The name of this spatial reference component. | |
PrecisionExImpl | An opaque reference to the precision information (including z/m awareness) implementation for this spatial reference. | |
PrecisionImpl | An opaque reference to the precision information implementation for this spatial reference. | |
Remarks | The comment string of this spatial reference component. | |
SetDomain | The XY domain extent. | |
SetFalseOriginAndUnits | Set the false origin and units. | |
SetMDomain | The measure domain extent. | |
SetMFalseOriginAndUnits | Set the measure false origin and units. | |
SetZDomain | The Z domain extent. | |
SetZFalseOriginAndUnits | Set the Z false origin and units. | |
SpatialReferenceImpl | SpatialReferenceImpl. | |
ZCoordinateUnit | The unit for the Z coordinate. |
ISpatialReference2.ApplyPrecision Method
Applies the measure and z value precisions.
Public Sub ApplyPrecision ( _
ByVal cPoints As Integer, _
ByRef Points As WKSPoint, _
ByRef ms As Double, _
ByRef zs As Double _
)
public void ApplyPrecision (
int cPoints,
ref WKSPoint Points,
ref double ms,
ref double zs
);
Description
The ApplyPrecision method snaps measure or z values to the spatial reference grid. Each SpatialReference has an extent and a resolution (1/precision) for the xy, z, and measure values. You can set this information with the SetZDomain, SetMDomain, SetZFalseOriginAndUnits or the SetMFalseOriginAndUnits methods. If you use a Domain method, the resolution (1/precision) is calculated from the given extent. The FalseOriginAndUnits methods sets the lower bound of the extent and explicitly defines the precision (units, or 1/resolution) of the spatial reference.
ISpatialReference2.ApplyXYPrecision Method
Applies the XY precision.
Public Sub ApplyXYPrecision ( _
ByVal cPoints As Integer, _
ByRef Points As WKSPoint _
)
public void ApplyXYPrecision (
int cPoints,
ref WKSPoint Points
);
Description
The ApplyXYPrecision method snaps XY coordinate values to the spatial reference's coordinate grid. Normally, the geodatabase calls this method when appropriate, however you may need to use it when comparing locally generated coordinates against features coming from a geodatabase.
Remarks
The cPoints value is the number of points to which you wish to apply the XY precision (1/resolution). A WKSPoint is a structure that contains the X and Y values of a coordinate pair.
ISpatialReference2.IsMPrecisionEqual Method
Returns true if the measure precisions of the two spatial references are the same.
Public Function IsMPrecisionEqual ( _
ByVal otherSR As ISpatialReference _
) As Boolean
public bool IsMPrecisionEqual (
ISpatialReference otherSR
);
Description
Compares the measure precisions (resolutions) . Both spatial references must be of the same type (both PCS, both GCS, etc).
Remarks
The IClone::IsEqual method for PCSs and GCSs compares only the projection information (projection, spheroid, projected units, etc.). It does not compare any properties related to the coordinate grid definition for the spatial references.
Use the ISpatialReference2.IsXY/Z/MPrecisionEqual methods to compare coordinate grid information.
Use the ISpatialReferenceTolerance.IsXY/Z/MToleranceEqual methods to compare the various cluster tolerances for the spatial references.
ISpatialReference2.IsXYPrecisionEqual Method
Returns true if the XY precisions of the two spatial references are the same.
Public Function IsXYPrecisionEqual ( _
ByVal otherSR As ISpatialReference _
) As Boolean
public bool IsXYPrecisionEqual (
ISpatialReference otherSR
);
Description
Compares the X and Y precision (resolution) values. Both spatial references must be of the same type (both GCS, both PCS, etc).
Remarks
The IClone::IsEqual method for PCSs and GCSs compares only the projection information (projection, spheroid, projected units, etc.). It does not compare any properties related to the coordinate grid definition for the spatial references.
Use the ISpatialReference2.IsXY/Z/MPrecisionEqual methods to compare coordinate grid information.
Use the ISpatialReferenceTolerance.IsXY/Z/MToleranceEqual methods to compare the various cluster tolerances for the spatial references.
ISpatialReference2.IsZPrecisionEqual Method
Returns true if the Z precisions of the two spatial references are the same.
Public Function IsZPrecisionEqual ( _
ByVal otherSR As ISpatialReference _
) As Boolean
public bool IsZPrecisionEqual (
ISpatialReference otherSR
);
Description
Compares the Z precisions (resolutions). Both srs must be of the same type (both GCS, both PCS, etc).
Remarks
The IClone::IsEqual method for PCSs and GCSs compares only the projection information (projection, spheroid, projected units, etc.). It does not compare any properties related to the coordinate grid definition for the spatial references.
Use the ISpatialReference2.IsXY/Z/MPrecisionEqual methods to compare coordinate grid information.
Use the ISpatialReferenceTolerance.IsXY/Z/MToleranceEqual methods to compare the various cluster tolerances for the spatial references.
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. |
Classes that implement ISpatialReference2
Classes | Description |
---|---|
GeographicCoordinateSystem | Creates a geographic coordinate system. |
ProjectedCoordinateSystem | Creates a projected coordinate system. |
UnknownCoordinateSystem | Creates an unknown coordinate system. |
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;
}