protected List createParentBoundables(List childBoundables,int newLevel){
  Assert.isTrue(!childBoundables.isEmpty());
  int minLeafCount=(int)Math.ceil((childBoundables.size() / (double)getNodeCapacity()));
  ArrayList sortedChildBoundables=new ArrayList(childBoundables);
  Collections.sort(sortedChildBoundables,xComparator);
  List[] verticalSlices=verticalSlices(sortedChildBoundables,(int)Math.ceil(Math.sqrt(minLeafCount)));
  return createParentBoundablesFromVerticalSlices(verticalSlices,newLevel);
}

protected List createParentBoundables ( List childBoundables , int newLevel ) { Assert . isTrue ( ! childBoundables . isEmpty ( ) ) ; int minLeafCount = ( int ) Math . ceil ( ( childBoundables . size ( ) / ( double ) getNodeCapacity ( ) ) ) ; ArrayList sortedChildBoundables = new ArrayList ( childBoundables ) ; Collections . sort ( sortedChildBoundables , xComparator ) ; List [ ] verticalSlices = verticalSlices ( sortedChildBoundables , ( int ) Math . ceil ( Math . sqrt ( minLeafCount ) ) ) ; return createParentBoundablesFromVerticalSlices ( verticalSlices , newLevel ) ; }
creates the parent level for the given child level . first , orders the items by the x - values of the midpoints , and groups them into vertical slices . for each slice , orders the items by the y - values of the midpoints , and group them into runs of size m ( the node capacity ) . for each run , creates a new ( parent ) node .
