use of com.revolsys.elevation.gridded.GriddedElevationModel in project com.revolsys.open by revolsys.
the class ScaledIntegerGriddedDigitalElevationModelTest method test200RandomAccess.
@Test
public void test200RandomAccess() {
final long time = System.currentTimeMillis();
final GriddedElevationModel model = GriddedElevationModelTest.newIntArrayModelNaNOnDiagonal(3005);
final String filePath = "target/test/elevation/nanDiagonal.sigdem";
writeModel(model, filePath);
try (final ScaledIntegerGriddedDigitalElevationModelFile actualModel = new ScaledIntegerGriddedDigitalElevationModelFile(Paths.get(filePath))) {
assertModelEquals(model, actualModel);
}
System.out.println("test200RandomAccess\t" + Dates.toEllapsedTime(time, System.currentTimeMillis()));
}
use of com.revolsys.elevation.gridded.GriddedElevationModel in project com.revolsys.open by revolsys.
the class ScaledIntegerGriddedDigitalElevationModelTest method test203RandomAccessMissingCreateEmpty.
@Test
public void test203RandomAccessMissingCreateEmpty() throws IOException {
final String filePath = "target/test/elevation/missingCreateEmpty.sigdem";
final Path path = Paths.get(filePath);
Files.deleteIfExists(path);
final GeometryFactory geometryFactory = GeometryFactory.fixed3d(3005, 1000.0, 1000.0, 1000.0);
final GriddedElevationModel expectedModel = GriddedElevationModelTest.newIntArrayModelEmpty(3005);
try (final ScaledIntegerGriddedDigitalElevationModelFile actualModel = new ScaledIntegerGriddedDigitalElevationModelFile(path, geometryFactory, 0, 0, 255, 255, 1)) {
assertModelEquals(expectedModel, actualModel);
}
final GriddedElevationModel actualModel = GriddedElevationModel.newGriddedElevationModel(path);
assertModelEquals(expectedModel, actualModel);
}
Aggregations