{"action":"created","issue":{"url":"https://api.github.com/repos/CartoDB/crankshaft/issues/59","repository_url":"https://api.github.com/repos/CartoDB/crankshaft","labels_url":"https://api.github.com/repos/CartoDB/crankshaft/issues/59/labels{/name}","comments_url":"https://api.github.com/repos/CartoDB/crankshaft/issues/59/comments","events_url":"https://api.github.com/repos/CartoDB/crankshaft/issues/59/events","html_url":"https://github.com/CartoDB/crankshaft/pull/59","id":159011502,"number":59,"title":"KMeans clustering and weighted centroid analysis","user":{"login":"stuartlynn","id":209838,"avatar_url":"https://avatars.githubusercontent.com/u/209838?v=3","gravatar_id":"","url":"https://api.github.com/users/stuartlynn","html_url":"https://github.com/stuartlynn","followers_url":"https://api.github.com/users/stuartlynn/followers","following_url":"https://api.github.com/users/stuartlynn/following{/other_user}","gists_url":"https://api.github.com/users/stuartlynn/gists{/gist_id}","starred_url":"https://api.github.com/users/stuartlynn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stuartlynn/subscriptions","organizations_url":"https://api.github.com/users/stuartlynn/orgs","repos_url":"https://api.github.com/users/stuartlynn/repos","events_url":"https://api.github.com/users/stuartlynn/events{/privacy}","received_events_url":"https://api.github.com/users/stuartlynn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-06-07T20:02:22Z","updated_at":"2016-06-10T13:09:24Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/CartoDB/crankshaft/pulls/59","html_url":"https://github.com/CartoDB/crankshaft/pull/59","diff_url":"https://github.com/CartoDB/crankshaft/pull/59.diff","patch_url":"https://github.com/CartoDB/crankshaft/pull/59.patch"},"body":"@ohasselblad CR please :-) \r\n\r\nAdds KMeans clustering and weighted centroid functions to crankshaft.\r\n\r\n- [ ] All declared geometries are `geometry(Geometry, 4326)` for general geoms, or `geometry(Point, 4326)`\r\n- [x] Include python is activated for new functions. Include this before importing modules: `plpy.execute('SELECT cdb_crankshaft._cdb_crankshaft_activate_py()')`\r\n- [x] Docs for public-facing functions are written\r\n- [x] New functions follow the naming conventions: `CDB_NameOfFunction`. Where internal functions begin with an underscore `_`.\r\n- [x] If appropriate, new functions accepts an arbitrary query as an input (see [Crankshaft Issue #6](https://github.com/CartoDB/crankshaft/issues/6) for more information)\r\n \r\n\r\n"},"comment":{"url":"https://api.github.com/repos/CartoDB/crankshaft/issues/comments/225177479","html_url":"https://github.com/CartoDB/crankshaft/pull/59#issuecomment-225177479","issue_url":"https://api.github.com/repos/CartoDB/crankshaft/issues/59","id":225177479,"user":{"login":"stuartlynn","id":209838,"avatar_url":"https://avatars.githubusercontent.com/u/209838?v=3","gravatar_id":"","url":"https://api.github.com/users/stuartlynn","html_url":"https://github.com/stuartlynn","followers_url":"https://api.github.com/users/stuartlynn/followers","following_url":"https://api.github.com/users/stuartlynn/following{/other_user}","gists_url":"https://api.github.com/users/stuartlynn/gists{/gist_id}","starred_url":"https://api.github.com/users/stuartlynn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stuartlynn/subscriptions","organizations_url":"https://api.github.com/users/stuartlynn/orgs","repos_url":"https://api.github.com/users/stuartlynn/repos","events_url":"https://api.github.com/users/stuartlynn/events{/privacy}","received_events_url":"https://api.github.com/users/stuartlynn/received_events","type":"User","site_admin":false},"created_at":"2016-06-10T13:09:24Z","updated_at":"2016-06-10T13:09:24Z","body":"Hey @rochoa I reworked CDB_WeightedMean in to an aggregate function \r\n\r\n```postgres\r\nselect  cdb_crankshaft.CDB_WeightedMean(the_geom, weight), class from table group by class\r\n```\r\nI think it makes a lot more sense and will resole some the other issues. It means tweaking camshaft though after you merged that PR. \r\n\r\nLet me know what you think "}}
{"actor":{"display_login":"stuartlynn"}}