LaiFile extends ExplorerFile { long getCellIndex(double lon, double lat) { final int zoneIndex = Eeap.getInstance().getZoneIndex(lon, lat); if (zoneIndex != -1) { final int gridIndex = getGridList().get(zoneIndex).getIndex(lon, lat); if (gridIndex != -1) { return gridIndex + zoneIndex * zoneIndexMultiplier; } } return -1; } LaiFile(EEFilePair eeFilePair, DataContext dataContext); @Override final Area getArea(); @Override Product createProduct();  }
@Test public void testZoneDataSizes() throws IOException { if (HDR_FILE.exists() && DBL_FILE.exists()) { final DataFormat dataFormat = Dddb.getInstance().getDataFormat(HDR_FILE); final LaiFile laiFile = new LaiFile(new EEFilePair(HDR_FILE, DBL_FILE), dataFormat.createContext(DBL_FILE, "r")); final SequenceData sequenceData = laiFile.getDataBlock().getSequence(DFFG_LAI_NAME); assertEquals(ZONE_COUNT, sequenceData.getElementCount()); CompoundData compoundData; compoundData = sequenceData.getCompound(0); assertEquals(0, compoundData.getPosition()); compoundData.resolveSize(); assertEquals(3791314, compoundData.getSize()); compoundData = sequenceData.getCompound(1); assertEquals(3791314, compoundData.getPosition()); compoundData.resolveSize(); assertEquals(3791314, compoundData.getSize()); compoundData = sequenceData.getCompound(2); compoundData.resolveSize(); assertEquals(3052488, compoundData.getSize()); compoundData = sequenceData.getCompound(3); compoundData.resolveSize(); assertEquals(3052488, compoundData.getSize()); laiFile.getCellIndex(0.0, 0.0); } }