Package org.opengis.geometry

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


         for( double angle = 0.0; angle < 360.0; angle += delta ){
             double ordinates[] = new double[]{
                     Math.sin( Math.toRadians(angle) ),
                     Math.cos( Math.toRadians(angle) )
             };
             DirectPosition point = postitionFactory.createDirectPosition( ordinates );
             points.add( point );
         }
         List<OrientableCurve> curves = new ArrayList<OrientableCurve>();       
         // A curve will be created
         // - The curve will be set as parent curves for the Curve segments
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});
    Envelope bounds = new EnvelopeImpl( positionA, positionB );
   
    LineSegmentImpl expected = new LineSegmentImpl( crs, new double[]{10,Double.NaN}, new double[]{70,Double.NaN}, 0.0 );   
   
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});
    Envelope bounds = new EnvelopeImpl( positionA, positionB );
   
    LineSegmentImpl expected = new LineSegmentImpl( crs, new double[]{10,Double.NaN}, new double[]{70,Double.NaN}, 0.0 );   
   
    LineSegment actual =  factory.processBoundsToSegment( bounds );
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});
    Envelope bounds = new EnvelopeImpl( positionA, positionB );
   
    LineSegmentImpl segment = new LineSegmentImpl( crs, new double[]{10,Double.NaN}, new double[]{70,Double.NaN}, 0.0 );
   
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});
    Envelope bounds = new EnvelopeImpl( positionA, positionB );
   
    LineSegmentImpl segment = new LineSegmentImpl( crs, new double[]{10,Double.NaN}, new double[]{70,Double.NaN}, 0.0 );
   
    // create expected ring
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});
    Envelope bounds = new EnvelopeImpl( positionA, positionB );
   
    // create expected ring
    DirectPosition one = new DirectPositionImpl( positionA );
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});
    Envelope bounds = new EnvelopeImpl( positionA, positionB );
   
    // create expected ring
    DirectPosition one = new DirectPositionImpl( positionA );
    one.setOrdinate( 1, bounds.getMinimum(1) );
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

 
  public void testBuildPoint() {
   
    // test positionfactory
    PositionFactory posFactory = builder.getPositionFactory();
    DirectPosition position = posFactory.createDirectPosition(new double[] { 48.44, -123.37 });
   
    // test primitivefactory
    PrimitiveFactory primitiveFactory = builder.getPrimitiveFactory();
    Point point = primitiveFactory.createPoint(new double[] { 48.44, -123.37 });
   
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.