RegionChooserCommandLineInterface.java 1.87 KB
Newer Older
Eric Duminil's avatar
Eric Duminil committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package eu.simstadt.regionchooser;

import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.logging.Logger;
import java.util.stream.Stream;


/*
 * Utility class to launch RegionChooser without GUI.
 */
public class RegionChooserCommandLineInterface
{
	private static final Logger LOGGER = Logger.getLogger(RegionChooserCommandLineInterface.class.getName());

	public static void main(String[] args) throws IOException {
		LOGGER.info(String.format("Launching RegionChooser %s", RegionChooserUtils.getApplicationVersion()));
		if (args.length == 0) {
			displayInfoAndQuit();
		}

		Path[] paths = Stream.of(args).map(Paths::get).toArray(Path[]::new);
		for (Path path : paths) {
			System.out.println(path);
		}
		//TODO: Also get output file
		//TODO: Also get EPSG
		//TODO: Also get WKT polygon

		//		StringBuilder sb = RegionExtractor.selectRegionDirectlyFromCityGML(wktPolygon, srsName, paths);
		//
		//		File buildingIdsFile = selectSaveFileWithDialog(project,
		//				csvCitygmls.replace(";", "_").replace(".gml", ""), "selected_region");
		//		RegionChooserUtils.writeStringBuilderToFile(sb, buildingIdsFile.toPath());
	}

	private static void displayInfoAndQuit() {
		LOGGER.info(
				"Please add one directory path as argument. Either a repository path in order to list the available projects:\n"
						+ "  java -d64 -classpath lib/*;workflows/* eu.simstadt.desktop.SimStadtCommandLineInterface ..\\TestRepository\n"
						+ "Or a project path in order to list the available workflows:\n"
						+ "  java -d64 -classpath lib/*;workflows/* eu.simstadt.desktop.SimStadtCommandLineInterface ..\\TestRepository\\Gruenbuehl.proj\n"
						+ "Or a workflow path in order to launch the workflow:\n"
						+ "  java -d64 -classpath lib/*;workflows/* eu.simstadt.desktop.SimStadtCommandLineInterface ..\\TestRepository\\Gruenbuehl.proj\\a.step");
		System.exit(0);
	}
}