{"action":"created","comment":{"url":"https://api.github.com/repos/pierrre/geohash/pulls/comments/40722675","id":40722675,"diff_hunk":"@@ -142,3 +152,41 @@ func (r Range) Round() float64 {\n \t}\n \treturn roundDecimal(r.Mid(), dec)\n }\n+\n+// Return the neighbors of the supplied geohash. They are returned as a slice,\n+// starting at the neighbor to the north, and going around clockwise with the\n+// last being the neighbor to the northwest. See diagram below:\n+//\n+// 7  0  1\n+// 6  x  2\n+// 5  4  3\n+\n+func Neighbors(gh string) []string {\n+\tneighbors := make([]string, 8)\n+\n+\tbox, _ := Decode(gh)\n+\tprecision := len(gh)\n+\n+\taverage := func(r Range) float64 {","path":"geohash.go","position":36,"original_position":36,"commit_id":"34d024a93dc17a1ebdcfb7cae6f1819b0c321e18","original_commit_id":"34d024a93dc17a1ebdcfb7cae6f1819b0c321e18","user":{"login":"pierrre","id":131535,"avatar_url":"https://avatars.githubusercontent.com/u/131535?v=3","gravatar_id":"","url":"https://api.github.com/users/pierrre","html_url":"https://github.com/pierrre","followers_url":"https://api.github.com/users/pierrre/followers","following_url":"https://api.github.com/users/pierrre/following{/other_user}","gists_url":"https://api.github.com/users/pierrre/gists{/gist_id}","starred_url":"https://api.github.com/users/pierrre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pierrre/subscriptions","organizations_url":"https://api.github.com/users/pierrre/orgs","repos_url":"https://api.github.com/users/pierrre/repos","events_url":"https://api.github.com/users/pierrre/events{/privacy}","received_events_url":"https://api.github.com/users/pierrre/received_events","type":"User","site_admin":false},"body":"There is already the `Mid()` method.","created_at":"2015-09-29T20:13:29Z","updated_at":"2015-09-29T20:13:29Z","html_url":"https://github.com/pierrre/geohash/pull/1#discussion_r40722675","pull_request_url":"https://api.github.com/repos/pierrre/geohash/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/pierrre/geohash/pulls/comments/40722675"},"html":{"href":"https://github.com/pierrre/geohash/pull/1#discussion_r40722675"},"pull_request":{"href":"https://api.github.com/repos/pierrre/geohash/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/pierrre/geohash/pulls/1","id":46319098,"html_url":"https://github.com/pierrre/geohash/pull/1","diff_url":"https://github.com/pierrre/geohash/pull/1.diff","patch_url":"https://github.com/pierrre/geohash/pull/1.patch","issue_url":"https://api.github.com/repos/pierrre/geohash/issues/1","number":1,"state":"open","locked":false,"title":"Add Neighbors() which returns the neighbors of the supplied geohash","user":{"login":"victorquinn","id":660139,"avatar_url":"https://avatars.githubusercontent.com/u/660139?v=3","gravatar_id":"","url":"https://api.github.com/users/victorquinn","html_url":"https://github.com/victorquinn","followers_url":"https://api.github.com/users/victorquinn/followers","following_url":"https://api.github.com/users/victorquinn/following{/other_user}","gists_url":"https://api.github.com/users/victorquinn/gists{/gist_id}","starred_url":"https://api.github.com/users/victorquinn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/victorquinn/subscriptions","organizations_url":"https://api.github.com/users/victorquinn/orgs","repos_url":"https://api.github.com/users/victorquinn/repos","events_url":"https://api.github.com/users/victorquinn/events{/privacy}","received_events_url":"https://api.github.com/users/victorquinn/received_events","type":"User","site_admin":false},"body":"Also added Box.Height() and Box.Width() as helpers and tests for all of the above","created_at":"2015-09-29T19:13:11Z","updated_at":"2015-09-29T20:13:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3c4fa0446342abc5c14f758fd8b32daa214a82b3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pierrre/geohash/pulls/1/commits","review_comments_url":"https://api.github.com/repos/pierrre/geohash/pulls/1/comments","review_comment_url":"https://api.github.com/repos/pierrre/geohash/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pierrre/geohash/issues/1/comments","statuses_url":"https://api.github.com/repos/pierrre/geohash/statuses/34d024a93dc17a1ebdcfb7cae6f1819b0c321e18","head":{"label":"LocationKit:master","ref":"master","sha":"34d024a93dc17a1ebdcfb7cae6f1819b0c321e18","user":{"login":"LocationKit","id":13803173,"avatar_url":"https://avatars.githubusercontent.com/u/13803173?v=3","gravatar_id":"","url":"https://api.github.com/users/LocationKit","html_url":"https://github.com/LocationKit","followers_url":"https://api.github.com/users/LocationKit/followers","following_url":"https://api.github.com/users/LocationKit/following{/other_user}","gists_url":"https://api.github.com/users/LocationKit/gists{/gist_id}","starred_url":"https://api.github.com/users/LocationKit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LocationKit/subscriptions","organizations_url":"https://api.github.com/users/LocationKit/orgs","repos_url":"https://api.github.com/users/LocationKit/repos","events_url":"https://api.github.com/users/LocationKit/events{/privacy}","received_events_url":"https://api.github.com/users/LocationKit/received_events","type":"Organization","site_admin":false},"repo":{"id":43371550,"name":"geohash","full_name":"LocationKit/geohash","owner":{"login":"LocationKit","id":13803173,"avatar_url":"https://avatars.githubusercontent.com/u/13803173?v=3","gravatar_id":"","url":"https://api.github.com/users/LocationKit","html_url":"https://github.com/LocationKit","followers_url":"https://api.github.com/users/LocationKit/followers","following_url":"https://api.github.com/users/LocationKit/following{/other_user}","gists_url":"https://api.github.com/users/LocationKit/gists{/gist_id}","starred_url":"https://api.github.com/users/LocationKit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LocationKit/subscriptions","organizations_url":"https://api.github.com/users/LocationKit/orgs","repos_url":"https://api.github.com/users/LocationKit/repos","events_url":"https://api.github.com/users/LocationKit/events{/privacy}","received_events_url":"https://api.github.com/users/LocationKit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/LocationKit/geohash","description":"Go Geohash","fork":true,"url":"https://api.github.com/repos/LocationKit/geohash","forks_url":"https://api.github.com/repos/LocationKit/geohash/forks","keys_url":"https://api.github.com/repos/LocationKit/geohash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LocationKit/geohash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LocationKit/geohash/teams","hooks_url":"https://api.github.com/repos/LocationKit/geohash/hooks","issue_events_url":"https://api.github.com/repos/LocationKit/geohash/issues/events{/number}","events_url":"https://api.github.com/repos/LocationKit/geohash/events","assignees_url":"https://api.github.com/repos/LocationKit/geohash/assignees{/user}","branches_url":"https://api.github.com/repos/LocationKit/geohash/branches{/branch}","tags_url":"https://api.github.com/repos/LocationKit/geohash/tags","blobs_url":"https://api.github.com/repos/LocationKit/geohash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LocationKit/geohash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LocationKit/geohash/git/refs{/sha}","trees_url":"https://api.github.com/repos/LocationKit/geohash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LocationKit/geohash/statuses/{sha}","languages_url":"https://api.github.com/repos/LocationKit/geohash/languages","stargazers_url":"https://api.github.com/repos/LocationKit/geohash/stargazers","contributors_url":"https://api.github.com/repos/LocationKit/geohash/contributors","subscribers_url":"https://api.github.com/repos/LocationKit/geohash/subscribers","subscription_url":"https://api.github.com/repos/LocationKit/geohash/subscription","commits_url":"https://api.github.com/repos/LocationKit/geohash/commits{/sha}","git_commits_url":"https://api.github.com/repos/LocationKit/geohash/git/commits{/sha}","comments_url":"https://api.github.com/repos/LocationKit/geohash/comments{/number}","issue_comment_url":"https://api.github.com/repos/LocationKit/geohash/issues/comments{/number}","contents_url":"https://api.github.com/repos/LocationKit/geohash/contents/{+path}","compare_url":"https://api.github.com/repos/LocationKit/geohash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LocationKit/geohash/merges","archive_url":"https://api.github.com/repos/LocationKit/geohash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LocationKit/geohash/downloads","issues_url":"https://api.github.com/repos/LocationKit/geohash/issues{/number}","pulls_url":"https://api.github.com/repos/LocationKit/geohash/pulls{/number}","milestones_url":"https://api.github.com/repos/LocationKit/geohash/milestones{/number}","notifications_url":"https://api.github.com/repos/LocationKit/geohash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LocationKit/geohash/labels{/name}","releases_url":"https://api.github.com/repos/LocationKit/geohash/releases{/id}","created_at":"2015-09-29T14:11:17Z","updated_at":"2015-09-29T14:11:18Z","pushed_at":"2015-09-29T19:12:20Z","git_url":"git://github.com/LocationKit/geohash.git","ssh_url":"git@github.com:LocationKit/geohash.git","clone_url":"https://github.com/LocationKit/geohash.git","svn_url":"https://github.com/LocationKit/geohash","homepage":null,"size":106,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pierrre:master","ref":"master","sha":"09a95b807879d5f1ed51fcf2b6199dd29649336d","user":{"login":"pierrre","id":131535,"avatar_url":"https://avatars.githubusercontent.com/u/131535?v=3","gravatar_id":"","url":"https://api.github.com/users/pierrre","html_url":"https://github.com/pierrre","followers_url":"https://api.github.com/users/pierrre/followers","following_url":"https://api.github.com/users/pierrre/following{/other_user}","gists_url":"https://api.github.com/users/pierrre/gists{/gist_id}","starred_url":"https://api.github.com/users/pierrre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pierrre/subscriptions","organizations_url":"https://api.github.com/users/pierrre/orgs","repos_url":"https://api.github.com/users/pierrre/repos","events_url":"https://api.github.com/users/pierrre/events{/privacy}","received_events_url":"https://api.github.com/users/pierrre/received_events","type":"User","site_admin":false},"repo":{"id":16865904,"name":"geohash","full_name":"pierrre/geohash","owner":{"login":"pierrre","id":131535,"avatar_url":"https://avatars.githubusercontent.com/u/131535?v=3","gravatar_id":"","url":"https://api.github.com/users/pierrre","html_url":"https://github.com/pierrre","followers_url":"https://api.github.com/users/pierrre/followers","following_url":"https://api.github.com/users/pierrre/following{/other_user}","gists_url":"https://api.github.com/users/pierrre/gists{/gist_id}","starred_url":"https://api.github.com/users/pierrre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pierrre/subscriptions","organizations_url":"https://api.github.com/users/pierrre/orgs","repos_url":"https://api.github.com/users/pierrre/repos","events_url":"https://api.github.com/users/pierrre/events{/privacy}","received_events_url":"https://api.github.com/users/pierrre/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pierrre/geohash","description":"Go Geohash","fork":false,"url":"https://api.github.com/repos/pierrre/geohash","forks_url":"https://api.github.com/repos/pierrre/geohash/forks","keys_url":"https://api.github.com/repos/pierrre/geohash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pierrre/geohash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pierrre/geohash/teams","hooks_url":"https://api.github.com/repos/pierrre/geohash/hooks","issue_events_url":"https://api.github.com/repos/pierrre/geohash/issues/events{/number}","events_url":"https://api.github.com/repos/pierrre/geohash/events","assignees_url":"https://api.github.com/repos/pierrre/geohash/assignees{/user}","branches_url":"https://api.github.com/repos/pierrre/geohash/branches{/branch}","tags_url":"https://api.github.com/repos/pierrre/geohash/tags","blobs_url":"https://api.github.com/repos/pierrre/geohash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pierrre/geohash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pierrre/geohash/git/refs{/sha}","trees_url":"https://api.github.com/repos/pierrre/geohash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pierrre/geohash/statuses/{sha}","languages_url":"https://api.github.com/repos/pierrre/geohash/languages","stargazers_url":"https://api.github.com/repos/pierrre/geohash/stargazers","contributors_url":"https://api.github.com/repos/pierrre/geohash/contributors","subscribers_url":"https://api.github.com/repos/pierrre/geohash/subscribers","subscription_url":"https://api.github.com/repos/pierrre/geohash/subscription","commits_url":"https://api.github.com/repos/pierrre/geohash/commits{/sha}","git_commits_url":"https://api.github.com/repos/pierrre/geohash/git/commits{/sha}","comments_url":"https://api.github.com/repos/pierrre/geohash/comments{/number}","issue_comment_url":"https://api.github.com/repos/pierrre/geohash/issues/comments{/number}","contents_url":"https://api.github.com/repos/pierrre/geohash/contents/{+path}","compare_url":"https://api.github.com/repos/pierrre/geohash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pierrre/geohash/merges","archive_url":"https://api.github.com/repos/pierrre/geohash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pierrre/geohash/downloads","issues_url":"https://api.github.com/repos/pierrre/geohash/issues{/number}","pulls_url":"https://api.github.com/repos/pierrre/geohash/pulls{/number}","milestones_url":"https://api.github.com/repos/pierrre/geohash/milestones{/number}","notifications_url":"https://api.github.com/repos/pierrre/geohash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pierrre/geohash/labels{/name}","releases_url":"https://api.github.com/repos/pierrre/geohash/releases{/id}","created_at":"2014-02-15T15:58:29Z","updated_at":"2015-09-02T15:37:30Z","pushed_at":"2015-09-29T19:13:11Z","git_url":"git://github.com/pierrre/geohash.git","ssh_url":"git@github.com:pierrre/geohash.git","clone_url":"https://github.com/pierrre/geohash.git","svn_url":"https://github.com/pierrre/geohash","homepage":null,"size":368,"stargazers_count":18,"watchers_count":18,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":1,"forks":5,"open_issues":1,"watchers":18,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pierrre/geohash/pulls/1"},"html":{"href":"https://github.com/pierrre/geohash/pull/1"},"issue":{"href":"https://api.github.com/repos/pierrre/geohash/issues/1"},"comments":{"href":"https://api.github.com/repos/pierrre/geohash/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/pierrre/geohash/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/pierrre/geohash/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pierrre/geohash/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/pierrre/geohash/statuses/34d024a93dc17a1ebdcfb7cae6f1819b0c321e18"}}}}