예제 #1
0
 public static void TestGetXCorrectCR185697()
 {
     com.epl.geometry.OperatorFactoryLocal engine         = com.epl.geometry.OperatorFactoryLocal.GetInstance();
     com.epl.geometry.OperatorClip         clipOp         = (com.epl.geometry.OperatorClip)engine.GetOperator(com.epl.geometry.Operator.Type.Clip);
     com.epl.geometry.Polyline             polylineCR     = MakePolylineCR();
     com.epl.geometry.SimpleGeometryCursor polylineCursCR = new com.epl.geometry.SimpleGeometryCursor(polylineCR);
     com.epl.geometry.SpatialReference     gcsWGS84       = com.epl.geometry.SpatialReference.Create(4326);
     com.epl.geometry.Envelope2D           envelopeCR     = new com.epl.geometry.Envelope2D();
     envelopeCR.xmin = -180;
     envelopeCR.xmax = 180;
     envelopeCR.ymin = -90;
     envelopeCR.ymax = 90;
     // CR
     com.epl.geometry.Polyline clippedPolylineCR = (com.epl.geometry.Polyline)clipOp.Execute(polylineCR, envelopeCR, gcsWGS84, null);
     com.epl.geometry.Point    pointResult       = new com.epl.geometry.Point();
     clippedPolylineCR.GetPointByVal(0, pointResult);
     NUnit.Framework.Assert.IsTrue(pointResult.GetX() == -180);
     clippedPolylineCR.GetPointByVal(1, pointResult);
     NUnit.Framework.Assert.IsTrue(pointResult.GetX() == -90);
     clippedPolylineCR.GetPointByVal(2, pointResult);
     NUnit.Framework.Assert.IsTrue(pointResult.GetX() == 0);
     clippedPolylineCR.GetPointByVal(3, pointResult);
     NUnit.Framework.Assert.IsTrue(pointResult.GetX() == 100);
     clippedPolylineCR.GetPointByVal(4, pointResult);
     NUnit.Framework.Assert.IsTrue(pointResult.GetX() == 170);
     clippedPolylineCR.GetPointByVal(5, pointResult);
     NUnit.Framework.Assert.IsTrue(pointResult.GetX() == 180);
 }