Commit d1ad9518 authored by Eric Duminil's avatar Eric Duminil
Browse files

Adding center too.

Still wrong
parent 2ad61a3f
Showing with 4 additions and 2 deletions
+4 -2
...@@ -101,10 +101,12 @@ static int selectRegionDirectlyFromCityGML(String wktPolygon, String srsName, Wr ...@@ -101,10 +101,12 @@ static int selectRegionDirectlyFromCityGML(String wktPolygon, String srsName, Wr
} }
/** /**
* Returns true if bounding box of cityObjectNode intersects the polygon. * Returns true if corners or center of bounding box of cityObjectNode are inside the polygon. Might select too much,
* which might be desirable for roads or landuse.
*/ */
private static boolean isBoundingBoxTouching(CityObjectMember cityObjectNode, Geometry polygon) { private static boolean isBoundingBoxTouching(CityObjectMember cityObjectNode, Geometry polygon) {
return point(cityObjectNode.xMax, cityObjectNode.yMax).within(polygon) || return point(cityObjectNode.x, cityObjectNode.y).within(polygon) ||
point(cityObjectNode.xMax, cityObjectNode.yMax).within(polygon) ||
point(cityObjectNode.xMax, cityObjectNode.yMin).within(polygon) || point(cityObjectNode.xMax, cityObjectNode.yMin).within(polygon) ||
point(cityObjectNode.xMin, cityObjectNode.yMin).within(polygon) || point(cityObjectNode.xMin, cityObjectNode.yMin).within(polygon) ||
point(cityObjectNode.xMin, cityObjectNode.yMax).within(polygon); point(cityObjectNode.xMin, cityObjectNode.yMax).within(polygon);
......
Supports Markdown
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