{"action":"created","comment":{"url":"https://api.github.com/repos/boostorg/geometry/pulls/comments/31877706","id":31877706,"diff_hunk":"@@ -0,0 +1,400 @@\n+// Boost.Geometry (aka GGL, Generic Geometry Library)\n+\n+// Copyright (c) 2015, Oracle and/or its affiliates.\n+\n+// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle\n+\n+// Licensed under the Boost Software License version 1.0.\n+// http://www.boost.org/users/license.html\n+\n+#ifndef BOOST_GEOMETRY_VIEWS_DETAIL_BOUNDARY_VIEW_IMPLEMENTATION_HPP\n+#define BOOST_GEOMETRY_VIEWS_DETAIL_BOUNDARY_VIEW_IMPLEMENTATION_HPP\n+\n+#include <cstddef>\n+#include <algorithm>\n+#include <iterator>\n+#include <memory>\n+#include <new> // for std::bad_alloc\n+#include <utility>\n+#include <vector>\n+\n+#include <boost/core/addressof.hpp>\n+#include <boost/iterator.hpp>\n+#include <boost/iterator/iterator_facade.hpp>\n+#include <boost/iterator/iterator_categories.hpp>\n+#include <boost/mpl/assert.hpp>\n+#include <boost/mpl/if.hpp>\n+#include <boost/range.hpp>\n+#include <boost/type_traits/is_const.hpp>\n+#include <boost/type_traits/is_convertible.hpp>\n+\n+#include <boost/geometry/core/closure.hpp>\n+#include <boost/geometry/core/exterior_ring.hpp>\n+#include <boost/geometry/core/interior_rings.hpp>\n+#include <boost/geometry/core/ring_type.hpp>\n+#include <boost/geometry/core/tags.hpp>\n+\n+#include <boost/geometry/util/range.hpp>\n+\n+#include <boost/geometry/views/closeable_view.hpp>\n+\n+#include <boost/geometry/algorithms/num_interior_rings.hpp>\n+\n+\n+namespace boost { namespace geometry\n+{\n+\n+\n+#ifndef DOXYGEN_NO_DETAIL\n+namespace detail { namespace boundary_views\n+{\n+\n+\n+template\n+<\n+    typename Polygon,\n+    typename Value = typename ring_type<Polygon>::type,\n+    typename Reference = typename ring_return_type<Polygon>::type,\n+    typename Difference = std::ptrdiff_t","path":"include/boost/geometry/views/detail/boundary_view/implementation.hpp","position":58,"original_position":58,"commit_id":"a331405d55b52da6895167cfd8845a653148f8ca","original_commit_id":"a331405d55b52da6895167cfd8845a653148f8ca","user":{"login":"awulkiew","id":1226951,"avatar_url":"https://avatars.githubusercontent.com/u/1226951?v=3","gravatar_id":"","url":"https://api.github.com/users/awulkiew","html_url":"https://github.com/awulkiew","followers_url":"https://api.github.com/users/awulkiew/followers","following_url":"https://api.github.com/users/awulkiew/following{/other_user}","gists_url":"https://api.github.com/users/awulkiew/gists{/gist_id}","starred_url":"https://api.github.com/users/awulkiew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awulkiew/subscriptions","organizations_url":"https://api.github.com/users/awulkiew/orgs","repos_url":"https://api.github.com/users/awulkiew/repos","events_url":"https://api.github.com/users/awulkiew/events{/privacy}","received_events_url":"https://api.github.com/users/awulkiew/received_events","type":"User","site_admin":false},"body":"A side note, this could be:\r\n\r\n    range_difference<\r\n        remove_reference<\r\n            interior_return_type<Polygon>::type\r\n        >::type\r\n    >::type","created_at":"2015-06-07T15:24:40Z","updated_at":"2015-06-07T15:24:40Z","html_url":"https://github.com/boostorg/geometry/pull/299#discussion_r31877706","pull_request_url":"https://api.github.com/repos/boostorg/geometry/pulls/299","_links":{"self":{"href":"https://api.github.com/repos/boostorg/geometry/pulls/comments/31877706"},"html":{"href":"https://github.com/boostorg/geometry/pull/299#discussion_r31877706"},"pull_request":{"href":"https://api.github.com/repos/boostorg/geometry/pulls/299"}}},"pull_request":{"url":"https://api.github.com/repos/boostorg/geometry/pulls/299","id":36386391,"html_url":"https://github.com/boostorg/geometry/pull/299","diff_url":"https://github.com/boostorg/geometry/pull/299.diff","patch_url":"https://github.com/boostorg/geometry/pull/299.patch","issue_url":"https://api.github.com/repos/boostorg/geometry/issues/299","number":299,"state":"open","locked":false,"title":"New feature: support bg::intersection(areal, areal, linear)","user":{"login":"mkaravel","id":6397014,"avatar_url":"https://avatars.githubusercontent.com/u/6397014?v=3","gravatar_id":"","url":"https://api.github.com/users/mkaravel","html_url":"https://github.com/mkaravel","followers_url":"https://api.github.com/users/mkaravel/followers","following_url":"https://api.github.com/users/mkaravel/following{/other_user}","gists_url":"https://api.github.com/users/mkaravel/gists{/gist_id}","starred_url":"https://api.github.com/users/mkaravel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkaravel/subscriptions","organizations_url":"https://api.github.com/users/mkaravel/orgs","repos_url":"https://api.github.com/users/mkaravel/repos","events_url":"https://api.github.com/users/mkaravel/events{/privacy}","received_events_url":"https://api.github.com/users/mkaravel/received_events","type":"User","site_admin":false},"body":"The purpose of this PR is to support the intersection set operation for two input areal geometries and when the output type requested is linear.\r\n\r\nThe approach taken is to create boundary views of the areal geometries, and use these views as input to the linear/linear geometry intersection algorithm.\r\n\r\nThe boundary view implemented currently lies in `detail` namespace, and could be moved to the `geometry` namespace if/when the need arises and when proper support for non-areal geometries is also implemented.\r\n\r\nAnother intersecting aspect of the boundary view implementation is a new iterator (currently residing along with the boundary view code) that returns the rings of a polygon. If there is interest for something like this, I could move this iterator to the `iterators` directory and use it a basis to implement `ring_iterator<Areal>` iterator class for areal geometries (rings, polygons and multipolygons).\r\n\r\nOn the technical side, in order to implement the boundary view for a polygon and a multipolygon I ended up creating and storing an `std::vector<>` of boundary views of the rings of the polygon and multipolygon, respectively. Notice that this is a very lightweight object as no points are copied, and only ***views*** of the rings are stored. It was necessary to implement it this way for two reasons:\r\n\r\n1. I needed somehow to keep track of boundary view objects of the rings of the polygon/multipolygon.\r\n2. I needed to make sure that the `boundary_view<Polygon>` or `boundary_view<MultiPolygon>` object created is a model of the *MultiLinestring* concept, and in particular that it must behave as a `Boost.Range` *Random Access Range*.","created_at":"2015-05-28T09:17:54Z","updated_at":"2015-06-07T15:24:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b73af939e53ce812b88cccf2b440e7e65ca62bdc","assignee":null,"milestone":{"url":"https://api.github.com/repos/boostorg/geometry/milestones/1","html_url":"https://github.com/boostorg/geometry/milestones/1.59","labels_url":"https://api.github.com/repos/boostorg/geometry/milestones/1/labels","id":1017572,"number":1,"title":"1.59","description":"","creator":{"login":"awulkiew","id":1226951,"avatar_url":"https://avatars.githubusercontent.com/u/1226951?v=3","gravatar_id":"","url":"https://api.github.com/users/awulkiew","html_url":"https://github.com/awulkiew","followers_url":"https://api.github.com/users/awulkiew/followers","following_url":"https://api.github.com/users/awulkiew/following{/other_user}","gists_url":"https://api.github.com/users/awulkiew/gists{/gist_id}","starred_url":"https://api.github.com/users/awulkiew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awulkiew/subscriptions","organizations_url":"https://api.github.com/users/awulkiew/orgs","repos_url":"https://api.github.com/users/awulkiew/repos","events_url":"https://api.github.com/users/awulkiew/events{/privacy}","received_events_url":"https://api.github.com/users/awulkiew/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":13,"state":"open","created_at":"2015-03-12T02:04:50Z","updated_at":"2015-06-03T14:33:28Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/boostorg/geometry/pulls/299/commits","review_comments_url":"https://api.github.com/repos/boostorg/geometry/pulls/299/comments","review_comment_url":"https://api.github.com/repos/boostorg/geometry/pulls/comments{/number}","comments_url":"https://api.github.com/repos/boostorg/geometry/issues/299/comments","statuses_url":"https://api.github.com/repos/boostorg/geometry/statuses/a331405d55b52da6895167cfd8845a653148f8ca","head":{"label":"mkaravel:feature/intersection_areal_areal_linear","ref":"feature/intersection_areal_areal_linear","sha":"a331405d55b52da6895167cfd8845a653148f8ca","user":{"login":"mkaravel","id":6397014,"avatar_url":"https://avatars.githubusercontent.com/u/6397014?v=3","gravatar_id":"","url":"https://api.github.com/users/mkaravel","html_url":"https://github.com/mkaravel","followers_url":"https://api.github.com/users/mkaravel/followers","following_url":"https://api.github.com/users/mkaravel/following{/other_user}","gists_url":"https://api.github.com/users/mkaravel/gists{/gist_id}","starred_url":"https://api.github.com/users/mkaravel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkaravel/subscriptions","organizations_url":"https://api.github.com/users/mkaravel/orgs","repos_url":"https://api.github.com/users/mkaravel/repos","events_url":"https://api.github.com/users/mkaravel/events{/privacy}","received_events_url":"https://api.github.com/users/mkaravel/received_events","type":"User","site_admin":false},"repo":{"id":15894753,"name":"geometry","full_name":"mkaravel/geometry","owner":{"login":"mkaravel","id":6397014,"avatar_url":"https://avatars.githubusercontent.com/u/6397014?v=3","gravatar_id":"","url":"https://api.github.com/users/mkaravel","html_url":"https://github.com/mkaravel","followers_url":"https://api.github.com/users/mkaravel/followers","following_url":"https://api.github.com/users/mkaravel/following{/other_user}","gists_url":"https://api.github.com/users/mkaravel/gists{/gist_id}","starred_url":"https://api.github.com/users/mkaravel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkaravel/subscriptions","organizations_url":"https://api.github.com/users/mkaravel/orgs","repos_url":"https://api.github.com/users/mkaravel/repos","events_url":"https://api.github.com/users/mkaravel/events{/privacy}","received_events_url":"https://api.github.com/users/mkaravel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mkaravel/geometry","description":"Boost.org geometry module","fork":true,"url":"https://api.github.com/repos/mkaravel/geometry","forks_url":"https://api.github.com/repos/mkaravel/geometry/forks","keys_url":"https://api.github.com/repos/mkaravel/geometry/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mkaravel/geometry/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mkaravel/geometry/teams","hooks_url":"https://api.github.com/repos/mkaravel/geometry/hooks","issue_events_url":"https://api.github.com/repos/mkaravel/geometry/issues/events{/number}","events_url":"https://api.github.com/repos/mkaravel/geometry/events","assignees_url":"https://api.github.com/repos/mkaravel/geometry/assignees{/user}","branches_url":"https://api.github.com/repos/mkaravel/geometry/branches{/branch}","tags_url":"https://api.github.com/repos/mkaravel/geometry/tags","blobs_url":"https://api.github.com/repos/mkaravel/geometry/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mkaravel/geometry/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mkaravel/geometry/git/refs{/sha}","trees_url":"https://api.github.com/repos/mkaravel/geometry/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mkaravel/geometry/statuses/{sha}","languages_url":"https://api.github.com/repos/mkaravel/geometry/languages","stargazers_url":"https://api.github.com/repos/mkaravel/geometry/stargazers","contributors_url":"https://api.github.com/repos/mkaravel/geometry/contributors","subscribers_url":"https://api.github.com/repos/mkaravel/geometry/subscribers","subscription_url":"https://api.github.com/repos/mkaravel/geometry/subscription","commits_url":"https://api.github.com/repos/mkaravel/geometry/commits{/sha}","git_commits_url":"https://api.github.com/repos/mkaravel/geometry/git/commits{/sha}","comments_url":"https://api.github.com/repos/mkaravel/geometry/comments{/number}","issue_comment_url":"https://api.github.com/repos/mkaravel/geometry/issues/comments{/number}","contents_url":"https://api.github.com/repos/mkaravel/geometry/contents/{+path}","compare_url":"https://api.github.com/repos/mkaravel/geometry/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mkaravel/geometry/merges","archive_url":"https://api.github.com/repos/mkaravel/geometry/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mkaravel/geometry/downloads","issues_url":"https://api.github.com/repos/mkaravel/geometry/issues{/number}","pulls_url":"https://api.github.com/repos/mkaravel/geometry/pulls{/number}","milestones_url":"https://api.github.com/repos/mkaravel/geometry/milestones{/number}","notifications_url":"https://api.github.com/repos/mkaravel/geometry/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mkaravel/geometry/labels{/name}","releases_url":"https://api.github.com/repos/mkaravel/geometry/releases{/id}","created_at":"2014-01-14T07:16:18Z","updated_at":"2015-03-11T09:37:57Z","pushed_at":"2015-06-07T14:35:30Z","git_url":"git://github.com/mkaravel/geometry.git","ssh_url":"git@github.com:mkaravel/geometry.git","clone_url":"https://github.com/mkaravel/geometry.git","svn_url":"https://github.com/mkaravel/geometry","homepage":"http://boost.org/libs/geometry","size":37715,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"boostorg:develop","ref":"develop","sha":"8bd6a692bb2cb71efe1bf049ab4c58356749a22a","user":{"login":"boostorg","id":3170529,"avatar_url":"https://avatars.githubusercontent.com/u/3170529?v=3","gravatar_id":"","url":"https://api.github.com/users/boostorg","html_url":"https://github.com/boostorg","followers_url":"https://api.github.com/users/boostorg/followers","following_url":"https://api.github.com/users/boostorg/following{/other_user}","gists_url":"https://api.github.com/users/boostorg/gists{/gist_id}","starred_url":"https://api.github.com/users/boostorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boostorg/subscriptions","organizations_url":"https://api.github.com/users/boostorg/orgs","repos_url":"https://api.github.com/users/boostorg/repos","events_url":"https://api.github.com/users/boostorg/events{/privacy}","received_events_url":"https://api.github.com/users/boostorg/received_events","type":"Organization","site_admin":false},"repo":{"id":7590021,"name":"geometry","full_name":"boostorg/geometry","owner":{"login":"boostorg","id":3170529,"avatar_url":"https://avatars.githubusercontent.com/u/3170529?v=3","gravatar_id":"","url":"https://api.github.com/users/boostorg","html_url":"https://github.com/boostorg","followers_url":"https://api.github.com/users/boostorg/followers","following_url":"https://api.github.com/users/boostorg/following{/other_user}","gists_url":"https://api.github.com/users/boostorg/gists{/gist_id}","starred_url":"https://api.github.com/users/boostorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boostorg/subscriptions","organizations_url":"https://api.github.com/users/boostorg/orgs","repos_url":"https://api.github.com/users/boostorg/repos","events_url":"https://api.github.com/users/boostorg/events{/privacy}","received_events_url":"https://api.github.com/users/boostorg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/boostorg/geometry","description":"Boost.org geometry module","fork":false,"url":"https://api.github.com/repos/boostorg/geometry","forks_url":"https://api.github.com/repos/boostorg/geometry/forks","keys_url":"https://api.github.com/repos/boostorg/geometry/keys{/key_id}","collaborators_url":"https://api.github.com/repos/boostorg/geometry/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/boostorg/geometry/teams","hooks_url":"https://api.github.com/repos/boostorg/geometry/hooks","issue_events_url":"https://api.github.com/repos/boostorg/geometry/issues/events{/number}","events_url":"https://api.github.com/repos/boostorg/geometry/events","assignees_url":"https://api.github.com/repos/boostorg/geometry/assignees{/user}","branches_url":"https://api.github.com/repos/boostorg/geometry/branches{/branch}","tags_url":"https://api.github.com/repos/boostorg/geometry/tags","blobs_url":"https://api.github.com/repos/boostorg/geometry/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/boostorg/geometry/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/boostorg/geometry/git/refs{/sha}","trees_url":"https://api.github.com/repos/boostorg/geometry/git/trees{/sha}","statuses_url":"https://api.github.com/repos/boostorg/geometry/statuses/{sha}","languages_url":"https://api.github.com/repos/boostorg/geometry/languages","stargazers_url":"https://api.github.com/repos/boostorg/geometry/stargazers","contributors_url":"https://api.github.com/repos/boostorg/geometry/contributors","subscribers_url":"https://api.github.com/repos/boostorg/geometry/subscribers","subscription_url":"https://api.github.com/repos/boostorg/geometry/subscription","commits_url":"https://api.github.com/repos/boostorg/geometry/commits{/sha}","git_commits_url":"https://api.github.com/repos/boostorg/geometry/git/commits{/sha}","comments_url":"https://api.github.com/repos/boostorg/geometry/comments{/number}","issue_comment_url":"https://api.github.com/repos/boostorg/geometry/issues/comments{/number}","contents_url":"https://api.github.com/repos/boostorg/geometry/contents/{+path}","compare_url":"https://api.github.com/repos/boostorg/geometry/compare/{base}...{head}","merges_url":"https://api.github.com/repos/boostorg/geometry/merges","archive_url":"https://api.github.com/repos/boostorg/geometry/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/boostorg/geometry/downloads","issues_url":"https://api.github.com/repos/boostorg/geometry/issues{/number}","pulls_url":"https://api.github.com/repos/boostorg/geometry/pulls{/number}","milestones_url":"https://api.github.com/repos/boostorg/geometry/milestones{/number}","notifications_url":"https://api.github.com/repos/boostorg/geometry/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/boostorg/geometry/labels{/name}","releases_url":"https://api.github.com/repos/boostorg/geometry/releases{/id}","created_at":"2013-01-13T15:59:29Z","updated_at":"2015-06-03T15:25:16Z","pushed_at":"2015-06-07T14:48:22Z","git_url":"git://github.com/boostorg/geometry.git","ssh_url":"git@github.com:boostorg/geometry.git","clone_url":"https://github.com/boostorg/geometry.git","svn_url":"https://github.com/boostorg/geometry","homepage":"http://boost.org/libs/geometry","size":50200,"stargazers_count":48,"watchers_count":48,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":34,"mirror_url":null,"open_issues_count":6,"forks":34,"open_issues":6,"watchers":48,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/boostorg/geometry/pulls/299"},"html":{"href":"https://github.com/boostorg/geometry/pull/299"},"issue":{"href":"https://api.github.com/repos/boostorg/geometry/issues/299"},"comments":{"href":"https://api.github.com/repos/boostorg/geometry/issues/299/comments"},"review_comments":{"href":"https://api.github.com/repos/boostorg/geometry/pulls/299/comments"},"review_comment":{"href":"https://api.github.com/repos/boostorg/geometry/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/boostorg/geometry/pulls/299/commits"},"statuses":{"href":"https://api.github.com/repos/boostorg/geometry/statuses/a331405d55b52da6895167cfd8845a653148f8ca"}}}}