In order to compare the spatial reference of my map and this of my database I use the following code:
<SPAN class="keyword token">var</SPAN> mapSR <SPAN class="operator token">=</SPAN> myMap<SPAN class="punctuation token">.</SPAN>ActiveView<SPAN class="punctuation token">.</SPAN>SpatialReference<SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">var</SPAN> gdbSR <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">(</SPAN>IGeoDataset<SPAN class="punctuation token">)</SPAN>myFeatureClass<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN>SpatialReference<SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">bool</SPAN> areSame <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">(</SPAN>IClone<SPAN class="punctuation token">)</SPAN>mapSR<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">IsEqual</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">(</SPAN>IClone<SPAN class="punctuation token">)</SPAN>gdbSR<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">if</SPAN><SPAN class="punctuation token">(</SPAN>areSame<SPAN class="punctuation token">)</SPAN> <SPAN class="comment token"><SPAN>// also compare map-resolution as suggested here: </SPAN><A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fdesktop.arcgis.com%2Fen%2Farcobjects%2Flatest%2Fnet%2Fwebframe.htm%23ISpatialReference_IsPrecisionEqual.htm" target="_blank">https://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#ISpatialReference_IsPrecisionEqual.htm</A></SPAN>
mapSR<SPAN class="punctuation token">.</SPAN><SPAN class="token function">IsPrecisionEqual</SPAN><SPAN class="punctuation token">(</SPAN>gdbSR<SPAN class="punctuation token">,</SPAN> <SPAN class="keyword token">out</SPAN> areSame<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
After calling IsPrecisionEqual areSame will be false (I ensured the method was called by setting a breakpoint), which I don´t understand. When I dive into the spatial references, e.g. using a watch, I can´t see any (meaningful) differences:
(ISpatialReferenceResolution)mapSR
COM Object
[System.__ComObject]: COM Object
Abbreviation: ""
Alias: ""
FactoryCode: 0
MResolution: 0.0001
MResolution: 0.0001
MTolerance: 0.001
MToleranceValid: esriSRToleranceOK
Name: "ETRS89_UTM32"
PrecisionExImpl: 1529763776
PrecisionImpl: 1533456216
Remarks: ""
SpatialReferenceImpl: 689094056
VerticalCoordinateSystem: null
XYTolerance: 0.0001
XYToleranceValid: esriSRToleranceOK
ZCoordinateUnit: null
ZTolerance: 0.001
ZToleranceValid: esriSRToleranceOK
(ISpatialReferenceResolution)gdbSR
COM Object
[System.__ComObject]: COM Object
Abbreviation: null
Alias: null
FactoryCode: 0
MResolution: 0.0001
MResolution: 0.0001
MTolerance: 0.001
MToleranceValid: esriSRToleranceOK
Name: "ETRS89_UTM32"
PrecisionExImpl: 1103993808
PrecisionImpl: 1100159248
Remarks: null
SpatialReferenceImpl: 689094056
VerticalCoordinateSystem: null
XYTolerance: 0.0001
XYToleranceValid: esriSRToleranceOK
ZCoordinateUnit: null
ZTolerance: 0.001
ZToleranceValid: esriSRToleranceOK
<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Also get_XYResolution(false) returns 0.00001 (which is 10times the XYTolerance, as seen above) for both the maps and the databases spatial reference.
I also tried to use ISpatialReference3.IsXYResolutionEqual, because I´m only interested in plane resolution and tolerance. However this also returns false when comparing the two spatial references. So what do IsXYResolutionEqual and IsResolutionEqual compare asside from the above properties? Are those Impl- and ExImp-properties considered as well (which is not documented)?