Search in sources :

Example 16 with GriddedElevationModel

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()));
}
Also used : ScaledIntegerGriddedDigitalElevationModelFile(com.revolsys.elevation.gridded.scaledint.ScaledIntegerGriddedDigitalElevationModelFile) GriddedElevationModel(com.revolsys.elevation.gridded.GriddedElevationModel) Test(org.junit.Test)

Example 17 with GriddedElevationModel

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);
}
Also used : Path(java.nio.file.Path) GeometryFactory(com.revolsys.geometry.model.GeometryFactory) ScaledIntegerGriddedDigitalElevationModelFile(com.revolsys.elevation.gridded.scaledint.ScaledIntegerGriddedDigitalElevationModelFile) GriddedElevationModel(com.revolsys.elevation.gridded.GriddedElevationModel) Test(org.junit.Test)

Aggregations

GriddedElevationModel (com.revolsys.elevation.gridded.GriddedElevationModel)17 IntArrayScaleGriddedElevationModel (com.revolsys.elevation.gridded.IntArrayScaleGriddedElevationModel)4 GeometryFactory (com.revolsys.geometry.model.GeometryFactory)4 Path (java.nio.file.Path)4 Test (org.junit.Test)4 ScaledIntegerGriddedDigitalElevationModelFile (com.revolsys.elevation.gridded.scaledint.ScaledIntegerGriddedDigitalElevationModelFile)3 Graphics2D (java.awt.Graphics2D)2 MapEx (com.revolsys.collection.map.MapEx)1 GriddedElevationModelImage (com.revolsys.elevation.gridded.GriddedElevationModelImage)1 ColorGradientGriddedElevationModelRasterizer (com.revolsys.elevation.gridded.rasterizer.ColorGradientGriddedElevationModelRasterizer)1 BoundingBox (com.revolsys.geometry.model.BoundingBox)1 RsSwingServiceInitializer (com.revolsys.swing.RsSwingServiceInitializer)1 GriddedElevationModelZRange (com.revolsys.swing.map.layer.elevation.gridded.GriddedElevationModelZRange)1 TiledGriddedElevationModelLayer (com.revolsys.swing.map.layer.elevation.gridded.TiledGriddedElevationModelLayer)1 AbstractGriddedElevationModelLayerRenderer (com.revolsys.swing.map.layer.elevation.gridded.renderer.AbstractGriddedElevationModelLayerRenderer)1