{"action":"closed","issue":{"url":"https://api.github.com/repos/davidmoten/rtree/issues/20","labels_url":"https://api.github.com/repos/davidmoten/rtree/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/davidmoten/rtree/issues/20/comments","events_url":"https://api.github.com/repos/davidmoten/rtree/issues/20/events","html_url":"https://github.com/davidmoten/rtree/issues/20","id":60805374,"number":20,"title":"RTree creation API might seem a bit contraintuitive","user":{"login":"pereferrera","id":254208,"avatar_url":"https://avatars.githubusercontent.com/u/254208?v=3","gravatar_id":"","url":"https://api.github.com/users/pereferrera","html_url":"https://github.com/pereferrera","followers_url":"https://api.github.com/users/pereferrera/followers","following_url":"https://api.github.com/users/pereferrera/following{/other_user}","gists_url":"https://api.github.com/users/pereferrera/gists{/gist_id}","starred_url":"https://api.github.com/users/pereferrera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pereferrera/subscriptions","organizations_url":"https://api.github.com/users/pereferrera/orgs","repos_url":"https://api.github.com/users/pereferrera/repos","events_url":"https://api.github.com/users/pereferrera/events{/privacy}","received_events_url":"https://api.github.com/users/pereferrera/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-12T11:32:15Z","updated_at":"2015-03-13T02:17:21Z","closed_at":"2015-03-13T02:17:21Z","body":"Hello,\r\nFirst of all thanks for this library, it is very useful and overall well done. I just got stuck with it for some minutes, not realizing what was wrong in my code. I finally realized that the RTree object is returning a new copy of itself when adding a point. This makes sense with the concept of immutable RTree, and I recognize I should have paid more attention when reading the examples. However I think this API is contraintuitive - If the RTree is immutable then why does it have an add() method? - and might lead to the same mistake by other people. What I would suggest as an improved API is to make an RTreeBuilder, which would be in charge of receiving all the points and then create an immutable RTree, which wouldn't have the method add(). If online modifications to the RTree are needed maybe they can be provided via static methods of it, e.g. RTreeBuilder.delete(tree, point): RTree"}}