Ticket #6584 (closed Bugs: fixed)

Opened 5 years ago

Last modified 5 years ago

Point to linestring distance calculation

Reported by: aleksey.tulinov@… Owned by: barendgehrels
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.


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

Change History

Changed 5 years ago by aleksey.tulinov@…

Patch for point-to-linestring calculation

Changed 5 years ago by aleksey.tulinov@…

Test application

comment:1 Changed 5 years ago by barendgehrels

  • Status changed from new to closed
  • Resolution set to fixed
  • Milestone changed from To Be Determined to Boost 1.50.0

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


Add a comment

Modify Ticket

Change Properties
<Author field>
as closed
The resolution will be deleted. Next status will be 'reopened'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.