clean-pslg.js
function boundEdges (points, edges) {
  var bounds = new Array(edges.length)
  for (var i = 0; i < edges.length; ++i) {
    var e = edges[i]
    var a = points[e[0]]
    var b = points[e[1]]
    bounds[i] = [
      nextafter(Math.min(a[0], b[0]), -Infinity),
      nextafter(Math.min(a[1], b[1]), -Infinity),
      nextafter(Math.max(a[0], b[0]), Infinity),
      nextafter(Math.max(a[1], b[1]), Infinity)
    ]
  }
  return bounds
}
function boundEdges (points, edges) {
  var bounds = new Array(edges.length)
  for (var i = 0; i < edges.length; ++i) {
    var e = edges[i]
    var a = points[e[0]]
    var b = points[e[1]]
    bounds[i] = [
      nextafter(Math.min(a[0], b[0]), -Infinity),
      nextafter(Math.min(a[1], b[1]), -Infinity),
      nextafter(Math.max(a[0], b[0]), Infinity),
      nextafter(Math.max(a[1], b[1]), Infinity)
    ]
  }
  return bounds
}
function boundEdges ( points , edges ) { var bounds = new Array ( edges . length ) for ( var i = 0 ; i < edges . length ; ++ i ) { var e = edges [ i ] var a = points [ e [ 0 ] ] var b = points [ e [ 1 ] ] bounds [ i ] = [ nextafter ( Math . min ( a [ 0 ] , b [ 0 ] ) , - Infinity ) , nextafter ( Math . min ( a [ 1 ] , b [ 1 ] ) , - Infinity ) , nextafter ( Math . max ( a [ 0 ] , b [ 0 ] ) , Infinity ) , nextafter ( Math . max ( a [ 1 ] , b [ 1 ] ) , Infinity ) ] } return bounds }
Convert a list of edges in a pslg to bounding boxes
Convert a list of edges in a pslg to bounding boxes