Skip to content

Commit

Permalink
Merge branch 'bg-prepare'
Browse files Browse the repository at this point in the history
  • Loading branch information
awulkiew committed Mar 8, 2017
2 parents e1a5ea7 + d857009 commit a2be554
Show file tree
Hide file tree
Showing 110 changed files with 7,468 additions and 1,887 deletions.
1 change: 1 addition & 0 deletions doc/doxy/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ INPUT = . .. ../../../../boost/geometry/core \
../../../../boost/geometry/strategies/agnostic \
../../../../boost/geometry/strategies/cartesian \
../../../../boost/geometry/strategies/spherical \
../../../../boost/geometry/strategies/geographic \
../../../../boost/geometry/strategies/transform \
../../../../boost/geometry/util \
../../../../boost/geometry/views \
Expand Down
22 changes: 11 additions & 11 deletions doc/index/rtree/query.qbk
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[/============================================================================
Boost.Geometry Index

Copyright (c) 2011-2013 Adam Wulkiewicz.
Copyright (c) 2011-2017 Adam Wulkiewicz.

Use, modification and distribution is subject to the Boost Software License,
Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
Expand Down Expand Up @@ -57,7 +57,7 @@ Query iterators returned by free functions
__box__ box_region(...);
std::copy(bgi::qbegin(rt, bgi::intersects(box_region)), bgi::qend(rt), std::back_inserter(returned_values));

[h4 Spatial predicates]
[h4 Spatial queries]

Queries using spatial predicates returns `__value__`s which are related somehow to some Geometry - box, polygon, etc.
Names of spatial predicates correspond to names of __boost_geometry__ algorithms (boolean operations).
Expand Down Expand Up @@ -129,6 +129,9 @@ The same way different query Geometries can be used:
Segment seg(/*...*/);
rt.query(bgi::nearest(seg, k), std::back_inserter(returned_values));

[note In case of k-NN queries performed with `query()` function it's not guaranteed that the returned values will be sorted according to the distance.
It's different in case of k-NN queries performed with query iterator returned by `qbegin()` function which guarantees the iteration over the closest `__value__`s first. ]

[h4 User-defined unary predicate]

The user may pass a `UnaryPredicate` - function, function object or lambda expression taking const reference to Value and returning bool.
Expand Down Expand Up @@ -175,7 +178,7 @@ may use `index::satisfies()` function like on the example below:
rt.query(index::intersects(box) && !index::satisfies(is_not_red),
std::back_inserter(result));

[h4 Passing a set of predicates]
[h4 Passing set of predicates]

It's possible to use some number of predicates in one query by connecting them with `operator&&` e.g. `Pred1 && Pred2 && Pred3 && ...`.

Expand All @@ -190,7 +193,7 @@ left-to-right so placing most restrictive predicates first should accelerate the
rt.query(index::intersects(box1) && !index::within(box2) && index::overlaps(box3),
std::back_inserter(result));

Of course it's possible to connect different types of predicates together.
It's possible to connect different types of predicates together.

index::query(rt, index::nearest(pt, k) && index::within(b), std::back_inserter(returned_values));

Expand All @@ -211,13 +214,11 @@ or may be stopped at some point, when all interesting values were gathered. The
break;
}

[note In the case of iterative k-NN queries it's guaranteed to iterate over the closest `__value__`s first. ]

[warning The modification of the `rtree`, e.g. insertion or removal of `__value__`s may invalidate the iterators. ]

[h4 Inserting query results into the other R-tree]
[h4 Inserting query results into another R-tree]

There are several ways of inserting Values returned by a query to the other R-tree container.
There are several ways of inserting Values returned by a query into another R-tree container.
The most basic way is creating a temporary container for Values and insert them later.

namespace bgi = boost::geometry::index;
Expand All @@ -231,14 +232,13 @@ The most basic way is creating a temporary container for Values and insert them
rt1.query(bgi::intersects(Box(/*...*/)), std::back_inserter(result));
RTree rt2(result.begin(), result.end());

However there are better ways. One of these methods is mentioned in the "Creation and modification" section.
However there are other ways. One of these methods is mentioned in the "Creation and modification" section.
The insert iterator may be passed directly into the query.

RTree rt3;
rt1.query(bgi::intersects(Box(/*...*/))), bgi::inserter(rt3));

If you're a user of Boost.Range you'll appreciate the third option. You may pass the result Range directly into the
constructor or `insert()` member function.
You may also pass the resulting Range directly into the constructor or `insert()` member function using Boost.Range adaptor syntax.

RTree rt4(rt1 | bgi::adaptors::queried(bgi::intersects(Box(/*...*/)))));

Expand Down
4 changes: 3 additions & 1 deletion doc/make_qbk.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
# Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
# Copyright (c) 2009-2012 Mateusz Loskot ([email protected]), London, UK
# Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland
#
# Use, modification and distribution is subject to the Boost Software License,
# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
Expand Down Expand Up @@ -123,7 +124,8 @@ def cs_to_quickbook(section):
, "distance::cross_track", "distance::cross_track_point_box"
, "distance::projected_point"
, "within::winding", "within::franklin", "within::crossings_multiply"
, "area::surveyor", "area::huiller"
, "area::surveyor", "area::spherical"
#, "area::geographic"
, "buffer::point_circle", "buffer::point_square"
, "buffer::join_round", "buffer::join_miter"
, "buffer::end_round", "buffer::end_flat"
Expand Down
9 changes: 5 additions & 4 deletions doc/quickref.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
Copyright (c) 2009-2015 Bruno Lalande, Paris, France.
Copyright (c) 2013-2015 Adam Wulkiewicz, Lodz, Poland.
This file was modified by Oracle on 2014, 2015.
Modifications copyright (c) 2014-2015, Oracle and/or its affiliates.
This file was modified by Oracle on 2014, 2015, 2017.
Modifications copyright (c) 2014-2017, Oracle and/or its affiliates.
Contributed and/or modified by Menelaos Karavelas, 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,
Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
Expand Down Expand Up @@ -521,7 +521,8 @@
<bridgehead renderas="sect3">Area</bridgehead>
<simplelist type="vert" columns="1">
<member><link linkend="geometry.reference.strategies.strategy_area_surveyor">strategy::area::surveyor</link></member>
<!--member><link linkend="geometry.reference.strategies.strategy_area_huiller">strategy::area::huiller</link></member-->
<member><link linkend="geometry.reference.strategies.strategy_area_spherical">strategy::area::spherical</link></member>
<!--member><link linkend="geometry.reference.strategies.strategy_area_geographic">strategy::area::geographic</link></member-->
</simplelist>
</entry>
<entry valign="top">
Expand Down
19 changes: 12 additions & 7 deletions doc/reference.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@
[include generated/crosses.qbk]
[endsect]

[section:difference difference]
[include generated/difference.qbk]
[endsect]

[section:disjoint disjoint]
[include generated/disjoint.qbk]
Expand All @@ -125,17 +127,19 @@
[include generated/for_each.qbk]
[endsect]

[/section:intersection intersection]
[section:intersection intersection]
[include generated/intersection.qbk]
[/endsect]
[endsect]

[section:intersects intersects]
[include generated/intersects.qbk]
[endsect]

[include generated/is_empty.qbk]

[section:is_simple is_simple]
[include generated/is_simple.qbk]
[endsect]

[section:is_valid is_valid]
[include generated/is_valid.qbk]
Expand Down Expand Up @@ -176,9 +180,9 @@
[include generated/simplify.qbk]
[endsect]

[/section:sym_difference sym_difference]
[section:sym_difference sym_difference]
[include generated/sym_difference.qbk]
[/endsect]
[endsect]

[section:touches touches]
[include generated/touches.qbk]
Expand All @@ -188,9 +192,9 @@
[include generated/transform.qbk]
[endsect]

[/section:union union]
[section:union_ union_]
[include generated/union.qbk]
[/endsect]
[endsect]

[include generated/unique.qbk]

Expand Down Expand Up @@ -333,7 +337,8 @@
[include generated/distance_cross_track.qbk]
[include generated/distance_cross_track_point_box.qbk]
[include generated/area_surveyor.qbk]
[/include generated/area_huiller.qbk]
[include generated/area_spherical.qbk]
[/include generated/area_geographic.qbk]
[include generated/buffer_join_round.qbk]
[include generated/buffer_join_miter.qbk]
[include generated/buffer_end_round.qbk]
Expand Down
2 changes: 2 additions & 0 deletions doc/release_notes.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
[*Breaking changes]

* ublas_transformer is renamed to matrix_transformer
* explicit modifier is added to constructors of rtree index::dynamic_* parameters
* strategy::area::huiller replaced by strategy::area::spherical

[*Solved issues]

Expand Down
4 changes: 2 additions & 2 deletions doc/src/examples/algorithms/append.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@

#include <iostream>

#include <boost/assign.hpp>

#include <boost/geometry.hpp>
#include <boost/geometry/geometries/polygon.hpp>
#include <boost/geometry/geometries/adapted/boost_tuple.hpp>

#include <boost/assign.hpp> /*< At the end to avoid conflicts with Boost.QVM >*/

BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian)

int main()
Expand Down
4 changes: 2 additions & 2 deletions doc/src/examples/core/tag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@

#include <iostream>

#include <boost/assign.hpp>

#include <boost/geometry.hpp>
#include <boost/geometry/geometries/polygon.hpp>
#include <boost/geometry/geometries/multi_polygon.hpp>
#include <boost/geometry/geometries/adapted/boost_tuple.hpp>

#include <boost/assign.hpp> /*< At the end to avoid conflicts with Boost.QVM >*/

BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian)

template <typename Tag> struct dispatch {};
Expand Down
4 changes: 2 additions & 2 deletions doc/src/examples/geometries/adapted/boost_range/sliced.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@

#include <iostream>

#include <boost/assign.hpp>

#include <boost/geometry.hpp>
#include <boost/geometry/geometries/linestring.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/geometries/adapted/boost_range/sliced.hpp>

#include <boost/assign.hpp> /*< At the end to avoid conflicts with Boost.QVM >*/


int main()
{
Expand Down
4 changes: 2 additions & 2 deletions doc/src/examples/geometries/adapted/boost_range/strided.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@

#include <iostream>

#include <boost/assign.hpp>

#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/geometries/ring.hpp>
#include <boost/geometry/geometries/adapted/boost_range/strided.hpp>

#include <boost/assign.hpp> /*< At the end to avoid conflicts with Boost.QVM >*/


int main()
{
Expand Down
2 changes: 2 additions & 0 deletions doc/src/examples/quick_start.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
//#pragma warning( disable : 4244 )
#endif // defined(_MSC_VER)

#include <iostream>

//[quickstart_include

#include <boost/geometry.hpp>
Expand Down
7 changes: 6 additions & 1 deletion include/boost/geometry/algorithms/area.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.

// This file was modified by Oracle on 2017.
// Modifications copyright (c) 2017 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle

// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.

Expand Down Expand Up @@ -303,7 +307,8 @@ inline typename default_area_result<Geometry>::type area(Geometry const& geometr
[heading Available Strategies]
\* [link geometry.reference.strategies.strategy_area_surveyor Surveyor (cartesian)]
\* [link geometry.reference.strategies.strategy_area_huiller Huiller (spherical)]
\* [link geometry.reference.strategies.strategy_area_spherical Spherical]
[/link geometry.reference.strategies.strategy_area_geographic Geographic]
}
*/
template <typename Geometry, typename Strategy>
Expand Down
Loading

0 comments on commit a2be554

Please sign in to comment.