{"action":"created","issue":{"url":"https://api.github.com/repos/coolaj86/s2-geometry-javascript/issues/3","repository_url":"https://api.github.com/repos/coolaj86/s2-geometry-javascript","labels_url":"https://api.github.com/repos/coolaj86/s2-geometry-javascript/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/coolaj86/s2-geometry-javascript/issues/3/comments","events_url":"https://api.github.com/repos/coolaj86/s2-geometry-javascript/issues/3/events","html_url":"https://github.com/coolaj86/s2-geometry-javascript/issues/3","id":168041416,"number":3,"title":"Wrong values coming back.","user":{"login":"Kyderman","id":5080027,"avatar_url":"https://avatars.githubusercontent.com/u/5080027?v=3","gravatar_id":"","url":"https://api.github.com/users/Kyderman","html_url":"https://github.com/Kyderman","followers_url":"https://api.github.com/users/Kyderman/followers","following_url":"https://api.github.com/users/Kyderman/following{/other_user}","gists_url":"https://api.github.com/users/Kyderman/gists{/gist_id}","starred_url":"https://api.github.com/users/Kyderman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kyderman/subscriptions","organizations_url":"https://api.github.com/users/Kyderman/orgs","repos_url":"https://api.github.com/users/Kyderman/repos","events_url":"https://api.github.com/users/Kyderman/events{/privacy}","received_events_url":"https://api.github.com/users/Kyderman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-07-28T08:33:35Z","updated_at":"2016-07-28T08:45:29Z","closed_at":null,"body":"I get the completely wrong values back using this over the normal node library.\r\n\r\n11464666304699432960 comes back from you.\r\n\r\n5220233617774477312 comes from the traditional.\r\n\r\nThe traditional works perfectly, but this doesnt :/"},"comment":{"url":"https://api.github.com/repos/coolaj86/s2-geometry-javascript/issues/comments/235835961","html_url":"https://github.com/coolaj86/s2-geometry-javascript/issues/3#issuecomment-235835961","issue_url":"https://api.github.com/repos/coolaj86/s2-geometry-javascript/issues/3","id":235835961,"user":{"login":"Kyderman","id":5080027,"avatar_url":"https://avatars.githubusercontent.com/u/5080027?v=3","gravatar_id":"","url":"https://api.github.com/users/Kyderman","html_url":"https://github.com/Kyderman","followers_url":"https://api.github.com/users/Kyderman/followers","following_url":"https://api.github.com/users/Kyderman/following{/other_user}","gists_url":"https://api.github.com/users/Kyderman/gists{/gist_id}","starred_url":"https://api.github.com/users/Kyderman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kyderman/subscriptions","organizations_url":"https://api.github.com/users/Kyderman/orgs","repos_url":"https://api.github.com/users/Kyderman/repos","events_url":"https://api.github.com/users/Kyderman/events{/privacy}","received_events_url":"https://api.github.com/users/Kyderman/received_events","type":"User","site_admin":false},"created_at":"2016-07-28T08:45:29Z","updated_at":"2016-07-28T08:45:29Z","body":"So, in many of the pokemon apis you have something like this\r\n\r\n    /**\r\n\t * Utility method to get all the S2 Cell IDs in a given radius.\r\n\t * Ported from https://github.com/tejado/pgoapi/blob/master/pokecli.py\r\n\t */\r\n\tfunction getCellIDs(radius, lat, lng) {\r\n\t     var cell = new s2.S2CellId(new s2.S2LatLng(lat, lng)),\r\n\t        parentCell = cell.parent(15),\r\n\t        prevCell = parentCell.prev(),\r\n\t        nextCell = parentCell.next(),\r\n\t        cellIDs = [parentCell.id()];\r\n\r\n\t    for (var i = 0; i < radius; i++) {\r\n\t        cellIDs.unshift(prevCell.id());\r\n\t        cellIDs.push(nextCell.id());\r\n\t        prevCell = prevCell.prev();\r\n\t        nextCell = nextCell.next();\r\n\t    }\r\n\t    console.log(cellIDs);\r\n\t    return cellIDs;\r\n\t}\r\n\r\n\r\n\r\nIm using this with this library\r\n\r\n    /**\r\n\t * Utility method to get all the S2 Cell IDs in a given radius.\r\n\t * Ported from https://github.com/tejado/pgoapi/blob/master/pokecli.py\r\n\t */\r\n\tfunction getNeighbors(lat, lng, step) {\r\n\t    //var step = 10;\r\n\t    var level = 15;\r\n\t    var origin = S2.latLngToQuadkey(lat, lng, level);\r\n\t    var walk = [];\r\n\t    // 10 before and 10 after\r\n\t    var next = S2.nextKey(origin);\r\n\t    var prev = S2.prevKey(origin);\r\n\t    var i;\r\n\r\n\t    for (i = 0; i < step; i++) {\r\n\t        walk.unshift(S2.toId(prev));\r\n\t        prev = S2.prevKey(prev);\r\n\t    }\r\n\r\n\t    walk.push(S2.toId(origin));\r\n\r\n\t    for (i = 0; i < step; i++) {\r\n\t        // in range(10):\r\n\t        walk.push(S2.toId(next));\r\n\t        next = S2.nextKey(next);\r\n\t    }\r\n\t    console.log(walk);\r\n\t    return walk;\r\n\t}\r\n\r\n\r\nWith the original node gallery using lat:51.352085106718384 and lng:-2.9877930879592896\r\n\r\nI get the values beginning with 5, with this library, they begin with 1's.\r\n\r\nAs such, it isnt working :/"}}
{"actor":{"display_login":"Kyderman"}}