use of org.geotoolkit.sld.xml.StyleXmlIO in project geotoolkit by Geomatys.
the class MapfileToSLDProcess method execute.
@Override
protected void execute() throws ProcessException {
final File mapfile = inputParameters.getValue(IN_FILE);
final File sldfile = inputParameters.getValue(IN_OUTPUT);
final MapfileReader reader = new MapfileReader();
reader.setInput(mapfile);
try {
mapfileFeature = reader.read();
final MutableStyledLayerDescriptor sld = SLDF.createSLD();
// convert it
convert(sld, mapfileFeature);
// avoid memory leak
mapfileFeature = null;
// write the sld
final StyleXmlIO utils = new StyleXmlIO();
utils.writeSLD(sldfile, sld, StyledLayerDescriptor.V_1_1_0);
} catch (IOException ex) {
throw new ProcessException(ex.getMessage(), this, ex);
} catch (JAXBException ex) {
throw new ProcessException(ex.getMessage(), this, ex);
}
}
Aggregations