Examples of DirectPositionImpl


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

     * @see #get(int)
     */
    public DirectPosition getDirectPosition(int column, DirectPosition dest) throws IndexOutOfBoundsException {
        DirectPosition position = (DirectPosition) get(column);
        if (dest == null) {
            dest = new DirectPositionImpl(position.getCoordinateReferenceSystem());
        }
        for (int i = 0; i < position.getDimension(); i++) {
            dest.setOrdinate(i, position.getOrdinate(i));
        }
        return dest;
View Full Code Here

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

     */
    public Object[] toArray() {
        int n = size();
        DirectPosition [] result = new DirectPosition[n];
        for (int i=0; i<n; i++) {
            result[i] = new DirectPositionImpl((DirectPosition)get(i));
        }
        return result;
    }
View Full Code Here

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

    public CurveSegment reverse() {
        LineStringImpl result = new LineStringImpl();
        PointArray pa = result.getSamplePoints();
        int n = controlPoints.size();
        for (int i=n-1; i>=0; i--) {
            pa.add(new DirectPositionImpl(controlPoints.get(i).getDirectPosition()));
        }
        return result;
    }
View Full Code Here

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

     * @param position
     * @param crs
     */
    public PointImpl(final DirectPosition position, final CoordinateReferenceSystem crs) {
        super(crs);
        this.position = (position == null) ? new DirectPositionImpl(crs) : position;
    }
View Full Code Here

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

     * Returns a copy of this point's position.  We must return a copy (and not
     * a reference to our internal object), otherwise the caller could modify
     * the values of the object and we would not know.
     */
    public DirectPosition getDirectPosition() {
        return new DirectPositionImpl(position);
    }
View Full Code Here

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

     */
    public void setDirectPosition(final DirectPosition position) throws UnmodifiableGeometryException {
        if (isMutable()) {
            CoordinateReferenceSystem myCRS = getCoordinateReferenceSystem();
            CoordinateReferenceSystem pointCRS = position.getCoordinateReferenceSystem();
            DirectPosition copy = new DirectPositionImpl(position);
            if ((myCRS != null) && (pointCRS != null) && (!myCRS.equals(pointCRS))) {
                // Do the conversion.
                try {
                  BasicFactories commonFactory = BasicFactories.getDefault();
                    CoordinateOperationFactory cof = commonFactory.getCoordinateOperationFactory();
View Full Code Here

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

     * @param  dest An optionnaly pre-allocated direct position.
     * @return The {@code dest} argument, or a new object if {@code dest} was null.
     * @throws IndexOutOfBoundsException if an index is out of bounds.
     */
    public DirectPosition get(int row, int column, DirectPosition dest) throws IndexOutOfBoundsException {
        DirectPosition target = new DirectPositionImpl(getInternal( row, column ));
       
        if (dest == null || !dest.getCoordinateReferenceSystem().equals(target.getCoordinateReferenceSystem())){
            return target;
        }
        for (int i = 0; i < target.getDimension(); i++) {
            dest.setOrdinate(i, target.getOrdinate(i));
        }
        return dest;
    }
View Full Code Here

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

     * @throws IndexOutOfBoundsException if an index is out of bounds.
     * @throws UnsupportedOperationException if this grid is immutable.
     */
    public void set(int row, int column, DirectPosition position) throws IndexOutOfBoundsException,
                                                                         UnsupportedOperationException {
        DirectPosition target = new DirectPositionImpl(getInternal(row, column));
       
        if (position.getCoordinateReferenceSystem().equals(target.getCoordinateReferenceSystem())) {
            for (int i = 0; i < position.getDimension(); i++) {
                target.setOrdinate(i, position.getOrdinate(i));
            }
        }
    }
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.