Commit 24b24d58 authored by duminil's avatar duminil
Browse files

RegionChooser: Todos

parent 4e46e9df
...@@ -18,16 +18,18 @@ ...@@ -18,16 +18,18 @@
{ {
static private WKTReader wktReader = new WKTReader(); static private WKTReader wktReader = new WKTReader();
//TODO: Test it
static public StringBuffer selectRegionDirectlyFromCityGML(Path citygmlPath, String wktPolygon) static public StringBuffer selectRegionDirectlyFromCityGML(Path citygmlPath, String wktPolygon)
throws IOException, ParseException { throws IOException, ParseException {
//TODO: Write directly to file
// Instant start = Instant.now(); // Instant start = Instant.now();
Geometry poly = wktReader.read(wktPolygon); Geometry poly = wktReader.read(wktPolygon);
final GeometryFactory gf = new GeometryFactory(); final GeometryFactory gf = new GeometryFactory();
//TODO: Don't read all the file. Not possible for 15GB gml files
String s = new String(Files.readAllBytes(citygmlPath), Charset.defaultCharset()); String s = new String(Files.readAllBytes(citygmlPath), Charset.defaultCharset());
Pattern cityObjectPattern = Pattern Pattern cityObjectPattern = Pattern
.compile("(?s)<(core:)?cityObjectMember>.*?<\\/(core:)?cityObjectMember>\\s*"); .compile("(?s)<(core:)?cityObjectMember>.*?<\\/(core:)?cityObjectMember>\\s*");
//TODO: Allow other coordinate systems
Pattern gsk3CoordinatesPattern = Pattern Pattern gsk3CoordinatesPattern = Pattern
.compile("(?<![\\d\\.])(3\\d\\d\\d\\d\\d\\d[\\.\\d]*) (5\\d\\d\\d\\d\\d\\d[\\.\\d]*)"); .compile("(?<![\\d\\.])(3\\d\\d\\d\\d\\d\\d[\\.\\d]*) (5\\d\\d\\d\\d\\d\\d[\\.\\d]*)");
Matcher cityObjectMatcher = cityObjectPattern.matcher(s); Matcher cityObjectMatcher = cityObjectPattern.matcher(s);
......
Supports Markdown
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