src/main/java/ucar/geoapi/NetcdfProjection.java
@Override
    public Point2D transform(final Point2D ptSrc, final Point2D ptDst) throws TransformException {
        double x = ptSrc.getX();
        double y = ptSrc.getY();
        if (isInverse) {
            final LatLonPoint pt = projection.projToLatLon(ProjectionPoint.create(x, y));
            x = pt.getLongitude();
            y = pt.getLatitude();
        } else {
            final ProjectionPoint pt = projection.latLonToProj(LatLonPoint.create(y, x));
            x = pt.getX();
            y = pt.getY();
        }
        if (ptDst == null) {
            return new Point2D.Double(x, y);
        }
        ptDst.setLocation(x, y);
        return ptDst;
    }
/**
     * Transforms the specified {@code ptSrc} and stores the result in {@code ptDst}.
     * If {@code ptDst} is {@code null}, a new {@link Point2D} object is allocated
     * and then the result of the transformation is stored in this object. In either case,
     * {@code ptDst}, which contains the transformed point, is returned for convenience.
     * If {@code ptSrc} and {@code ptDst} are the same object, the input point is
     * correctly overwritten with the transformed point.
     *
     * <p>This method delegates to one of the following methods:</p>
     * <ul>
     *   <li>{@link Projection#latLonToProj(LatLonPoint)}
     *       for the forward projection.</li>
     *   <li>{@link Projection#projToLatLon(ProjectionPoint)}
     *       for the inverse projection.</li>
     * </ul>
     *
     * @param  ptSrc  the coordinate point to be transformed.
     * @param  ptDst  the coordinate point that stores the result of transforming {@code ptSrc},
     *         or {@code null} if a new point shall be created.
     * @return the coordinate point after transforming {@code ptSrc} and storing the result in {@code ptDst}
     *         or in a new point if {@code ptDst} was null.
     * @throws TransformException if the point can not be transformed.
     */
Transforms the specified  ptSrc and stores the result in  ptDst.
If  ptDst is  null, a new  Point2D object is allocated
and then the result of the transformation is stored in this object. In either case,
ptDst, which contains the transformed point, is returned for convenience.
If  ptSrc and  ptDst are the same object, the input point is
correctly overwritten with the transformed point.

This method delegates to one of the following methods:

 Projection#latLonToProj(LatLonPoint)
for the forward projection.
 Projection#projToLatLon(ProjectionPoint)
for the inverse projection.


@param  ptSrc  the coordinate point to be transformed.
@param  ptDst  the coordinate point that stores the result of transforming  ptSrc,
or  null if a new point shall be created.
@return the coordinate point after transforming  ptSrc and storing the result in  ptDst
or in a new point if  ptDst was null.
@throws TransformException if the point can not be transformed.
Transforms the specified ptSrc and stores the result in ptDst . If ptDst is null a new Point2D object is allocated and then the result of the transformation is stored in this object . In either case ptDst which contains the transformed point is returned for convenience . If ptSrc and ptDst are the same object the input point is correctly overwritten with the transformed point . This method delegates to one of the following methods : Projection#latLonToProj ( LatLonPoint ) for the forward projection . Projection#projToLatLon ( ProjectionPoint ) for the inverse projection . @param ptSrc the coordinate point to be transformed . @param ptDst the coordinate point that stores the result of transforming ptSrc or null if a new point shall be created . @return the coordinate point after transforming ptSrc and storing the result in ptDst or in a new point if ptDst was null . @throws TransformException if the point can not be transformed .
@Override
    public Point2D transform(final Point2D ptSrc, final Point2D ptDst) throws TransformException {
        double x = ptSrc.getX();
        double y = ptSrc.getY();
        if (isInverse) {
            final LatLonPoint pt = projection.projToLatLon(ProjectionPoint.create(x, y));
            x = pt.getLongitude();
            y = pt.getLatitude();
        } else {
            final ProjectionPoint pt = projection.latLonToProj(LatLonPoint.create(y, x));
            x = pt.getX();
            y = pt.getY();
        }
        if (ptDst == null) {
            return new Point2D.Double(x, y);
        }
        ptDst.setLocation(x, y);
        return ptDst;
    }
@ Override public Point2D transform ( final Point2D ptSrc , final Point2D ptDst ) throws TransformException { double x = ptSrc . getX ( ) ; double y = ptSrc . getY ( ) ; if ( isInverse ) { final LatLonPoint pt = projection . projToLatLon ( ProjectionPoint . create ( x , y ) ) ; x = pt . getLongitude ( ) ; y = pt . getLatitude ( ) ; } else { final ProjectionPoint pt = projection . latLonToProj ( LatLonPoint . create ( y , x ) ) ; x = pt . getX ( ) ; y = pt . getY ( ) ; } if ( ptDst == null ) { return new Point2D . Double ( x , y ) ; } ptDst . setLocation ( x , y ) ; return ptDst ; }
Transforms the specified {@code ptSrc} and stores the result in {@code ptDst}.
Transforms the specified { @code ptSrc } and stores the result in { @code ptDst } .