writeGetScene((Scene) o, output, gs);
}
private void writeGetScene(Scene scene, OutputStream output,
GetSceneRequest gs) throws IOException {
KmlBuilder kmlBuilder = new KmlBuilder();
for (W3DSLayer layer : scene.getLayers()) {
kmlBuilder.addW3DSLayer(layer);
}
Marshaller marshaller;
try {
marshaller = JAXBContext.newInstance((Kml.class))
.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
marshaller.marshal(kmlBuilder.getKml(), output);
} catch (JAXBException exception) {
throw new ServiceException(exception);
}
}