Opened 8 years ago
Closed 8 years ago
#3048 closed defect (fixed)
Use Squared Distance instead of Distance in Simplify
|Reported by:||pramsey||Owned by:||pramsey|
By avoiding sqrt() and using getPoint_cp, speed up the simplification routines, particularly on large polygons. Patch from J. Santana.
Change History (6)
by , 8 years ago
comment:1 by , 8 years ago
|Status:||new → closed|
comment:2 by , 8 years ago
A couple of warnings left:
measures.c:2159:1: warning: no previous prototype for 'distance2d_sqr_pt_pt' [-Wmissing-prototypes] distance2d_sqr_pt_pt(const POINT2D *p1, const POINT2D *p2) ^ measures.c:2223:1: warning: no previous prototype for 'distance2d_sqr_pt_seg' [-Wmissing-prototypes] distance2d_sqr_pt_seg(const POINT2D *p, const POINT2D *A, const POINT2D *B) ^
comment:3 by , 8 years ago
btw, the algo was using square distance in its beginning (11 years ago). I dont' remember when it got changed to use flat distance. REF: r329
comment:4 by , 8 years ago
|Status:||closed → reopened|
I was wrong, as of r329 only variable _names_ had the "sqared" label, but the implementation was bogus. The fix, later, went the way to use flat distance rather than squared one.
Anyway, simplify tests are failing for me, both in unit test and regress. Am I the only one ?
comment:5 by , 8 years ago
|Status:||reopened → closed|
I was the only one, reconfiguring the sourcetree gave me a green
Committed in 2.1 at r13247, trunk at r13248