Opened 6 years ago

Closed 6 years ago

#6584 closed Bugs (fixed)

Point to linestring distance calculation

Reported by: aleksey.tulinov@… Owned by: Barend Gehrels
Milestone: Boost 1.50.0 Component: geometry
Version: Boost Development Trunk Severity: Problem
Keywords: Cc:


distance() is using comparable distance for first segment and real distance to the rest of the segments of a linestring. If real distance is smaller than comp distance to first segment, then it is selected as min distance and distance to first segment is effectively ignored.

I've attached patch and test application. In test application:

Actual result: 707107 1e+06

Expected result: 707107 707107 Since point is closer to the first segment.

Attachments (2)

distance.patch (574 bytes) - added by aleksey.tulinov@… 6 years ago.
Patch for point-to-linestring calculation
test2.cpp (619 bytes) - added by aleksey.tulinov@… 6 years ago.
Test application

Download all attachments as: .zip

Change History (3)

Changed 6 years ago by aleksey.tulinov@…

Attachment: distance.patch added

Patch for point-to-linestring calculation

Changed 6 years ago by aleksey.tulinov@…

Attachment: test2.cpp added

Test application

comment:1 Changed 6 years ago by Barend Gehrels

Milestone: To Be DeterminedBoost 1.50.0
Resolution: fixed
Status: newclosed

Thanks for this patch.

It is applied.

After that I got differences in the unit tests. That was because the comparable strategy (eps) for integers selected the wrong return type. That has been fixed as well.

Unit tests are updated.

This problem was reported earlier (5730) but at that time I did not see the severity of this bug, so glad you reported it again.

Alas it is too late for 1.49

Note: See TracTickets for help on using tickets.