ProjectionTransformation wgs84

2619
1
Jump to solution
09-30-2015 10:26 AM
Highlighted
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);
Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Esri 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

Reply
0 Kudos
1 Reply
Highlighted
Esri 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

Reply
0 Kudos