Commit Graph

8536 Commits

Author SHA1 Message Date
Menelaos Karavelas
efd60133dc [algorithms][distance] update backward compatibility code according to
the new design rationale
2014-10-13 15:22:13 +03:00
Menelaos Karavelas
0daeabbe57 [algorithms][distance] re-factor the point range-to-geometry and
geometry-to-geometry distance computations: instead of computing distances
directly, first compute the closest features and then compute the distance
as the distance to the closest features; rewrite point range-to-geometry
distance computation so that the range passed can be a range of segments
of the geometry; remove all dispatch code (moved to other more appropriate files,
or replaced by more compact dispatch code);
2014-10-13 15:18:28 +03:00
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
Adam Wulkiewicz
f3aed16636 Merge pull request #157 from zerebubuth/integral_point_on_surface
Fix `point_on_surface` for integral coordinates
2014-10-13 12:36:00 +02: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
Matt Amos
c3cfb5489c [test][point_on_surface] Added test for CCW point on surface calculation. 2014-10-13 02:43:37 +01:00
Matt Amos
65a65ab69a [extreme_points] Kludge to flip side strategy for CCW polygons and their inners. 2014-10-13 02:42:35 +01:00
Matt Amos
85fec8faa9 [test][point_on_surface] Add test for point_on_surface using integer coordinates. 2014-10-13 00:32:19 +01:00
Matt Amos
434baaa510 [point_on_surface] Do multiply & divide as separate steps to preserve as much precision as possible when using integer coordinates. 2014-10-13 00:31:42 +01:00
Adam Wulkiewicz
95b3fb45d3 [centroid] Disable translation for non-areal Geometries. 2014-10-11 11:57:49 +02:00
Adam Wulkiewicz
5e3656a09a [centroid] Disable error-reducing translation for other coordinate systems than cartesian.
Remove undefined namespace.
Add missing headers.
Add a note about other coordinate systems.
Add copyright info.
2014-10-11 01:42:20 +02:00
Adam Wulkiewicz
d7722e190a [centroid] Reduce numerical errors by translating the Geometry closer to 0 and then the result back.
The first Point of the Geometry is used as the new origin.
During the centroid calculation each Point is translated by subtracting the origin.
At the end the resulting point is translated back by adding the origin.
2014-10-11 00:14:36 +02:00
Adam Wulkiewicz
379c40ea20 [test][centroid] Improve the test for Polygon using big coordinates. 2014-10-10 22:30:08 +02:00
Adam Wulkiewicz
d20bd1f020 [test][to_svg] Add geom_to_svg() helper function. 2014-10-10 22:29:16 +02:00
Adam Wulkiewicz
b36d2f1a1e [doc] Update release notes. 2014-10-10 20:47:39 +02:00
Adam Wulkiewicz
99ceace25b [doc] Update release notes. 2014-10-10 20:41:11 +02:00
Adam Wulkiewicz
d5f8b1c5fc [test][point_on_surface] Add missing closing Point in on of the tests. 2014-10-10 20:38:44 +02:00
Adam Wulkiewicz
45029d6cb5 [point_on_surface] Remove unneeded function. 2014-10-10 20:38:17 +02:00
Adam Wulkiewicz
72c838c16d Merge pull request #153 from awulkiew/feature/refactor_turns
Overlay/Turns refactorization
2014-10-10 20:32:55 +02:00
Adam Wulkiewicz
7b5487baad Merge pull request #154 from awulkiew/fix/point_on_surface
Fix/point on surface
2014-10-10 20:31:48 +02:00
Adam Wulkiewicz
9a01219429 [test][point_on_surface] Add test for Polygon containing non-uniformly distributed points. 2014-10-10 16:21:36 +02:00
Adam Wulkiewicz
9b9bde7f34 [test][centroid] Add test for big doubles. 2014-10-10 13:48:30 +02:00
Adam Wulkiewicz
5ea7bcc5a7 [test][point_on_surface] Add test for Polygon using big coordinates (ticket 10643) 2014-10-10 13:05:40 +02:00
Adam Wulkiewicz
776cc4c731 [point_on_surface] Use arithmetic mean instead of centroid(bashein-detmer). 2014-10-10 13:04:20 +02:00
Adam Wulkiewicz
326d267f9d [test][setops] Fix invalid namespace in test_get_turns_ll_invariance. 2014-10-09 01:41:43 +02:00
Adam Wulkiewicz
e539a09278 [overlay] Move signed_index_type to separate file. Clean headers in ring_ and segment_identifier.hpp. 2014-10-09 01:07:14 +02:00
Adam Wulkiewicz
7cf47bb1e5 [overlay][is_valid] Replace int with signed_index_type for segments indexes. 2014-10-08 23:50:16 +02:00
Adam Wulkiewicz
296f137d85 [overlay][relate][is_valid][buffer] Remove other_id from turn_operation. 2014-10-08 20:23:42 +02: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
7ee87715d0 [test][index] Add ctor to throwing_varray required by the new implementation of redistribute_elements. 2014-10-07 23:07:45 +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
7de377e170 [doc] Update release notes. 2014-10-07 15:01:18 +02:00
Adam Wulkiewicz
7b1e4bd601 [doc][index] Docs upgrade (mostly related to Range adaptors).
Add a tip about usage of Boost.Range adaptors with the rtree.
Add an example of usage of Boost.Range adaptors.
Replace invalid main(void) with main() in examples.
Fix MSVC type conversion warnings in examples.
2014-10-07 14:52:08 +02:00
Adam Wulkiewicz
38a5bffb05 [doc] Update release notes. 2014-10-06 12:59:30 +02:00
Adam Wulkiewicz
c57be3a036 [test][index] Use new names of variant nodes in the implementation of throwing nodes in exceptions tests. 2014-10-05 16:20:09 +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