All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.geolatte.geom.crs.trans.CoordinateOperation Maven / Gradle / Ivy

Go to download

This geoLatte-geom library offers a geometry model that conforms to the OGC Simple Features for SQL specification.

The newest version!
package org.geolatte.geom.crs.trans;

/**
 * Low-level transformation interface
 *
 * Created by Karel Maesen, Geovise BVBA on 20/07/17.
 */
public interface CoordinateOperation {

    boolean isReversible();

    int inCoordinateDimension();

    int outCoordinateDimension();

    void forward(double[] inCoordinate, double[] outCoordinate);

    void reverse(double[] inCoordinate, double[] outCoordinate);

    /**
     * Creates a new {@code CoordinateOperation} from this instance by appending and the specified instance in the forward direction;
     *
     * @param operation the instance to append
     * @return a new instance
     */
    default CoordinateOperation appendForward(CoordinateOperation operation) {
        return new ConcatenatedOperation.Builder().forward( this ).forward(operation).build();
    }

    /**
     * Creates a new {@code CoordinateOperation} from this instance by appending and the specified instance in the reverse direction;
     *
     * @param operation the instance to append
     * @return a new instance
     */
    default CoordinateOperation appendReverse(CoordinateOperation operation) {
        return new ConcatenatedOperation.Builder().forward( this ).reverse(operation).build();
    }


    /**
     * Creates a new {@code CoordinateOperation} by reversing this instance
     * @return a new {@code CoordinateOperation} by reversing this instance
     */
    default CoordinateOperation reversed() {
        return new ConcatenatedOperation.Builder().reverse(this).build();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy