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);
}
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);
}
Aggregations