{"action":"created","comment":{"url":"https://api.github.com/repos/qgis/QGIS/pulls/comments/136695836","pull_request_review_id":60275722,"id":136695836,"diff_hunk":"@@ -994,6 +995,81 @@ QgsGeometry QgsGeometry::orientedMinimumBoundingBox( double &area, double &angle\n   return minBounds;\n }\n \n+static QgsCircle __recMinimalEnclosingCircle( QgsMultiPoint points, QgsMultiPoint boundary )\n+{\n+  auto l_boundary = boundary.length();\n+  QgsCircle circ_mec;\n+  if ( ( points.length() == 0 ) || ( l_boundary == 3 ) )\n+  {\n+    switch ( l_boundary )\n+    {\n+      case 0:\n+        circ_mec = QgsCircle();\n+        break;\n+      case 1:\n+        circ_mec = QgsCircle( QgsPoint( boundary.last() ), 0 );\n+        boundary.pop_back();\n+        break;\n+      case 2:\n+      {\n+        QgsPointXY p1 = boundary.last();\n+        boundary.pop_back();\n+        QgsPointXY p2 = boundary.last();\n+        boundary.pop_back();\n+        circ_mec = QgsCircle().from2Points( QgsPoint( p1 ), QgsPoint( p2 ) );\n+      }\n+      break;\n+      default:\n+        QgsPoint p1( boundary.at( 0 ) );\n+        QgsPoint p2( boundary.at( 1 ) );\n+        QgsPoint p3( boundary.at( 2 ) );\n+        circ_mec = QgsCircle().minimalCircleFrom3points( p1, p2, p3 );\n+        break;\n+    }\n+    return circ_mec;\n+  }\n+  else\n+  {\n+    QgsPointXY pxy = points.last();\n+    points.pop_back();\n+    circ_mec = __recMinimalEnclosingCircle( points, boundary );\n+    QgsPoint p( pxy );\n+    if ( !circ_mec.contains( p ) )\n+    {\n+      boundary.append( pxy );\n+      circ_mec = __recMinimalEnclosingCircle( points, boundary );\n+    }\n+  }\n+  return circ_mec;\n+}\n+\n+QgsGeometry QgsGeometry::minimalEnclosingCircle( QgsPoint &center, double &radius, unsigned int segments ) const","path":"src/core/geometry/qgsgeometry.cpp","position":null,"original_position":60,"commit_id":"4732c667e654b9435fd5cf82be12335e4dba026b","original_commit_id":"139ce031bf5d1ffde0ad47b5f8f414f96a0fc944","user":{"login":"lbartoletti","id":7521540,"avatar_url":"https://avatars1.githubusercontent.com/u/7521540?v=4","gravatar_id":"","url":"https://api.github.com/users/lbartoletti","html_url":"https://github.com/lbartoletti","followers_url":"https://api.github.com/users/lbartoletti/followers","following_url":"https://api.github.com/users/lbartoletti/following{/other_user}","gists_url":"https://api.github.com/users/lbartoletti/gists{/gist_id}","starred_url":"https://api.github.com/users/lbartoletti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lbartoletti/subscriptions","organizations_url":"https://api.github.com/users/lbartoletti/orgs","repos_url":"https://api.github.com/users/lbartoletti/repos","events_url":"https://api.github.com/users/lbartoletti/events{/privacy}","received_events_url":"https://api.github.com/users/lbartoletti/received_events","type":"User","site_admin":false},"body":"done","created_at":"2017-09-02T13:26:25Z","updated_at":"2017-09-02T13:26:25Z","html_url":"https://github.com/qgis/QGIS/pull/5106#discussion_r136695836","pull_request_url":"https://api.github.com/repos/qgis/QGIS/pulls/5106","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/qgis/QGIS/pulls/comments/136695836"},"html":{"href":"https://github.com/qgis/QGIS/pull/5106#discussion_r136695836"},"pull_request":{"href":"https://api.github.com/repos/qgis/QGIS/pulls/5106"}},"in_reply_to_id":136683550},"pull_request":{"url":"https://api.github.com/repos/qgis/QGIS/pulls/5106","id":138976691,"html_url":"https://github.com/qgis/QGIS/pull/5106","diff_url":"https://github.com/qgis/QGIS/pull/5106.diff","patch_url":"https://github.com/qgis/QGIS/pull/5106.patch","issue_url":"https://api.github.com/repos/qgis/QGIS/issues/5106","number":5106,"state":"open","locked":false,"title":"[FEATURE][Processing] Minimal enclosing circle","user":{"login":"lbartoletti","id":7521540,"avatar_url":"https://avatars1.githubusercontent.com/u/7521540?v=4","gravatar_id":"","url":"https://api.github.com/users/lbartoletti","html_url":"https://github.com/lbartoletti","followers_url":"https://api.github.com/users/lbartoletti/followers","following_url":"https://api.github.com/users/lbartoletti/following{/other_user}","gists_url":"https://api.github.com/users/lbartoletti/gists{/gist_id}","starred_url":"https://api.github.com/users/lbartoletti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lbartoletti/subscriptions","organizations_url":"https://api.github.com/users/lbartoletti/orgs","repos_url":"https://api.github.com/users/lbartoletti/repos","events_url":"https://api.github.com/users/lbartoletti/events{/privacy}","received_events_url":"https://api.github.com/users/lbartoletti/received_events","type":"User","site_admin":false},"body":"## Description\r\nThis PR adds a new minimum bounding geometry : the minimal enclosing circle (or smallest-enclosing circle).\r\nMy implementation is based on the [Welzl's algorithm](http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.46.1450) and it is mainly adapted from this [code](https://chromium.googlesource.com/chromiumos/platform/touch_firmware_test/+/factory-samus-6658.B/tests/validator/minicircle.py).\r\n\r\nReference:\r\n- https://en.wikipedia.org/wiki/Smallest-circle_problem\r\n- http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.46.1450\r\n\r\nPossible improvement:\r\n- Create a global processing tools for the minimum bounding geometry like [ArcGis](http://pro.arcgis.com/en/pro-app/tool-reference/data-management/minimum-bounding-geometry.htm). Also, maybe all these algorithms must be in the same category (Vector general or Vector geometry)?\r\n- Extend it for the 3D (minimal sphere).\r\n\r\n## Checklist\r\n\r\n> Reviewing is a process done by project maintainers, mostly on a volunteer basis. We try to keep the overhead as small as possible and appreciate if you help us to do so by completing the following items. Feel free to ask in a comment if you have troubles with any of them.\r\n\r\n- [X] Commit messages are descriptive and explain the rationale for changes\r\n- [ ] Commits which fix bugs include `fixes #11111` in the commit message next to the description\r\n- [X] Commits which add new features are tagged with `[FEATURE]` in the commit message\r\n- [ ] Commits which change the UI or existing user workflows are tagged with `[needs-docs]` in the commit message and containt sufficient information in the commit message to be documented\r\n- [X] I have read the [QGIS Coding Standards](https://docs.qgis.org/testing/en/docs/developers_guide/codingstandards.html) and this PR complies with them\r\n- [X] This PR passes all existing unit tests (test results will be reported by travis-ci after opening this PR)\r\n- [X] New unit tests have been added for core changes\r\n- [X] I have run [the `scripts/prepare-commit.sh` script](https://github.com/qgis/QGIS/blob/master/.github/CONTRIBUTE.md#contributing-to-qgis) before each commit\r\n","created_at":"2017-09-01T21:28:48Z","updated_at":"2017-09-02T13:26:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"70b608557ff8746a3cb7200772c9726641d438ef","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/qgis/QGIS/pulls/5106/commits","review_comments_url":"https://api.github.com/repos/qgis/QGIS/pulls/5106/comments","review_comment_url":"https://api.github.com/repos/qgis/QGIS/pulls/comments{/number}","comments_url":"https://api.github.com/repos/qgis/QGIS/issues/5106/comments","statuses_url":"https://api.github.com/repos/qgis/QGIS/statuses/4732c667e654b9435fd5cf82be12335e4dba026b","head":{"label":"lbartoletti:MinimalEnclosingCircle","ref":"MinimalEnclosingCircle","sha":"4732c667e654b9435fd5cf82be12335e4dba026b","user":{"login":"lbartoletti","id":7521540,"avatar_url":"https://avatars1.githubusercontent.com/u/7521540?v=4","gravatar_id":"","url":"https://api.github.com/users/lbartoletti","html_url":"https://github.com/lbartoletti","followers_url":"https://api.github.com/users/lbartoletti/followers","following_url":"https://api.github.com/users/lbartoletti/following{/other_user}","gists_url":"https://api.github.com/users/lbartoletti/gists{/gist_id}","starred_url":"https://api.github.com/users/lbartoletti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lbartoletti/subscriptions","organizations_url":"https://api.github.com/users/lbartoletti/orgs","repos_url":"https://api.github.com/users/lbartoletti/repos","events_url":"https://api.github.com/users/lbartoletti/events{/privacy}","received_events_url":"https://api.github.com/users/lbartoletti/received_events","type":"User","site_admin":false},"repo":{"id":69051246,"name":"QGIS","full_name":"lbartoletti/QGIS","owner":{"login":"lbartoletti","id":7521540,"avatar_url":"https://avatars1.githubusercontent.com/u/7521540?v=4","gravatar_id":"","url":"https://api.github.com/users/lbartoletti","html_url":"https://github.com/lbartoletti","followers_url":"https://api.github.com/users/lbartoletti/followers","following_url":"https://api.github.com/users/lbartoletti/following{/other_user}","gists_url":"https://api.github.com/users/lbartoletti/gists{/gist_id}","starred_url":"https://api.github.com/users/lbartoletti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lbartoletti/subscriptions","organizations_url":"https://api.github.com/users/lbartoletti/orgs","repos_url":"https://api.github.com/users/lbartoletti/repos","events_url":"https://api.github.com/users/lbartoletti/events{/privacy}","received_events_url":"https://api.github.com/users/lbartoletti/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lbartoletti/QGIS","description":"QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)","fork":true,"url":"https://api.github.com/repos/lbartoletti/QGIS","forks_url":"https://api.github.com/repos/lbartoletti/QGIS/forks","keys_url":"https://api.github.com/repos/lbartoletti/QGIS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lbartoletti/QGIS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lbartoletti/QGIS/teams","hooks_url":"https://api.github.com/repos/lbartoletti/QGIS/hooks","issue_events_url":"https://api.github.com/repos/lbartoletti/QGIS/issues/events{/number}","events_url":"https://api.github.com/repos/lbartoletti/QGIS/events","assignees_url":"https://api.github.com/repos/lbartoletti/QGIS/assignees{/user}","branches_url":"https://api.github.com/repos/lbartoletti/QGIS/branches{/branch}","tags_url":"https://api.github.com/repos/lbartoletti/QGIS/tags","blobs_url":"https://api.github.com/repos/lbartoletti/QGIS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lbartoletti/QGIS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lbartoletti/QGIS/git/refs{/sha}","trees_url":"https://api.github.com/repos/lbartoletti/QGIS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lbartoletti/QGIS/statuses/{sha}","languages_url":"https://api.github.com/repos/lbartoletti/QGIS/languages","stargazers_url":"https://api.github.com/repos/lbartoletti/QGIS/stargazers","contributors_url":"https://api.github.com/repos/lbartoletti/QGIS/contributors","subscribers_url":"https://api.github.com/repos/lbartoletti/QGIS/subscribers","subscription_url":"https://api.github.com/repos/lbartoletti/QGIS/subscription","commits_url":"https://api.github.com/repos/lbartoletti/QGIS/commits{/sha}","git_commits_url":"https://api.github.com/repos/lbartoletti/QGIS/git/commits{/sha}","comments_url":"https://api.github.com/repos/lbartoletti/QGIS/comments{/number}","issue_comment_url":"https://api.github.com/repos/lbartoletti/QGIS/issues/comments{/number}","contents_url":"https://api.github.com/repos/lbartoletti/QGIS/contents/{+path}","compare_url":"https://api.github.com/repos/lbartoletti/QGIS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lbartoletti/QGIS/merges","archive_url":"https://api.github.com/repos/lbartoletti/QGIS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lbartoletti/QGIS/downloads","issues_url":"https://api.github.com/repos/lbartoletti/QGIS/issues{/number}","pulls_url":"https://api.github.com/repos/lbartoletti/QGIS/pulls{/number}","milestones_url":"https://api.github.com/repos/lbartoletti/QGIS/milestones{/number}","notifications_url":"https://api.github.com/repos/lbartoletti/QGIS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lbartoletti/QGIS/labels{/name}","releases_url":"https://api.github.com/repos/lbartoletti/QGIS/releases{/id}","deployments_url":"https://api.github.com/repos/lbartoletti/QGIS/deployments","created_at":"2016-09-23T18:36:24Z","updated_at":"2016-09-23T18:36:59Z","pushed_at":"2017-09-02T13:26:14Z","git_url":"git://github.com/lbartoletti/QGIS.git","ssh_url":"git@github.com:lbartoletti/QGIS.git","clone_url":"https://github.com/lbartoletti/QGIS.git","svn_url":"https://github.com/lbartoletti/QGIS","homepage":"http://qgis.org","size":1298844,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"qgis:master","ref":"master","sha":"d9152429a1003e65e5cd524bf977304c97313416","user":{"login":"qgis","id":483444,"avatar_url":"https://avatars3.githubusercontent.com/u/483444?v=4","gravatar_id":"","url":"https://api.github.com/users/qgis","html_url":"https://github.com/qgis","followers_url":"https://api.github.com/users/qgis/followers","following_url":"https://api.github.com/users/qgis/following{/other_user}","gists_url":"https://api.github.com/users/qgis/gists{/gist_id}","starred_url":"https://api.github.com/users/qgis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qgis/subscriptions","organizations_url":"https://api.github.com/users/qgis/orgs","repos_url":"https://api.github.com/users/qgis/repos","events_url":"https://api.github.com/users/qgis/events{/privacy}","received_events_url":"https://api.github.com/users/qgis/received_events","type":"Organization","site_admin":false},"repo":{"id":1690480,"name":"QGIS","full_name":"qgis/QGIS","owner":{"login":"qgis","id":483444,"avatar_url":"https://avatars3.githubusercontent.com/u/483444?v=4","gravatar_id":"","url":"https://api.github.com/users/qgis","html_url":"https://github.com/qgis","followers_url":"https://api.github.com/users/qgis/followers","following_url":"https://api.github.com/users/qgis/following{/other_user}","gists_url":"https://api.github.com/users/qgis/gists{/gist_id}","starred_url":"https://api.github.com/users/qgis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qgis/subscriptions","organizations_url":"https://api.github.com/users/qgis/orgs","repos_url":"https://api.github.com/users/qgis/repos","events_url":"https://api.github.com/users/qgis/events{/privacy}","received_events_url":"https://api.github.com/users/qgis/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/qgis/QGIS","description":"QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)","fork":false,"url":"https://api.github.com/repos/qgis/QGIS","forks_url":"https://api.github.com/repos/qgis/QGIS/forks","keys_url":"https://api.github.com/repos/qgis/QGIS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/qgis/QGIS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/qgis/QGIS/teams","hooks_url":"https://api.github.com/repos/qgis/QGIS/hooks","issue_events_url":"https://api.github.com/repos/qgis/QGIS/issues/events{/number}","events_url":"https://api.github.com/repos/qgis/QGIS/events","assignees_url":"https://api.github.com/repos/qgis/QGIS/assignees{/user}","branches_url":"https://api.github.com/repos/qgis/QGIS/branches{/branch}","tags_url":"https://api.github.com/repos/qgis/QGIS/tags","blobs_url":"https://api.github.com/repos/qgis/QGIS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/qgis/QGIS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/qgis/QGIS/git/refs{/sha}","trees_url":"https://api.github.com/repos/qgis/QGIS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/qgis/QGIS/statuses/{sha}","languages_url":"https://api.github.com/repos/qgis/QGIS/languages","stargazers_url":"https://api.github.com/repos/qgis/QGIS/stargazers","contributors_url":"https://api.github.com/repos/qgis/QGIS/contributors","subscribers_url":"https://api.github.com/repos/qgis/QGIS/subscribers","subscription_url":"https://api.github.com/repos/qgis/QGIS/subscription","commits_url":"https://api.github.com/repos/qgis/QGIS/commits{/sha}","git_commits_url":"https://api.github.com/repos/qgis/QGIS/git/commits{/sha}","comments_url":"https://api.github.com/repos/qgis/QGIS/comments{/number}","issue_comment_url":"https://api.github.com/repos/qgis/QGIS/issues/comments{/number}","contents_url":"https://api.github.com/repos/qgis/QGIS/contents/{+path}","compare_url":"https://api.github.com/repos/qgis/QGIS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/qgis/QGIS/merges","archive_url":"https://api.github.com/repos/qgis/QGIS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/qgis/QGIS/downloads","issues_url":"https://api.github.com/repos/qgis/QGIS/issues{/number}","pulls_url":"https://api.github.com/repos/qgis/QGIS/pulls{/number}","milestones_url":"https://api.github.com/repos/qgis/QGIS/milestones{/number}","notifications_url":"https://api.github.com/repos/qgis/QGIS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/qgis/QGIS/labels{/name}","releases_url":"https://api.github.com/repos/qgis/QGIS/releases{/id}","deployments_url":"https://api.github.com/repos/qgis/QGIS/deployments","created_at":"2011-05-02T08:06:26Z","updated_at":"2017-09-02T10:59:35Z","pushed_at":"2017-09-02T13:26:16Z","git_url":"git://github.com/qgis/QGIS.git","ssh_url":"git@github.com:qgis/QGIS.git","clone_url":"https://github.com/qgis/QGIS.git","svn_url":"https://github.com/qgis/QGIS","homepage":"http://qgis.org","size":1312879,"stargazers_count":1518,"watchers_count":1518,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1104,"mirror_url":null,"open_issues_count":84,"forks":1104,"open_issues":84,"watchers":1518,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/qgis/QGIS/pulls/5106"},"html":{"href":"https://github.com/qgis/QGIS/pull/5106"},"issue":{"href":"https://api.github.com/repos/qgis/QGIS/issues/5106"},"comments":{"href":"https://api.github.com/repos/qgis/QGIS/issues/5106/comments"},"review_comments":{"href":"https://api.github.com/repos/qgis/QGIS/pulls/5106/comments"},"review_comment":{"href":"https://api.github.com/repos/qgis/QGIS/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/qgis/QGIS/pulls/5106/commits"},"statuses":{"href":"https://api.github.com/repos/qgis/QGIS/statuses/4732c667e654b9435fd5cf82be12335e4dba026b"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"lbartoletti"}}