Search in sources :

Example 1 with RasterSummary

use of org.hortonmachine.modules.RasterSummary in project hortonmachine by TheHortonMachine.

the class HM method makeSldStyleForRaster.

public static void makeSldStyleForRaster(String tableName, String rasterPath, double opacity) throws Exception {
    RasterSummary s = new RasterSummary();
    s.pm = new DummyProgressMonitor();
    s.inRaster = rasterPath;
    s.process();
    double min = s.outMin;
    double max = s.outMax;
    String style = RasterStyleUtilities.styleToString(RasterStyleUtilities.createStyleForColortable(tableName, min, max, opacity));
    File styleFile = FileUtilities.substituteExtention(new File(rasterPath), "sld");
    FileUtilities.writeFile(style, styleFile);
}
Also used : RasterSummary(org.hortonmachine.modules.RasterSummary) DummyProgressMonitor(org.hortonmachine.gears.libs.monitor.DummyProgressMonitor) LineString(org.locationtech.jts.geom.LineString) File(java.io.File)

Example 2 with RasterSummary

use of org.hortonmachine.modules.RasterSummary in project hortonmachine by TheHortonMachine.

the class HM method makeQgisStyleForRaster.

public static void makeQgisStyleForRaster(String tableName, String rasterPath, int labelDecimals) throws Exception {
    RasterSummary s = new RasterSummary();
    s.pm = new DummyProgressMonitor();
    s.inRaster = rasterPath;
    s.process();
    double min = s.outMin;
    double max = s.outMax;
    String style = RasterStyleUtilities.createQGISRasterStyle(tableName, min, max, null, labelDecimals);
    File styleFile = FileUtilities.substituteExtention(new File(rasterPath), "qml");
    FileUtilities.writeFile(style, styleFile);
}
Also used : RasterSummary(org.hortonmachine.modules.RasterSummary) DummyProgressMonitor(org.hortonmachine.gears.libs.monitor.DummyProgressMonitor) LineString(org.locationtech.jts.geom.LineString) File(java.io.File)

Aggregations

File (java.io.File)2 DummyProgressMonitor (org.hortonmachine.gears.libs.monitor.DummyProgressMonitor)2 RasterSummary (org.hortonmachine.modules.RasterSummary)2 LineString (org.locationtech.jts.geom.LineString)2