| 8892 | |
| 8893 | // Convert a list of edges in a pslg to bounding boxes |
| 8894 | function boundEdges (points, edges) { |
| 8895 | var bounds = new Array(edges.length) |
| 8896 | for (var i = 0; i < edges.length; ++i) { |
| 8897 | var e = edges[i] |
| 8898 | var a = points[e[0]] |
| 8899 | var b = points[e[1]] |
| 8900 | bounds[i] = [ |
| 8901 | nextafter(Math.min(a[0], b[0]), -Infinity), |
| 8902 | nextafter(Math.min(a[1], b[1]), -Infinity), |
| 8903 | nextafter(Math.max(a[0], b[0]), Infinity), |
| 8904 | nextafter(Math.max(a[1], b[1]), Infinity) |
| 8905 | ] |
| 8906 | } |
| 8907 | return bounds |
| 8908 | } |
| 8909 | |
| 8910 | // Convert a list of points into bounding boxes by duplicating coords |
| 8911 | function boundPoints (points) { |