src/main/java/ucar/geoapi/NetcdfProjection.java
@Override
    public void transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)
            throws TransformException
    {
        final int srcDim = getSourceDimensions();
        final int dstDim = getTargetDimensions();
        if (srcPts == dstPts && needsCopy(srcOff, srcDim, dstOff, dstDim, numPts)) {
            srcPts = Arrays.copyOfRange(srcPts, srcOff, srcOff + numPts*srcDim);
            srcOff = 0;
        }
        while (--numPts >= 0) {
            if (isInverse) {
                final LatLonPoint pt = projection.projToLatLon(srcPts[srcOff], srcPts[srcOff+1]);
                dstPts[dstOff]   = pt.getLongitude();
                dstPts[dstOff+1] = pt.getLatitude();
            } else {
                final ProjectionPoint pt = projection.latLonToProj(srcPts[srcOff+1], srcPts[srcOff]);
                dstPts[dstOff  ] = pt.getX();
                dstPts[dstOff+1] = pt.getY();
            }
            srcOff += srcDim;
            dstOff += dstDim;
        }
    }
/**
     * Transforms an arbitrary amount of points from the given source array to the given destination array.
     * This method delegates to one of the following methods for each point:
     *
     * <ul>
     *   <li>{@link Projection#latLonToProj(LatLonPoint)} for the forward projection.</li>
     *   <li>{@link Projection#projToLatLon(ProjectionPoint)} for the inverse projection.</li>
     * </ul>
     */
Transforms an arbitrary amount of points from the given source array to the given destination array.
This method delegates to one of the following methods for each point.


Transforms an arbitrary amount of points from the given source array to the given destination array . This method delegates to one of the following methods for each point .
@Override
    public void transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)
            throws TransformException
    {
        final int srcDim = getSourceDimensions();
        final int dstDim = getTargetDimensions();
        if (srcPts == dstPts && needsCopy(srcOff, srcDim, dstOff, dstDim, numPts)) {
            srcPts = Arrays.copyOfRange(srcPts, srcOff, srcOff + numPts*srcDim);
            srcOff = 0;
        }
        while (--numPts >= 0) {
            if (isInverse) {
                final LatLonPoint pt = projection.projToLatLon(srcPts[srcOff], srcPts[srcOff+1]);
                dstPts[dstOff]   = pt.getLongitude();
                dstPts[dstOff+1] = pt.getLatitude();
            } else {
                final ProjectionPoint pt = projection.latLonToProj(srcPts[srcOff+1], srcPts[srcOff]);
                dstPts[dstOff  ] = pt.getX();
                dstPts[dstOff+1] = pt.getY();
            }
            srcOff += srcDim;
            dstOff += dstDim;
        }
    }
@ Override public void transform ( double [ ] srcPts , int srcOff , double [ ] dstPts , int dstOff , int numPts ) throws TransformException { final int srcDim = getSourceDimensions ( ) ; final int dstDim = getTargetDimensions ( ) ; if ( srcPts == dstPts && needsCopy ( srcOff , srcDim , dstOff , dstDim , numPts ) ) { srcPts = Arrays . copyOfRange ( srcPts , srcOff , srcOff + numPts * srcDim ) ; srcOff = 0 ; } while ( -- numPts >= 0 ) { if ( isInverse ) { final LatLonPoint pt = projection . projToLatLon ( srcPts [ srcOff ] , srcPts [ srcOff + 1 ] ) ; dstPts [ dstOff ] = pt . getLongitude ( ) ; dstPts [ dstOff + 1 ] = pt . getLatitude ( ) ; } else { final ProjectionPoint pt = projection . latLonToProj ( srcPts [ srcOff + 1 ] , srcPts [ srcOff ] ) ; dstPts [ dstOff ] = pt . getX ( ) ; dstPts [ dstOff + 1 ] = pt . getY ( ) ; } srcOff += srcDim ; dstOff += dstDim ; } }
Transforms an arbitrary amount of points from the given source array to the given destination array.
Transforms an arbitrary amount of points from the given source array to the given destination array .