PixelGeoCoding extends AbstractGeoCoding implements BasicPixelGeoCoding { @Override public PixelPos getPixelPos(final GeoPos geoPos, PixelPos pixelPos) { initialize(); if (pixelPos == null) { pixelPos = new PixelPos(); } if (geoPos.isValid()) { if (pixelPosEstimator != null) { getPixelPosUsingEstimator(geoPos, pixelPos); } else { getPixelPosUsingQuadTreeSearch(geoPos, pixelPos); } } else { pixelPos.setInvalid(); } return pixelPos; } 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 testGetPixelPos() throws IOException { Product product = createProduct(); TiePointGeoCoding tiePointGeoCoding = (TiePointGeoCoding) product.getGeoCoding(); GeoCoding pixelGeoCoding = GeoCodingFactory.createPixelGeoCoding(product.getBand("latBand"), product.getBand("lonBand"), null, 2, ProgressMonitor.NULL); product.setGeoCoding(pixelGeoCoding); TiePointGrid latGrid = tiePointGeoCoding.getLatGrid(); TiePointGrid lonGrid = tiePointGeoCoding.getLonGrid(); GeoPos gp = new GeoPos(latGrid.getTiePoints()[0], lonGrid.getTiePoints()[0]); PixelPos pixelPos = pixelGeoCoding.getPixelPos(gp, null); assertEquals(new PixelPos(0.5f, 0.5f), pixelPos); System.out.println("----"); gp = new GeoPos((latGrid.getTiePoints()[0] + latGrid.getTiePoints()[1]) / 2, (lonGrid.getTiePoints()[0] + lonGrid.getTiePoints()[1]) / 2); pixelPos = pixelGeoCoding.getPixelPos(gp, null); assertEquals(new PixelPos(2.5f, 0.5f), pixelPos); }