Class RasterStyleUtilities


  • public class RasterStyleUtilities
    extends Object
    A class to help with raster styling.
    Author:
    Andrea Antonello (www.hydrologis.com)
    • Constructor Detail

      • RasterStyleUtilities

        public RasterStyleUtilities()
    • Method Detail

      • dumpRasterStyle

        public static void dumpRasterStyle​(String path,
                                           double min,
                                           double max,
                                           double[] values,
                                           Color[] colors,
                                           double opacity)
                                    throws Exception
        Throws:
        Exception
      • createQGISRasterStyle

        public static String createQGISRasterStyle​(String colorTableName,
                                                   double min,
                                                   double max,
                                                   double[] values,
                                                   int labelDecimals)
                                            throws Exception
        Throws:
        Exception
      • createDefaultRasterStyle

        public static org.geotools.styling.Style createDefaultRasterStyle()
      • createStyleForColortable

        public static org.geotools.styling.Style createStyleForColortable​(String colorTableName,
                                                                          double min,
                                                                          double max,
                                                                          double opacity)
                                                                   throws Exception
        Throws:
        Exception
      • createStyleForColortable

        public static org.geotools.styling.Style createStyleForColortable​(String colorTableName,
                                                                          double min,
                                                                          double max,
                                                                          double[] values,
                                                                          double opacity)
                                                                   throws Exception
        Create style for a given colortable.
        Parameters:
        colorTableName - the name of the colortable (has to be available in {@link org.hortonmachine.gears.utils.colors.DefaultTables).
        min -
        max -
        values -
        opacity -
        Returns:
        the style.
        Throws:
        Exception
      • styleToString

        public static String styleToString​(org.geotools.styling.Style style)
                                    throws Exception
        Throws:
        Exception