Package org.opengis.geometry.coordinate

Examples of org.opengis.geometry.coordinate.Position


    assertTrue(Double.compare(uc.getOrdinate(0), Double.NaN) == 0);
    assertTrue(Double.compare(uc.getOrdinate(1), Double.NaN) == 0);
    assertTrue(Double.compare(uc.getOrdinate(2), Double.NaN) == 0);
   
    // public Position createPosition(DirectPosition dp);
    Position pos1 = cf.createPosition(dp2);
    assertTrue(pos1.getDirectPosition().getOrdinate(0) == 10.0);
    assertTrue(pos1.getDirectPosition().getOrdinate(1) == -115000.0);
    assertTrue(pos1.getDirectPosition().getOrdinate(2) == 0.0000000125);

    // public LineSegment createLineSegment(Position startPoint, Position endPoint);
    Position pos2 = cf.createPosition(dp1);
    LineSegment seg1 = cf.createLineSegment(pos1, pos2);
    assertTrue(Double.compare(seg1.getEndPoint().getOrdinate(0), Double.NaN) == 0.0);
    assertTrue(Double.compare(seg1.getEndPoint().getOrdinate(1), Double.NaN) == 0.0);
    assertTrue(Double.compare(seg1.getEndPoint().getOrdinate(2), Double.NaN) == 0.0);
    assertTrue(seg1.getStartPoint().getOrdinate(0) == 10.0);
View Full Code Here


    // public PointImpl createPoint(Position position);
    // public PointImpl createPoint(DirectPositionImpl dp);
    da[0] = 999999999.0;
    da[1] = 100.0;
    da[2] = -0.00000565;
    Position pos1 = new DirectPositionImpl( pf.getCoordinateReferenceSystem(),  da );
    Point p2 = pf.createPoint(pos1);
    assertTrue(p2.getDirectPosition().getOrdinate(0) == 999999999.0);
    assertTrue(p2.getDirectPosition().getOrdinate(1) == 100.0);
    assertTrue(p2.getDirectPosition().getOrdinate(2) == -0.00000565);
   
View Full Code Here

    // public PointImpl createPoint(Position position);
    // public PointImpl createPoint(DirectPositionImpl dp);
    da[0] = 999999999.0;
    da[1] = 100.0;
    da[2] = -0.00000565;
    Position pos1 = new DirectPositionImpl( pf.getCoordinateReferenceSystem(),  da );
    Point p2 = pf.createPoint(pos1);
    assertTrue(p2.getDirectPosition().getOrdinate(0) == 999999999.0);
    assertTrue(p2.getDirectPosition().getOrdinate(1) == 100.0);
    assertTrue(p2.getDirectPosition().getOrdinate(2) == -0.00000565);
View Full Code Here

    assertTrue(Double.compare(uc.getOrdinate(0), Double.NaN) == 0);
    assertTrue(Double.compare(uc.getOrdinate(1), Double.NaN) == 0);
    assertTrue(Double.compare(uc.getOrdinate(2), Double.NaN) == 0);
   
    // public Position createPosition(DirectPosition dp);
    Position pos1 = cf.createPosition(dp2);
    assertTrue(pos1.getDirectPosition().getOrdinate(0) == 10.0);
    assertTrue(pos1.getDirectPosition().getOrdinate(1) == -115000.0);
    assertTrue(pos1.getDirectPosition().getOrdinate(2) == 0.0000000125);

    // public LineSegment createLineSegment(Position startPoint, Position endPoint);
    Position pos2 = cf.createPosition(dp1);
    LineSegment seg1 = cf.createLineSegment(pos1, pos2);
    assertTrue(Double.compare(seg1.getEndPoint().getOrdinate(0), Double.NaN) == 0.0);
    assertTrue(Double.compare(seg1.getEndPoint().getOrdinate(1), Double.NaN) == 0.0);
    assertTrue(Double.compare(seg1.getEndPoint().getOrdinate(2), Double.NaN) == 0.0);
    assertTrue(seg1.getStartPoint().getOrdinate(0) == 10.0);
View Full Code Here

    // TODO JR: Zur kenntnisnahme:
    // Wie in deinem Vorschlag von unserem Telefonat am 04/10 hole ich die CoordFactory über ein DP
       
    //CoordinateFactoryImpl coordFactory = this.getFeatGeomFactory().getCoordinateFactory();   
    for (int i = 0; i < aPointArray.size(); i++) {
            Position copy = new PositionImpl( aPointArray.getDirectPosition(i, null) );
      add( copy );
    }
        crs = getDirectPosition(0).getDirectPosition().getCoordinateReferenceSystem();
  }
View Full Code Here

   * @return double[]
   */
  public double[] getCoordinate(int index) {
    // test ok
   
    Position pos = getDirectPosition(index);
    return pos.getDirectPosition().getCoordinate();

    // Auskommentiert und geändert durch Sanjay am 21.08.2006
    // der komplette code hat nicht soviel sinn gemacht, wurde nicht getestet
    // Position nicht berücksichtigt wurde
    // OLD CODE:
View Full Code Here

   * Creates an envelope for all points in point array
   *
   * @return envelope for all points in point array
   */
  public EnvelopeImpl getEnvelope() {
        Position position = getDirectPosition( 0 );       
    EnvelopeImpl env = new EnvelopeImpl( position );
   
    for (int i = 1, n = length(); i < n; i++) {
      double[] c1 = getCoordinate(i);
      env.expand(c1);
View Full Code Here

   * @see org.opengis.geometry.coordinate.PointArray#get(int, org.opengis.geometry.coordinate.DirectPosition)
   */
  public DirectPosition getPosition(int col, DirectPosition dest)
      throws IndexOutOfBoundsException {
    // Test ok (SJ)
    Position pos = get(col);

    double[] coords = pos.getDirectPosition().getCoordinate();   
    if (dest != null) {
            if( dest instanceof DirectPositionImpl ){
                DirectPositionImpl fast = (DirectPositionImpl) dest;
                // Set coordinates in existing DP
                fast.setCoordinate(coords);   
            }
            else {
                for( int i=0; i<coords.length; i++ ){
                    dest.setOrdinate( i, coords[i] );
                }
            }     
    } else {
            dest = pos.getDirectPosition();     
    }   
    return dest;
  }
View Full Code Here

   */
  public void setPosition(int index, DirectPosition position)
      throws IndexOutOfBoundsException, UnsupportedOperationException {
    // Test ok
    // Set copy of the coordinates of the given DirectPosition
        Position pos = get(index);
        DirectPosition inPlace = pos.getDirectPosition();
        double[] coord = position.getCoordinate();
        for( int i=0; i<coord.length; i++){
            inPlace.setOrdinate( i, coord[i] );
        }
  }
View Full Code Here

   * @param coord
   */
  public void set(int index, double[] coord) {
    // TODO test
    // Manipulate the coordinates at the Position entry at the index
    Position pos = get(index);
        DirectPosition position = pos.getDirectPosition();
        for( int i=0; i<coord.length; i++){
            position.setOrdinate( i, coord[i] );
        }
  }
View Full Code Here

TOP

Related Classes of org.opengis.geometry.coordinate.Position

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.