示例#1
0
 public static void testGetXCorrectCR185697()
 {
     com.esri.core.geometry.OperatorFactoryLocal engine = com.esri.core.geometry.OperatorFactoryLocal
                                                          .getInstance();
     com.esri.core.geometry.OperatorClip clipOp = (com.esri.core.geometry.OperatorClip
                                                   )engine.getOperator(com.esri.core.geometry.Operator.Type.Clip);
     com.esri.core.geometry.Polyline             polylineCR     = makePolylineCR();
     com.esri.core.geometry.SimpleGeometryCursor polylineCursCR = new com.esri.core.geometry.SimpleGeometryCursor
                                                                      (polylineCR);
     com.esri.core.geometry.SpatialReference gcsWGS84 = com.esri.core.geometry.SpatialReference
                                                        .create(4326);
     com.esri.core.geometry.Envelope2D envelopeCR = new com.esri.core.geometry.Envelope2D
                                                        ();
     envelopeCR.xmin = -180;
     envelopeCR.xmax = 180;
     envelopeCR.ymin = -90;
     envelopeCR.ymax = 90;
     // CR
     com.esri.core.geometry.Polyline clippedPolylineCR = (com.esri.core.geometry.Polyline
                                                          )clipOp.execute(polylineCR, envelopeCR, gcsWGS84, null);
     com.esri.core.geometry.Point pointResult = new com.esri.core.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);
 }