From 5c0578febce13f59c6f0bb34af543e3449e97448 Mon Sep 17 00:00:00 2001 From: duminil <duminil@2c044af0-2e85-064f-a0c3-7471430cffcd> Date: Fri, 19 May 2017 13:18:41 +0000 Subject: [PATCH] RegionChooser: Testing ConvexHull with WGS84 --- .../regionchooser/test/ConvexHullCalculatorTests.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/eu/simstadt/regionchooser/test/ConvexHullCalculatorTests.java b/test/eu/simstadt/regionchooser/test/ConvexHullCalculatorTests.java index dc5807e..72485f7 100644 --- a/test/eu/simstadt/regionchooser/test/ConvexHullCalculatorTests.java +++ b/test/eu/simstadt/regionchooser/test/ConvexHullCalculatorTests.java @@ -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)); } } -- GitLab