comparison src/java/de/intevation/mxd/Converter.java @ 41:60ed2164035a

Introduced MapScript writer.
author Raimund Renkert <rrenkert@intevation.de>
date Thu, 14 Apr 2011 11:31:29 +0200
parents 7a927921eb6c
children ef7ca23c4233
comparison
equal deleted inserted replaced
40:a1bc7220efe7 41:60ed2164035a
8 8
9 import java.net.MalformedURLException; 9 import java.net.MalformedURLException;
10 10
11 import de.intevation.mxd.reader.IReader; 11 import de.intevation.mxd.reader.IReader;
12 import de.intevation.mxd.reader.MXDReader; 12 import de.intevation.mxd.reader.MXDReader;
13 13 import de.intevation.mxd.writer.IWriter;
14 import de.intevation.mxd.writer.MapScriptWriter;
14 /** 15 /**
15 * The entry point of the MXD converter tool. 16 * The entry point of the MXD converter tool.
16 * 17 *
17 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> 18 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
18 */ 19 */
66 */ 67 */
67 public static void main(String[] args) { 68 public static void main(String[] args) {
68 try{ 69 try{
69 70
70 IReader reader = new MXDReader(); 71 IReader reader = new MXDReader();
72 IWriter writer = new MapScriptWriter();
71 reader.init(); 73 reader.init();
72 74
73 String path = System.getProperty("mxd.file"); 75 String path = System.getProperty("mxd.file");
74 if (path.equals("${MXDFILE}")) { 76 if (path.equals("${MXDFILE}")) {
75 System.out.println("No valid MXD file. Use ant parameter" + 77 System.out.println("No valid MXD file. Use ant parameter" +
77 System.exit(-1); 79 System.exit(-1);
78 } 80 }
79 reader.setFilename(path); 81 reader.setFilename(path);
80 82
81 reader.read(); 83 reader.read();
84 writer.write(reader.getMapDocument());
82 reader.shutdown(); 85 reader.shutdown();
83 } 86 }
84 catch(IOException e){ 87 catch(IOException e){
85 e.printStackTrace(); 88 e.printStackTrace();
86 } 89 }
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)