Skip to content

Conversation

@cookiedan42
Copy link
Contributor

see #1466

  • I agree to follow the project's code of conduct.
  • I added an entry to CHANGES.md if knowledge of this change could be valuable to users.

- LineString where adjacent monotonic segments are grouped with a bounding box
Implement Intersects for MontoneChain
- large speedup on more complex geometries, but slower than base impl for simpler geometries
Use MonotoneChain for large boundary intersections in ContainsProperly
@cookiedan42 cookiedan42 mentioned this pull request Dec 8, 2025

impl<'a, T: GeoNum> From<&'a LineString<T>> for MonotoneChain<'a, T> {
fn from(linestring: &'a LineString<T>) -> Self {
// each segment is a a series of coordinates which are montonically increasing/decreasing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// each segment is a a series of coordinates which are montonically increasing/decreasing
// each segment is a series of coordinates which are montonically increasing/decreasing

}

impl<'a, T: GeoNum> MonotoneChainSegment<'a, T> {
/// inclusive, exclusive
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doc comment is pretty cryptic. Can you elaborate?


Self {
ls: linestring,
bounding_rect: Rect::<T>::new(linestring[0], linestring[linestring.len() - 1]),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is public, we should avoid panic, or at least document the panic condition in the case of LINESTRING EMPTY.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants