use of com.sldeditor.common.output.SLDOutputFormatEnum in project sldeditor by robward-scisys.
the class ExportSLD method main.
/**
* The main method.
*
* @param args the arguments
*/
public static void main(String[] args) {
if ((args.length != 2) && (args.length != 3)) {
System.out.println("Usage:");
System.out.println("ExportSLD <input JSON file> <destination folder> [<output format>]");
System.out.println("Where <output format> is SLD, YSLD. The default IS SLD");
System.exit(0);
}
String filename = args[0];
File outputFolder = new File(args[1]);
if (!outputFolder.exists()) {
outputFolder.mkdirs();
}
if (args.length == 3) {
SLDOutputFormatEnum format;
try {
format = SLDOutputFormatEnum.valueOf(args[2]);
outputFormat = format;
} catch (IllegalArgumentException e) {
System.err.println("Unknown output format : " + args[2]);
System.exit(1);
}
}
Map<String, SLDDataInterface> layerMap = MXDParser.readLayers(filename, outputFormat);
if (layerMap != null) {
for (String layerName : layerMap.keySet()) {
File f = new File(outputFolder, generateFilename(layerName));
writeData(f, layerName, layerMap.get(layerName));
}
}
}
use of com.sldeditor.common.output.SLDOutputFormatEnum in project sldeditor by robward-scisys.
the class SLDDataTest method testOriginalFormat.
/**
* Test original format.
*/
@Test
public void testOriginalFormat() {
SLDData data = new SLDData(null, null);
assertEquals(SLDOutputFormatEnum.SLD, data.getOriginalFormat());
SLDOutputFormatEnum expected = SLDOutputFormatEnum.YSLD;
data.setOriginalFormat(expected);
assertEquals(expected, data.getOriginalFormat());
}
Aggregations