Commit 3e233948 authored by Eric Duminil's avatar Eric Duminil
Browse files

Bugfix: Old envelope is deleted.

parent bf336305
...@@ -112,7 +112,7 @@ private static String replaceEnvelopeInHeader(String header, Envelope envelope, ...@@ -112,7 +112,7 @@ private static String replaceEnvelopeInHeader(String header, Envelope envelope,
double zMin = 0; double zMin = 0;
double zMax = 0; double zMax = 0;
Pattern boundedByPattern = Pattern.compile( Pattern boundedByPattern = Pattern.compile(
"(?is)<gml:boundedBy>.*?<gml:lowerCorner>(.*?)</gml:lowerCorner>\\s*<gml:upperCorner>(.*?)</gml:upperCorner>.*?</gml:boundedBy>"); "(?is)<gml:boundedBy>.*?<gml:lowerCorner[^>]*>(.*?)</gml:lowerCorner>\\s*<gml:upperCorner[^>]*>(.*?)</gml:upperCorner>.*?</gml:boundedBy>");
Matcher matcher = boundedByPattern.matcher(header); Matcher matcher = boundedByPattern.matcher(header);
String headerWithoutEnvelope = header; String headerWithoutEnvelope = header;
if (matcher.find()) { if (matcher.find()) {
......
...@@ -168,6 +168,7 @@ void testExtractBuildingsFrom2Citygmls() throws Throwable { ...@@ -168,6 +168,7 @@ void testExtractBuildingsFrom2Citygmls() throws Throwable {
void testExtractBuildingsAndRemoveOld() throws Throwable { void testExtractBuildingsAndRemoveOld() throws Throwable {
String wktPolygon = "POLYGON((293229.6831819388 5623753.072371232,293681.22751166753 5623744.274551504,293668.8482257676 5623469.512992135,293197.09954629745 5623504.821467172,293229.6831819388 5623753.072371232))"; String wktPolygon = "POLYGON((293229.6831819388 5623753.072371232,293681.22751166753 5623744.274551504,293668.8482257676 5623469.512992135,293197.09954629745 5623504.821467172,293229.6831819388 5623753.072371232))";
Path citygmlPath = TEST_REPOSITORY.resolve("Others.proj/Aachen_LoD2_293_5623_1_NW.gml"); Path citygmlPath = TEST_REPOSITORY.resolve("Others.proj/Aachen_LoD2_293_5623_1_NW.gml");
//NOTE: This file has <gml:lowerCorner srsDimension="3"> and not just <gml:lowerCorner>, which caused problems with parsing.
StringWriter gmlWriter = new StringWriter(); StringWriter gmlWriter = new StringWriter();
int count = RegionExtractor.selectRegionDirectlyFromCityGML(wktPolygon, "EPSG:25832", gmlWriter, citygmlPath); int count = RegionExtractor.selectRegionDirectlyFromCityGML(wktPolygon, "EPSG:25832", gmlWriter, citygmlPath);
......
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