Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Eric Duminil
RegionChooser
Commits
5c0578fe
Commit
5c0578fe
authored
May 19, 2017
by
duminil
Browse files
RegionChooser: Testing ConvexHull with WGS84
parent
cca35e6d
Changes
1
Show whitespace changes
Inline
Side-by-side
test/eu/simstadt/regionchooser/test/ConvexHullCalculatorTests.java
View file @
5c0578fe
...
@@ -22,8 +22,9 @@ public void testExtractConvexHullFromOneBuilding() throws Throwable {
...
@@ -22,8 +22,9 @@ public void testExtractConvexHullFromOneBuilding() throws Throwable {
Path
citygmlPath
=
repo
.
resolve
(
"Gruenbuehl.proj/20140218_Gruenbuehl_LOD2_1building.gml"
);
Path
citygmlPath
=
repo
.
resolve
(
"Gruenbuehl.proj/20140218_Gruenbuehl_LOD2_1building.gml"
);
Geometry
hull
=
ConvexHullCalculator
.
calculateFromCityGML
(
citygmlPath
);
Geometry
hull
=
ConvexHullCalculator
.
calculateFromCityGML
(
citygmlPath
);
assertEquals
(
hull
.
getCoordinates
().
length
,
4
+
1
);
// Convex hull of a building should be a closed rectangle
assertEquals
(
hull
.
getCoordinates
().
length
,
4
+
1
);
// Convex hull of a building should be a closed rectangle
Point
someBuildingPoint
=
gf
.
createPoint
(
new
Coordinate
(
3515960.36
,
5415667.91
));
// Point someBuildingPoint = gf.createPoint(new Coordinate(3515960.36, 5415667.91)); // Original coordinates, GSK3
assertTrue
(
hull
.
contains
(
someBuildingPoint
));
Point
someBuildingPoint
=
gf
.
createPoint
(
new
Coordinate
(
9.21656126408
,
48.8782253597
));
// WGS84
assertTrue
(
"Hull should contain every building point"
,
hull
.
contains
(
someBuildingPoint
));
}
}
@Test
@Test
...
@@ -32,7 +33,8 @@ public void testExtractConvexHullFromOneSmallRegion() throws Throwable {
...
@@ -32,7 +33,8 @@ public void testExtractConvexHullFromOneSmallRegion() throws Throwable {
Path
citygmlPath
=
repo
.
resolve
(
"Gruenbuehl.proj/Gruenbuehl_LOD2_ALKIS_1010.gml"
);
Path
citygmlPath
=
repo
.
resolve
(
"Gruenbuehl.proj/Gruenbuehl_LOD2_ALKIS_1010.gml"
);
Geometry
hull
=
ConvexHullCalculator
.
calculateFromCityGML
(
citygmlPath
);
Geometry
hull
=
ConvexHullCalculator
.
calculateFromCityGML
(
citygmlPath
);
assertTrue
(
hull
.
getCoordinates
().
length
>
4
);
// Convex hull should have at least 4 corners
assertTrue
(
hull
.
getCoordinates
().
length
>
4
);
// Convex hull should have at least 4 corners
Point
somewhereBetweenBuildings
=
gf
.
createPoint
(
new
Coordinate
(
3515883.6668538367
,
5415843.300640578
));
// Point somewhereBetweenBuildings = gf.createPoint(new Coordinate(3515883.6668538367, 5415843.300640578)); // Original coordinates, GSK3
assertTrue
(
hull
.
contains
(
somewhereBetweenBuildings
));
Point
somewhereBetweenBuildings
=
gf
.
createPoint
(
new
Coordinate
(
9.21552249084
,
48.87980446
));
// WGS84
assertTrue
(
"Hull should contain region between buildings"
,
hull
.
contains
(
somewhereBetweenBuildings
));
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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