cdm/src/main/java/ucar/nc2/dt/grid/GridCoordSys.java
@Override
  public int[] findXYindexFromLatLon(double lat, double lon, int[] result) {
    Projection dataProjection = getProjection();
    ProjectionPoint pp = dataProjection.latLonToProj(new LatLonPointImpl(lat, lon), new ProjectionPointImpl());

    return findXYindexFromCoord(pp.getX(), pp.getY(), result);
  }
@Override
  public int[] findXYindexFromLatLon(double lat, double lon, int[] result) {
    Projection dataProjection = getProjection();
    ProjectionPoint pp = dataProjection.latLonToProj(new LatLonPointImpl(lat, lon), new ProjectionPointImpl());

    return findXYindexFromCoord(pp.getX(), pp.getY(), result);
  }
@ Override public int [ ] findXYindexFromLatLon ( double lat , double lon , int [ ] result ) { Projection dataProjection = getProjection ( ) ; ProjectionPoint pp = dataProjection . latLonToProj ( new LatLonPointImpl ( lat , lon ) , new ProjectionPointImpl ( ) ) ; return findXYindexFromCoord ( pp . getX ( ) , pp . getY ( ) , result ) ; }
Given a lat,lon point, find the x,y index in the coordinate system.

@param lat    latitude position.
@param lon    longitude position.
@param result put result in here, may be null
@return int[2], 0=x,1=y indices in the coordinate system of the point. These will be -1 if out of range.
Given a lat lon point find the x y index in the coordinate system .