Package dev.avelar.mapnik
Class RasterColorizer
java.lang.Object
dev.avelar.mapnik.RasterColorizer
Colours a single-band raster, such as an elevation grid or a grey image, by its values. Add stops
from low to high, then pass it to
Symbolizer.colorizer(RasterColorizer).
RasterColorizer.create().defaultMode(RasterColorizer.Mode.LINEAR)
.stop(0, "blue").stop(500, "green").stop(3000, "white");
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumHow values between stops are coloured. -
Method Summary
Modifier and TypeMethodDescriptionColour a single-band image with these stops, as the raster symbolizer would.static RasterColorizercreate()defaultColor(Color color) defaultColor(String color) The colour for values below the first stop and for missing data.The mode for stops that do not set their own.epsilon(double epsilon) How close a value must be to a stop to count as equal, inRasterColorizer.Mode.EXACTmode.Add a stop atvalue, which must be above the previous stop's.stop(double value, String color, RasterColorizer.Mode mode, String label) Asstop(double, String)with its own mode and an optional label, which may be null.inttoString()toXml()
-
Method Details
-
create
-
defaultMode
The mode for stops that do not set their own. Mapnik's default isRasterColorizer.Mode.LINEAR. -
defaultColor
The colour for values below the first stop and for missing data. Mapnik's default is transparent. -
defaultColor
-
epsilon
How close a value must be to a stop to count as equal, inRasterColorizer.Mode.EXACTmode. -
stop
Add a stop atvalue, which must be above the previous stop's. Colour as in a style file. -
stop
-
stop
Asstop(double, String)with its own mode and an optional label, which may be null. -
colorize
Colour a single-band image with these stops, as the raster symbolizer would. Needs no GDAL: this is how to draw elevation or other data you hold as aGrayImage. -
stopCount
public int stopCount() -
toXml
-
toString
-