Package org.geotools.geometry.iso.primitive

Examples of org.geotools.geometry.iso.primitive.CurveImpl


        assertEquals(point1.getPosition().getOrdinate(i), point2.getPosition().getOrdinate(i), epsilon);
      }
     
    }
    else if (geom1 instanceof CurveImpl && geom2 instanceof CurveImpl) {
      CurveImpl curve1 = (CurveImpl) geom1;
      CurveImpl curve2 = (CurveImpl) geom2;
      List<DirectPosition> list1 = curve1.asDirectPositions();
      List<DirectPosition> list2 = curve2.asDirectPositions();
      Iterator<DirectPosition> iterator1 = list1.iterator();
      Iterator<DirectPosition> iterator2 = list2.iterator();
      while (iterator1.hasNext() && iterator2.hasNext()) {
        PointImpl p1 = new PointImpl( iterator1.next());
        PointImpl p2 = new PointImpl( iterator2.next());
View Full Code Here


    points.add(primitiveFactory.createPoint( new double[]{-123.45463828850829,48.54973520267305} ));
    points.add(primitiveFactory.createPoint( new double[]{-123.4550070827961,48.54290089070186} ));
        LineString lineString = geometryFactory.createLineString(points);
        List curveSegmentList = Collections.singletonList(lineString);
       
        CurveImpl curve1 = (CurveImpl) primitiveFactory.createCurve(curveSegmentList);
        CurveImpl curve2 = (CurveImpl) curve1.transform(crs2);
       
    // create expected result
    PositionFactory expectedPosF2 = new PositionFactoryImpl(crs2, new PrecisionModel());
    PrimitiveFactory expectedPrimF2 = new PrimitiveFactoryImpl(crs2, expectedPosF2);
    GeometryFactory ExpectedGeomF2 = new GeometryFactoryImpl(crs2, expectedPosF2);
   
    List<Position> expectedPoints = new ArrayList<Position>();
    expectedPoints.add(expectedPrimF2.createPoint( new double[]{1187128.000000001, 395268.0000000004} ));
    expectedPoints.add(expectedPrimF2.createPoint( new double[]{1187127.9999999998, 396026.99999999825} ));
    expectedPoints.add(expectedPrimF2.createPoint( new double[]{1188245.0000000007, 396027.0000000039} ));
    expectedPoints.add(expectedPrimF2.createPoint( new double[]{1188245.0000000005, 395268.0000000018} ));
        LineString expectedLineString = ExpectedGeomF2.createLineString(expectedPoints);
        List expectedCurveSegmentList = Collections.singletonList(expectedLineString);
       
        CurveImpl expectedCurve = (CurveImpl) expectedPrimF2.createCurve(expectedCurveSegmentList);
   
    //System.out.println(curve1);
    //System.out.println(curve2);
    //System.out.println(expectedCurve);
   
View Full Code Here

    points1.add(primitiveFactory.createPoint( new double[]{-123.4550070827961,48.54290089070186} ));
    points1.add(primitiveFactory.createPoint( new double[]{-123.47009555832284,48.543261561072285} ));
    LineString lineString1 = geometryFactory.createLineString(points1);
        List curveSegmentList1 = Collections.singletonList(lineString1);
       
        CurveImpl curve1 = (CurveImpl) primitiveFactory.createCurve(curveSegmentList1);
       
    /* Build Ring from Curve */
    ArrayList<OrientableCurve> curveList = new ArrayList<OrientableCurve>();
    curveList.add(curve1);
   
    RingImplUnsafe ring1 = (RingImplUnsafe) primitiveFactory.createRing(curveList);
    RingImplUnsafe ring2 = (RingImplUnsafe) ring1.transform(crs2);
   
    // create expected result
    PositionFactory expectedPosF2 = new PositionFactoryImpl(crs2, new PrecisionModel());
    PrimitiveFactory expectedPrimF2 = new PrimitiveFactoryImpl(crs2, expectedPosF2);
    GeometryFactory ExpectedGeomF2 = new GeometryFactoryImpl(crs2, expectedPosF2);
   
    List<Position> expectedPoints = new ArrayList<Position>();
    expectedPoints.add(expectedPrimF2.createPoint( new double[]{1187128.000000001, 395268.0000000004} ));
    expectedPoints.add(expectedPrimF2.createPoint( new double[]{1187127.9999999998, 396026.99999999825} ));
    expectedPoints.add(expectedPrimF2.createPoint( new double[]{1188245.0000000007, 396027.0000000039} ));
    expectedPoints.add(expectedPrimF2.createPoint( new double[]{1188245.0000000005, 395268.0000000018} ));
    expectedPoints.add(expectedPrimF2.createPoint( new double[]{1187128.000000001, 395268.0000000004} ));
        LineString expectedLineString = ExpectedGeomF2.createLineString(expectedPoints);
        List expectedCurveSegmentList = Collections.singletonList(expectedLineString);
       
        CurveImpl expectedCurve = (CurveImpl) expectedPrimF2.createCurve(expectedCurveSegmentList);
       
    /* Build Ring from Curve */
    ArrayList<OrientableCurve> expectedCurveList = new ArrayList<OrientableCurve>();
    expectedCurveList.add(expectedCurve);
   
View Full Code Here

 
  private void _testCurves() {
   
    // (c1)
    // Curve is not simple, cause it has self-intersections
    CurveImpl curve = this.createCurveA(this.builder);
    assertTrue(!curve.isSimple());

    // (c2)
    // Curve is simple, cause it has no self-intersections
    curve = this.createCurveB(this.builder);
    assertTrue(curve.isSimple());
   
    // (c3)
    // Closed Intersecting Curve - not simple
    curve = this.createCurveClosedIntersection();
    assertTrue(!curve.isSimple());

    // (c4)
    // Closed Curve - simple
    curve = this.createCurveClosed();
    assertTrue(curve.isSimple());

    // (c5)
    // Curve which touches itself in a vertex (vertex-vertex intersection) - not simple
    curve = this.createCurveTouchesInVertex();
    assertTrue(!curve.isSimple());

    // (c6)
    // Curve which touches itself in an edge (vertex-edge intersection) - not simple
    curve = this.createCurveTouchesInEdge();
    assertTrue(!curve.isSimple());

  }
View Full Code Here

    }
    return rSurface;
  }
 
  private CurveImpl createCurveFromWKT(String aWKTcurve) {
    CurveImpl rCurve = null;
    WKTReader wktReader = new WKTReader(this.crs);
    try {
      rCurve = (CurveImpl) wktReader.read(aWKTcurve);
    } catch (ParseException e) {
      e.printStackTrace();
View Full Code Here

    SurfaceImpl surfaceAwithHole = this.createSurfaceAwithHole(crs);
    SurfaceImpl surfaceAwithTwoHoles = this.createSurfaceAwithTwoHoles(crs);
    SurfaceImpl surfaceBwithoutHole = this.createSurfaceBwithoutHole(crs);
    SurfaceImpl surfaceBwithHole = this.createSurfaceBwithHole(crs);
    SurfaceImpl surfaceC = this.createSurfaceC(crs);
    CurveImpl curveA = this.createCurveA(crs);
    CurveImpl curveF = this.createCurveF(crs);

    GeometryImpl g1 = null;
    GeometryImpl g2 = null;
   
    g1 = surfaceBwithoutHole;
View Full Code Here

  }
 
  private void _testCurveCurve(CoordinateReferenceSystem crs) {

    CurveImpl curveA = this.createCurveA(crs);
    CurveImpl curveB = this.createCurveB(crs);
    CurveImpl curveC = this.createCurveC(crs);
    CurveImpl curveD = this.createCurveD(crs);
    CurveImpl curveE = this.createCurveE(crs);
   
    CurveImpl c1 = null;
    CurveImpl c2 = null;
   
    // (C1) - Touch
    c1 = curveA;
    c2 = curveB;
    //System.out.println("(C1)");
View Full Code Here

  }

 
 
  private CurveImpl createCurveFromWKT(CoordinateReferenceSystem crs, String aWKTcurve) {
    CurveImpl rCurve = null;
    WKTReader wktReader = new WKTReader(crs);
    try {
      rCurve = (CurveImpl) wktReader.read(aWKTcurve);
    } catch (ParseException e) {
      e.printStackTrace();
View Full Code Here

    DirectPosition dp1 = pf.createDirectPosition(new double[]{10, 30});
    DirectPosition dp2 = pf.createDirectPosition(new double[]{70, 15});
    LineSegment line1 = gf.createLineSegment(dp1, pf.createDirectPosition(new double[]{20, 40}));
    LineSegment line2 = gf.createLineSegment(dp2, pf.createDirectPosition(new double[]{45, 25}));
    Set<OrientableCurve> curves = new HashSet<OrientableCurve>();
    curves.add( new CurveImpl( line1 ) );
    curves.add( new CurveImpl( line2 ) );
    MultiCurve mc = af.createMultiCurve(curves);
   
    assertNotNull(mc);
    //assertNotNull(mc.getBoundary());
    assertNotNull(mc.getEnvelope());
View Full Code Here

    // create multiprimitive object
    List<CurveSegment> curves = new ArrayList<CurveSegment>();
    curves.add( edge1 );
    curves.add( edge2 );
    curves.add( edge3 );
    Curve s = new CurveImpl(crs, curves);
   
    curves = new ArrayList<CurveSegment>();
    curves.add( edge1_1 );
    curves.add( edge2_1 );
    curves.add( edge3_1 );
    Curve s2 = new CurveImpl(crs, curves);
   
    Set<Primitive> primitives = new HashSet<Primitive>();
    primitives.add(s);
    primitives.add(s2);
    MultiPrimitiveImpl mp = (MultiPrimitiveImpl) agf.createMultiPrimitive(primitives);
View Full Code Here

TOP

Related Classes of org.geotools.geometry.iso.primitive.CurveImpl

Copyright © 2018 www.massapicom. 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.