ProjectionTransformation wgs84

2955
1
Jump to solution
09-30-2015 10:26 AM
nicogis
MVP Frequent Contributor

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);
0 Kudos
1 Solution

Accepted Solutions
CharlesMacleod
Esri Regular Contributor

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!

View solution in original post

0 Kudos
1 Reply
CharlesMacleod
Esri Regular Contributor

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!

0 Kudos