/** * Given a lat,lon point, find the x,y index in the coordinate system. * If outside the range, the closest point is returned * * @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. */ @Override public int[] findXYindexFromLatLonBounded(double lat, double lon, int[] result) { Projection dataProjection = getProjection(); ProjectionPoint pp = dataProjection.latLonToProj(new LatLonPointImpl(lat, lon), new ProjectionPointImpl()); return findXYindexFromCoordBounded(pp.getX(), pp.getY(), result); }
/** * Given a lat,lon point, find the x,y index in the coordinate system. * If outside the range, the closest point is returned * * @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. */ @Override public int[] findXYindexFromLatLonBounded(double lat, double lon, int[] result) { Projection dataProjection = getProjection(); ProjectionPoint pp = dataProjection.latLonToProj(new LatLonPointImpl(lat, lon), new ProjectionPointImpl()); return findXYindexFromCoordBounded(pp.getX(), pp.getY(), result); }
/** * Given a lat,lon point, find the x,y index in the coordinate system. * If outside the range, the closest point is returned * * @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. */ @Override public int[] findXYindexFromLatLonBounded(double lat, double lon, int[] result) { Projection dataProjection = getProjection(); ProjectionPoint pp = dataProjection.latLonToProj(new LatLonPointImpl(lat, lon), new ProjectionPointImpl()); return findXYindexFromCoordBounded(pp.getX(), pp.getY(), result); }