Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Eric Duminil
RegionChooser
Commits
3e233948
Commit
3e233948
authored
Feb 20, 2023
by
Eric Duminil
Browse files
Bugfix: Old envelope is deleted.
parent
bf336305
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/eu/simstadt/regionchooser/RegionExtractor.java
View file @
3e233948
...
@@ -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
())
{
...
...
src/test/java/eu/simstadt/regionchooser/RegionExtractorTests.java
View file @
3e233948
...
@@ -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
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment