use of org.polymap.core.style.model.raster.RasterRGBStyle in project polymap4-core by Polymap4.
the class DefaultStyle method fillRGBStyle.
public static RasterStyle fillRGBStyle(FeatureStyle fs, GridCoverage2D gridCoverage) {
RasterRGBStyle rgb = fs.members().createElement(RasterRGBStyle.defaults);
rgb.opacity.createValue(ConstantNumber.defaults(1.0));
rgb.redBand.createValue(ConstantRasterBand.defaults(0));
rgb.greenBand.createValue(ConstantRasterBand.defaults(1));
rgb.blueBand.createValue(ConstantRasterBand.defaults(2));
return rgb;
}
use of org.polymap.core.style.model.raster.RasterRGBStyle 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;
}
Aggregations