PixelGeoCoding extends AbstractGeoCoding implements BasicPixelGeoCoding { static float getNegativeLonMax(float lon0, float lon1, float lon2, float lon3) { float lonMax; lonMax = -180.0f; if (lon0 < 0.0f) { lonMax = lon0; } if (lon1 < 0.0f) { lonMax = max(lon1, lonMax); } if (lon2 < 0.0f) { lonMax = max(lon2, lonMax); } if (lon3 < 0.0f) { lonMax = max(lon3, lonMax); } return lonMax; } PixelGeoCoding(final Band latBand, final Band lonBand, final String validMask, final int searchRadius);  PixelGeoCoding(final Band latBand, final Band lonBand, final String validMask, final int searchRadius,
                          ProgressMonitor pm); static long getRequiredMemory(Product product, boolean usesValidMask); @Override Band getLatBand(); @Override Band getLonBand(); @Override String getValidMask(); @Override GeoCoding getPixelPosEstimator(); @Override int getSearchRadius(); @Override boolean isCrossingMeridianAt180(); @Override boolean canGetPixelPos(); @Override boolean canGetGeoPos(); @Override PixelPos getPixelPos(final GeoPos geoPos, PixelPos pixelPos); void getPixelPosUsingEstimator(final GeoPos geoPos, PixelPos pixelPos); void getPixelPosUsingQuadTreeSearch(final GeoPos geoPos, PixelPos pixelPos); @Override GeoPos getGeoPos(final PixelPos pixelPos, GeoPos geoPos); @Override boolean equals(Object o); @Override int hashCode(); @Override synchronized void dispose(); @Override boolean transferGeoCoding(final Scene srcScene, final Scene destScene, final ProductSubsetDef subsetDef); @Override Datum getDatum();  }
@Test public void testGetNegativeLonMax() throws Exception { float lon0 = 160.0f; float lon1 = 150.0f; float lon2 = -169.0f; float lon3 = 165.0f; float result = PixelGeoCoding.getNegativeLonMax(lon0, lon1, lon2, lon3); assertEquals(-169.0f, result, 0.0f); lon0 = -175.0f; lon1 = 170.0f; lon2 = -169.0f; lon3 = -170.0f; result = PixelGeoCoding.getNegativeLonMax(lon0, lon1, lon2, lon3); assertEquals(-169.0f, result, 0.0f); lon0 = 170.0f; lon1 = 160.0f; lon2 = -175.0f; lon3 = -165.0f; result = PixelGeoCoding.getNegativeLonMax(lon0, lon1, lon2, lon3); assertEquals(-165.0f, result, 0.0f); lon0 = -150.0f; lon1 = +160.0f; lon2 = -140.0f; lon3 = -170.0f; result = PixelGeoCoding.getNegativeLonMax(lon0, lon1, lon2, lon3); assertEquals(-140.0f, result, 0.0f); lon0 = 170.0f; lon1 = -175.0f; lon2 = -165.0f; lon3 = -150.0f; result = PixelGeoCoding.getNegativeLonMax(lon0, lon1, lon2, lon3); assertEquals(-150.0f, result, 0.0f); lon0 = 140.0f; lon1 = 150.0f; lon2 = 160.0f; lon3 = -170.0f; result = PixelGeoCoding.getNegativeLonMax(lon0, lon1, lon2, lon3); assertEquals(-170.0f, result, 0.0f); lon0 = -175.0f; lon1 = -165.0f; lon2 = 170.0f; lon3 = 160.0f; result = PixelGeoCoding.getNegativeLonMax(lon0, lon1, lon2, lon3); assertEquals(-165.0f, result, 0.0f); lon0 = 170.0f; lon1 = -140.0f; lon2 = 160.0f; lon3 = -150.0f; result = PixelGeoCoding.getNegativeLonMax(lon0, lon1, lon2, lon3); assertEquals(-140.0f, result, 0.0f); lon0 = -160.0f; lon1 = -150.0f; lon2 = 170.0f; lon3 = -170.0f; result = PixelGeoCoding.getNegativeLonMax(lon0, lon1, lon2, lon3); assertEquals(-150.0f, result, 0.0f); lon0 = 170.0f; lon1 = -170.0f; lon2 = 150.0f; lon3 = 160.0f; result = PixelGeoCoding.getNegativeLonMax(lon0, lon1, lon2, lon3); assertEquals(-170.0f, result, 0.0f); lon0 = -170.0f; lon1 = 150.0f; lon2 = 160.0f; lon3 = 140.0f; result = PixelGeoCoding.getNegativeLonMax(lon0, lon1, lon2, lon3); assertEquals(-170.0f, result, 0.0f); lon0 = -150.0f; lon1 = -170.0f; lon2 = -160.0f; lon3 = 170.0f; result = PixelGeoCoding.getNegativeLonMax(lon0, lon1, lon2, lon3); assertEquals(-150.0f, result, 0.0f); }