org.geolatte.geom.crs.trans.TransformOperation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of geolatte-geom Show documentation
Show all versions of geolatte-geom Show documentation
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;
import org.geolatte.geom.Position;
import org.geolatte.geom.Positions;
import org.geolatte.geom.crs.CoordinateReferenceSystem;
/**
* Created by Karel Maesen, Geovise BVBA on 2019-03-27.
*/
public interface TransformOperation {
CoordinateReferenceSystem
getSource();
CoordinateReferenceSystem getTarget();
CoordinateOperation getOperation();
default Q forward(P pos) {
double[] out = new double[getTarget().getCoordinateDimension()];
getOperation().forward(pos.toArray(null), out);
return Positions.mkPosition(getTarget().getPositionClass(), out);
}
default P reverse(Q pos) {
double[] out = new double[getSource().getCoordinateDimension()];
getOperation().reverse(pos.toArray(null), out);
return Positions.mkPosition(getSource().getPositionClass(), out);
}
TransformOperation reversed();
}