Opened 10 years ago
Closed 10 years ago
#3048 closed defect (fixed)
Use Squared Distance instead of Distance in Simplify
Reported by: | pramsey | Owned by: | pramsey |
---|---|---|---|
Priority: | high | Milestone: | PostGIS 2.1.6 |
Component: | postgis | Version: | 2.1.x |
Keywords: | Cc: |
Description
By avoiding sqrt() and using getPoint_cp, speed up the simplification routines, particularly on large polygons. Patch from J. Santana.
Attachments (1)
Change History (6)
by , 10 years ago
Attachment: | sqrt.patch added |
---|
comment:1 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 by , 10 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 , 10 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 , 10 years ago
Resolution: | fixed |
---|---|
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 , 10 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
I was the only one, reconfiguring the sourcetree gave me a green
Committed in 2.1 at r13247, trunk at r13248