Hi Gustaf,
Simplest way to implement saving/loading would be to add "implements Serializable" to KdNode and use Java serialization, though that wouldn't be the most efficient of course. Plenty of other ways to handle saving/loaded of course. I personally don't have plans to work on adding such myself though. Could also be an argument that it's better to not save the tree itself, and instead just save the points that went into making the tree. This tree was designed for adding points one by one at runtime to have low overhead, but if you're loading a bunch of existing points at once you can make a much better balanced tree. If one wanted to adapt this code to make a better tree from a bulk list of loaded points, the simplest route would likely involve modifying KdNode to allow larger nodes to be temporarily instantiated, and proceed to run the splitting until getting to nodes that fit the normal bucket size settings.
Best Regards,
Alex