Skip to content
GitLab
Explore
Projects
Groups
Snippets
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
8 years ago
by
duminil
Browse files
Options
Download
Email Patches
Plain Diff
RegionChooser: Testing ConvexHull with WGS84
parent
cca35e6d
master
develop
migrate_to_Java11
0.2.2
0.1.0
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/eu/simstadt/regionchooser/test/ConvexHullCalculatorTests.java
+6
-4
...imstadt/regionchooser/test/ConvexHullCalculatorTests.java
with
6 additions
and
4 deletions
+6
-4
test/eu/simstadt/regionchooser/test/ConvexHullCalculatorTests.java
+
6
-
4
View file @
5c0578fe
...
...
@@ -22,8 +22,9 @@ public void testExtractConvexHullFromOneBuilding() throws Throwable {
Path
citygmlPath
=
repo
.
resolve
(
"Gruenbuehl.proj/20140218_Gruenbuehl_LOD2_1building.gml"
);
Geometry
hull
=
ConvexHullCalculator
.
calculateFromCityGML
(
citygmlPath
);
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
));
assertTrue
(
hull
.
contains
(
someBuildingPoint
));
// Point someBuildingPoint = gf.createPoint(new Coordinate(3515960.36, 5415667.91)); // Original coordinates, GSK3
Point
someBuildingPoint
=
gf
.
createPoint
(
new
Coordinate
(
9.21656126408
,
48.8782253597
));
// WGS84
assertTrue
(
"Hull should contain every building point"
,
hull
.
contains
(
someBuildingPoint
));
}
@Test
...
...
@@ -32,7 +33,8 @@ public void testExtractConvexHullFromOneSmallRegion() throws Throwable {
Path
citygmlPath
=
repo
.
resolve
(
"Gruenbuehl.proj/Gruenbuehl_LOD2_ALKIS_1010.gml"
);
Geometry
hull
=
ConvexHullCalculator
.
calculateFromCityGML
(
citygmlPath
);
assertTrue
(
hull
.
getCoordinates
().
length
>
4
);
// Convex hull should have at least 4 corners
Point
somewhereBetweenBuildings
=
gf
.
createPoint
(
new
Coordinate
(
3515883.6668538367
,
5415843.300640578
));
assertTrue
(
hull
.
contains
(
somewhereBetweenBuildings
));
// Point somewhereBetweenBuildings = gf.createPoint(new Coordinate(3515883.6668538367, 5415843.300640578)); // Original coordinates, GSK3
Point
somewhereBetweenBuildings
=
gf
.
createPoint
(
new
Coordinate
(
9.21552249084
,
48.87980446
));
// WGS84
assertTrue
(
"Hull should contain region between buildings"
,
hull
.
contains
(
somewhereBetweenBuildings
));
}
}
This diff is collapsed.
Click to expand it.
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
Menu
Explore
Projects
Groups
Snippets