Skip to content

Commit

Permalink
Fix comparison of multipolygons bounds check [#780] (#793)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdon authored Jan 16, 2024
1 parent 7492f69 commit 0cb2645
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ private void compareGeometry(TileCoord coord, String layer, Geometry geom1, Geom
compareValues(coord, layer, "feature JTS geometry type", geom1.getGeometryType(), geom2.getGeometryType());
compareValues(coord, layer, "feature num geometries", geom1.getNumGeometries(), geom2.getNumGeometries());
if (geom1 instanceof MultiPolygon) {
for (int i = 0; i < geom1.getNumGeometries(); i++) {
for (int i = 0; i < geom1.getNumGeometries() && i < geom2.getNumGeometries(); i++) {
comparePolygon(coord, layer, geometryType, (Polygon) geom1.getGeometryN(i), (Polygon) geom2.getGeometryN(i));
}
} else if (geom1 instanceof Polygon p1 && geom2 instanceof Polygon p2) {
Expand All @@ -378,7 +378,7 @@ private void comparePolygon(TileCoord coord, String layer, String geomType, Poly
compareValues(coord, layer, geomType + " exterior ring geometry", p1.getExteriorRing(), p2.getExteriorRing());
if (compareValues(coord, layer, geomType + " num interior rings", p1.getNumInteriorRing(),
p2.getNumInteriorRing())) {
for (int i = 0; i < p1.getNumInteriorRing(); i++) {
for (int i = 0; i < p1.getNumInteriorRing() && i < p2.getNumInteriorRing(); i++) {
compareValues(coord, layer, geomType + " interior ring geometry", p1.getInteriorRingN(i),
p2.getInteriorRingN(i));
}
Expand Down

0 comments on commit 0cb2645

Please sign in to comment.