{"action":"created","comment":{"url":"https://api.github.com/repos/d3/d3-geo/pulls/comments/103083864","pull_request_review_id":23862800,"id":103083864,"diff_hunk":"@@ -0,0 +1,94 @@\n+import {default as polygonContains} from \"./polygonContains\";\n+import {default as distance} from \"./distance\";\n+import {epsilon,radians} from \"./math\";\n+\n+var contains = {\n+  Sphere: function() {\n+    return true;\n+  },\n+  Point: function(feature, point) {\n+    return distance(feature.coordinates, point) === 0;\n+  },\n+  MultiPoint: function(feature, point) {\n+    var coordinates = feature.coordinates, i = -1, n = coordinates.length, f;\n+    while (++i < n) {\n+      f = { type: \"Point\", coordinates: coordinates[i] };\n+      if (contains[f.type](f, point)) {\n+        return true;\n+      }\n+    }\n+    return false;\n+  },\n+  LineString: function(feature, point) {\n+    var ab = distance(feature.coordinates[0], feature.coordinates[1]),\n+      ao = distance(feature.coordinates[0], point),\n+      ob = distance(point, feature.coordinates[1]);\n+    return ao + ob <= ab + epsilon;\n+  },\n+  MultiLineString: function(feature, point) {\n+    var coordinates = feature.coordinates, i = -1, n = coordinates.length, f;\n+    while (++i < n) {\n+      f = { type: \"LineString\", coordinates: coordinates[i] };\n+      if (contains[f.type](f, point)) {\n+        return true;\n+      }\n+    }\n+    return false;\n+  },\n+  Polygon: function(feature, point) {\n+    return polygonContains(feature.coordinates.map(ringRadians), pointRadians(point))\n+      ? true\n+      : false;","path":"src/contains.js","position":41,"original_position":41,"commit_id":"2807f323e476225c93e0f303f278c9735ec48bf1","original_commit_id":"2807f323e476225c93e0f303f278c9735ec48bf1","user":{"login":"mbostock","id":230541,"avatar_url":"https://avatars.githubusercontent.com/u/230541?v=3","gravatar_id":"","url":"https://api.github.com/users/mbostock","html_url":"https://github.com/mbostock","followers_url":"https://api.github.com/users/mbostock/followers","following_url":"https://api.github.com/users/mbostock/following{/other_user}","gists_url":"https://api.github.com/users/mbostock/gists{/gist_id}","starred_url":"https://api.github.com/users/mbostock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbostock/subscriptions","organizations_url":"https://api.github.com/users/mbostock/orgs","repos_url":"https://api.github.com/users/mbostock/repos","events_url":"https://api.github.com/users/mbostock/events{/privacy}","received_events_url":"https://api.github.com/users/mbostock/received_events","type":"User","site_admin":false},"body":"I’d probably say `!!polygonContains(…)` here.","created_at":"2017-02-25T17:50:02Z","updated_at":"2017-02-25T17:50:02Z","html_url":"https://github.com/d3/d3-geo/pull/86#discussion_r103083864","pull_request_url":"https://api.github.com/repos/d3/d3-geo/pulls/86","_links":{"self":{"href":"https://api.github.com/repos/d3/d3-geo/pulls/comments/103083864"},"html":{"href":"https://github.com/d3/d3-geo/pull/86#discussion_r103083864"},"pull_request":{"href":"https://api.github.com/repos/d3/d3-geo/pulls/86"}}},"pull_request":{"url":"https://api.github.com/repos/d3/d3-geo/pulls/86","id":107921128,"html_url":"https://github.com/d3/d3-geo/pull/86","diff_url":"https://github.com/d3/d3-geo/pull/86.diff","patch_url":"https://github.com/d3/d3-geo/pull/86.patch","issue_url":"https://api.github.com/repos/d3/d3-geo/issues/86","number":86,"state":"open","locked":false,"title":"d3.geoContains(feature, point)","user":{"login":"Fil","id":7001,"avatar_url":"https://avatars.githubusercontent.com/u/7001?v=3","gravatar_id":"","url":"https://api.github.com/users/Fil","html_url":"https://github.com/Fil","followers_url":"https://api.github.com/users/Fil/followers","following_url":"https://api.github.com/users/Fil/following{/other_user}","gists_url":"https://api.github.com/users/Fil/gists{/gist_id}","starred_url":"https://api.github.com/users/Fil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fil/subscriptions","organizations_url":"https://api.github.com/users/Fil/orgs","repos_url":"https://api.github.com/users/Fil/repos","events_url":"https://api.github.com/users/Fil/events{/privacy}","received_events_url":"https://api.github.com/users/Fil/received_events","type":"User","site_admin":false},"body":"fixes https://github.com/d3/d3-geo/issues/73 according to https://github.com/d3/d3/issues/2662#issuecomment-245330507","created_at":"2017-02-24T22:29:10Z","updated_at":"2017-02-25T17:50:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2c3118fce190cf72eb0c466f7f404247962beada","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/d3/d3-geo/pulls/86/commits","review_comments_url":"https://api.github.com/repos/d3/d3-geo/pulls/86/comments","review_comment_url":"https://api.github.com/repos/d3/d3-geo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/d3/d3-geo/issues/86/comments","statuses_url":"https://api.github.com/repos/d3/d3-geo/statuses/2807f323e476225c93e0f303f278c9735ec48bf1","head":{"label":"Fil:geoContains","ref":"geoContains","sha":"2807f323e476225c93e0f303f278c9735ec48bf1","user":{"login":"Fil","id":7001,"avatar_url":"https://avatars.githubusercontent.com/u/7001?v=3","gravatar_id":"","url":"https://api.github.com/users/Fil","html_url":"https://github.com/Fil","followers_url":"https://api.github.com/users/Fil/followers","following_url":"https://api.github.com/users/Fil/following{/other_user}","gists_url":"https://api.github.com/users/Fil/gists{/gist_id}","starred_url":"https://api.github.com/users/Fil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fil/subscriptions","organizations_url":"https://api.github.com/users/Fil/orgs","repos_url":"https://api.github.com/users/Fil/repos","events_url":"https://api.github.com/users/Fil/events{/privacy}","received_events_url":"https://api.github.com/users/Fil/received_events","type":"User","site_admin":false},"repo":{"id":65721463,"name":"d3-geo","full_name":"Fil/d3-geo","owner":{"login":"Fil","id":7001,"avatar_url":"https://avatars.githubusercontent.com/u/7001?v=3","gravatar_id":"","url":"https://api.github.com/users/Fil","html_url":"https://github.com/Fil","followers_url":"https://api.github.com/users/Fil/followers","following_url":"https://api.github.com/users/Fil/following{/other_user}","gists_url":"https://api.github.com/users/Fil/gists{/gist_id}","starred_url":"https://api.github.com/users/Fil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fil/subscriptions","organizations_url":"https://api.github.com/users/Fil/orgs","repos_url":"https://api.github.com/users/Fil/repos","events_url":"https://api.github.com/users/Fil/events{/privacy}","received_events_url":"https://api.github.com/users/Fil/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Fil/d3-geo","description":"Geographic projections, spherical shapes and spherical trigonometry.","fork":true,"url":"https://api.github.com/repos/Fil/d3-geo","forks_url":"https://api.github.com/repos/Fil/d3-geo/forks","keys_url":"https://api.github.com/repos/Fil/d3-geo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Fil/d3-geo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Fil/d3-geo/teams","hooks_url":"https://api.github.com/repos/Fil/d3-geo/hooks","issue_events_url":"https://api.github.com/repos/Fil/d3-geo/issues/events{/number}","events_url":"https://api.github.com/repos/Fil/d3-geo/events","assignees_url":"https://api.github.com/repos/Fil/d3-geo/assignees{/user}","branches_url":"https://api.github.com/repos/Fil/d3-geo/branches{/branch}","tags_url":"https://api.github.com/repos/Fil/d3-geo/tags","blobs_url":"https://api.github.com/repos/Fil/d3-geo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Fil/d3-geo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Fil/d3-geo/git/refs{/sha}","trees_url":"https://api.github.com/repos/Fil/d3-geo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Fil/d3-geo/statuses/{sha}","languages_url":"https://api.github.com/repos/Fil/d3-geo/languages","stargazers_url":"https://api.github.com/repos/Fil/d3-geo/stargazers","contributors_url":"https://api.github.com/repos/Fil/d3-geo/contributors","subscribers_url":"https://api.github.com/repos/Fil/d3-geo/subscribers","subscription_url":"https://api.github.com/repos/Fil/d3-geo/subscription","commits_url":"https://api.github.com/repos/Fil/d3-geo/commits{/sha}","git_commits_url":"https://api.github.com/repos/Fil/d3-geo/git/commits{/sha}","comments_url":"https://api.github.com/repos/Fil/d3-geo/comments{/number}","issue_comment_url":"https://api.github.com/repos/Fil/d3-geo/issues/comments{/number}","contents_url":"https://api.github.com/repos/Fil/d3-geo/contents/{+path}","compare_url":"https://api.github.com/repos/Fil/d3-geo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Fil/d3-geo/merges","archive_url":"https://api.github.com/repos/Fil/d3-geo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Fil/d3-geo/downloads","issues_url":"https://api.github.com/repos/Fil/d3-geo/issues{/number}","pulls_url":"https://api.github.com/repos/Fil/d3-geo/pulls{/number}","milestones_url":"https://api.github.com/repos/Fil/d3-geo/milestones{/number}","notifications_url":"https://api.github.com/repos/Fil/d3-geo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Fil/d3-geo/labels{/name}","releases_url":"https://api.github.com/repos/Fil/d3-geo/releases{/id}","deployments_url":"https://api.github.com/repos/Fil/d3-geo/deployments","created_at":"2016-08-15T09:38:04Z","updated_at":"2017-01-31T11:03:25Z","pushed_at":"2017-02-24T22:31:33Z","git_url":"git://github.com/Fil/d3-geo.git","ssh_url":"git@github.com:Fil/d3-geo.git","clone_url":"https://github.com/Fil/d3-geo.git","svn_url":"https://github.com/Fil/d3-geo","homepage":"","size":4684,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","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":1,"default_branch":"master"}},"base":{"label":"d3:master","ref":"master","sha":"a53cf05963aea3dd9e289ad81c8069f4d30682f6","user":{"login":"d3","id":1562726,"avatar_url":"https://avatars.githubusercontent.com/u/1562726?v=3","gravatar_id":"","url":"https://api.github.com/users/d3","html_url":"https://github.com/d3","followers_url":"https://api.github.com/users/d3/followers","following_url":"https://api.github.com/users/d3/following{/other_user}","gists_url":"https://api.github.com/users/d3/gists{/gist_id}","starred_url":"https://api.github.com/users/d3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/d3/subscriptions","organizations_url":"https://api.github.com/users/d3/orgs","repos_url":"https://api.github.com/users/d3/repos","events_url":"https://api.github.com/users/d3/events{/privacy}","received_events_url":"https://api.github.com/users/d3/received_events","type":"Organization","site_admin":false},"repo":{"id":53070901,"name":"d3-geo","full_name":"d3/d3-geo","owner":{"login":"d3","id":1562726,"avatar_url":"https://avatars.githubusercontent.com/u/1562726?v=3","gravatar_id":"","url":"https://api.github.com/users/d3","html_url":"https://github.com/d3","followers_url":"https://api.github.com/users/d3/followers","following_url":"https://api.github.com/users/d3/following{/other_user}","gists_url":"https://api.github.com/users/d3/gists{/gist_id}","starred_url":"https://api.github.com/users/d3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/d3/subscriptions","organizations_url":"https://api.github.com/users/d3/orgs","repos_url":"https://api.github.com/users/d3/repos","events_url":"https://api.github.com/users/d3/events{/privacy}","received_events_url":"https://api.github.com/users/d3/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/d3/d3-geo","description":"Geographic projections, spherical shapes and spherical trigonometry.","fork":false,"url":"https://api.github.com/repos/d3/d3-geo","forks_url":"https://api.github.com/repos/d3/d3-geo/forks","keys_url":"https://api.github.com/repos/d3/d3-geo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/d3/d3-geo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/d3/d3-geo/teams","hooks_url":"https://api.github.com/repos/d3/d3-geo/hooks","issue_events_url":"https://api.github.com/repos/d3/d3-geo/issues/events{/number}","events_url":"https://api.github.com/repos/d3/d3-geo/events","assignees_url":"https://api.github.com/repos/d3/d3-geo/assignees{/user}","branches_url":"https://api.github.com/repos/d3/d3-geo/branches{/branch}","tags_url":"https://api.github.com/repos/d3/d3-geo/tags","blobs_url":"https://api.github.com/repos/d3/d3-geo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/d3/d3-geo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/d3/d3-geo/git/refs{/sha}","trees_url":"https://api.github.com/repos/d3/d3-geo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/d3/d3-geo/statuses/{sha}","languages_url":"https://api.github.com/repos/d3/d3-geo/languages","stargazers_url":"https://api.github.com/repos/d3/d3-geo/stargazers","contributors_url":"https://api.github.com/repos/d3/d3-geo/contributors","subscribers_url":"https://api.github.com/repos/d3/d3-geo/subscribers","subscription_url":"https://api.github.com/repos/d3/d3-geo/subscription","commits_url":"https://api.github.com/repos/d3/d3-geo/commits{/sha}","git_commits_url":"https://api.github.com/repos/d3/d3-geo/git/commits{/sha}","comments_url":"https://api.github.com/repos/d3/d3-geo/comments{/number}","issue_comment_url":"https://api.github.com/repos/d3/d3-geo/issues/comments{/number}","contents_url":"https://api.github.com/repos/d3/d3-geo/contents/{+path}","compare_url":"https://api.github.com/repos/d3/d3-geo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/d3/d3-geo/merges","archive_url":"https://api.github.com/repos/d3/d3-geo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/d3/d3-geo/downloads","issues_url":"https://api.github.com/repos/d3/d3-geo/issues{/number}","pulls_url":"https://api.github.com/repos/d3/d3-geo/pulls{/number}","milestones_url":"https://api.github.com/repos/d3/d3-geo/milestones{/number}","notifications_url":"https://api.github.com/repos/d3/d3-geo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/d3/d3-geo/labels{/name}","releases_url":"https://api.github.com/repos/d3/d3-geo/releases{/id}","deployments_url":"https://api.github.com/repos/d3/d3-geo/deployments","created_at":"2016-03-03T17:49:37Z","updated_at":"2017-02-24T01:02:47Z","pushed_at":"2017-02-24T22:31:34Z","git_url":"git://github.com/d3/d3-geo.git","ssh_url":"git@github.com:d3/d3-geo.git","clone_url":"https://github.com/d3/d3-geo.git","svn_url":"https://github.com/d3/d3-geo","homepage":"","size":4680,"stargazers_count":142,"watchers_count":142,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":41,"mirror_url":null,"open_issues_count":10,"forks":41,"open_issues":10,"watchers":142,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/d3/d3-geo/pulls/86"},"html":{"href":"https://github.com/d3/d3-geo/pull/86"},"issue":{"href":"https://api.github.com/repos/d3/d3-geo/issues/86"},"comments":{"href":"https://api.github.com/repos/d3/d3-geo/issues/86/comments"},"review_comments":{"href":"https://api.github.com/repos/d3/d3-geo/pulls/86/comments"},"review_comment":{"href":"https://api.github.com/repos/d3/d3-geo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/d3/d3-geo/pulls/86/commits"},"statuses":{"href":"https://api.github.com/repos/d3/d3-geo/statuses/2807f323e476225c93e0f303f278c9735ec48bf1"}}}}
{"actor":{"display_login":"mbostock"}}