Skip to content

Fix LineSegment.project to handle segments projecting onto a single endpoint#1179

Merged
dr-jts merged 1 commit intolocationtech:masterfrom
dr-jts:fix-linesegment-project-seg
Feb 3, 2026
Merged

Fix LineSegment.project to handle segments projecting onto a single endpoint#1179
dr-jts merged 1 commit intolocationtech:masterfrom
dr-jts:fix-linesegment-project-seg

Conversation

@dr-jts
Copy link
Copy Markdown
Contributor

@dr-jts dr-jts commented Feb 3, 2026

Fix LineSegment.project(LineSegment) to correctly return a segment projecting onto a single endpoint. This should return a zero-length segment at the endpoint, but was returning null.

Also adds a slight improvement to project the segment endpoints only if not equal to an endpoint (when projection factor is between 0 and 1).

Fixes #1178

@dr-jts dr-jts changed the title Fix LineSegment.project to handle segments projecting onto an endpoint Fix LineSegment.project to handle segments projecting onto a single endpoint Feb 3, 2026
@dr-jts dr-jts merged commit ecb26e1 into locationtech:master Feb 3, 2026
2 checks passed
@dr-jts dr-jts deleted the fix-linesegment-project-seg branch February 3, 2026 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Projection of LineSegment to only an endpoint of LineSegment results in null

1 participant