Skip to content

Commit 5ee7f69

Browse files
committed
Test for issue #53
1 parent b9dfe55 commit 5ee7f69

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

ProjNet.Tests/ProjNetIssues.cs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,26 @@ public void TestAngularUnitsEqualParamsIssue()
224224
//check equality of angular units
225225
Assert.AreEqual (true, pcs1.GeographicCoordinateSystem.AngularUnit.EqualParams (pcs2.GeographicCoordinateSystem.AngularUnit));
226226
}
227-
227+
228+
[Test, Description("transformation somehow is wrong"), Category("Question")]
229+
public static void TestGitHubIssue53()
230+
{
231+
// arrange
232+
CoordinateSystemFactory csFact = new CoordinateSystemFactory();
233+
CoordinateTransformationFactory ctFact = new CoordinateTransformationFactory();
234+
ICoordinateSystem csWgs84 = GeographicCoordinateSystem.WGS84;
235+
IProjectedCoordinateSystem csUtm35N = ProjectedCoordinateSystem.WGS84_UTM(35, true);
236+
ICoordinateTransformation csTrans = ctFact.CreateFromCoordinateSystems(csWgs84, csUtm35N);
237+
ICoordinateTransformation csTransBack = ctFact.CreateFromCoordinateSystems(csUtm35N, csWgs84);
238+
239+
// act
240+
double[] point = new[] { 42.5, 24.5 };
241+
var r = csTrans.MathTransform.Transform(point);
242+
var rBack = csTransBack.MathTransform.Transform(r);
243+
244+
// assert
245+
Assert.AreEqual(point[0], rBack[0], 1e-5);
246+
Assert.AreEqual(point[1], rBack[1], 1e-5);
247+
}
228248
}
229249
}

0 commit comments

Comments
 (0)