use of org.polymap.core.style.model.raster.RasterColorMapStyle in project polymap4-core by Polymap4.
the class DefaultStyle method fillColorMapStyle.
public static RasterStyle fillColorMapStyle(FeatureStyle fs, GridCoverage2D gridCoverage, PredefinedColorMap predef) {
RasterColorMapStyle colormap = fs.members().createElement(RasterColorMapStyle.defaults);
colormap.opacity.createValue(ConstantNumber.defaults(1.0));
predef.fillModel(colormap, gridCoverage, new NullProgressMonitor());
return colormap;
}
use of org.polymap.core.style.model.raster.RasterColorMapStyle 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