Package org.geotools.geometry.jts.spatialschema.geometry

Examples of org.geotools.geometry.jts.spatialschema.geometry.DirectPositionImpl


  public PositionFactoryImpl( CoordinateReferenceSystem crs ){
    this.crs = crs;
  }
  public DirectPosition createDirectPosition(double[] ordiantes)
      throws MismatchedDimensionException {
    return new DirectPositionImpl( crs, ordiantes );
  }
View Full Code Here


      throws MismatchedDimensionException {
    return new DirectPositionImpl( crs, ordiantes );
  }

  public Position createPosition(Position position) {
    return new DirectPositionImpl( position.getDirectPosition() );
  }
View Full Code Here

    PointArray pointArray = (PointArray) createPointArray();
    int D = crs.getCoordinateSystem().getDimension();
    if (D == 2) {
      for (int i = start; i < end; i += D) {
        double[] ordinates = new double[] { array[i], array[i + 1] };
        pointArray.add(new DirectPositionImpl(crs, ordinates));
      }
    } else if (D == 3) {
      for (int i = start; i < end; i += D) {
        double[] ordinates = new double[] { array[i], array[i + 1],
            array[i + 2] };
        pointArray.add(new DirectPositionImpl(crs, ordinates));
      }
    } else {
      for (int i = start; i < end; i += D) {
        double[] ordinates = new double[D];
        for (int o = 0; i < D; i++) {
          ordinates[o] = array[i + o];
        }
        pointArray.add(new DirectPositionImpl(crs, ordinates));
      }
    }
    return pointArray;
  }
View Full Code Here

        // PENDING(NL): Add code to check for CRS compatibility
        // Must consider possibility that this is a pixel envelope
        // rather than geo coordinate; only way to be sure is to check Units
        DirectPosition topCorner = envelope.getUpperCorner();
        DirectPosition botCorner = envelope.getLowerCorner();
        DirectPosition topLeft = new DirectPositionImpl(topCorner);
        DirectPosition botRight = new DirectPositionImpl(botCorner);
       
        //Again, making assumption we can ignore this LatLonAlt stuff - colin
       
        /*
        // If the Envelope coordinates are LatLonAlts,
        // calling setOrdinate causes Error-level logging messages,
        // including a stack trace,
        // though it still works.  But in principal we should
        // call get/setLat and get/setLon instead if we have LatLonAlts
        if (topLeft instanceof LatLonAlt && botRight instanceof LatLonAlt) {
          ((LatLonAlt) topLeft).setLon(((LatLonAlt)
              botCorner).getLon(NonSI.DEGREE_ANGLE), NonSI.DEGREE_ANGLE);
          ((LatLonAlt) botRight).setLon(((LatLonAlt)
              topCorner).getLon(NonSI.DEGREE_ANGLE), NonSI.DEGREE_ANGLE);
        } else {*/
         
        topLeft.setOrdinate(1, botCorner.getOrdinate(1));
  botRight.setOrdinate(1, topCorner.getOrdinate(1));
       
         //}//end of else statment associated with above LatLongAlt stuff
        // Create a JTS Envelope
        Coordinate jtsTopRight =
            JTSUtils.directPositionToCoordinate(topCorner);
View Full Code Here

    DirectPosition position = point.getDirectPosition();
    assertNotNull(position);
  }

  public void testNewPointHere() {
    DirectPosition here = new DirectPositionImpl(DefaultGeographicCRS.WGS84);
    here.setOrdinate(0, 48.44);
    here.setOrdinate(1, -123.37); // 48.44,-123.37

    Point point = new PointImpl(here);
    assertNotNull(point.getCoordinateReferenceSystem());
    assertEquals(here.getCoordinateReferenceSystem(), point
        .getCoordinateReferenceSystem());
    assertEquals(here, point.getDirectPosition());
    assertEquals(here.hashCode(), point.getDirectPosition().hashCode());
  }
View Full Code Here

        return crs;
    }
   

    public Position createPosition( DirectPosition point ) {
        return new DirectPositionImpl( point );
    }
View Full Code Here

    public Position createPosition( DirectPosition point ) {
        return new DirectPositionImpl( point );
    }
    public DirectPosition createDirectPosition() {
        return new DirectPositionImpl(crs);
    }
View Full Code Here

    /**
     * @inheritDoc
     * @see org.opengis.geometry.coordinate.Factory#createDirectPosition(double[])
     */
    public DirectPosition createDirectPosition(final double[] coordinates) {
        return new DirectPositionImpl(crs, coordinates);
    }
View Full Code Here

     * @param coordinates
     * @return
     */
    public DirectPosition createDirectPosition(final double[] coordinates) {
        if (coordinates != null) {
            return new DirectPositionImpl(crs, coordinates);
        } else {
            return new DirectPositionImpl(crs);
        }
    }
View Full Code Here

     *
     * @revisit Should we specify that changes to the returned point will not be reflected
     *          to this array, or should we left the decision to the implementor?
     */
    public Position get(int column) throws IndexOutOfBoundsException {
        return new DirectPositionImpl((DirectPosition)super.get(column));
    }
View Full Code Here

TOP

Related Classes of org.geotools.geometry.jts.spatialschema.geometry.DirectPositionImpl

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.