Examples of MathTransform


Examples of org.opengis.referencing.operation.MathTransform

    private void transform() throws Exception {
        ILayer editLayer = getMap().getEditManager().getEditLayer();
        if (map.getViewportModel().getCRS().equals(editLayer.getCRS(null))) {
            return;
        }
        MathTransform mt = CRS.findMathTransform(map.getViewportModel().getCRS(), editLayer
                .getCRS(), true);
        if (mt == null || mt.isIdentity()) {
            return;
        }
        double[] coords = new double[coordinates.length * 2];
        for( int i = 0; i < coordinates.length; i++ ) {
            coords[i * 2] = coordinates[i].x;
            coords[i * 2 + 1] = coordinates[i].y;
        }
        mt.transform(coords, 0, coords, 0, coordinates.length);
        for( int i = 0; i < coordinates.length; i++ ) {
            coordinates[i].x = coords[i * 2];
            coordinates[i].y = coords[i * 2 + 1];
        }
    }
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.