Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
msbarry committed Apr 26, 2023
1 parent c4aa9e0 commit 5851111
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -314,20 +314,20 @@ public static Geometry snapAndFixPolygon(Geometry geom, PrecisionModel tilePreci
stats.dataError(stage + "_snap_fix_input");
}
return GeometryPrecisionReducer.reduce(geom, tilePrecision);
} catch (IllegalArgumentException e) {
} catch (TopologyException | IllegalArgumentException e) {
// precision reduction fails if geometry is invalid, so attempt
// to fix it then try again
geom = GeometryFixer.fix(geom);
stats.dataError(stage + "_snap_fix_input2");
try {
return GeometryPrecisionReducer.reduce(geom, tilePrecision);
} catch (IllegalArgumentException e2) {
} catch (TopologyException | IllegalArgumentException e2) {
// give it one last try but with more aggressive fixing, just in case (see issue #511)
geom = fixPolygon(geom, tilePrecision.gridSize() / 2);
stats.dataError(stage + "_snap_fix_input3");
try {
return GeometryPrecisionReducer.reduce(geom, tilePrecision);
} catch (IllegalArgumentException e3) {
} catch (TopologyException | IllegalArgumentException e3) {
stats.dataError(stage + "_snap_fix_input3_failed");
throw new GeometryException("snap_third_time_failed", "Error reducing precision");
}
Expand Down
1 change: 0 additions & 1 deletion planetiler-core/test.wkt

This file was deleted.

0 comments on commit 5851111

Please sign in to comment.