if I write projection trasformation using wgs84 the create method crash. If I use another sr != 4326 the create method is OK. Is a bug?
SpatialReference sr4326 = SpatialReferences.WGS84;
SpatialReference sr3857 = SpatialReferences.WebMercator;
ProjectionTransformation projTransFromSRs = ArcGIS.Core.Geometry.ProjectionTransformation.Create(sr3857,sr4326);
Solved! Go to Solution.
Hi Domenico, this is definitely a bug. Thanks! We will fix at 1.2. "projTransFromSRs" should be returned but, of course, its Transformation property will be null in this case.
Note: "==" is not overloaded so the false is because the SRs are not the same instance. Please use "IsEqual".
Said another way:
var sr1 = new SpatialReferenceBuilder(SpatialReferences.WGS84.Wkid).ToSpatialReference();
var sr2 = new SpatialReferenceBuilder(SpatialReferences.WGS84.Wkid).ToSpatialReference();
sr1 == sr2 //False!
sr1.IsEqual(sr2) //True!
Hi Domenico, this is definitely a bug. Thanks! We will fix at 1.2. "projTransFromSRs" should be returned but, of course, its Transformation property will be null in this case.
Note: "==" is not overloaded so the false is because the SRs are not the same instance. Please use "IsEqual".
Said another way:
var sr1 = new SpatialReferenceBuilder(SpatialReferences.WGS84.Wkid).ToSpatialReference();
var sr2 = new SpatialReferenceBuilder(SpatialReferences.WGS84.Wkid).ToSpatialReference();
sr1 == sr2 //False!
sr1.IsEqual(sr2) //True!