Class GrassColorTable
- java.lang.Object
-
- org.hortonmachine.gears.io.grasslegacy.map.color.ColorTable
-
- org.hortonmachine.gears.io.grasslegacy.map.color.GrassColorTable
-
public class GrassColorTable extends ColorTable
Representation of a GRASS colortable for raster maps
- Since:
- 1.1.0
- Author:
- Andrea Antonello - www.hydrologis.com
-
-
Field Summary
-
Fields inherited from class org.hortonmachine.gears.io.grasslegacy.map.color.ColorTable
backgroundColor, blank, colorTableEmpty, FIXED_COLORMAP, GRADIENT_COLORMAP, rules
-
-
Constructor Summary
Constructors Constructor Description GrassColorTable(String colorFilePath, double[] dataRange)Creates a new instance of ColorTableGrassColorTable(String mapsetPath, String mapName, double[] dataRange)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringcreateDefaultColorRulesString(double[] dataRange, boolean writeToDisk)Create a default colorrules of the string format of the colorfile of the map.voidcreateDefaultColorTable(double[] dataRange)create the default color table for a given dataRange for the case in which no hardcoded color table is foundintgetAlpha()FilegetColrFile()static StringsetColorTableFromRules(File colrFile, double[] dataRange, int[][] colorRules)-
Methods inherited from class org.hortonmachine.gears.io.grasslegacy.map.color.ColorTable
addColorRule, addColorRule, getColor, getColorRules, insertRule, interpolateColorMap, interpolateColorValue, interpolateColorValue, interpolateColorValue, isEmpty, setBackgroundColor, size
-
-
-
-
Constructor Detail
-
GrassColorTable
public GrassColorTable(String mapsetPath, String mapName, double[] dataRange) throws IOException
- Throws:
IOException
-
GrassColorTable
public GrassColorTable(String colorFilePath, double[] dataRange) throws IOException
Creates a new instance of ColorTable- Throws:
IOException
-
-
Method Detail
-
createDefaultColorTable
public void createDefaultColorTable(double[] dataRange)
create the default color table for a given dataRange for the case in which no hardcoded color table is found- Overrides:
createDefaultColorTablein classColorTable- Parameters:
dataRange- the datarange for which the colortable is created
-
setColorTableFromRules
public static String setColorTableFromRules(File colrFile, double[] dataRange, int[][] colorRules) throws IOException
- Throws:
IOException
-
createDefaultColorRulesString
public String createDefaultColorRulesString(double[] dataRange, boolean writeToDisk) throws Exception
Create a default colorrules of the string format of the colorfile of the map.- Parameters:
dataRange- can be null- Returns:
- the string format of the colorfile of the map
- Throws:
Exception
-
getColrFile
public File getColrFile()
-
getAlpha
public int getAlpha()
- Overrides:
getAlphain classColorTable
-
-