{"action":"created","comment":{"url":"https://api.github.com/repos/OpenGeoscience/geojs/pulls/comments/36305565","id":36305565,"diff_hunk":"@@ -194,9 +198,55 @@ geo.contourFeature = function (arg) {\n     if (gridW * gridH > data.length) {\n       gridH = Math.floor(data.length) / gridW;\n     }\n+    /* If we are not using the position values (we are using x0, y0, dx, dy),\n+     * and wrapLongitude is turned on, and the position spans 180 degrees,\n+     * duplicate one or two columns of points at opposite ends of the map. */\n+    usePos = (x0 === null || x0 === undefined || y0 === null ||\n+        y0 === undefined || !dx || !dy);\n+    if (!usePos && result.wrapLongitude && (x0 < -180 || x0 > 180 ||\n+        x0 + dx * (gridW - 1) < -180 || x0 + dx * (gridW - 1) > 180) &&","path":"src/core/contourFeature.js","position":25,"original_position":25,"commit_id":"c8240e57a0e21d9069dc7736f69c66d46146bcb4","original_commit_id":"c8240e57a0e21d9069dc7736f69c66d46146bcb4","user":{"login":"aashish24","id":146527,"avatar_url":"https://avatars.githubusercontent.com/u/146527?v=3","gravatar_id":"","url":"https://api.github.com/users/aashish24","html_url":"https://github.com/aashish24","followers_url":"https://api.github.com/users/aashish24/followers","following_url":"https://api.github.com/users/aashish24/following{/other_user}","gists_url":"https://api.github.com/users/aashish24/gists{/gist_id}","starred_url":"https://api.github.com/users/aashish24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aashish24/subscriptions","organizations_url":"https://api.github.com/users/aashish24/orgs","repos_url":"https://api.github.com/users/aashish24/repos","events_url":"https://api.github.com/users/aashish24/events{/privacy}","received_events_url":"https://api.github.com/users/aashish24/received_events","type":"User","site_admin":false},"body":"Can we think of a general function for this wrapping? This will be really useful for plane, graph, contour, polygon feature.","created_at":"2015-08-05T14:13:28Z","updated_at":"2015-08-05T14:13:28Z","html_url":"https://github.com/OpenGeoscience/geojs/pull/428#discussion_r36305565","pull_request_url":"https://api.github.com/repos/OpenGeoscience/geojs/pulls/428","_links":{"self":{"href":"https://api.github.com/repos/OpenGeoscience/geojs/pulls/comments/36305565"},"html":{"href":"https://github.com/OpenGeoscience/geojs/pull/428#discussion_r36305565"},"pull_request":{"href":"https://api.github.com/repos/OpenGeoscience/geojs/pulls/428"}}},"pull_request":{"url":"https://api.github.com/repos/OpenGeoscience/geojs/pulls/428","id":41613760,"html_url":"https://github.com/OpenGeoscience/geojs/pull/428","diff_url":"https://github.com/OpenGeoscience/geojs/pull/428.diff","patch_url":"https://github.com/OpenGeoscience/geojs/pull/428.patch","issue_url":"https://api.github.com/repos/OpenGeoscience/geojs/issues/428","number":428,"state":"open","locked":false,"title":"Add a wrapLongitude option to the contourFeature.","user":{"login":"manthey","id":8781639,"avatar_url":"https://avatars.githubusercontent.com/u/8781639?v=3","gravatar_id":"","url":"https://api.github.com/users/manthey","html_url":"https://github.com/manthey","followers_url":"https://api.github.com/users/manthey/followers","following_url":"https://api.github.com/users/manthey/following{/other_user}","gists_url":"https://api.github.com/users/manthey/gists{/gist_id}","starred_url":"https://api.github.com/users/manthey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manthey/subscriptions","organizations_url":"https://api.github.com/users/manthey/orgs","repos_url":"https://api.github.com/users/manthey/repos","events_url":"https://api.github.com/users/manthey/events{/privacy}","received_events_url":"https://api.github.com/users/manthey/received_events","type":"User","site_admin":false},"body":"I am defaulting this to true, such that if stride positioning is used (x0, y0, dx, dy), if the data spans 180 degrees (plus or minus), it will be wrapped around so that part of the contour is at negative longitude and part is at positive longitude.  If the grid appears to span 360 degrees, join the ends (but only if wrapping was necessary).\r\n\r\nIn the general case, we might want to check the map coordinate system and only default to true if the x coordinate system is degree based (or even adjust it to the coordinate system so you could use gradians).\r\n\r\nAdded a jasmine test to make sure wrapping behaves as expected.\r\n\r\nThis fixes issue #427.","created_at":"2015-08-04T20:30:10Z","updated_at":"2015-08-05T14:13:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a342bba440570adf035a08273e16c2c8503bcc05","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/OpenGeoscience/geojs/pulls/428/commits","review_comments_url":"https://api.github.com/repos/OpenGeoscience/geojs/pulls/428/comments","review_comment_url":"https://api.github.com/repos/OpenGeoscience/geojs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OpenGeoscience/geojs/issues/428/comments","statuses_url":"https://api.github.com/repos/OpenGeoscience/geojs/statuses/c8240e57a0e21d9069dc7736f69c66d46146bcb4","head":{"label":"OpenGeoscience:wrap-contour","ref":"wrap-contour","sha":"c8240e57a0e21d9069dc7736f69c66d46146bcb4","user":{"login":"OpenGeoscience","id":3434706,"avatar_url":"https://avatars.githubusercontent.com/u/3434706?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenGeoscience","html_url":"https://github.com/OpenGeoscience","followers_url":"https://api.github.com/users/OpenGeoscience/followers","following_url":"https://api.github.com/users/OpenGeoscience/following{/other_user}","gists_url":"https://api.github.com/users/OpenGeoscience/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenGeoscience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenGeoscience/subscriptions","organizations_url":"https://api.github.com/users/OpenGeoscience/orgs","repos_url":"https://api.github.com/users/OpenGeoscience/repos","events_url":"https://api.github.com/users/OpenGeoscience/events{/privacy}","received_events_url":"https://api.github.com/users/OpenGeoscience/received_events","type":"Organization","site_admin":false},"repo":{"id":12960038,"name":"geojs","full_name":"OpenGeoscience/geojs","owner":{"login":"OpenGeoscience","id":3434706,"avatar_url":"https://avatars.githubusercontent.com/u/3434706?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenGeoscience","html_url":"https://github.com/OpenGeoscience","followers_url":"https://api.github.com/users/OpenGeoscience/followers","following_url":"https://api.github.com/users/OpenGeoscience/following{/other_user}","gists_url":"https://api.github.com/users/OpenGeoscience/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenGeoscience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenGeoscience/subscriptions","organizations_url":"https://api.github.com/users/OpenGeoscience/orgs","repos_url":"https://api.github.com/users/OpenGeoscience/repos","events_url":"https://api.github.com/users/OpenGeoscience/events{/privacy}","received_events_url":"https://api.github.com/users/OpenGeoscience/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenGeoscience/geojs","description":"High performance visualization and geospatial analysis library","fork":false,"url":"https://api.github.com/repos/OpenGeoscience/geojs","forks_url":"https://api.github.com/repos/OpenGeoscience/geojs/forks","keys_url":"https://api.github.com/repos/OpenGeoscience/geojs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenGeoscience/geojs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenGeoscience/geojs/teams","hooks_url":"https://api.github.com/repos/OpenGeoscience/geojs/hooks","issue_events_url":"https://api.github.com/repos/OpenGeoscience/geojs/issues/events{/number}","events_url":"https://api.github.com/repos/OpenGeoscience/geojs/events","assignees_url":"https://api.github.com/repos/OpenGeoscience/geojs/assignees{/user}","branches_url":"https://api.github.com/repos/OpenGeoscience/geojs/branches{/branch}","tags_url":"https://api.github.com/repos/OpenGeoscience/geojs/tags","blobs_url":"https://api.github.com/repos/OpenGeoscience/geojs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenGeoscience/geojs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenGeoscience/geojs/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenGeoscience/geojs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenGeoscience/geojs/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenGeoscience/geojs/languages","stargazers_url":"https://api.github.com/repos/OpenGeoscience/geojs/stargazers","contributors_url":"https://api.github.com/repos/OpenGeoscience/geojs/contributors","subscribers_url":"https://api.github.com/repos/OpenGeoscience/geojs/subscribers","subscription_url":"https://api.github.com/repos/OpenGeoscience/geojs/subscription","commits_url":"https://api.github.com/repos/OpenGeoscience/geojs/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenGeoscience/geojs/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenGeoscience/geojs/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenGeoscience/geojs/issues/comments{/number}","contents_url":"https://api.github.com/repos/OpenGeoscience/geojs/contents/{+path}","compare_url":"https://api.github.com/repos/OpenGeoscience/geojs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenGeoscience/geojs/merges","archive_url":"https://api.github.com/repos/OpenGeoscience/geojs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenGeoscience/geojs/downloads","issues_url":"https://api.github.com/repos/OpenGeoscience/geojs/issues{/number}","pulls_url":"https://api.github.com/repos/OpenGeoscience/geojs/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenGeoscience/geojs/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenGeoscience/geojs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenGeoscience/geojs/labels{/name}","releases_url":"https://api.github.com/repos/OpenGeoscience/geojs/releases{/id}","created_at":"2013-09-19T21:39:25Z","updated_at":"2015-07-24T21:40:24Z","pushed_at":"2015-08-04T20:30:11Z","git_url":"git://github.com/OpenGeoscience/geojs.git","ssh_url":"git@github.com:OpenGeoscience/geojs.git","clone_url":"https://github.com/OpenGeoscience/geojs.git","svn_url":"https://github.com/OpenGeoscience/geojs","homepage":"","size":18198,"stargazers_count":27,"watchers_count":27,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":13,"mirror_url":null,"open_issues_count":69,"forks":13,"open_issues":69,"watchers":27,"default_branch":"master"}},"base":{"label":"OpenGeoscience:master","ref":"master","sha":"c750256d9b9384adcfe43500776564dc50412526","user":{"login":"OpenGeoscience","id":3434706,"avatar_url":"https://avatars.githubusercontent.com/u/3434706?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenGeoscience","html_url":"https://github.com/OpenGeoscience","followers_url":"https://api.github.com/users/OpenGeoscience/followers","following_url":"https://api.github.com/users/OpenGeoscience/following{/other_user}","gists_url":"https://api.github.com/users/OpenGeoscience/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenGeoscience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenGeoscience/subscriptions","organizations_url":"https://api.github.com/users/OpenGeoscience/orgs","repos_url":"https://api.github.com/users/OpenGeoscience/repos","events_url":"https://api.github.com/users/OpenGeoscience/events{/privacy}","received_events_url":"https://api.github.com/users/OpenGeoscience/received_events","type":"Organization","site_admin":false},"repo":{"id":12960038,"name":"geojs","full_name":"OpenGeoscience/geojs","owner":{"login":"OpenGeoscience","id":3434706,"avatar_url":"https://avatars.githubusercontent.com/u/3434706?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenGeoscience","html_url":"https://github.com/OpenGeoscience","followers_url":"https://api.github.com/users/OpenGeoscience/followers","following_url":"https://api.github.com/users/OpenGeoscience/following{/other_user}","gists_url":"https://api.github.com/users/OpenGeoscience/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenGeoscience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenGeoscience/subscriptions","organizations_url":"https://api.github.com/users/OpenGeoscience/orgs","repos_url":"https://api.github.com/users/OpenGeoscience/repos","events_url":"https://api.github.com/users/OpenGeoscience/events{/privacy}","received_events_url":"https://api.github.com/users/OpenGeoscience/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenGeoscience/geojs","description":"High performance visualization and geospatial analysis library","fork":false,"url":"https://api.github.com/repos/OpenGeoscience/geojs","forks_url":"https://api.github.com/repos/OpenGeoscience/geojs/forks","keys_url":"https://api.github.com/repos/OpenGeoscience/geojs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenGeoscience/geojs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenGeoscience/geojs/teams","hooks_url":"https://api.github.com/repos/OpenGeoscience/geojs/hooks","issue_events_url":"https://api.github.com/repos/OpenGeoscience/geojs/issues/events{/number}","events_url":"https://api.github.com/repos/OpenGeoscience/geojs/events","assignees_url":"https://api.github.com/repos/OpenGeoscience/geojs/assignees{/user}","branches_url":"https://api.github.com/repos/OpenGeoscience/geojs/branches{/branch}","tags_url":"https://api.github.com/repos/OpenGeoscience/geojs/tags","blobs_url":"https://api.github.com/repos/OpenGeoscience/geojs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenGeoscience/geojs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenGeoscience/geojs/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenGeoscience/geojs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenGeoscience/geojs/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenGeoscience/geojs/languages","stargazers_url":"https://api.github.com/repos/OpenGeoscience/geojs/stargazers","contributors_url":"https://api.github.com/repos/OpenGeoscience/geojs/contributors","subscribers_url":"https://api.github.com/repos/OpenGeoscience/geojs/subscribers","subscription_url":"https://api.github.com/repos/OpenGeoscience/geojs/subscription","commits_url":"https://api.github.com/repos/OpenGeoscience/geojs/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenGeoscience/geojs/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenGeoscience/geojs/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenGeoscience/geojs/issues/comments{/number}","contents_url":"https://api.github.com/repos/OpenGeoscience/geojs/contents/{+path}","compare_url":"https://api.github.com/repos/OpenGeoscience/geojs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenGeoscience/geojs/merges","archive_url":"https://api.github.com/repos/OpenGeoscience/geojs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenGeoscience/geojs/downloads","issues_url":"https://api.github.com/repos/OpenGeoscience/geojs/issues{/number}","pulls_url":"https://api.github.com/repos/OpenGeoscience/geojs/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenGeoscience/geojs/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenGeoscience/geojs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenGeoscience/geojs/labels{/name}","releases_url":"https://api.github.com/repos/OpenGeoscience/geojs/releases{/id}","created_at":"2013-09-19T21:39:25Z","updated_at":"2015-07-24T21:40:24Z","pushed_at":"2015-08-04T20:30:11Z","git_url":"git://github.com/OpenGeoscience/geojs.git","ssh_url":"git@github.com:OpenGeoscience/geojs.git","clone_url":"https://github.com/OpenGeoscience/geojs.git","svn_url":"https://github.com/OpenGeoscience/geojs","homepage":"","size":18198,"stargazers_count":27,"watchers_count":27,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":13,"mirror_url":null,"open_issues_count":69,"forks":13,"open_issues":69,"watchers":27,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenGeoscience/geojs/pulls/428"},"html":{"href":"https://github.com/OpenGeoscience/geojs/pull/428"},"issue":{"href":"https://api.github.com/repos/OpenGeoscience/geojs/issues/428"},"comments":{"href":"https://api.github.com/repos/OpenGeoscience/geojs/issues/428/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenGeoscience/geojs/pulls/428/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenGeoscience/geojs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OpenGeoscience/geojs/pulls/428/commits"},"statuses":{"href":"https://api.github.com/repos/OpenGeoscience/geojs/statuses/c8240e57a0e21d9069dc7736f69c66d46146bcb4"}}}}