{"action":"created","comment":{"url":"https://api.github.com/repos/boostorg/geometry/pulls/comments/29623726","id":29623726,"diff_hunk":"@@ -0,0 +1,104 @@\n+// Boost.Geometry (aka GGL, Generic Geometry Library)\n+\n+// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.\n+// Copyright (c) 2008-2015 Bruno Lalande, Paris, France.\n+// Copyright (c) 2009-2015 Mateusz Loskot, London, UK.\n+\n+// This file was modified by Oracle on 2015.\n+// Modifications copyright (c) 2015, Oracle and/or its affiliates.\n+\n+// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle\n+\n+// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library\n+// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.\n+\n+// Use, modification and distribution is subject to the Boost Software License,\n+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at\n+// http://www.boost.org/LICENSE_1_0.txt)\n+\n+#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_ENVELOPE_IMPLEMENTATION_HPP\n+#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_ENVELOPE_IMPLEMENTATION_HPP\n+\n+#include <boost/geometry/core/exterior_ring.hpp>\n+#include <boost/geometry/core/tags.hpp>\n+\n+#include <boost/geometry/algorithms/expand.hpp>\n+\n+#include <boost/geometry/algorithms/detail/envelope/box.hpp>\n+#include <boost/geometry/algorithms/detail/envelope/linestring.hpp>\n+#include <boost/geometry/algorithms/detail/envelope/multilinestring.hpp>\n+#include <boost/geometry/algorithms/detail/envelope/multipoint.hpp>\n+#include <boost/geometry/algorithms/detail/envelope/point.hpp>\n+#include <boost/geometry/algorithms/detail/envelope/range.hpp>\n+#include <boost/geometry/algorithms/detail/envelope/segment.hpp>\n+\n+#include <boost/geometry/algorithms/dispatch/envelope.hpp>\n+\n+\n+namespace boost { namespace geometry\n+{\n+\n+#ifndef DOXYGEN_NO_DETAIL\n+namespace detail { namespace envelope\n+{\n+\n+\n+struct exterior_ring_expand_policy\n+{\n+    template <typename Box, typename Geometry>\n+    static inline void apply(Box& mbr, Geometry const& geometry)\n+    {\n+        Box ring_mbr;\n+        envelope_range<>::apply(exterior_ring(geometry), ring_mbr);\n+        geometry::expand(mbr, ring_mbr);","path":"include/boost/geometry/algorithms/detail/envelope/implementation.hpp","position":53,"original_position":53,"commit_id":"e8f82e62ea5b13809736106f62ae1e4194dd9aeb","original_commit_id":"e8f82e62ea5b13809736106f62ae1e4194dd9aeb","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":"It seemed to me more natural to name it according to how the geometry is used in the policy (taking its exterior ring).","created_at":"2015-05-04T21:06:32Z","updated_at":"2015-05-04T21:06:32Z","html_url":"https://github.com/boostorg/geometry/pull/289#discussion_r29623726","pull_request_url":"https://api.github.com/repos/boostorg/geometry/pulls/289","_links":{"self":{"href":"https://api.github.com/repos/boostorg/geometry/pulls/comments/29623726"},"html":{"href":"https://github.com/boostorg/geometry/pull/289#discussion_r29623726"},"pull_request":{"href":"https://api.github.com/repos/boostorg/geometry/pulls/289"}}},"pull_request":{"url":"https://api.github.com/repos/boostorg/geometry/pulls/289","id":34627932,"html_url":"https://github.com/boostorg/geometry/pull/289","diff_url":"https://github.com/boostorg/geometry/pull/289.diff","patch_url":"https://github.com/boostorg/geometry/pull/289.patch","issue_url":"https://api.github.com/repos/boostorg/geometry/issues/289","number":289,"state":"open","locked":false,"title":"New feature: envelope and expand for spherical equatorial coordinate system","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":"This PR implements (or re-implements) the algorithms `bg::envelope` and `bg::expand`.\r\n\r\nAs far as the old implementation is concerned, the new approach does use `bg::assign_inverse` as it might not be well-defined for user-defined number types.\r\n\r\nRegarding the new implementation, the following are implemented for the spherical equatorial and possibly geographic coordinate systems (see lists below for which combinations support geographic coordinate systems; \"spherical\" below refers to \"spherical equatorial\"):\r\n\r\n#### expand algorithm\r\n* `expand(box, point)` (spherical and geographic)\r\n* `expand(box, segment)` (spherical only)\r\n* `expand(box, box)` (spherical and geographic)\r\n\r\n#### envelope algorithm\r\n* `envelope(point, mbr)` (spherical and geographic)\r\n* `envelope(segment, mbr)` (spherical only)\r\n* `envelope(box, mbr)` (spherical and geographic)\r\n* `envelope(linestring, mbr)` (spherical only)\r\n* `envelope(multilinestring, mbr)` (spherical only)\r\n* `envelope(multipoint, mbr)` (spherical and geographic)\r\n\r\nThis PR depends on PR #271, as it requires the coordinate normalization functionality introduced in that PR.\r\n\r\n**Note 1:** due to the changes introduced in this PR, and in particular how MBRs are computed on the sphere/spheroid, one of the distance unit tests fails. This is a known issue and will be addressed after this PR is reviewed and merged.\r\n\r\n**Note 2:** what is still missing is the implementation of the `envelope` algorithms for areal geometries (rings, polygons and multipolygons). This is still under development and will either be added to this PR, or through a new PR at a later point.","created_at":"2015-05-04T10:32:27Z","updated_at":"2015-05-04T21:06:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"57d00429abd6ca17d0eff41295604f110ae68da2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/boostorg/geometry/pulls/289/commits","review_comments_url":"https://api.github.com/repos/boostorg/geometry/pulls/289/comments","review_comment_url":"https://api.github.com/repos/boostorg/geometry/pulls/comments{/number}","comments_url":"https://api.github.com/repos/boostorg/geometry/issues/289/comments","statuses_url":"https://api.github.com/repos/boostorg/geometry/statuses/e8f82e62ea5b13809736106f62ae1e4194dd9aeb","head":{"label":"mkaravel:feature/envelope_and_expand_for_spherical_cs","ref":"feature/envelope_and_expand_for_spherical_cs","sha":"e8f82e62ea5b13809736106f62ae1e4194dd9aeb","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-05-04T09:35:07Z","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":36148,"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":"5e54fbc510694ef937c91d03040181658e3f2eff","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-05-04T19:45:51Z","pushed_at":"2015-05-04T10:32:27Z","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":48927,"stargazers_count":46,"watchers_count":46,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":28,"mirror_url":null,"open_issues_count":6,"forks":28,"open_issues":6,"watchers":46,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/boostorg/geometry/pulls/289"},"html":{"href":"https://github.com/boostorg/geometry/pull/289"},"issue":{"href":"https://api.github.com/repos/boostorg/geometry/issues/289"},"comments":{"href":"https://api.github.com/repos/boostorg/geometry/issues/289/comments"},"review_comments":{"href":"https://api.github.com/repos/boostorg/geometry/pulls/289/comments"},"review_comment":{"href":"https://api.github.com/repos/boostorg/geometry/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/boostorg/geometry/pulls/289/commits"},"statuses":{"href":"https://api.github.com/repos/boostorg/geometry/statuses/e8f82e62ea5b13809736106f62ae1e4194dd9aeb"}}}}