Opened 5 years ago

Closed 5 years ago

#6584 closed Bugs (fixed)

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.

Attachments (2)

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

Download all attachments as: .zip

Change History (3)

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

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

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 Comment

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain barendgehrels.
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.