Commit 77aedd5
Enforce minimum sample interval for resampling.
The minimum sample interval is somewhat arbitrarily set to 16 × δ, where
δ is the Douglas–Peucker threshold. This fixes cases where resampling
stops too early due to the perpendicular distance being below the
threshold; particularly for points that are far apart and whose
great-circle arc is projected to an S-shape. The midpoint lies along a
straight line, failing the Douglas–Peucker check, but further resampling
produces an S-shape.
Ideally, resampling should also detect cases where an intermediate point
does not need to be drawn, i.e. where there truly is a straight line.
This fix causes points to be drawn at the minimum sample interval, and
thus may degrade performance slightly due to drawing redundant points.
Fixes d3#1162.1 parent e15ac86 commit 77aedd5
4 files changed
Lines changed: 30 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2970 | 2970 | | |
2971 | 2971 | | |
2972 | 2972 | | |
2973 | | - | |
| 2973 | + | |
2974 | 2974 | | |
2975 | 2975 | | |
2976 | 2976 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
290 | | - | |
| 290 | + | |
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
297 | | - | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
298 | 300 | | |
299 | 301 | | |
300 | 302 | | |
| |||
757 | 759 | | |
758 | 760 | | |
759 | 761 | | |
760 | | - | |
761 | | - | |
| 762 | + | |
| 763 | + | |
762 | 764 | | |
763 | 765 | | |
764 | 766 | | |
765 | 767 | | |
766 | 768 | | |
767 | | - | |
768 | | - | |
769 | 769 | | |
770 | 770 | | |
771 | 771 | | |
772 | 772 | | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
773 | 794 | | |
774 | 795 | | |
775 | 796 | | |
| |||
0 commit comments