SlstrTiePointGeoCoding extends TiePointGeoCoding { @Override public GeoPos getGeoPos(PixelPos pixelPos, GeoPos geoPos) { PixelPos transformedPixelPos = new PixelPos(); transform.transform(pixelPos, transformedPixelPos); return super.getGeoPos(transformedPixelPos, geoPos); } SlstrTiePointGeoCoding(TiePointGrid latGrid, TiePointGrid lonGrid, AffineTransform2D transform); @Override GeoPos getGeoPos(PixelPos pixelPos, GeoPos geoPos); @Override PixelPos getPixelPos(GeoPos geoPos, PixelPos pixelPos); @Override boolean transferGeoCoding(Scene srcScene, Scene destScene, ProductSubsetDef subsetDef); @Override boolean canClone(); @SuppressWarnings("MethodDoesntCallSuperMethod") @Override GeoCoding clone();  }
@Test public void testGetGeoPos_IdentityTransform() { final PixelPos pixelPos = new PixelPos(6, 6); final GeoPos referenceGeoPos = new GeoPos(); referenceGeoCoding.getGeoPos(pixelPos, referenceGeoPos); final GeoPos slstrGeoPos = new GeoPos(); slstrCoding.getGeoPos(pixelPos, slstrGeoPos); assertEquals(referenceGeoPos.getLat(), slstrGeoPos.getLat(), 1e-8); assertEquals(referenceGeoPos.getLon(), slstrGeoPos.getLon(), 1e-8); }
@Test public void testGetGeoPos_Transform() throws Exception { final PixelPos pixelPos1 = new PixelPos(4, 7); final PixelPos pixelPos2 = new PixelPos(6, 6); final PixelPos pixelPos3 = new PixelPos(7, 4); final GeoPos referenceGeoPos1 = new GeoPos(); final GeoPos referenceGeoPos2 = new GeoPos(); final GeoPos referenceGeoPos3 = new GeoPos(); referenceGeoCoding.getGeoPos(pixelPos1, referenceGeoPos1); referenceGeoCoding.getGeoPos(pixelPos2, referenceGeoPos2); referenceGeoCoding.getGeoPos(pixelPos3, referenceGeoPos3); final AffineTransform transform = new AffineTransform(); transform.scale(2.0, 2.0); transform.translate(1.0, 1.0); final SlstrTiePointGeoCoding slstrTiePointGeoCoding = new SlstrTiePointGeoCoding(lat, lon, new AffineTransform2D(transform)); final GeoPos slstrGeoPos1 = new GeoPos(); final GeoPos slstrGeoPos2 = new GeoPos(); final GeoPos slstrGeoPos3 = new GeoPos(); slstrTiePointGeoCoding.getGeoPos(pixelPos1, slstrGeoPos1); slstrTiePointGeoCoding.getGeoPos(pixelPos2, slstrGeoPos2); slstrTiePointGeoCoding.getGeoPos(pixelPos3, slstrGeoPos3); assertEquals(referenceGeoPos1.getLat() * 2 , slstrGeoPos1.getLat(), 1e-8); assertEquals(referenceGeoPos1.getLon() * 2, slstrGeoPos1.getLon(), 1e-8); assertEquals(referenceGeoPos2.getLat() * 2 , slstrGeoPos2.getLat(), 1e-8); assertEquals(referenceGeoPos2.getLon() * 2, slstrGeoPos2.getLon(), 1e-8); assertEquals(referenceGeoPos3.getLat() * 2 , slstrGeoPos3.getLat(), 1e-8); assertEquals(referenceGeoPos3.getLon() * 2, slstrGeoPos3.getLon(), 1e-8); }