Commit af8031da authored by Eric Duminil's avatar Eric Duminil
Browse files

Notes.

parent 30b3cb26
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
import java.nio.file.Paths; import java.nio.file.Paths;
import java.util.Scanner; import java.util.Scanner;
import java.util.concurrent.Callable; import java.util.concurrent.Callable;
import java.util.logging.Logger;
import org.locationtech.jts.geom.Polygon; import org.locationtech.jts.geom.Polygon;
import org.locationtech.jts.io.WKTReader; import org.locationtech.jts.io.WKTReader;
import org.locationtech.jts.io.WKTWriter; import org.locationtech.jts.io.WKTWriter;
...@@ -23,6 +24,9 @@ ...@@ -23,6 +24,9 @@
@Command(name = "region_chooser", mixinStandardHelpOptions = true, version = "regionChooser x.x", description = "Extracts a region from one or more citygmls.", sortOptions = false) @Command(name = "region_chooser", mixinStandardHelpOptions = true, version = "regionChooser x.x", description = "Extracts a region from one or more citygmls.", sortOptions = false)
class RegionChooserCommandLineInterface implements Callable<Integer> class RegionChooserCommandLineInterface implements Callable<Integer>
{ {
private static final Logger LOGGER = Logger.getLogger(RegionChooserCommandLineInterface.class.getName());
@Option(names = { "-i", @Option(names = { "-i",
"--input" }, required = true, split = ",", description = "Citygml files to extract from", paramLabel = "input.gml") "--input" }, required = true, split = ",", description = "Citygml files to extract from", paramLabel = "input.gml")
//TODO: Allow folders too? //TODO: Allow folders too?
...@@ -47,7 +51,6 @@ class RegionChooserCommandLineInterface implements Callable<Integer> ...@@ -47,7 +51,6 @@ class RegionChooserCommandLineInterface implements Callable<Integer>
public Integer call() throws Exception { public Integer call() throws Exception {
//TODO: Move as much logic to utils as possible //TODO: Move as much logic to utils as possible
//TODO: Test //TODO: Test
//TODO: Use logger
CoordinateReferenceSystem localCRS; CoordinateReferenceSystem localCRS;
if (espgId == null) { if (espgId == null) {
...@@ -55,7 +58,7 @@ public Integer call() throws Exception { ...@@ -55,7 +58,7 @@ public Integer call() throws Exception {
} else { } else {
localCRS = RegionChooserUtils.crsFromSrsName("EPSG:" + espgId); localCRS = RegionChooserUtils.crsFromSrsName("EPSG:" + espgId);
} }
System.out.println("Coordinate system is " + localCRS); LOGGER.info("Coordinate system: " + localCRS);
String wktPolygon; String wktPolygon;
...@@ -81,7 +84,7 @@ public Integer call() throws Exception { ...@@ -81,7 +84,7 @@ public Integer call() throws Exception {
.write(RegionChooserUtils.changePolygonCRS(wgs84Polygon, RegionChooserUtils.WGS84, localCRS)); .write(RegionChooserUtils.changePolygonCRS(wgs84Polygon, RegionChooserUtils.WGS84, localCRS));
} }
System.out.println("WKT Polygon : " + wktPolygon); LOGGER.info("WKT Polygon expressed in local coordinates: " + wktPolygon);
StringBuilder sb = RegionExtractor.selectRegionDirectlyFromCityGML(wktPolygon, localCRS.toString(), citygmls); StringBuilder sb = RegionExtractor.selectRegionDirectlyFromCityGML(wktPolygon, localCRS.toString(), citygmls);
......
...@@ -28,7 +28,8 @@ public BuildingXmlNode(VTDNav navigator, int buildingOffset, int buildingLength) ...@@ -28,7 +28,8 @@ public BuildingXmlNode(VTDNav navigator, int buildingOffset, int buildingLength)
this.coordinatesFinder = new AutoPilot(navigator); this.coordinatesFinder = new AutoPilot(navigator);
this.buildingLength = buildingLength; this.buildingLength = buildingLength;
this.buildingOffset = buildingOffset; this.buildingOffset = buildingOffset;
extractCoordinates(); //NOTE: Should it be done lazily? Is there any reason to extract a BuildingXmlNode without coordinates? extractCoordinates();
//TODO: Get Building ID too, in order to avoid duplicates?
} }
public boolean hasCoordinates() { public boolean hasCoordinates() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment