From 78d64e521721cbde59eb26aa461e20b07a1f410c Mon Sep 17 00:00:00 2001
From: duminil <duminil@2c044af0-2e85-064f-a0c3-7471430cffcd>
Date: Wed, 15 Jun 2016 13:12:08 +0000
Subject: [PATCH] RegionChooser: Beginning to merge both RegionChoosers.

---
 src/eu/simstadt/regionchooser/RegionExtractor.java | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/eu/simstadt/regionchooser/RegionExtractor.java b/src/eu/simstadt/regionchooser/RegionExtractor.java
index c753fc9..9c4faf5 100644
--- a/src/eu/simstadt/regionchooser/RegionExtractor.java
+++ b/src/eu/simstadt/regionchooser/RegionExtractor.java
@@ -18,10 +18,15 @@
 {
 	static private WKTReader wktReader = new WKTReader();
 
-	//TODO: Test it
 	static public StringBuffer selectRegionDirectlyFromCityGML(Path citygmlPath, String wktPolygon)
 			throws IOException, ParseException {
 		//			Instant start = Instant.now();
+
+		//TODO: wktPolygon should be in WGS84, and converted here to locate coordinates system
+		//TODO: GetSRSName, either via CityDoctorModel or reading 50 first lines of the citygmlfile
+		//		CityDoctorModel model = CityDoctorModel.loadWithEnergyADEAndNoSchemaValidation(citygmlPath.toFile());
+		//		GeoCoordinatesAccessor coordinates = GeoCoordinatesAccessor.coordinatesComputedFromBuildingsIfNeeded(model);
+		//		System.out.println(coordinates.getCoordinateReferenceSystem().getName());
 		Geometry poly = wktReader.read(wktPolygon);
 		final GeometryFactory gf = new GeometryFactory();
 		//TODO: Don't read all the file. Not possible for 15GB gml files
@@ -29,7 +34,7 @@ static public StringBuffer selectRegionDirectlyFromCityGML(Path citygmlPath, Str
 
 		Pattern cityObjectPattern = Pattern
 				.compile("(?s)<(core:)?cityObjectMember>.*?<\\/(core:)?cityObjectMember>\\s*");
-		//TODO: Allow other coordinate systems
+		//TODO: Allow other coordinate systems. Either use distinc patterns depending on EPSG, or use CityDoctorModel
 		Pattern gsk3CoordinatesPattern = Pattern
 				.compile("(?<![\\d\\.])(3\\d\\d\\d\\d\\d\\d[\\.\\d]*) (5\\d\\d\\d\\d\\d\\d[\\.\\d]*)");
 		Matcher cityObjectMatcher = cityObjectPattern.matcher(s);
-- 
GitLab