Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to simplify geometries that fail with TopologyException #115834

Merged
merged 2 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/changelog/115834.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 115834
summary: Try to simplify geometries that fail with `TopologyException`
area: Geo
type: bug
issues: []
iverase marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,11 @@ private static org.locationtech.jts.geom.Geometry clipGeometry(
return null;
}
} catch (TopologyException ex) {
// we should never get here but just to be super safe because a TopologyException will kill the node
throw new IllegalArgumentException(ex);
// Note we should never throw a TopologyException as it kill the node
// unfortunately the intersection method is not perfect and it will throw this error for complex
// geometries even when valid. We can still simplify such geometry so we just return the original and
// let the simplification process handle it.
return geometry;
}
}
}
Expand Down