use of org.geotoolkit.display.canvas.control.StopOnErrorMonitor in project geotoolkit by Geomatys.
the class PortrayalServiceTest method testRendering.
private void testRendering(final MapLayer layer) throws Exception {
final StopOnErrorMonitor monitor = new StopOnErrorMonitor();
final MapLayers context = MapBuilder.createContext(CommonCRS.WGS84.normalizedGeographic());
context.getComponents().add(layer);
assertEquals(1, context.getComponents().size());
for (final Envelope env : envelopes) {
for (double[] drange : timestamps) {
for (double[] erange : elevations) {
final GeneralEnvelope cenv = new GeneralEnvelope(CRS.compound(env.getCoordinateReferenceSystem(), CommonCRS.Vertical.ELLIPSOIDAL.crs(), CommonCRS.Temporal.JAVA.crs()));
cenv.subEnvelope(0, 2).setEnvelope(env);
cenv.setRange(2, erange[0], erange[1]);
cenv.setRange(3, drange[0], drange[1]);
final CanvasDef cdef = new CanvasDef(new Dimension(800, 600), cenv);
cdef.setAzimuth(0);
cdef.setMonitor(monitor);
final BufferedImage img = DefaultPortrayalService.portray(cdef, new SceneDef(context));
assertNull(monitor.getLastException());
assertNotNull(img);
}
}
}
}
Aggregations