Package org.opengis.geometry

Examples of org.opengis.geometry.PositionFactory.createDirectPosition()


    CoordinateReferenceSystem crs = DefaultGeographicCRS.WGS84;
    PicoContainer container = container( crs ); // normal 2D
    GeometryFactoryImpl factory = (GeometryFactoryImpl) container.getComponentInstanceOfType( GeometryFactory.class );
    PositionFactory positionFactory = (PositionFactory ) container.getComponentInstanceOfType( PositionFactory.class );
   
    DirectPosition positionA = positionFactory.createDirectPosition(new double[]{10, 10});
    DirectPosition positionB = positionFactory.createDirectPosition(new double[]{70, 30});
   
    LineSegmentImpl expected = createLineSegment(positionA, positionB);   
    LineSegmentImpl actual = (LineSegmentImpl) factory.createLineSegment(positionA, positionB);
   
View Full Code Here


    PicoContainer container = container( crs ); // normal 2D
    GeometryFactoryImpl factory = (GeometryFactoryImpl) container.getComponentInstanceOfType( GeometryFactory.class );
    PositionFactory positionFactory = (PositionFactory ) container.getComponentInstanceOfType( PositionFactory.class );
   
    DirectPosition positionA = positionFactory.createDirectPosition(new double[]{10, 10});
    DirectPosition positionB = positionFactory.createDirectPosition(new double[]{70, 30});
   
    LineSegmentImpl expected = createLineSegment(positionA, positionB);   
    LineSegmentImpl actual = (LineSegmentImpl) factory.createLineSegment(positionA, positionB);
   
    assertEquals( expected, actual );
View Full Code Here

    CoordinateReferenceSystem crs = DefaultGeographicCRS.WGS84;
    PicoContainer container = container( crs ); // normal 2D
    //PrimitiveFactoryImpl factory = (PrimitiveFactoryImpl) container.getComponentInstanceOfType( PrimitiveFactoryImpl.class );
    PositionFactory positionFactory = (PositionFactory ) container.getComponentInstanceOfType( PositionFactory.class );
   
    DirectPosition positionA = positionFactory.createDirectPosition(new double[]{10, 10});
    DirectPosition positionB = positionFactory.createDirectPosition(new double[]{70, 30});
   
    CurveImpl expected = createCurve(positionA, positionB);   
    CurveImpl actual = createCurve(positionA, positionB);
   
View Full Code Here

    PicoContainer container = container( crs ); // normal 2D
    //PrimitiveFactoryImpl factory = (PrimitiveFactoryImpl) container.getComponentInstanceOfType( PrimitiveFactoryImpl.class );
    PositionFactory positionFactory = (PositionFactory ) container.getComponentInstanceOfType( PositionFactory.class );
   
    DirectPosition positionA = positionFactory.createDirectPosition(new double[]{10, 10});
    DirectPosition positionB = positionFactory.createDirectPosition(new double[]{70, 30});
   
    CurveImpl expected = createCurve(positionA, positionB);   
    CurveImpl actual = createCurve(positionA, positionB);
   
    assertEquals( expected, actual );
View Full Code Here

    CoordinateReferenceSystem crs = DefaultGeographicCRS.WGS84;
    PicoContainer container = container( crs ); // normal 2D
    //PrimitiveFactoryImpl factory = (PrimitiveFactoryImpl) container.getComponentInstanceOfType( PrimitiveFactoryImpl.class );
    PositionFactory positionFactory = (PositionFactory ) container.getComponentInstanceOfType( PositionFactory.class );
   
    DirectPosition positionA = positionFactory.createDirectPosition(new double[]{10, 10});
    DirectPosition positionB = positionFactory.createDirectPosition(new double[]{20, 20});
   
    CurveImpl curve = createCurve(positionA, positionB);   

    // test split (split seems broken)
View Full Code Here

    PicoContainer container = container( crs ); // normal 2D
    //PrimitiveFactoryImpl factory = (PrimitiveFactoryImpl) container.getComponentInstanceOfType( PrimitiveFactoryImpl.class );
    PositionFactory positionFactory = (PositionFactory ) container.getComponentInstanceOfType( PositionFactory.class );
   
    DirectPosition positionA = positionFactory.createDirectPosition(new double[]{10, 10});
    DirectPosition positionB = positionFactory.createDirectPosition(new double[]{20, 20});
   
    CurveImpl curve = createCurve(positionA, positionB);   

    // test split (split seems broken)
    //curve.split(5);
View Full Code Here

    assertTrue(curve.equals((Object) curve2));
    assertTrue(curve.equals((Object) curve));
    assertFalse(curve.equals((Object) positionA));
    assertFalse(curve.equals((Object) null));
    DirectPosition positionC = positionFactory.createDirectPosition(new double[]{30, 30});
    CurveImpl curve3 = createCurve(positionA, positionC);
    assertFalse(curve.equals((Object) curve3));
   
  }
 
View Full Code Here

    AggregateFactoryImpl af = (AggregateFactoryImpl) c.getComponentInstanceOfType(AggregateFactory.class);
    GeometryFactoryImpl gf = (GeometryFactoryImpl) c.getComponentInstanceOfType( GeometryFactory.class );
    PositionFactory pf = (PositionFactory ) c.getComponentInstanceOfType( PositionFactory.class );
   
    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 ) );
View Full Code Here

    AggregateFactoryImpl af = (AggregateFactoryImpl) c.getComponentInstanceOfType(AggregateFactory.class);
    GeometryFactoryImpl gf = (GeometryFactoryImpl) c.getComponentInstanceOfType( GeometryFactory.class );
    PositionFactory pf = (PositionFactory ) c.getComponentInstanceOfType( PositionFactory.class );
   
    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 ) );
View Full Code Here

    PositionFactory posF = builder.getPositionFactory();
    PrimitiveFactory primF = builder.getPrimitiveFactory();
    GeometryFactory geomF = builder.getGeometryFactory();   

//     create directpositions
    DirectPosition start = posF.createDirectPosition(new double[]{ 48.44, -123.37 });
    DirectPosition middle = posF.createDirectPosition(new double[]{ 47, -122 });
    DirectPosition end = posF.createDirectPosition(new double[]{ 46.5, -121.5 });

//     add directpositions to a list
    ArrayList<Position> positions = new ArrayList<Position>();
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.