protected Double getNearestNeighborValue ( GriddedTile griddedTile , TImage image , Double [ ] [ ] leftLastColumns , Double [ ] [ ] topLeftRows , Double [ ] [ ] topRows , int y , int x , float widthRatio , float heightRatio , float destTop , float destLeft , float srcTop , float srcLeft ) { // Determine which source pixel to use float xSource = getXSource ( x , destLeft , srcLeft , widthRatio ) ; float ySource = getYSource ( y , destTop , srcTop , heightRatio ) ; // Get the closest nearest neighbors List < int [ ] > nearestNeighbors = getNearestNeighbors ( xSource , ySource ) ; // Get the coverage data value from the source pixel nearest neighbors // until one is found Double value = null ; for ( int [ ] nearestNeighbor : nearestNeighbors ) { value = getValueOverBorders ( griddedTile , image , leftLastColumns , topLeftRows , topRows , nearestNeighbor [ 0 ] , nearestNeighbor [ 1 ] ) ; if ( value != null ) { break ; } } return value ; }
Get the nearest neighbor coverage data value