Examples of CurveBoundary


Examples of org.opengis.geometry.primitive.CurveBoundary

    PrimitiveFactoryImpl tPrimitiveFactory = (PrimitiveFactoryImpl) builder.getPrimitiveFactory();
   
    DirectPosition dp1 = tCoordFactory.createDirectPosition(new double[] {0, 0});
    DirectPosition dp2 = tCoordFactory.createDirectPosition(new double[] {100, 100});
   
    CurveBoundary curveBoundary1 = tPrimitiveFactory.createCurveBoundary(dp1, dp2);
   
    //System.out.println(curveBoundary1);

    // RepresentativePoint()
    DirectPosition dp = curveBoundary1.getRepresentativePoint();
    assertTrue(dp.getOrdinate(0) == 0);
    assertTrue(dp.getOrdinate(1) == 0);
   
    assertTrue(curveBoundary1.isCycle() == true);
   
    // Test creating a curve boundary with the same start and end point (should result in
    //  an exception).
    PointImpl point1 = new PointImpl(dp1);
    try {
      CurveBoundaryImpl b2 = new CurveBoundaryImpl(this.crs, point1, point1);
      // fail if we get here, the above should throw an exception
      fail();
    }
    catch (IllegalArgumentException expected) {
     
    }
   
    // test clone
    PointImpl point2 = new PointImpl(dp2);
    CurveBoundaryImpl b2 = new CurveBoundaryImpl(curveBoundary1.getCoordinateReferenceSystem(), point1, point2);
    try {
      CurveBoundaryImpl expected = ((CurveBoundaryImpl) curveBoundary1).clone();
      assertTrue(b2.equals(expected));
    } catch (CloneNotSupportedException e) {
      e.printStackTrace();
View Full Code Here

Examples of org.opengis.geometry.primitive.CurveBoundary

    //System.out.println("\n*** TEST: .getEndConstructiveParam()\n" + curve1.getEndConstructiveParam());
    assertTrue(curve1.getEndConstructiveParam() == 1.0);

    // ***** getBoundary()
    //System.out.println("\n*** TEST: .getBoundary()\n" + curve1.getBoundary());
    CurveBoundary cb = curve1.getBoundary();
    assertTrue(cb != null);
    double[] dp = cb.getStartPoint().getDirectPosition().getCoordinate();
    assertTrue(dp[0] == -50);
    assertTrue(dp[1] == 0);
    dp = cb.getEndPoint().getDirectPosition().getCoordinate();
    assertTrue(dp[0] == 50);
    assertTrue(dp[1] == 0);
   
    // ***** getEnvelope()
    //System.out.println("\n*** TEST: .getEnvelope()\n" + curve1.getEnvelope());
View Full Code Here

Examples of org.opengis.geometry.primitive.CurveBoundary

    //System.out.println("\n*** TEST: .getEndConstructiveParam()\n" + curve1.getEndConstructiveParam());
    assertTrue(curve1.getEndConstructiveParam() == 1.0);

    // ***** getBoundary()
    //System.out.println("\n*** TEST: .getBoundary()\n" + curve1.getBoundary());
    CurveBoundary cb = curve1.getBoundary();
    assertTrue(cb != null);
    double[] dp = cb.getStartPoint().getDirectPosition().getCoordinate();
    assertTrue(dp[0] == -50);
    assertTrue(dp[1] == 0);
    dp = cb.getEndPoint().getDirectPosition().getCoordinate();
    assertTrue(dp[0] == 50);
    assertTrue(dp[1] == 0);
   
    // ***** getEnvelope()
    //System.out.println("\n*** TEST: .getEnvelope()\n" + curve1.getEnvelope());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.