use of org.polymap.core.style.model.raster.RasterGrayStyle in project polymap4-core by Polymap4.
the class SLDSerializer2 method serialize.
@Override
public org.geotools.styling.Style serialize(Context context) {
FeatureStyle featureStyle = context.featureStyle.get();
List<Style> sorted = featureStyle.members().stream().sorted((s1, s2) -> s1.zPriority.get().compareTo(s2.zPriority.get())).collect(Collectors.toList());
org.geotools.styling.Style result = sf.createStyle();
for (Style style : sorted) {
if (style.active.get()) {
StyleSerializer serializer = null;
if (style instanceof PointStyle) {
serializer = new PointStyleSerializer(context);
} else if (style instanceof PolygonStyle) {
serializer = new PolygonStyleSerializer(context);
} else if (style instanceof TextStyle) {
serializer = new TextStyleSerializer(context);
} else if (style instanceof LineStyle) {
serializer = new LineStyleSerializer(context);
} else if (style instanceof RasterGrayStyle) {
serializer = new RasterSerializer.GraySerializer(context);
} else if (style instanceof RasterRGBStyle) {
serializer = new RasterSerializer.RGBSerializer(context);
} else if (style instanceof RasterColorMapStyle) {
serializer = new RasterSerializer.ColorMapSerializer(context);
} else {
throw new RuntimeException("Unhandled Style type: " + style.getClass().getName());
}
serializer.serialize(style, result);
}
}
return result;
}
use of org.polymap.core.style.model.raster.RasterGrayStyle in project polymap4-core by Polymap4.
the class DefaultStyle method fillGrayscaleStyle.
public static RasterStyle fillGrayscaleStyle(FeatureStyle fs, GridCoverage2D gridCoverage) {
RasterGrayStyle gray = fs.members().createElement(RasterGrayStyle.defaults);
gray.opacity.createValue(ConstantNumber.defaults(1.0));
gray.grayBand.createValue(ConstantRasterBand.defaults(0));
return gray;
}
Aggregations