Modify

Ticket #6584 (closed Bugs: fixed)

Opened 2 years ago

Last modified 2 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:

Description

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

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

Change History

Changed 2 years ago by aleksey.tulinov@…

Patch for point-to-linestring calculation

Changed 2 years ago by aleksey.tulinov@…

Test application

comment:1 Changed 2 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

View

Add a comment

Modify Ticket

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


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

 
Note: See TracTickets for help on using tickets.