Merge branch 'develop' into bg-prepare

This commit is contained in:
Adam Wulkiewicz
2021-02-28 22:05:22 +01:00
269 changed files with 8698 additions and 5116 deletions

View File

@@ -2,8 +2,8 @@
//
// Copyright (c) 2011-2012 Barend Gehrels, Amsterdam, the Netherlands.
// This file was modified by Oracle on 2018.
// Modifications copyright (c) 2018, Oracle and/or its affiliates.
// This file was modified by Oracle on 2018-2021.
// Modifications copyright (c) 2018-2021, Oracle and/or its affiliates.
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
@@ -20,6 +20,7 @@
\defgroup area area: calculate area of a Geometry
\defgroup arithmetic arithmetic: arithmetic operations on points
\defgroup assign assign: assign values to geometries
\defgroup azimuth azimuth: calculate azimuth of a segment defined by a pair of points
\defgroup buffer buffer: calculate buffer of a geometry
\defgroup centroid centroid: calculate centroid (center of gravity) of a geometry
\defgroup clear clear: clear geometries

View File

@@ -5,7 +5,7 @@
Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
Copyright (c) 2009-2012 Bruno Lalande, Paris, France.
Copyright (c) 2018, Oracle and/or its affiliates.
Copyright (c) 2018-2021, Oracle and/or its affiliates.
Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
@@ -24,6 +24,8 @@
[import src/examples/algorithms/assign_3d_point.cpp]
[import src/examples/algorithms/assign_inverse.cpp]
[import src/examples/algorithms/assign_points.cpp]
[import src/examples/algorithms/azimuth.cpp]
[import src/examples/algorithms/azimuth_strategy.cpp]
[import src/examples/algorithms/buffer_with_strategies.cpp]
[import src/examples/algorithms/clear.cpp]
[import src/examples/algorithms/centroid.cpp]

View File

@@ -6,7 +6,7 @@
# Copyright (c) 2009-2012 Mateusz Loskot (mateusz@loskot.net), London, UK
# Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland
#
# Copyright (c) 2018, Oracle and/or its affiliates.
# Copyright (c) 2018-2021, Oracle and/or its affiliates.
# Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
# Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
# Use, modification and distribution is subject to the Boost Software License,
@@ -96,7 +96,7 @@ def cs_to_quickbook(section):
call_doxygen()
algorithms = ["append", "assign", "make", "clear"
, "area", "buffer", "centroid", "convert", "correct", "covered_by"
, "area", "azimuth", "buffer", "centroid", "convert", "correct", "covered_by"
, "convex_hull", "crosses", "densify", "difference"
, "discrete_frechet_distance", "discrete_hausdorff_distance", "disjoint"
, "distance", "envelope", "equals", "expand", "for_each", "is_empty"

View File

@@ -364,6 +364,10 @@
coordinate values)
</member>
</simplelist>
<bridgehead renderas="sect3">Azimuth</bridgehead>
<simplelist type="vert" columns="1">
<member><link linkend="geometry.reference.algorithms.azimuth">azimuth</link></member>
</simplelist>
<bridgehead renderas="sect3">Buffer</bridgehead>
<simplelist type="vert" columns="1">
<member><link linkend="geometry.reference.algorithms.buffer">buffer</link></member>

View File

@@ -6,8 +6,8 @@
Copyright (c) 2009-2017 Bruno Lalande, Paris, France.
Copyright (c) 2013-2017 Adam Wulkiewicz, Lodz, Poland.
This file was modified by Oracle on 2014, 2017, 2018.
Modifications copyright (c) 2014-2018, Oracle and/or its affiliates.
This file was modified by Oracle on 2014-2021.
Modifications copyright (c) 2014-2021, Oracle and/or its affiliates.
Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
@@ -80,6 +80,10 @@
[include generated/append.qbk]
[section:azimuth azimuth]
[include generated/azimuth.qbk]
[endsect]
[section:buffer buffer]
[include generated/buffer.qbk]
[endsect]

View File

@@ -0,0 +1,22 @@
[/============================================================================
Boost.Geometry
Copyright (c) 2021, Oracle and/or its affiliates.
Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
Use, modification and distribution is subject to the Boost Software License,
Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
=============================================================================/]
[def __this_function__ azimuth]
[heading_conformance_no_ogc __this_function__]
[note PostGIS contains an algorithm ST_Azimuth with the same functionality.
See the [@https://postgis.net/docs/ST_Azimuth.html PostGIS documentation].
]
[heading Behavior]
The algorithm calculates the azimuth of a segment defined by a pair of points.
[note The result is in radians.]

View File

@@ -0,0 +1,42 @@
// Boost.Geometry
// QuickBook Example
// Copyright (c) 2021, Oracle and/or its affiliates
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//[azimuth
//` Shows how to calculate azimuth
#include <iostream>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
int main()
{
typedef boost::geometry::model::d2::point_xy<double> point_type;
point_type p1(0, 0);
point_type p2(1, 1);
auto azimuth = boost::geometry::azimuth(p1, p2);
std::cout << "azimuth: " << azimuth << std::endl;
return 0;
}
//]
//[azimuth_output
/*`
Output:
[pre
azimuth: 0.785398
]
*/
//]

View File

@@ -0,0 +1,46 @@
// Boost.Geometry
// QuickBook Example
// Copyright (c) 2021, Oracle and/or its affiliates
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//[azimuth_strategy
//` Shows how to calculate azimuth in geographic coordinate system
#include <iostream>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point.hpp>
int main()
{
namespace bg = boost::geometry;
typedef bg::model::point<double, 2, bg::cs::geographic<bg::degree> > point_type;
point_type p1(0, 0);
point_type p2(1, 1);
bg::srs::spheroid<double> spheroid(6378137.0, 6356752.3142451793);
bg::strategies::azimuth::geographic<> strategy(spheroid);
auto azimuth = boost::geometry::azimuth(p1, p2, strategy);
std::cout << "azimuth: " << azimuth << std::endl;
return 0;
}
//]
//[azimuth_strategy_output
/*`
Output:
[pre
azimuth: 0.788674
]
*/
//]