Commit Graph

2457 Commits

Author SHA1 Message Date
Menelaos Karavelas
e74accfab9 [algorithms][distance] re-factor point-to-geometry distance computations;
include in point_to_geometry.hpp implementation of point-to-multigeometry
distance computations and dispatches; compute, whenever applicable, the closest
feature of the goemetry to the point, and then compute the distance as the
distance of this closest feature to the point; optimize the performance of
point-to-ring and point-to-polygon by not computing both containment and distance
to the boundary: compute the distance to the boundary only if the containment
test fails;
2014-10-13 15:14:23 +03:00
Menelaos Karavelas
e206352d12 [algorithms][distance] modify segment_to_box generic distance computation
to compute first the point-segment pair that realizes the minimum comparable
distance, and then use this pair to compute the actual distance; for the
cartesian-specific approach modify the code to work correctly and efficiently
for both comparable and non-comparable strategies, without calling
distance_comparable_to_regular;
2014-10-13 13:48:16 +03:00
Menelaos Karavelas
f660c3e6ab [algorithms][distance] modify segment_to_segment distance computation
to compute first the point-segment pair that realizes the minimum comparable
distance, and then use this pair to compute the actual distance
2014-10-13 13:45:44 +03:00
Menelaos Karavelas
a472441749 [algorithms][distance] add new implementation for computing the distance
between a multipoint and a geometry
2014-10-13 12:21:36 +03:00
Menelaos Karavelas
ce57784e1a [algorithms][distance] add generic implementation for computing the
distance between a geometry (linestring, ring, polygon, multipoint,
multilinestring, multipolygon) and a segment or box
2014-10-13 12:18:02 +03:00
Menelaos Karavelas
a3d5fed181 [algorithms][distance] add generic implementation for distance
computation between a linear and a linear/areal geometry
2014-10-13 12:16:56 +03:00
Menelaos Karavelas
f0a8086912 [strategies][distance] eliminate the distance_comparable_to_regular class 2014-10-13 12:16:07 +03:00
Menelaos Karavelas
d8bc8c98b3 [algorithms][distance] modify the dispatch mechanism to cast the
geometry tag to segment, box, liear and areal
2014-10-13 12:14:36 +03:00
Menelaos Karavelas
547a76a611 [algorithms][distance] add generic R-Tree based implementation for
the distance of two linear geometries: there are two versions implemented,
that differ on the type of objects stored in the R-Tree:
* the points of the geometry are stored in the R-Tree, in which case
  the two geometries are first checked for intersection, and then,
  using the R-Tree we compute the distances of the points of one geometry
  to the segments of the other, and vice versa
* the segments of one geometry are stored in the R-Tree and then the
  R-Tree is queried with the segments of the second geometry
The second approach is currently the default.
2014-10-13 11:12:49 +03:00
Menelaos Karavelas
5cdec7ddc8 [algorithms][distance] add a utility class that defines an iterator type
based on the type of the geometry:
* returns a point iterator for multipoints
* returns a segment iterator for linestrings, rings, polygons,
  multilinestrings and multipolygons
the utility class also provides static begin and end methods for accessing
the first and beyond elements of the iterator type it defines
2014-10-13 11:09:48 +03:00
Menelaos Karavelas
cb6686f4b9 [algorithms][closest_feature] add algorithm for computing the element
in a range that is closest to a given geometry
2014-10-13 11:07:51 +03:00
Menelaos Karavelas
7d0313ded8 [algorithms][closest_feature] add algorithm for computing the pair of
closest features between two ranges, using the R-Tree
2014-10-13 11:07:00 +03:00
Menelaos Karavelas
f07af4a8de [algorithms][closest_feature] add algorithm for computing the closest
feature between a point and an open/closed range of segments (represented
as a range of points
2014-10-13 10:56:22 +03:00
Menelaos Karavelas
d0b424bde2 [algorithms][distance] replace ignore_unused_variable_warning by ignore_unused 2014-10-13 10:38:18 +03:00
Adam Wulkiewicz
795bda6abe [index] Fix unused parameters warnings. 2014-10-08 00:08:40 +02:00
Adam Wulkiewicz
4c192c76ae [index] Increase readability of redistribute_elements-related code.
Convert struct to functions templates (pick_seeds() functions).
Move template parameters from struct level to method level.
Both for automatic type deduction.
2014-10-07 23:37:09 +02:00
Adam Wulkiewicz
b98df446e4 [index] Use in-memory (std::allocator) temporary containers in redistribute_elements. 2014-10-07 23:04:58 +02:00
Adam Wulkiewicz
8e4bc68ed5 [index] Rename "static" nodes to "variant" nodes (it is more clear). 2014-10-05 16:19:18 +02:00
Adam Wulkiewicz
9d7ed2962e [index] Remove polymorphic nodes. Add the implementation of weak nodes, not included/used yet.
The rationale to remove polymorphic nodes:
1. such nodes can't work properly if stored in shared memory due to the way how addresses are calculated (using offsets).
2. the rtree using Variant-based nodes has similar performance and takes less memory.
3. the rtree using newly added weak_nodes (not supported/enabled yet) will be even faster and smaller.

This is the first step to entirely drop the support for polymorphic nodes. After this it should be not needed to explicitly specify the Nodes types in visitors, therefore it should be possible to dispatch the nodes types statically more conveniently, simplify templates by removal of unneeded parameters, write simpler and more maintainable code, etc.
2014-10-05 15:36:50 +02:00
Adam Wulkiewicz
22bd0ea747 [test][index] Change throwing nodes from polymorphic to variant-based. 2014-10-05 14:40:43 +02:00
Adam Wulkiewicz
5531315d98 [index] Move elements-access-related code to separate file, not mixing it with nodes definition. 2014-10-05 12:29:28 +02:00
Adam Wulkiewicz
0db47437f2 [index] Replace levels type size_t with size_types in R*-tree insert visitor. 2014-10-04 01:40:40 +02:00
Adam Wulkiewicz
3069084c15 [index] Replace levels type size_t with size_types in rtree insert visitor. 2014-10-04 01:29:04 +02:00
Adam Wulkiewicz
1f1f663a12 [index] Replace size_t with proper size_types in rtree remove visitor. 2014-10-04 00:59:06 +02:00
Adam Wulkiewicz
6b8aeabbdf [index] Cosmetic changes.
Remove unneeded typedefs in nodes.
Change the order of template parameters in bgidr::get(dynamic_node<>&)
2014-10-04 00:06:21 +02:00
Adam Wulkiewicz
fa7cd296d3 [index] Refactor count rtree visitor.
Remove specialization of count visitor for value_type, don't duplicate the same algorithm in 2 places.
Move Value/Indexable-aware parts into smaller helper struct and specialize it.
2014-10-02 23:40:53 +02:00
Adam Wulkiewicz
a9ac57dc8f [index] Support objects of type convertible to value_type in rtree::count(). 2014-10-02 23:37:32 +02:00
Adam Wulkiewicz
d331bf262a [index] Tweak type, variable names and description of member and free rtree insert() and remove() functions. 2014-10-02 21:44:18 +02:00
Adam Wulkiewicz
d32066530c [index] Support objects of type convertible to value_type in insert() and remove().
In previous implementation such objects was falling into the overload taking Range.
2014-10-02 21:22:32 +02:00
Adam Wulkiewicz
ff98b648ee [index] Update copyrights info. 2014-10-02 21:22:11 +02:00
Adam Wulkiewicz
3abe3e0b79 Merge branch 'develop' of github.com:boostorg/geometry into develop 2014-10-02 20:08:19 +02:00
Adam Wulkiewicz
eabb17b7e4 [index] Replace uses of traits:xxx with geometry::xxx metafunctions. 2014-10-02 20:06:02 +02:00
Adam Wulkiewicz
b2dfd7f0c8 [index] Use default Dimension templ. params in content() and margin() algorithms.
Replace traits::dimension<> with geometry::dimension<>.
2014-10-02 19:57:20 +02:00
Adam Wulkiewicz
e6331558a5 Merge pull request #150 from mkaravel/fix/for_each-alternate
[algorithms][for_each] Alternative fix
2014-10-02 12:33:47 +02:00
Adam Wulkiewicz
add58fec8c [iterators] Fix the description of closing_iterator<>. 2014-10-01 16:58:29 +02:00
Adam Wulkiewicz
39802e7923 [core] Add MPL_ASSERT for coordinate dimension > 0 2014-10-01 16:49:49 +02:00
Adam Wulkiewicz
1e968c3590 [index] Add default template parameters in the implementation of is_valid. Remove MPL assert 2014-10-01 16:28:15 +02:00
Barend Gehrels
cfb66e85b3 [debug] extend operator<< of segment_ratio, now displaying the real value too 2014-10-01 10:24:21 +02:00
Barend Gehrels
5d93d7a116 [debug] fix operator<< of segment_identifier, now using os 2014-10-01 10:23:39 +02:00
Menelaos Karavelas
6e52b356e7 [algorithms][for_each] fix bug in for_each_segment for open geometries
without using the closeable_view (so that mutable geometries can also
be supported)
2014-10-01 09:26:46 +03:00
Adam Wulkiewicz
f1ec0715ee Merge pull request #147 from mkaravel/fix/for_each
[algorithms][for_each] fix bug with for_each_segment for open geometries
2014-09-30 17:53:51 +02:00
Menelaos Karavelas
ac32f9dd58 [algorithms][for_each] fix bug with for_each_segment for open geometries:
for_each_segment was not considering the last implicit segment of open
geometries; the patch fixes this;
2014-09-30 17:08:15 +03:00
Menelaos Karavelas
f3ee1dedcd [algorithms][distance] qualify point_iterator by geometry namespace
(needed because of the changes in the point_iterator class, namely
the introduction of the bg::detail::point_iterator namespace)
2014-09-30 17:04:34 +03:00
Menelaos Karavelas
fb35d9db7a [iterators][segment_iterator] update segment_iterator implementation
following the changes in the point_iterator implementation design
and file/directory layout
2014-09-30 15:04:10 +03:00
Menelaos Karavelas
60f184e3ce [iterators][point_iterator] change file/directory structure for
point iterator; use detail::point_iterator namespace for the
implementation details of the point iterator;
2014-09-30 15:02:20 +03:00
Menelaos Karavelas
b9c496a1d8 [iterators][point_reverse_iterator] mark methods and constructors as inline 2014-09-30 15:00:42 +03:00
Adam Wulkiewicz
f76671507a Merge pull request #141 from mkaravel/feature/segment_iterator
Feature/segment iterator
2014-09-30 12:45:57 +02:00
Menelaos Karavelas
10ce79898a [iterators][segment_iterator] update implementation of segment_iterator
due to the change of namespace and name of the segment_iterator_type class;
make constructors of bg::segment_iterator class inline; change the return type
of segments_begin and segments_end to be segment_iterator<Geometry const>;
2014-09-30 09:50:47 +03:00
Menelaos Karavelas
404ca1cbe6 [iterators][segment_iterator] move implementation of bg::segment_iterator_type
to bg::detail::segment_iterator namespace; rename the class segment_iterator_type
to iterator_type;
2014-09-30 09:49:26 +03:00
Menelaos Karavelas
029cb92952 [iterators][segment_iterator] fix file-inclusion guarding macro to
reflect true file path
2014-09-29 17:15:23 +03:00